diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-08-21 03:17:38 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-08-21 03:17:38 +0200 |
commit | fcb93b2ca79dbddd7a8754f65d72b78c4d6c13b5 (patch) | |
tree | 984154ad82d849f659dc221231bdf33a10aced93 /list.c | |
parent | ad70b02f42a0fb95d479d46cc84dd8470abc917e (diff) | |
download | uci-fcb93b2ca79dbddd7a8754f65d72b78c4d6c13b5.tar.gz |
add convenience functions for looking up packages/sections/options
Diffstat (limited to 'list.c')
-rw-r--r-- | list.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |