src/cx/properties.h

changeset 1013
add8358fc3c3
parent 988
15b3ca7ee33f
child 1031
8a90552bba29
--- a/src/cx/properties.h	Sun Dec 15 12:19:21 2024 +0100
+++ b/src/cx/properties.h	Sun Dec 15 13:44:08 2024 +0100
@@ -363,6 +363,21 @@
 void cxPropertiesDestroy(CxProperties *prop);
 
 /**
+ * Destroys and re-initializes the properties interface.
+ *
+ * You might want to use this, to reset the parser after
+ * encountering a syntax error.
+ *
+ * @param prop the properties interface
+ */
+cx_attr_nonnull
+static inline void cxPropertiesReset(CxProperties *prop) {
+    CxPropertiesConfig config = prop->config;
+    cxPropertiesDestroy(prop);
+    cxPropertiesInit(prop, config);
+}
+
+/**
  * Initialize a properties parser with the default configuration.
  *
  * @param prop the properties interface

mercurial