diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-07-29 19:39:51 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-07-29 19:42:36 +0200 |
commit | 71016cda9739642fd49ffa949555e7240b7b1284 (patch) | |
tree | 70008362b7b413376d039dc2f23f35393ec9aa80 | |
parent | b45b4104d5d3db94254328cb0ed128d22835aa15 (diff) |
add support for multiple config_param_list::next pointers
-rw-r--r-- | config.c | 14 | ||||
-rw-r--r-- | config.h | 6 |
2 files changed, 16 insertions, 4 deletions
@@ -69,8 +69,8 @@ static void uci_array_to_blob(struct blob_buf *b, struct uci_option *o, free(str); } -static void uci_to_blob(struct blob_buf *b, struct uci_section *s, - const struct config_param_list *p) +static void __uci_to_blob(struct blob_buf *b, struct uci_section *s, + const struct config_param_list *p) { const struct blobmsg_policy *attr; struct uci_element *e; @@ -107,6 +107,16 @@ static void uci_to_blob(struct blob_buf *b, struct uci_section *s, } } +static void uci_to_blob(struct blob_buf *b, struct uci_section *s, + const struct config_param_list *p) +{ + int i; + + __uci_to_blob(b, s, p); + for (i = 0; i < p->n_next; i++) + uci_to_blob(b, s, p->next[i]); +} + static void config_parse_interface(struct uci_section *s) { @@ -15,10 +15,12 @@ union config_param_info { }; struct config_param_list { - const struct config_param_list *next; - int n_params; + int n_params, n_next; + const struct blobmsg_policy *params; const union config_param_info *info; + + const struct config_param_list *next[]; }; #endif |