aboutsummaryrefslogtreecommitdiffstats
path: root/src/anydb.h
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2019-05-13 16:31:55 +0200
committerJose Bollo <jose.bollo@iot.bzh>2019-05-13 16:33:10 +0200
commitc451f53b4f3acd2157f9c7e7365ecc5663e9ada7 (patch)
treedcdee6a94c2a82523b359012786f84f78a953ce4 /src/anydb.h
parentc5f4d75b492052f3c3a4e115c5f6a2060812a639 (diff)
Switch to filedb
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/anydb.h')
-rw-r--r--src/anydb.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/anydb.h b/src/anydb.h
index abc8c4c..843ef29 100644
--- a/src/anydb.h
+++ b/src/anydb.h
@@ -70,9 +70,10 @@ typedef struct anydb_value anydb_value_t;
*/
enum anydb_action
{
- Anydb_Action_Continue = 0,
- Anydb_Action_Update_And_Stop = 1,
- Anydb_Action_Remove_And_Continue = 2
+ Anydb_Action_Stop,
+ Anydb_Action_Continue,
+ Anydb_Action_Update_And_Stop,
+ Anydb_Action_Remove_And_Continue
};
typedef enum anydb_action anydb_action_t;
@@ -92,6 +93,7 @@ struct anydb_itf
void (*apply)(void *clodb, anydb_action_t (*oper)(void *closure, const anydb_key_t *key, anydb_value_t *value), void *closure);
int (*add)(void *clodb, const anydb_key_t *key, const anydb_value_t *value);
void (*gc)(void *clodb);
+ int (*sync)(void *clodb);
void (*destroy)(void *clodb);
};
typedef struct anydb_itf anydb_itf_t;
@@ -157,9 +159,23 @@ anydb_cleanup(
anydb_t *db
);
+/** is the database empty? */
+extern
+bool
+anydb_is_empty(
+ anydb_t *db
+);
+
/** destroy the database */
extern
void
anydb_destroy(
anydb_t *db
);
+
+/** synchronize database */
+extern
+int
+anydb_sync(
+ anydb_t *db
+);