diff options
author | Felix Fietkau <nbd@openwrt.org> | 2009-09-05 00:39:41 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2009-09-05 00:42:38 +0200 |
commit | 25b34febb4851f605f35b45df6eaebc45b122a12 (patch) | |
tree | 530a76c0d7c204a7bb99cae4fd8fc66749828623 /ucimap.h | |
parent | afa566288588a590961c366476bcd9341a957297 (diff) | |
download | uci-25b34febb4851f605f35b45df6eaebc45b122a12.tar.gz |
ucimap: add helper function for resizing lists and freeing items (both using ucimap internal allocation list), add test coverage for config change operations
Diffstat (limited to 'ucimap.h')
-rw-r--r-- | ucimap.h | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -164,12 +164,6 @@ struct ucimap_section_data { bool done; }; - -struct uci_listmap { - struct list_head list; - union ucimap_data data; -}; - struct uci_sectionmap { /* type string for the uci section */ const char *type; @@ -228,6 +222,7 @@ struct uci_optmap { struct ucimap_list { int n_items; + int size; union ucimap_data item[]; }; @@ -238,5 +233,7 @@ extern int ucimap_store_section(struct uci_map *map, struct uci_package *p, stru extern void ucimap_parse(struct uci_map *map, struct uci_package *pkg); extern int ucimap_parse_section(struct uci_map *map, struct uci_sectionmap *sm, struct ucimap_section_data *sd, struct uci_section *s); extern void ucimap_free_section(struct uci_map *map, struct ucimap_section_data *sd); +extern int ucimap_resize_list(struct ucimap_section_data *sd, struct ucimap_list **list, int items); +extern void ucimap_free_item(struct ucimap_section_data *sd, void *item); #endif |