more export stuff
[project/uci.git] / uci.h
diff --git a/uci.h b/uci.h
index 26cc3b7..c5594d8 100644 (file)
--- a/uci.h
+++ b/uci.h
@@ -67,7 +67,15 @@ extern void uci_perror(struct uci_context *ctx, const char *str);
  * @ctx: uci context
  * @name: name of the config file (relative to the config directory)
  */
-extern int uci_load(struct uci_context *ctx, const char *name);
+extern int uci_load(struct uci_context *ctx, const char *name, struct uci_config **cfg);
+
+/**
+ * uci_unload: Unload a config file from the uci context
+ *
+ * @ctx: uci context
+ * @name: name of the config file
+ */
+extern int uci_unload(struct uci_context *ctx, const char *name);
 
 /**
  * uci_cleanup: Clean up after an error
@@ -81,7 +89,7 @@ extern int uci_cleanup(struct uci_context *ctx);
  *
  * @ctx: uci context
  */
-extern char **uci_list_configs(struct uci_context *ctx);
+extern char **uci_list_configs();
 
 /* UCI data structures */
 
@@ -104,6 +112,7 @@ struct uci_parse_context
 
        /* private: */
        struct uci_config *cfg;
+       struct uci_section *section;
        FILE *file;
        char *buf;
        char *reason;
@@ -116,6 +125,8 @@ struct uci_config
        struct uci_list sections;
        struct uci_context *ctx;
        char *name;
+       /* private: */
+       int n_section;
 };
 
 struct uci_section
@@ -140,7 +151,7 @@ struct uci_option
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #endif
 
-#define uci_list_empty(list) (list->next == ptr)
+#define uci_list_empty(list) ((list)->next == (list))
 #define uci_list_entry(_type, _ptr) \
        ((struct uci_ ## _type *) ((char *)(_ptr) - offsetof(struct uci_ ## _type,list)))