]> pilppa.org Git - uci.git/blobdiff - ucimap.h
ucimap: add helper function for resizing lists and freeing items (both using ucimap...
[uci.git] / ucimap.h
index d0e8ce91c5f56611be8d5db1e67754b478b0d766..21aa83e56320bcbe1fc72248a4ee00a1fd20a91e 100644 (file)
--- 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