summaryrefslogtreecommitdiffstats
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index cf31f87..88ed8c1 100644
--- a/utils.c
+++ b/utils.c
@@ -43,6 +43,20 @@ blobmsg_list_fill(struct blobmsg_list *list, void *data, int len)
}
void
+blobmsg_list_move(struct blobmsg_list *list, struct blobmsg_list *src)
+{
+ struct blobmsg_list_node *node, *tmp;
+ void *ptr;
+
+ avl_remove_all_elements(&src->avl, node, avl, tmp) {
+ if (!avl_insert(&list->avl, &node->avl)) {
+ ptr = ((char *) node - list->node_offset);
+ free(ptr);
+ }
+ }
+}
+
+void
blobmsg_list_free(struct blobmsg_list *list)
{
struct blobmsg_list_node *node, *tmp;