[UCI_ERR_UNKNOWN] = "Unknown error",
};
-static void uci_cleanup(struct uci_context *ctx);
static void uci_unload_plugin(struct uci_context *ctx, struct uci_plugin *p);
#include "uci_internal.h"
-#include "util.c"
#include "list.c"
#include "history.c"
-#include "file.c"
/* exported functions */
struct uci_context *uci_alloc_context(void)
struct uci_context *ctx;
ctx = (struct uci_context *) malloc(sizeof(struct uci_context));
+ if (!ctx)
+ return NULL;
+
memset(ctx, 0, sizeof(struct uci_context));
uci_list_init(&ctx->root);
uci_list_init(&ctx->history_path);
return 0;
}
-static void uci_cleanup(struct uci_context *ctx)
+__private void uci_cleanup(struct uci_context *ctx)
{
struct uci_parse_context *pctx;