]> pilppa.org Git - uci.git/blobdiff - ucimap.c
shorten callback names
[uci.git] / ucimap.c
index cb86a4f34f61219645204e069245f666bfd8735a..191c97c4b9153df2ab589c8fcaf68bcbecbb3021 100644 (file)
--- a/ucimap.c
+++ b/ucimap.c
@@ -139,8 +139,8 @@ ucimap_free_section(struct uci_map *map, struct uci_sectmap_data *sd)
        if (!list_empty(&sd->list))
                list_del(&sd->list);
 
-       if (sd->sm->free_section)
-               sd->sm->free_section(map, section);
+       if (sd->sm->free)
+               sd->sm->free(map, section);
 
        for (i = 0; i < sd->allocmap_len; i++) {
                ucimap_free_item(&sd->allocmap[i]);
@@ -341,7 +341,7 @@ ucimap_parse_section(struct uci_map *map, struct uci_sectmap *sm, struct uci_sec
 
        section = (char *)sd + sizeof(struct uci_sectmap_data);
 
-       err = sm->init_section(map, section, s);
+       err = sm->init(map, section, s);
        if (err)
                goto error;
 
@@ -426,6 +426,9 @@ ucimap_store_section(struct uci_map *map, struct uci_package *p, void *section)
                static char buf[32];
                const char *str = NULL;
 
+               if (ucimap_is_list(om->type))
+                       continue;
+
                data = ucimap_get_data(sd, om);
                if (!TEST_BIT(sd->cmap, i))
                        continue;
@@ -443,6 +446,8 @@ ucimap_store_section(struct uci_map *map, struct uci_package *p, void *section)
                        sprintf(buf, "%d", !!data->b);
                        str = buf;
                        break;
+               default:
+                       continue;
                }
                ptr.value = str;
 
@@ -520,7 +525,7 @@ ucimap_parse(struct uci_map *map, struct uci_package *pkg)
                        continue;
 
                section = (char *) sd + sizeof(struct uci_sectmap_data);
-               if (sd->sm->add_section(map, section) != 0)
+               if (sd->sm->add(map, section) != 0)
                        ucimap_free_section(map, sd);
        }
 }