summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a248a2d)
raw | patch | inline | side by side (parent: a248a2d)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 17 Sep 2015 07:20:15 +0000 (09:20 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 17 Sep 2015 07:20:15 +0000 (09:20 +0200) |
src/core/store-private.h | patch | blob | history | |
src/core/store.c | patch | blob | history |
index 700fed60ff723f4e60bd986bff75df9c805fe4aa..f08bf1d2c2217fcde9565fcf964bd1567eceeed4 100644 (file)
--- a/src/core/store-private.h
+++ b/src/core/store-private.h
sdb_store_obj_t super;
sdb_data_t value;
-} sdb_attribute_t;
-#define ATTR(obj) ((sdb_attribute_t *)(obj))
-#define CONST_ATTR(obj) ((const sdb_attribute_t *)(obj))
+} attr_t;
+#define ATTR(obj) ((attr_t *)(obj))
+#define CONST_ATTR(obj) ((const attr_t *)(obj))
typedef struct {
sdb_store_obj_t super;
sdb_avltree_t *attributes;
-} sdb_service_t;
-#define SVC(obj) ((sdb_service_t *)(obj))
-#define CONST_SVC(obj) ((const sdb_service_t *)(obj))
+} service_t;
+#define SVC(obj) ((service_t *)(obj))
+#define CONST_SVC(obj) ((const service_t *)(obj))
typedef struct {
sdb_store_obj_t super;
sdb_avltree_t *services;
sdb_avltree_t *metrics;
sdb_avltree_t *attributes;
-} sdb_host_t;
-#define HOST(obj) ((sdb_host_t *)(obj))
-#define CONST_HOST(obj) ((const sdb_host_t *)(obj))
+} host_t;
+#define HOST(obj) ((host_t *)(obj))
+#define CONST_HOST(obj) ((const host_t *)(obj))
/* shortcuts for accessing service/host attributes */
#define _last_update super.last_update
diff --git a/src/core/store.c b/src/core/store.c
index 30b4d1c367cdc845714c98550501da3c1037f540..3936020d54ccd04b6cc3a9b47d6ed0f25b9627b0 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
static int
host_init(sdb_object_t *obj, va_list ap)
{
- sdb_host_t *sobj = HOST(obj);
+ host_t *sobj = HOST(obj);
int ret;
/* this will consume the first argument (type) of ap */
static void
host_destroy(sdb_object_t *obj)
{
- sdb_host_t *sobj = HOST(obj);
+ host_t *sobj = HOST(obj);
assert(obj);
store_obj_destroy(obj);
static int
service_init(sdb_object_t *obj, va_list ap)
{
- sdb_service_t *sobj = SVC(obj);
+ service_t *sobj = SVC(obj);
int ret;
/* this will consume the first argument (type) of ap */
static void
service_destroy(sdb_object_t *obj)
{
- sdb_service_t *sobj = SVC(obj);
+ service_t *sobj = SVC(obj);
assert(obj);
store_obj_destroy(obj);
};
static sdb_type_t host_type = {
- /* size = */ sizeof(sdb_host_t),
+ /* size = */ sizeof(host_t),
/* init = */ host_init,
/* destroy = */ host_destroy
};
static sdb_type_t service_type = {
- /* size = */ sizeof(sdb_service_t),
+ /* size = */ sizeof(service_t),
/* init = */ service_init,
/* destroy = */ service_destroy
};
};
static sdb_type_t attribute_type = {
- /* size = */ sizeof(sdb_attribute_t),
+ /* size = */ sizeof(attr_t),
/* init = */ attr_init,
/* destroy = */ attr_destroy
};
/* The store's host_lock has to be acquired before calling this function. */
static sdb_avltree_t *
-get_host_children(sdb_host_t *host, int type)
+get_host_children(host_t *host, int type)
{
if ((type != SDB_SERVICE) && (type != SDB_METRIC)
&& (type != SDB_ATTRIBUTE))
{
sdb_store_t *st = SDB_STORE(user_data);
- sdb_host_t *host;
+ host_t *host;
sdb_avltree_t *attrs;
int status = 0;
{
sdb_store_t *st = SDB_STORE(user_data);
- sdb_host_t *host;
- sdb_service_t *svc;
+ host_t *host;
+ service_t *svc;
sdb_avltree_t *services;
int status = 0;
{
sdb_store_t *st = SDB_STORE(user_data);
- sdb_host_t *host;
+ host_t *host;
sdb_avltree_t *services;
int status = 0;
sdb_store_t *st = SDB_STORE(user_data);
sdb_avltree_t *metrics;
- sdb_host_t *host;
+ host_t *host;
sdb_metric_t *m;
int status = 0;
sdb_store_t *st = SDB_STORE(user_data);
sdb_store_obj_t *obj = NULL;
- sdb_host_t *host;
+ host_t *host;
sdb_metric_t *metric;
sdb_avltree_t *metrics;
sdb_store_obj_t *
sdb_store_get_host(sdb_store_t *store, const char *name)
{
- sdb_host_t *host;
+ host_t *host;
if ((! store) || (! name))
return NULL;
sdb_timeseries_opts_t *opts, sdb_strbuf_t *buf)
{
sdb_avltree_t *metrics;
- sdb_host_t *host;
+ host_t *host;
sdb_metric_t *m;
sdb_timeseries_t *ts;