-int
-uci_fill_ptr(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_element *e, bool complete)
-{
- UCI_HANDLE_ERR(ctx);
- UCI_ASSERT(ctx, ptr != NULL);
- UCI_ASSERT(ctx, e != NULL);
-
- memset(ptr, 0, sizeof(struct uci_ptr));
- switch(e->type) {
- case UCI_TYPE_OPTION:
- ptr->o = uci_to_option(e);
- goto fill_option;
- case UCI_TYPE_SECTION:
- ptr->s = uci_to_section(e);
- goto fill_section;
- case UCI_TYPE_PACKAGE:
- ptr->p = uci_to_package(e);
- goto fill_package;
- default:
- UCI_THROW(ctx, UCI_ERR_INVAL);
- }
-
-fill_option:
- ptr->option = ptr->o->e.name;
- ptr->s = ptr->o->section;
-fill_section:
- ptr->section = ptr->s->e.name;
- ptr->p = ptr->s->package;
-fill_package:
- ptr->package = ptr->p->e.name;
-
- ptr->flags |= UCI_LOOKUP_DONE;
- if (complete)
- ptr->flags |= UCI_LOOKUP_COMPLETE;
-
- return 0;
-}
-
-static struct uci_element *
-expand_ptr(struct uci_context *ctx, struct uci_ptr *ptr, bool complete)
+__private struct uci_element *
+uci_expand_ptr(struct uci_context *ctx, struct uci_ptr *ptr, bool complete)