1 #ifndef ACL_MEMDB_INCLUDE_H 2 #define ACL_MEMDB_INCLUDE_H 8 #include "../stdlib/acl_define.h" 19 #define ACL_MDT_FLAG_NUL (0) 20 #define ACL_MDT_FLAG_UNI (1 << 0) 21 #define ACL_MDT_FLAG_KMR (1 << 1) 22 #define ACL_MDT_FLAG_DMR (1 << 2) 23 #define ACL_MDT_FLAG_SLICE1 (1 << 10) 24 #define ACL_MDT_FLAG_SLICE2 (1 << 11) 25 #define ACL_MDT_FLAG_SLICE3 (1 << 12) 26 #define ACL_MDT_FLAG_SLICE_RTGC_OFF (1 << 13) 57 unsigned int tbl_flag,
size_t init_capacity,
58 const char *key_labels[],
unsigned int flags[]);
71 void *data,
unsigned int dlen,
72 const char *key_labels[],
const char *keys[]);
83 const char *key_label,
const char *key);
96 const char *key_label,
const char *key,
int from,
int limit);
107 int from,
int limit);
120 const char *key_label,
const char *key,
121 void (*onfree_fn)(
void*,
unsigned int));
133 int (*walk_fn)(
const void*,
unsigned int),
134 int from,
int limit);
159 unsigned int tbl_flag,
size_t init_capacity,
160 const char *key_labels[],
unsigned int flags[]);
179 unsigned int dlen,
const char *key_labels[],
const char *keys[]);
200 const char *key,
int from,
int limit);
221 const char *key,
void (*onfree_fn)(
void*,
unsigned int));
ACL_API ACL_MDT_RES * acl_mdb_list(ACL_MDB *mdb, const char *tbl_name, int from, int limit)
ACL_API ACL_MDT * acl_mdb_tbl_create(ACL_MDB *mdb, const char *tbl_name, unsigned int tbl_flag, size_t init_capacity, const char *key_labels[], unsigned int flags[])
ACL_API int acl_mdb_walk(ACL_MDB *mdb, const char *tbl_name, int(*walk_fn)(const void *, unsigned int), int from, int limit)
ACL_API int acl_mdt_cnt(ACL_MDT *mdt)
ACL_API int acl_mdb_probe(ACL_MDB *mdb, const char *tbl_name, const char *key_label, const char *key)
ACL_API ACL_MDT_NOD * acl_mdt_add(ACL_MDT *mdt, void *data, unsigned int dlen, const char *key_labels[], const char *keys[])
ACL_API void acl_mdt_free(ACL_MDT *mdt)
ACL_API ACL_MDB * acl_mdb_create(const char *dbname, const char *dbtype)
ACL_API int acl_mdt_row_count(ACL_MDT_RES *res)
ACL_API ACL_MDT_RES * acl_mdt_find(ACL_MDT *mdt, const char *key_label, const char *key, int from, int limit)
ACL_API int acl_mdt_probe(ACL_MDT *mdt, const char *key_label, const char *key)
struct ACL_MDT_REC ACL_MDT_REC
struct ACL_MDT_NOD ACL_MDT_NOD
ACL_API ACL_MDT_NOD * acl_mdb_add(ACL_MDB *mdb, const char *tbl_name, void *data, unsigned int dlen, const char *key_labels[], const char *keys[])
ACL_API int acl_mdb_cnt(ACL_MDB *mdb, const char *tbl_name)
ACL_API int acl_mdt_delete(ACL_MDT *mdt, const char *key_label, const char *key, void(*onfree_fn)(void *, unsigned int))
ACL_API int acl_mdt_walk(ACL_MDT *mdt, int(*walk_fn)(const void *, unsigned int), int from, int len)
struct ACL_MDT_RES ACL_MDT_RES
ACL_API ACL_MDT * acl_mdt_create(const char *dbtype, const char *tbl_name, unsigned int tbl_flag, size_t init_capacity, const char *key_labels[], unsigned int flags[])
struct ACL_MDT_REF ACL_MDT_REF
ACL_API void acl_mdt_res_free(ACL_MDT_RES *res)
ACL_API ACL_MDT_RES * acl_mdt_list(ACL_MDT *mdt, int from, int limit)
ACL_API void acl_mdb_free(ACL_MDB *mdb)
struct ACL_MDT_IDX ACL_MDT_IDX
ACL_API const void * acl_mdt_fetch_row(ACL_MDT_RES *res)
ACL_API int acl_mdb_del(ACL_MDB *mdb, const char *tbl_name, const char *key_label, const char *key, void(*onfree_fn)(void *, unsigned int))
ACL_API ACL_MDT_RES * acl_mdb_find(ACL_MDB *mdb, const char *tbl_name, const char *key_label, const char *key, int from, int limit)