sdskv-common.h 1.37 KB
Newer Older
Matthieu Dorier's avatar
Matthieu Dorier committed
1
2
3
4
5
6
7
8
9
10
#ifndef SDSKV_COMMON_H 
#define SDSKV_COMMON_H


#if defined(__cplusplus)
extern "C" {
#endif

typedef enum sdskv_db_type_t 
{
11
12
13
14
    KVDB_MAP,       /* Datastore implementation using std::map   */
    KVDB_BWTREE,    /* Datastore implementation using a BwTree   */
    KVDB_LEVELDB,   /* Datastore implementation using LevelDB    */
    KVDB_BERKELEYDB /* Datasotre implementation using BerkeleyDB */
Matthieu Dorier's avatar
Matthieu Dorier committed
15
16
17
18
19
} sdskv_db_type_t;

typedef uint64_t sdskv_database_id_t;
#define SDSKV_DATABASE_ID_INVALID 0

20
21
22
23
24
25
26
27
28
29
30
31
#define SDSKV_SUCCESS          0 /* Success */
#define SDSKV_ERR_ALLOCATION  -1 /* Error allocating something */
#define SDSKV_ERR_INVALID_ARG -2 /* An argument is invalid */
#define SDSKV_ERR_MERCURY     -3 /* An error happened calling a Mercury function */
#define SDSKV_ERR_DB_CREATE   -4 /* Could not create database */
#define SDSKV_ERR_DB_NAME     -5 /* Invalid database name */
#define SDSKV_ERR_UNKNOWN_DB  -6 /* Database refered to by id is not known to provider */
#define SDSKV_ERR_UNKNOWN_PR  -7 /* Mplex id could not be matched with a provider */
#define SDSKV_ERR_PUT         -8 /* Could not put into the database */
#define SDSKV_ERR_UNKNOWN_KEY -9 /* Key requested does not exist */
#define SDSKV_ERR_SIZE        -10 /* Client did not allocate enough for the requested data */
#define SDSKV_ERR_ERASE       -11 /* Could not erase the given key */
Matthieu Dorier's avatar
Matthieu Dorier committed
32
33
34
35
36
37

#if defined(__cplusplus)
}
#endif

#endif