From fcb93b2ca79dbddd7a8754f65d72b78c4d6c13b5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 21 Aug 2010 03:17:38 +0200 Subject: add convenience functions for looking up packages/sections/options --- list.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'list.c') diff --git a/list.c b/list.c index 9917971..a336b84 100644 --- a/list.c +++ b/list.c @@ -357,6 +357,18 @@ done: return e; } +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) { -- cgit v1.2.1