summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 264e71a)
raw | patch | inline | side by side (parent: 264e71a)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 21 Feb 2014 00:52:43 +0000 (01:52 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 21 Feb 2014 00:52:43 +0000 (01:52 +0100) |
This function clears the entire store removing all entries. It's mostly
useful for testing, I suppose.
useful for testing, I suppose.
src/core/store.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
diff --git a/src/core/store.c b/src/core/store.c
index 652b24b33c738b2dba3ff5a91c08f0c9d56eb645..22e177ca8f95d4a1246f443b73f0457f48678f2f 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
* public API
*/
+void
+sdb_store_clear(void)
+{
+ sdb_llist_destroy(obj_list);
+ obj_list = NULL;
+} /* sdb_store_clear */
+
int
sdb_store_host(const char *name, sdb_time_t last_update)
{
index 100aadf260700bdbb0c77f59c16cfedd0ca50048..f2e210da1723eda40e62f5b7ef2d086ba26d00e5 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
struct sdb_store_base;
typedef struct sdb_store_base sdb_store_base_t;
+/*
+ * sdb_store_clear:
+ * Clear the entire store and remove all stored objects.
+ */
+void
+sdb_store_clear(void);
+
/*
* sdb_store_host:
* Add/update a host in the store. If the host, identified by its