--- a/src/cx/properties.h Thu Nov 07 20:22:56 2024 +0100 +++ b/src/cx/properties.h Thu Nov 07 22:46:58 2024 +0100 @@ -227,7 +227,7 @@ * @param value the value * @return zero on success, non-zero when sinking the k/v-pair failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull typedef int(*cx_properties_sink_func)( CxProperties *prop, CxPropertiesSink *sink, @@ -273,7 +273,7 @@ * @param target a string buffer where the read data shall be stored * @return zero on success, non-zero when reading data failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull typedef int(*cx_properties_read_func)( CxProperties *prop, CxPropertiesSource *src, @@ -287,7 +287,7 @@ * @param src the source * @return zero when initialization was successful, non-zero otherwise */ -__attribute__((__nonnull__)) +cx_attr_nonnull typedef int(*cx_properties_read_init_func)( CxProperties *prop, CxPropertiesSource *src @@ -299,7 +299,7 @@ * @param prop the properties interface that wants to read from the source * @param src the source */ -__attribute__((__nonnull__)) +cx_attr_nonnull typedef void(*cx_properties_read_clean_func)( CxProperties *prop, CxPropertiesSource *src @@ -345,7 +345,7 @@ * @param config the properties configuration * @see cxPropertiesInitDefault() */ -__attribute__((__nonnull__)) +cx_attr_nonnull void cxPropertiesInit(CxProperties *prop, CxPropertiesConfig config); /** @@ -359,7 +359,7 @@ * * @param prop the properties interface */ -__attribute__((__nonnull__)) +cx_attr_nonnull void cxPropertiesDestroy(CxProperties *prop); /** @@ -388,7 +388,8 @@ * @param len the length of the data * @return non-zero when a memory allocation was necessary but failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull +cx_attr_access_r(2, 3) int cxPropertiesFilln( CxProperties *prop, const char *buf, @@ -422,7 +423,7 @@ * @param str the string * @return non-zero when a memory allocation was necessary but failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull static inline int cx_properties_fill_cxstr( CxProperties *prop, cxstring str @@ -437,7 +438,7 @@ * @param str the string * @return non-zero when a memory allocation was necessary but failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull static inline int cx_properties_fill_mutstr( CxProperties *prop, cxmutstr str @@ -452,7 +453,8 @@ * @param str the string * @return non-zero when a memory allocation was necessary but failed */ -__attribute__((__nonnull__)) +cx_attr_nonnull +cx_attr_cstr_arg(2) static inline int cx_properties_fill_str( CxProperties *prop, const char *str @@ -467,7 +469,7 @@ * @param buf a pointer to stack memory * @param capacity the capacity of the stack memory */ -__attribute__((__nonnull__)) +cx_attr_nonnull void cxPropertiesUseStack( CxProperties *prop, char *buf, @@ -494,7 +496,8 @@ * @return the status code as defined above * @see cxPropertiesFill() */ -__attribute__((__nonnull__, __warn_unused_result__)) +cx_attr_nonnull +cx_attr_nodiscard CxPropertiesStatus cxPropertiesNext( CxProperties *prop, cxstring *key, @@ -513,7 +516,8 @@ * @return the sink * @see cxPropertiesLoad() */ -__attribute__((__nonnull__, __warn_unused_result__)) +cx_attr_nonnull +cx_attr_nodiscard CxPropertiesSink cxPropertiesMapSink(CxMap *map); /** @@ -523,7 +527,7 @@ * @return the properties source * @see cxPropertiesLoad() */ -__attribute__((__warn_unused_result__)) +cx_attr_nodiscard CxPropertiesSource cxPropertiesStringSource(cxstring str); /** @@ -534,7 +538,9 @@ * @return the properties source * @see cxPropertiesLoad() */ -__attribute__((__nonnull__, __warn_unused_result__)) +cx_attr_nonnull +cx_attr_nodiscard +cx_attr_access_r(1, 2) CxPropertiesSource cxPropertiesCstrnSource(const char *str, size_t len); /** @@ -547,7 +553,9 @@ * @return the properties source * @see cxPropertiesLoad() */ -__attribute__((__nonnull__, __warn_unused_result__)) +cx_attr_nonnull +cx_attr_nodiscard +cx_attr_cstr_arg(1) CxPropertiesSource cxPropertiesCstrSource(const char *str); /** @@ -559,7 +567,9 @@ * @return the properties source * @see cxPropertiesLoad() */ -__attribute__((__nonnull__, __warn_unused_result__)) +cx_attr_nonnull +cx_attr_nodiscard +cx_attr_access_r(1) CxPropertiesSource cxPropertiesFileSource(FILE *file, size_t chunk_size); @@ -578,7 +588,7 @@ * @param source the source * @return the status of the last operation */ -__attribute__((__nonnull__)) +cx_attr_nonnull CxPropertiesStatus cxPropertiesLoad( CxProperties *prop, CxPropertiesSink sink,