src/cx/properties.h

changeset 1557
03fbf1c99e73
parent 1555
8972247f54e8
child 1560
f060ecd65575
--- a/src/cx/properties.h	Sun Dec 07 19:36:51 2025 +0100
+++ b/src/cx/properties.h	Mon Dec 08 23:09:11 2025 +0100
@@ -340,13 +340,14 @@
  * Internal function - use cxPropertiesLoad() instead.
  *
  * @param config the parser config
+ * @param allocator the allocator for the values
  * @param filename the file name
  * @param target the target map
  * @return status code
  */
-cx_attr_nonnull
+cx_attr_nonnull_arg(4)
 CX_EXPORT CxPropertiesStatus cx_properties_load(CxPropertiesConfig config,
-        cxstring filename, CxMap *target);
+        const CxAllocator *allocator, cxstring filename, CxMap *target);
 
 /**
  * Loads properties from a file and inserts them into a map.
@@ -357,6 +358,7 @@
  * Any other configuration is not supported.
  *
  * @param config the parser config
+ * @param allocator the allocator for the values that will be stored in the map
  * @param filename (any string) the absolute or relative path to the file
  * @param target (@c CxMap*) the map where the properties shall be added
  * @retval CX_PROPERTIES_NO_ERROR (zero) at least one key/value pair was found
@@ -369,7 +371,8 @@
  * @retval CX_PROPERTIES_MAP_ERROR storing a key/value pair in the map failed
  * @see cxPropertiesLoadDefault()
  */
-#define cxPropertiesLoad(config, filename, target) cx_properties_load(config, cx_strcast(filename), target)
+#define cxPropertiesLoad(config, allocator, filename, target) \
+    cx_properties_load(config, allocator, cx_strcast(filename), target)
 
 /**
  * Loads properties from a file and inserts them into a map with a default config.
@@ -379,6 +382,7 @@
  * The map must either store pointers of type @c char*, or elements of type cxmutstr.
  * Any other configuration is not supported.
  *
+ * @param allocator the allocator for the values that will be stored in the map
  * @param filename (any string) the absolute or relative path to the file
  * @param target (@c CxMap*) the map where the properties shall be added
  * @retval CX_PROPERTIES_NO_ERROR (zero) at least one key/value pair was found
@@ -391,7 +395,8 @@
  * @retval CX_PROPERTIES_MAP_ERROR storing a key/value pair in the map failed
  * @see cxPropertiesLoad()
  */
-#define cxPropertiesLoadDefault(filename, target) cx_properties_load(cx_properties_config_default, cx_strcast(filename), target)
+#define cxPropertiesLoadDefault(allocator, filename, target) \
+    cx_properties_load(cx_properties_config_default, allocator, cx_strcast(filename), target)
 
 
 #ifdef __cplusplus

mercurial