1 #ifndef ACL_ZDB_INCLUDE_H 2 #define ACL_ZDB_INCLUDE_H 4 #include "../stdlib/acl_define.h" 5 #include "../stdlib/acl_vstring.h" 6 #include "../stdlib/acl_fhandle.h" 8 #ifndef ACL_CLIENT_ONLY 64 #define ZDB_FLAG_LINK_BUSY (1 << 0) 65 #define ZDB_FLAG_OPEN_LOCK (1 << 1) 66 #define ZDB_FLAG_CACHE_DAT (1 << 2) 67 #define ZDB_FLAG_CACHE_KEY (1 << 3) 68 #define ZDB_FLAG_SLICE_KEY (1 << 4) 69 #define ZDB_FLAG_SLICE_DAT (1 << 5) 72 #define ZDB_STAT_KEY_NEW (1 << 0) 113 #pragma pack(push, 4) 216 #define STORE_FLAG_KEY (1 << 0) 217 #define STORE_FLAG_DAT (1 << 1) 218 #define STORE_FLAG_IO_SLICE (1 << 2) 250 ACL_API
void zdb_test(
const char *cmd);
310 #define zdb_blk_data(b) ((b)->dat) 316 #define zdb_blk_free(b) acl_myfree((b)) 330 const void *dat,
size_t len);
468 const void *dat,
size_t len);
ACL_API ZDB * zdb_open(const char *dbname, unsigned int oflags, const ZDB_CFG *cfg)
ACL_API int zdb_key_status(ZDB *db, const char *filepath, ZDB_KEY_HDR *key_hdr)
ACL_API int zdb_key_check3(ZDB *db, const char *filepath, ZDB_KEY_HDR *key_hdr)
ACL_API int zdb_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off_saved, const void *dat, size_t len)
int(* dat_add)(ZDB *, zdb_key_t, const void *, int)
ACL_API ZDB_BLK * zdb_dat_get(ZDB *db, const ZDB_BLK_OFF *blk_off, zdb_key_t *key, size_t *size)
ACL_API void zdb_close(ZDB *db)
ACL_API int zdb_dat_update(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off, const void *dat, size_t len)
ACL_API int zdb_key_check(ZDB_KEY_STORE *store, ZDB_KEY_HDR *key_hdr)
ACL_API int zdb_key_walk(ZDB *db, int(*walk_fn)(ZDB_KEY_STORE *store))
ACL_API int zdb_dat_add(ZDB *db, zdb_key_t key, const void *dat, int len)
ACL_API int zdb_dat_stat(ZDB *db, const char *filepath, ZDB_DAT_HDR *dat_hdr)
ACL_API int zdb_key_get(ZDB *db, zdb_key_t key, ZDB_BLK_OFF *blk_off)
ACL_API ZDB_BLK * zdb_lookup(ZDB *db, zdb_key_t key, size_t *size, ZDB_BLK_OFF *blk_off_buf)
ACL_API void zdb_sync(ZDB *db)
int(* key_get)(ZDB *, zdb_key_t, ZDB_BLK_OFF *)
ACL_API void zdb_init(void)
ACL_API void zdb_test(const char *cmd)
ACL_API int zdb_dat_check3(ZDB *db, const char *filepath, ZDB_DAT_HDR *dat_hdr)
int(* key_set)(ZDB *, zdb_key_t, const ZDB_BLK_OFF *)
struct ZDB_STORE ZDB_STORE
ACL_API void zdb_key_store_close(ZDB_KEY_STORE *store)
ACL_API int zdb_key_init(ZDB *db, zdb_key_t key_begin, zdb_key_t key_end)
ACL_API ZDB_KEY_STORE * zdb_key_store_open2(ZDB *db, const char *filepath)
struct ZDB_BLK_HDR ZDB_BLK_HDR
ACL_API void zdb_end(void)
ACL_API int zdb_dat_walk(ZDB *db, int(*walk_fn)(ZDB_DAT_STORE *store))
ACL_API int dat_store_header_sync(ZDB_DAT_STORE *store)
ACL_API void zdb_dat_iter_set(ZDB_DAT_STORE *store, int read_data)
ACL_API int key_store_header_sync(ZDB_KEY_STORE *store)
ACL_API ZDB_DAT_STORE * zdb_dat_store_open(ZDB *db, const char *filepath)
ACL_API int zdb_key_set(ZDB *db, zdb_key_t key, const ZDB_BLK_OFF *blk_off)
int(* dat_update)(ZDB *, zdb_key_t, const ZDB_BLK_OFF *, const void *, size_t)
ACL_API void zdb_dat_store_close(ZDB_DAT_STORE *store)
ACL_API int zdb_dat_check(ZDB_DAT_STORE *store, ZDB_DAT_HDR *dat_hdr)
ACL_API ZDB_KEY_STORE * zdb_key_store_open(ZDB *db, zdb_key_t key)