add strict mode flag (enabled by default, can be disabled to ignore lines with parser...
[project/uci.git] / uci.h
diff --git a/uci.h b/uci.h
index 891fb3b..e0b3d30 100644 (file)
--- a/uci.h
+++ b/uci.h
@@ -173,7 +173,23 @@ extern int uci_set_element_value(struct uci_context *ctx, struct uci_element **e
  * @option: option name
  * @value: value (option) or type (section)
  */
-extern int uci_set(struct uci_context *ctx, char *package, char *section, char *option, char *value);
+extern int uci_set(struct uci_context *ctx, struct uci_package *p, char *section, char *option, char *value);
+
+/**
+ * uci_del_element: Delete a section or option
+ * @ctx: uci context
+ * @e: element (section or option)
+ */
+extern int uci_del_element(struct uci_context *ctx, struct uci_element *e);
+
+/**
+ * uci_del: Delete a section or option
+ * @ctx: uci context
+ * @p: uci package
+ * @section: section name
+ * @option: option name (optional)
+ */
+extern int uci_del(struct uci_context *ctx, struct uci_package *p, char *section, char *option);
 
 /**
  * uci_save: save change history for a package
@@ -204,6 +220,11 @@ enum uci_type {
        UCI_TYPE_OPTION = 3
 };
 
+enum uci_flags {
+       UCI_FLAG_STRICT = (1 << 0), /* strict mode for the parser */
+       UCI_FLAG_PERROR = (1 << 1), /* print error messages to stderr */
+};
+
 struct uci_element
 {
        struct uci_list list;
@@ -219,6 +240,9 @@ struct uci_context
        /* parser context, use for error handling only */
        struct uci_parse_context *pctx;
 
+       /* uci runtime flags */
+       enum uci_flags flags;
+
        /* private: */
        int errno;
        const char *func;