mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
refactor: rename signal_list_{init,destroy}() and node_list_parse()
This commit is contained in:
parent
78bcb67245
commit
f851aacf3c
5 changed files with 30 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
22
lib/signal.c
22
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue