]> pilppa.org Git - uci.git/blobdiff - uci.h
extend api to be able to get a full error string instead of printing it
[uci.git] / uci.h
diff --git a/uci.h b/uci.h
index 66ad752c395725ad94d9a859bcb3c654763f3743..d48ea7cef153349256adca7017e28fd178b92f60 100644 (file)
--- a/uci.h
+++ b/uci.h
@@ -83,6 +83,16 @@ extern void uci_free_context(struct uci_context *ctx);
  */
 extern void uci_perror(struct uci_context *ctx, const char *str);
 
+/**
+ * uci_geterror: Get an error string for the last uci error
+ * @ctx: uci context
+ * @dest: target pointer for the string
+ * @str: prefix for the error message
+ *
+ * Note: string must be freed by the caller
+ */
+extern void uci_get_errorstr(struct uci_context *ctx, char **dest, const char *str);
+
 /**
  * uci_import: Import uci config data from a stream
  * @ctx: uci context