From: Felix Fietkau Date: Sun, 24 Jun 2012 19:08:22 +0000 (+0200) Subject: add blobmsg_list_for_each X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a0851ba9f4bb4e653ba8e97fb329a8e51428f000;p=oweals%2Fprocd.git add blobmsg_list_for_each --- diff --git a/utils.h b/utils.h index e89f2f1..7ee65a0 100644 --- a/utils.h +++ b/utils.h @@ -22,6 +22,9 @@ struct blobmsg_list_node { #define blobmsg_list_init(list, type, field) \ __blobmsg_list_init(list, offsetof(type, field), sizeof(type)) +#define blobmsg_list_for_each(list, element) \ + avl_for_each_element(&(list)->avl, element, avl) + void __blobmsg_list_init(struct blobmsg_list *list, int offset, int len); int blobmsg_list_fill(struct blobmsg_list *list, void *data, int len); void blobmsg_list_free(struct blobmsg_list *list);