X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=libuci.c;h=50c17f92bb6bd19cc7fa763ff8e8ff0d6ce1d1d6;hp=6bbc874163217ef2543bf3810e59139518dba55b;hb=53726f5dd57ab09a206c96108a71db25e7517caa;hpb=4f629ff865b978a7ea399776ff6af83c6428bda0 diff --git a/libuci.c b/libuci.c index 6bbc874..50c17f9 100644 --- a/libuci.c +++ b/libuci.c @@ -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; +}