summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2f0b28)
raw | patch | inline | side by side (parent: e2f0b28)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 26 Jun 2014 20:27:31 +0000 (22:27 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 26 Jun 2014 20:27:31 +0000 (22:27 +0200) |
Hierarchical data will be represented using some object relationship
information rather than a weird tree construct below each host. That's going
to be more flexible.
information rather than a weird tree construct below each host. That's going
to be more flexible.
src/core/store-private.h | patch | blob | history | |
src/core/store.c | patch | blob | history | |
src/core/store_lookup.c | patch | blob | history |
index 7cc2f66dbffc50363b0c04986a02c4ca66c99360..e501b2cd830169b2b7de01660207c976ca66f089 100644 (file)
--- a/src/core/store-private.h
+++ b/src/core/store-private.h
typedef struct {
sdb_store_base_t super;
- sdb_llist_t *children;
+ sdb_llist_t *services;
sdb_llist_t *attributes;
} sdb_store_obj_t;
#define SDB_STORE_OBJ(obj) ((sdb_store_obj_t *)(obj))
diff --git a/src/core/store.c b/src/core/store.c
index df8c02fb152a87135c4f44464476d8d8096d5361..4e642de68042440a13f6b96171048de89f034178 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
if (ret)
return ret;
- sobj->children = sdb_llist_create();
- if (! sobj->children)
+ sobj->services = sdb_llist_create();
+ if (! sobj->services)
return -1;
sobj->attributes = sdb_llist_create();
if (! sobj->attributes)
store_base_destroy(obj);
- if (sobj->children)
- sdb_llist_destroy(sobj->children);
+ if (sobj->services)
+ sdb_llist_destroy(sobj->services);
if (sobj->attributes)
sdb_llist_destroy(sobj->attributes);
} /* sdb_store_obj_destroy */
if ((type != SDB_HOST) && (STORE_BASE(sobj)->type == SDB_HOST))
continue;
- sobj = store_lookup_in_list(sobj->children, type, name);
+ sobj = store_lookup_in_list(sobj->services, type, name);
if (sobj) {
sdb_llist_iter_destroy(iter);
return sobj;
if (type == SDB_ATTRIBUTE)
parent_list = parent->attributes;
else
- parent_list = parent->children;
+ parent_list = parent->services;
}
if (type == SDB_HOST)
if (! (flags & SDB_SKIP_SERVICES)) {
sdb_strbuf_append(buf, ", \"services\": ");
- store_obj_tojson(host->children, SDB_SERVICE, buf);
+ store_obj_tojson(host->services, SDB_SERVICE, buf);
}
sdb_strbuf_append(buf, "}");
index 3920b80127c5a228792b299e06bc5e6e51f1187b..f57cb05cab292fa53d86b56c936d35403fc77351 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
return match_string(&NAME_M(m)->name, obj->super.name);
break;
case SDB_SERVICE:
- iter = sdb_llist_get_iter(SDB_STORE_OBJ(obj)->children);
+ iter = sdb_llist_get_iter(SDB_STORE_OBJ(obj)->services);
break;
case SDB_ATTRIBUTE:
iter = sdb_llist_get_iter(SDB_STORE_OBJ(obj)->attributes);