-static void uci_export_section(struct uci_section *p)
-{
- struct uci_option *o;
- const char *name;
-
- printf("\nconfig '%s'", uci_escape(p->type));
- printf(" '%s'\n", uci_escape(p->name));
- uci_foreach_entry(option, &p->options, o) {
- printf("\toption '%s'", uci_escape(o->name));
- printf(" '%s'\n", uci_escape(o->value));
- }
-}
-
-static void foreach_section(const char *configname, const char *section, void (*callback)(struct uci_section *))
-{
- struct uci_config *cfg;
- struct uci_section *p;
-
- if (uci_load(ctx, configname, &cfg) != UCI_OK) {
- uci_perror(ctx, "uci_load");
- return;
- }
-
- uci_list_empty(&cfg->sections);
- uci_foreach_entry(section, &cfg->sections, p) {
- if (!section || !strcmp(p->name, section))
- callback(p);
- }
- uci_unload(ctx, configname);
-}
-