X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Finclude%2Fcore%2Fstore.h;h=100aadf260700bdbb0c77f59c16cfedd0ca50048;hb=c9ed4d2a7a92ef589809a7df9b04c061afa4ef64;hp=cf4ecbbb6f1155444a451bf57535bf536704098e;hpb=40b40eda60b517297089a209f3681c8ec064cd68;p=sysdb.git diff --git a/src/include/core/store.h b/src/include/core/store.h index cf4ecbb..100aadf 100644 --- a/src/include/core/store.h +++ b/src/include/core/store.h @@ -30,6 +30,7 @@ #include "sysdb.h" #include "core/object.h" +#include "core/data.h" #include "core/time.h" #include "utils/llist.h" #include "utils/strbuf.h" @@ -65,9 +66,20 @@ typedef struct sdb_store_base sdb_store_base_t; int sdb_store_host(const char *name, sdb_time_t last_update); +/* + * sdb_store_has_host: + * sdb_store_get_host: + * Query the store for a host by its (canonicalized) name. + * + * sdb_store_get_host increments the ref count of the host object. The caller + * needs to deref it when no longer using it. + */ _Bool sdb_store_has_host(const char *name); +sdb_store_base_t * +sdb_store_get_host(const char *name); + /* * sdb_store_attribute: * Add/update a host's attribute in the store. If the attribute, identified by @@ -84,7 +96,8 @@ sdb_store_has_host(const char *name); * - a negative value on error */ int -sdb_store_attribute(const char *hostname, const char *key, const char *value, +sdb_store_attribute(const char *hostname, + const char *key, const sdb_data_t *value, sdb_time_t last_update); /*