From 007552afb2ab7199407d51ca829c993d4c4db896 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Tue, 18 Jan 2022 03:23:31 +0000 Subject: [PATCH] more --- source/libs/tdb/inc/tdb.h | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/source/libs/tdb/inc/tdb.h b/source/libs/tdb/inc/tdb.h index eee8f8ed33..02b4422882 100644 --- a/source/libs/tdb/inc/tdb.h +++ b/source/libs/tdb/inc/tdb.h @@ -26,26 +26,23 @@ extern "C" { #define TDB_PUBLIC #define TDB_STATIC static -typedef enum { - TDB_BTREE_T = 0, - TDB_HASH_T, - TDB_HEAP_T, -} tdb_db_t; +typedef enum { TDB_BTREE_T = 0, TDB_HASH_T = 1, TDB_HEAP_T = 2 } tdb_db_t; -// Forward declaration +// Forward declarations typedef struct TDB TDB; typedef struct TDB_CURSOR TDB_CURSOR; -// SKey typedef struct { void* bdata; uint32_t size; } TDB_KEY, TDB_VALUE; // TDB Operations -TDB_EXTERN int tdbCreateDB(TDB** dbpp, tdb_db_t type); -TDB_EXTERN int tdbOpenDB(TDB* dbp, const char* fname, const char* dbname, uint32_t flags); -TDB_EXTERN int tdbCloseDB(TDB* dbp, uint32_t flags); +int tdbCreateDB(TDB** dbpp, tdb_db_t type); +int tdbOpenDB(TDB* dbp, const char* fname, const char* dbname, uint32_t flags); +int tdbCloseDB(TDB* dbp, uint32_t flags); +int tdbPut(TDB* dbp, const TDB_KEY* key, const TDB_VALUE* value, uint32_t flags); +int tdbGet(TDB* dbp, const TDB_KEY* key, TDB_VALUE* value, uint32_t flags); #ifdef __cplusplus } -- GitLab