#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;
uci_list_add(list, &h->e.list);
}
-static void
+void
uci_free_history(struct uci_history *h)
{
if (!h)
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;
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