--- a/src/cx/properties.h Sun Dec 28 15:45:39 2025 +0100 +++ b/src/cx/properties.h Sun Dec 28 17:31:20 2025 +0100 @@ -41,10 +41,6 @@ #include "map.h" #include "buffer.h" -#ifdef __cplusplus -extern "C" { -#endif - /** * Configures the expected characters for the properties parser. */ @@ -184,8 +180,8 @@ * @param config the properties configuration * @see cxPropertiesInitDefault() */ -cx_attr_nonnull -CX_EXPORT void cxPropertiesInit(CxProperties *prop, CxPropertiesConfig config); +CX_EXTERN CX_NONNULL +void cxPropertiesInit(CxProperties *prop, CxPropertiesConfig config); /** * Destroys the properties interface. @@ -198,8 +194,8 @@ * * @param prop the properties interface */ -cx_attr_nonnull -CX_EXPORT void cxPropertiesDestroy(CxProperties *prop); +CX_EXTERN CX_NONNULL +void cxPropertiesDestroy(CxProperties *prop); /** * Destroys and re-initializes the properties interface. @@ -209,8 +205,8 @@ * * @param prop the properties interface */ -cx_attr_nonnull -CX_EXPORT void cxPropertiesReset(CxProperties *prop); +CX_EXTERN CX_NONNULL +void cxPropertiesReset(CxProperties *prop); /** * Initialize a properties parser with the default configuration. @@ -242,8 +238,8 @@ * @retval non-zero a memory allocation was necessary but failed * @see cxPropertiesFill() */ -cx_attr_nonnull cx_attr_access_r(2, 3) -CX_EXPORT int cxPropertiesFilln(CxProperties *prop, const char *buf, size_t len); +CX_EXTERN CX_NONNULL CX_ACCESS_R(2, 3) +int cxPropertiesFilln(CxProperties *prop, const char *buf, size_t len); /** * Internal function, do not use. @@ -253,8 +249,8 @@ * @retval zero success * @retval non-zero a memory allocation was necessary but failed */ -cx_attr_nonnull -CX_INLINE int cx_properties_fill(CxProperties *prop, cxstring str) { +CX_NONNULL CX_INLINE +int cx_properties_fill(CxProperties *prop, cxstring str) { return cxPropertiesFilln(prop, str.ptr, str.length); } @@ -287,8 +283,8 @@ * @param buf a pointer to stack memory * @param capacity the capacity of the stack memory */ -cx_attr_nonnull -CX_EXPORT void cxPropertiesUseStack(CxProperties *prop, char *buf, size_t capacity); +CX_EXTERN CX_NONNULL +void cxPropertiesUseStack(CxProperties *prop, char *buf, size_t capacity); /** * Retrieves the next key/value-pair. @@ -320,8 +316,8 @@ * @retval CX_PROPERTIES_INVALID_MISSING_DELIMITER the properties data contains a line without delimiter * @retval CX_PROPERTIES_BUFFER_ALLOC_FAILED an internal allocation was necessary but failed */ -cx_attr_nonnull cx_attr_nodiscard -CX_EXPORT CxPropertiesStatus cxPropertiesNext(CxProperties *prop, cxstring *key, cxstring *value); +CX_EXTERN CX_NONNULL CX_NODISCARD +CxPropertiesStatus cxPropertiesNext(CxProperties *prop, cxstring *key, cxstring *value); /** * The size of the stack memory that `cxPropertiesLoad()` will reserve with `cxPropertiesUseStack()`. @@ -342,8 +338,8 @@ * @param config the parser config * @return status code */ -cx_attr_nonnull_arg(3) -CX_EXPORT CxPropertiesStatus cx_properties_load(const CxAllocator *allocator, +CX_EXTERN CX_NONNULL_ARG(3) +CxPropertiesStatus cx_properties_load(const CxAllocator *allocator, cxstring filename, CxMap *target, CxPropertiesConfig config); /** @@ -401,9 +397,4 @@ #define cxPropertiesLoadDefault(allocator, filename, target) \ cx_properties_load(allocator, cx_strcast(filename), target, cx_properties_config_default) - -#ifdef __cplusplus -} // extern "C" -#endif - #endif // UCX_PROPERTIES_H