From: Felix Fietkau Date: Tue, 12 Feb 2008 11:38:41 +0000 (+0100) Subject: make more functions available externally X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=68ced4fb649dd492c3f9af7119d00a4a638a32cb;p=uci.git make more functions available externally --- diff --git a/history.c b/history.c index c46c408..8935a3f 100644 --- a/history.c +++ b/history.c @@ -27,7 +27,7 @@ #include /* record a change that was done to a package */ -static void +void uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *section, char *option, char *value) { struct uci_history *h; @@ -48,7 +48,7 @@ uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *s uci_list_add(list, &h->e.list); } -static void +void uci_free_history(struct uci_history *h) { if (!h) diff --git a/libuci.c b/libuci.c index 04d9b90..a503699 100644 --- a/libuci.c +++ b/libuci.c @@ -193,6 +193,18 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac return 0; } +int uci_add_backend(struct uci_context *ctx, struct uci_backend *b) +{ + struct uci_element *e; + UCI_HANDLE_ERR(ctx); + e = uci_lookup_list(&ctx->backends, b->e.name); + if (e) + UCI_THROW(ctx, UCI_ERR_DUPLICATE); + + uci_list_add(&ctx->backends, &b->e.list); + return 0; +} + int uci_set_backend(struct uci_context *ctx, const char *name) { struct uci_element *e; diff --git a/uci_internal.h b/uci_internal.h index 81f0226..5b5a50d 100644 --- a/uci_internal.h +++ b/uci_internal.h @@ -32,8 +32,9 @@ struct uci_parse_context int bufsz; }; -static void uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *section, char *option, char *value); -static void uci_free_history(struct uci_history *h); +int uci_add_backend(struct uci_context *ctx, struct uci_backend *b); +void uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *section, char *option, char *value); +void uci_free_history(struct uci_history *h); /* * functions for debug and error handling, for internal use only