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]);
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;
struct uci_sectmap *sm = sd->sm;
struct uci_optmap *om;
int ofs = (char *)field - (char *)section;
- int i;
+ int i = 0;
ucimap_foreach_option(sm, om) {
if (om->offset == ofs) {
SET_BIT(sd->cmap, i);
break;
}
+ i++;
}
}
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;
sprintf(buf, "%d", !!data->b);
str = buf;
break;
+ default:
+ continue;
}
ptr.value = str;
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);
}
}