summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 57b25f1)
raw | patch | inline | side by side (parent: 57b25f1)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 6 Aug 2015 15:39:45 +0000 (17:39 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 6 Aug 2015 15:39:45 +0000 (17:39 +0200) |
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 ccb35389f5c5c6a7f912dccd24787860ee525445..0ab57d97be4e5ee884f6a472188fd857eb0bd6b2 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
sdb_avltree_clear(global_store->hosts);
} /* sdb_store_clear */
+int
+sdb_store_host(sdb_store_t *store, const char *name, sdb_time_t last_update)
+{
+ return store_host(name, last_update, SDB_OBJ(store));
+} /* sdb_store_host */
+
+int
+sdb_store_service(sdb_store_t *store, const char *hostname, const char *name,
+ sdb_time_t last_update)
+{
+ return store_service(hostname, name, last_update, SDB_OBJ(store));
+} /* sdb_store_service */
+
+int
+sdb_store_metric(sdb_store_t *store, const char *hostname, const char *name,
+ sdb_metric_store_t *metric_store, sdb_time_t last_update)
+{
+ return store_metric(hostname, name, metric_store, last_update, SDB_OBJ(store));
+} /* sdb_store_metric */
+
+int
+sdb_store_attribute(sdb_store_t *store, const char *hostname,
+ const char *key, const sdb_data_t *value, sdb_time_t last_update)
+{
+ return store_attribute(hostname, key, value, last_update, SDB_OBJ(store));
+} /* sdb_store_attribute */
+
+int
+sdb_store_service_attr(sdb_store_t *store, const char *hostname,
+ const char *service, const char *key, const sdb_data_t *value,
+ sdb_time_t last_update)
+{
+ return store_service_attr(hostname, service, key, value,
+ last_update, SDB_OBJ(store));
+} /* sdb_store_service_attr */
+
+int
+sdb_store_metric_attr(sdb_store_t *store, const char *hostname,
+ const char *metric, const char *key, const sdb_data_t *value,
+ sdb_time_t last_update)
+{
+ return store_metric_attr(hostname, metric, key, value,
+ last_update, SDB_OBJ(store));
+} /* sdb_store_metric_attr */
+
sdb_store_obj_t *
sdb_store_get_host(const char *name)
{
index e5e011875e1775a1592c0511e06d5f3928121b50..1cb0e5af1a6f386a5b2ad8af508edd1ce2e8b098 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
void
sdb_store_clear(void);
+/*
+ * sdb_store_host, sdb_store_service, sdb_store_metric, sdb_store_attribute,
+ * sdb_store_metric_attr:
+ * Store an object in the specified store.
+ */
+int
+sdb_store_host(sdb_store_t *store, const char *name, sdb_time_t last_update);
+int
+sdb_store_service(sdb_store_t *store, const char *hostname, const char *name,
+ sdb_time_t last_update);
+int
+sdb_store_metric(sdb_store_t *store, const char *hostname, const char *name,
+ sdb_metric_store_t *metric_store, sdb_time_t last_update);
+int
+sdb_store_attribute(sdb_store_t *store, const char *hostname,
+ const char *key, const sdb_data_t *value, sdb_time_t last_update);
+int
+sdb_store_service_attr(sdb_store_t *store, const char *hostname,
+ const char *service, const char *key, const sdb_data_t *value,
+ sdb_time_t last_update);
+int
+sdb_store_metric_attr(sdb_store_t *store, const char *hostname,
+ const char *metric, const char *key, const sdb_data_t *value,
+ sdb_time_t last_update);
+
/*
* sdb_store_get_host:
* Query the store for a host by its (canonicalized) name.