summaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-08-21 03:17:38 +0200
committerFelix Fietkau <nbd@openwrt.org>2010-08-21 03:17:38 +0200
commitfcb93b2ca79dbddd7a8754f65d72b78c4d6c13b5 (patch)
tree984154ad82d849f659dc221231bdf33a10aced93 /list.c
parentad70b02f42a0fb95d479d46cc84dd8470abc917e (diff)
downloaduci-fcb93b2ca79dbddd7a8754f65d72b78c4d6c13b5.tar.gz
add convenience functions for looking up packages/sections/options
Diffstat (limited to 'list.c')
-rw-r--r--list.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/list.c b/list.c
index 9917971..a336b84 100644
--- a/list.c
+++ b/list.c
@@ -358,6 +358,18 @@ done:
}
int
+uci_lookup_next(struct uci_context *ctx, struct uci_element **e, struct uci_list *list, const char *name)
+{
+ UCI_HANDLE_ERR(ctx);
+
+ *e = uci_lookup_list(list, name);
+ if (!*e)
+ UCI_THROW(ctx, UCI_ERR_NOTFOUND);
+
+ return 0;
+}
+
+int
uci_lookup_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *str, bool extended)
{
struct uci_element *e;