-/*
- * check the specified condition.
- * throw an invalid argument exception if it's false
- */
-#define UCI_ASSERT(ctx, expr) do { \
- if (!(expr)) { \
- DPRINTF("[%s:%d] Assertion failed\n", __FILE__, __LINE__); \
- UCI_THROW(ctx, UCI_ERR_INVAL); \
- } \
-} while (0)
-
-
-static char *uci_errstr[] = {
- [UCI_OK] = "Success",
- [UCI_ERR_MEM] = "Out of memory",
- [UCI_ERR_INVAL] = "Invalid argument",
- [UCI_ERR_NOTFOUND] = "Entry not found",
- [UCI_ERR_PARSE] = "Parse error",
- [UCI_ERR_UNKNOWN] = "Unknown error",
-};
+ ctx = (struct uci_context *) malloc(sizeof(struct uci_context));
+ memset(ctx, 0, sizeof(struct uci_context));
+ uci_list_init(&ctx->root);
+ uci_list_init(&ctx->history_path);
+ ctx->flags = UCI_FLAG_STRICT;