1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

add signal_list_clear()

This commit is contained in:
Manuel Pitz 2020-10-21 20:57:03 +02:00
parent 73dad5f73f
commit b911e9e7ab
2 changed files with 15 additions and 0 deletions

View file

@ -34,6 +34,8 @@ int signal_list_init(struct vlist *list) __attribute__ ((warn_unused_result));
int signal_list_destroy(struct vlist *list) __attribute__ ((warn_unused_result));
int signal_list_clear(struct vlist *list);
int signal_list_parse(struct vlist *list, json_t *cfg);
int signal_list_generate(struct vlist *list, unsigned len, enum SignalType fmt);

View file

@ -42,6 +42,19 @@ int signal_list_init(struct vlist *list)
return 0;
}
int signal_list_clear(struct vlist *list)
{
for (size_t i = 0; i < vlist_length(list); i++) {
struct signal *sig = (struct signal *) vlist_at(list, i);
signal_decref(sig);
}
vlist_clear(list);
return 0;
}
int signal_list_destroy(struct vlist *list)
{
int ret;