From 25b34febb4851f605f35b45df6eaebc45b122a12 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 5 Sep 2009 00:39:41 +0200 Subject: ucimap: add helper function for resizing lists and freeing items (both using ucimap internal allocation list), add test coverage for config change operations --- ucimap.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ucimap.h') diff --git a/ucimap.h b/ucimap.h index d0e8ce9..21aa83e 100644 --- a/ucimap.h +++ b/ucimap.h @@ -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 -- cgit v1.2.1