diff --git a/include/villas/node.h b/include/villas/node.h index 1616d7084..0673f2ef9 100644 --- a/include/villas/node.h +++ b/include/villas/node.h @@ -123,7 +123,7 @@ int node_parse(struct node *n, json_t *cfg, const char *name); * @param nodes The nodes will be added to this list. * @param all This list contains all valid nodes. */ -int node_parse_list(struct vlist *list, json_t *cfg, struct vlist *all); +int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all); /** Parse the list of signal definitions. */ int node_parse_signals(struct vlist *list, json_t *cfg); diff --git a/include/villas/signal.h b/include/villas/signal.h index d57f85851..d7af0e2f7 100644 --- a/include/villas/signal.h +++ b/include/villas/signal.h @@ -106,10 +106,10 @@ int signal_parse(struct signal *s, json_t *cfg); /** Initialize signal from a mapping_entry. */ int signal_init_from_mapping(struct signal *s, const struct mapping_entry *me, unsigned index); +int signal_list_init(struct vlist *list); +int signal_list_destroy(struct vlist *list); int signal_list_parse(struct vlist *list, json_t *cfg); - int signal_list_generate(struct vlist *list, unsigned len, enum signal_type fmt); - void signal_list_dump(const struct vlist *list, const union signal_data *data, int len); enum signal_type signal_type_from_str(const char *str); diff --git a/lib/node.c b/lib/node.c index b85beffbb..9a23bf183 100644 --- a/lib/node.c +++ b/lib/node.c @@ -78,7 +78,7 @@ static int node_direction_init(struct node_direction *nd, struct node *n) return ret; #endif /* WITH_HOOKS */ - ret = vlist_init(&nd->signals); + ret = signal_list_init(&nd->signals); if (ret) return ret; @@ -95,7 +95,7 @@ static int node_direction_destroy(struct node_direction *nd, struct node *n) return ret; #endif /* WITH_HOOKS */ - ret = vlist_destroy(&nd->signals, (dtor_cb_t) signal_decref, false); + ret = signal_list_destroy(&nd->signals); if (ret) return ret; @@ -716,7 +716,7 @@ struct memory_type * node_memory_type(struct node *n, struct memory_type *parent return node_type(n)->memory_type ? node_type(n)->memory_type(n, parent) : &memory_hugepage; } -int node_parse_list(struct vlist *list, json_t *cfg, struct vlist *all) +int node_list_parse(struct vlist *list, json_t *cfg, struct vlist *all) { struct node *node; const char *str; diff --git a/lib/path.c b/lib/path.c index 8365d266b..7bdb04b3f 100644 --- a/lib/path.c +++ b/lib/path.c @@ -333,7 +333,7 @@ int path_init(struct path *p) if (ret) return ret; - ret = vlist_init(&p->signals); + ret = signal_list_init(&p->signals); if (ret) return ret; @@ -553,7 +553,7 @@ int path_parse(struct path *p, json_t *cfg, struct vlist *nodes) /* Output node(s) */ if (json_out) { - ret = node_parse_list(&destinations, json_out, nodes); + ret = node_list_parse(&destinations, json_out, nodes); if (ret) jerror(&err, "Failed to parse output nodes"); } diff --git a/lib/signal.c b/lib/signal.c index 4cd6e89d4..47016714d 100644 --- a/lib/signal.c +++ b/lib/signal.c @@ -210,6 +210,28 @@ int signal_parse(struct signal *s, json_t *cfg) /* Signal list */ +int signal_list_init(struct vlist *list) +{ + int ret; + + ret = vlist_init(list); + if (ret) + return ret; + + return 0; +} + +int signal_list_destroy(struct vlist *list) +{ + int ret; + + ret = vlist_destroy(list, (dtor_cb_t) signal_decref, false); + if (ret) + return ret; + + return 0; +} + int signal_list_parse(struct vlist *list, json_t *cfg) { int ret;