make more functions available externally
authorFelix Fietkau <nbd@openwrt.org>
Tue, 12 Feb 2008 11:38:41 +0000 (12:38 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 12 Feb 2008 11:38:41 +0000 (12:38 +0100)
history.c
libuci.c
uci_internal.h

index c46c408..8935a3f 100644 (file)
--- a/history.c
+++ b/history.c
@@ -27,7 +27,7 @@
 #include <ctype.h>
 
 /* 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)
index 04d9b90..a503699 100644 (file)
--- 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;
index 81f0226..5b5a50d 100644 (file)
@@ -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