-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_foreach_entry(section, &cfg->sections, p) {
- if (!section || !strcmp(p->name, section))
- callback(p);
- }
- uci_unload(ctx, configname);
-}
-