diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-02-12 12:16:39 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-02-12 12:16:39 +0100 |
commit | 53726f5dd57ab09a206c96108a71db25e7517caa (patch) | |
tree | 12eaab9a1578a2b15f5806e1dc47b4b9e3ab2764 /libuci.c | |
parent | 4f629ff865b978a7ea399776ff6af83c6428bda0 (diff) | |
download | uci-53726f5dd57ab09a206c96108a71db25e7517caa.tar.gz |
add uci_set_backend()
Diffstat (limited to 'libuci.c')
-rw-r--r-- | libuci.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -194,4 +194,15 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac return 0; } +int uci_set_backend(struct uci_context *ctx, const char *name) +{ + struct uci_element *e; + UCI_HANDLE_ERR(ctx); + UCI_ASSERT(ctx, name != NULL); + e = uci_lookup_list(&ctx->backends, name); + if (!e) + UCI_THROW(ctx, UCI_ERR_NOTFOUND); + ctx->backend = uci_to_backend(e); + return 0; +} |