src/cx/string.h

changeset 1675
36c0fb2b60b2
parent 1674
8b0f162ac88e
child 1676
f889ffd07c86
--- a/src/cx/string.h	Sun Dec 28 15:45:39 2025 +0100
+++ b/src/cx/string.h	Sun Dec 28 17:31:20 2025 +0100
@@ -159,7 +159,7 @@
  *
  * @see cx_mutstrn()
  */
-cx_attr_nodiscard cx_attr_cstr_arg(1)
+CX_NODISCARD CX_CSTR_ARG(1)
 CX_INLINE cxmutstr cx_mutstr(char *cstring) {
     cxmutstr str;
     str.ptr = cstring;
@@ -183,7 +183,7 @@
  *
  * @see cx_mutstr()
  */
-cx_attr_nodiscard cx_attr_access_rw(1, 2)
+CX_NODISCARD CX_ACCESS_RW(1, 2)
 CX_INLINE cxmutstr cx_mutstrn(char *cstring, size_t length) {
     cxmutstr str;
     str.ptr = cstring;
@@ -208,7 +208,7 @@
  *
  * @see cx_strn()
  */
-cx_attr_nodiscard cx_attr_cstr_arg(1)
+CX_NODISCARD CX_CSTR_ARG(1)
 CX_INLINE cxstring cx_str(const char *cstring) {
     cxstring str;
     str.ptr = cstring;
@@ -233,7 +233,7 @@
  *
  * @see cx_str()
  */
-cx_attr_nodiscard cx_attr_access_r(1, 2)
+CX_NODISCARD CX_ACCESS_R(1, 2)
 CX_INLINE cxstring cx_strn(const char *cstring, size_t length) {
     cxstring str;
     str.ptr = cstring;
@@ -242,40 +242,39 @@
 }
 
 #ifdef __cplusplus
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxmutstr cx_strcast_m(cxmutstr str) {
     return str;
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxstring cx_strcast_m(cxstring str) {
     return str;
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxmutstr cx_strcast_m(char *str) {
     return cx_mutstr(str);
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxmutstr cx_strcast_m(unsigned char *str) {
     return cx_mutstr(reinterpret_cast<char*>(str));
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxstring cx_strcast_m(const char *str) {
     return cx_str(str);
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxstring cx_strcast_m(const unsigned char *str) {
     return cx_str(reinterpret_cast<const char*>(str));
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxstring cx_strcast_(cxmutstr str) {
     return cx_strn(str.ptr, str.length);
 }
-cx_attr_nodiscard
+CX_NODISCARD
 CX_CPPDECL cxstring cx_strcast_(cxstring str) {
     return str;
 }
 #define cx_strcast(s) cx_strcast_(cx_strcast_m(s))
-extern "C" {
 #else
 /**
  * Internal function, do not use.
@@ -284,7 +283,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxmutstr cx_strcast_cxms(cxmutstr str) {
     return str;
 }
@@ -295,7 +294,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxstring cx_strcast_cxs(cxstring str) {
     return str;
 }
@@ -307,7 +306,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxmutstr cx_strcast_uc(unsigned char *str) {
     return cx_mutstr((char*)str);
 }
@@ -319,7 +318,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxmutstr cx_strcast_c(char *str) {
     return cx_mutstr(str);
 }
@@ -331,7 +330,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxstring cx_strcast_ucc(const unsigned char *str) {
     return cx_str((const char*)str);
 }
@@ -343,7 +342,7 @@
  * @see cx_strcast_m()
  * @see cx_strcast()
  */
-cx_attr_nodiscard
+CX_NODISCARD
 CX_INLINE cxstring cx_strcast_cc(const char *str) {
     return cx_str(str);
 }
@@ -419,7 +418,8 @@
  *
  * @param str the string to free
  */
-CX_EXPORT void cx_strfree(cxmutstr *str);
+CX_EXTERN
+void cx_strfree(cxmutstr *str);
 
 /**
  * Passes the pointer in this string to the allocator's free function.
@@ -434,8 +434,8 @@
  * @param alloc the allocator
  * @param str the string to free
  */
-cx_attr_nonnull_arg(1)
-CX_EXPORT void cx_strfree_a(const CxAllocator *alloc, cxmutstr *str);
+CX_EXTERN CX_NONNULL_ARG(1)
+void cx_strfree_a(const CxAllocator *alloc, cxmutstr *str);
 
 /**
  * Copies a string.
@@ -450,8 +450,8 @@
  * @retval non-zero if re-allocation failed
  * @see cx_strcpy_a()
  */
-cx_attr_nonnull_arg(1)
-CX_EXPORT int cx_strcpy_a_(const CxAllocator *alloc, cxmutstr *dest, cxstring src);
+CX_EXTERN CX_NONNULL_ARG(1)
+int cx_strcpy_a_(const CxAllocator *alloc, cxmutstr *dest, cxstring src);
 
 /**
  * Copies a string.
@@ -496,8 +496,8 @@
  * @param ...      all strings
  * @return the accumulated length of all strings
  */
-cx_attr_nodiscard
-CX_EXPORT size_t cx_strlen(size_t count, ...);
+CX_EXTERN CX_NODISCARD
+size_t cx_strlen(size_t count, ...);
 
 /**
  * Concatenates strings.
@@ -519,8 +519,8 @@
  * @param ...   all other UCX strings
  * @return the concatenated string
  */
-cx_attr_nonnull
-CX_EXPORT cxmutstr cx_strcat_a(const CxAllocator *alloc,
+CX_EXTERN CX_NONNULL
+cxmutstr cx_strcat_a(const CxAllocator *alloc,
         cxmutstr str, size_t count, ...);
 
 /**
@@ -553,8 +553,8 @@
  * @return a substring of @p string starting at @p start
  * @see cx_strsubsl()
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strsubsl_(cxstring string, size_t start, size_t length);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strsubsl_(cxstring string, size_t start, size_t length);
 
 /**
  * Returns a substring.
@@ -566,19 +566,20 @@
  * @return a substring of @p string starting at @p start
  * @see cx_strsubs()
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strsubs_(cxstring string, size_t start);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strsubs_(cxstring string, size_t start);
 
-CX_INLINE cxmutstr cx_strsubs_m_(cxmutstr string, size_t start) {
+CX_INLINE
+cxmutstr cx_strsubs_m_(cxmutstr string, size_t start) {
     return cx_mutstrcast(cx_strsubs_(cx_strcast(string), start));
 }
 
-CX_INLINE cxmutstr cx_strsubsl_m_(cxmutstr string, size_t start, size_t length) {
+CX_INLINE
+cxmutstr cx_strsubsl_m_(cxmutstr string, size_t start, size_t length) {
     return cx_mutstrcast(cx_strsubsl_(cx_strcast(string), start, length));
 }
 
 #ifdef __cplusplus
-} // extern "C"
 CX_CPPDECL cxstring cx_strsubs_cpp_(cxstring string, size_t start) {
     return cx_strsubs_(string, start);
 }
@@ -593,7 +594,6 @@
 }
 #define cx_strsubs(string, start) cx_strsubs_cpp_(cx_strcast_m(string), start)
 #define cx_strsubsl(string, start, length) cx_strsubsl_cpp_(cx_strcast_m(string), start, length)
-extern "C" {
 #else
 /**
  * Returns a substring starting at the specified location.
@@ -644,7 +644,8 @@
  * @return the character at the index
  * @see cx_strat()
  */
-CX_INLINE char cx_strat_(cxstring str, off_t index) {
+CX_INLINE
+char cx_strat_(cxstring str, off_t index) {
     size_t i;
     if (index >= 0) {
         i = index;
@@ -684,8 +685,8 @@
  *
  * @see cx_strchr_m()
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strchr(cxstring string, int chr);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strchr(cxstring string, int chr);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -699,8 +700,8 @@
  *
  * @see cx_strchr()
  */
-cx_attr_nodiscard
-CX_EXPORT cxmutstr cx_strchr_m(cxmutstr string, int chr);
+CX_EXTERN CX_NODISCARD
+cxmutstr cx_strchr_m(cxmutstr string, int chr);
 
 /**
  * Returns a substring starting at the location of the last occurrence of the
@@ -714,8 +715,8 @@
  *
  * @see cx_strrchr_m()
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strrchr(cxstring string, int chr);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strrchr(cxstring string, int chr);
 
 /**
  * Returns a substring starting at the location of the last occurrence of the
@@ -729,8 +730,8 @@
  *
  * @see cx_strrchr()
  */
-cx_attr_nodiscard
-CX_EXPORT cxmutstr cx_strrchr_m(cxmutstr string, int chr);
+CX_EXTERN CX_NODISCARD
+cxmutstr cx_strrchr_m(cxmutstr string, int chr);
 
 /**
  * Searches for a specific substring.
@@ -743,8 +744,8 @@
  * or an empty string, if the sequence is not contained
  * @see cx_strstr()
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strstr_(cxstring haystack, cxstring needle);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strstr_(cxstring haystack, cxstring needle);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -774,8 +775,8 @@
  * or an empty string, if the sequence is not contained
  * @see cx_strstr_m()
  */
-cx_attr_nodiscard
-CX_EXPORT cxmutstr cx_strstr_m_(cxmutstr haystack, cxstring needle);
+CX_EXTERN CX_NODISCARD
+cxmutstr cx_strstr_m_(cxmutstr haystack, cxstring needle);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -806,8 +807,8 @@
  * @return the actual number of split items
  * @see cx_strsplit()
  */
-cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(4, 3)
-CX_EXPORT size_t cx_strsplit_(cxstring string, cxstring delim,
+CX_EXTERN CX_NODISCARD CX_NONNULL CX_ACCESS_W(4, 3)
+size_t cx_strsplit_(cxstring string, cxstring delim,
         size_t limit, cxstring *output);
 
 /**
@@ -823,8 +824,8 @@
  * @return the actual number of split items
  * @see cx_strsplit_a()
  */
-cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(5)
-CX_EXPORT size_t cx_strsplit_a_(const CxAllocator *allocator,
+CX_EXTERN CX_NODISCARD CX_NONNULL CX_ACCESS_W(5)
+size_t cx_strsplit_a_(const CxAllocator *allocator,
         cxstring string, cxstring delim,
         size_t limit, cxstring **output);
 
@@ -841,8 +842,8 @@
  * @return the actual number of split items
  * @see cx_strsplit_m()
  */
-cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(4, 3)
-CX_EXPORT size_t cx_strsplit_m_(cxmutstr string, cxstring delim,
+CX_EXTERN CX_NODISCARD CX_NONNULL CX_ACCESS_W(4, 3)
+size_t cx_strsplit_m_(cxmutstr string, cxstring delim,
         size_t limit, cxmutstr *output);
 
 /**
@@ -858,8 +859,8 @@
  * @return the actual number of split items
  * @see cx_strsplit_ma()
  */
-cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(5)
-CX_EXPORT size_t cx_strsplit_ma_(const CxAllocator *allocator,
+CX_EXTERN CX_NODISCARD CX_NONNULL CX_ACCESS_W(5)
+size_t cx_strsplit_ma_(const CxAllocator *allocator,
         cxmutstr string, cxstring delim, size_t limit,
         cxmutstr **output);
 
@@ -946,8 +947,8 @@
  * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger
  * than @p s2, zero if both strings equal
  */
-cx_attr_nodiscard
-CX_EXPORT int cx_strcmp_(cxstring s1, cxstring s2);
+CX_EXTERN CX_NODISCARD
+int cx_strcmp_(cxstring s1, cxstring s2);
 
 /**
  * Compares two strings.
@@ -967,8 +968,8 @@
  * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger
  * than @p s2, zero if both strings equal ignoring case
  */
-cx_attr_nodiscard
-CX_EXPORT int cx_strcasecmp_(cxstring s1, cxstring s2);
+CX_EXTERN CX_NODISCARD
+int cx_strcasecmp_(cxstring s1, cxstring s2);
 
 /**
  * Compares two strings ignoring case.
@@ -993,8 +994,8 @@
  * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger
  * than @p s2, zero if both strings equal
  */
-cx_attr_nodiscard  cx_attr_nonnull
-CX_EXPORT int cx_strcmp_p(const void *s1, const void *s2);
+CX_EXTERN CX_NODISCARD CX_NONNULL
+int cx_strcmp_p(const void *s1, const void *s2);
 
 /**
  * Compares two strings ignoring case.
@@ -1006,9 +1007,8 @@
  * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger
  * than @p s2, zero if both strings equal ignoring case
  */
-cx_attr_nodiscard cx_attr_nonnull
-CX_EXPORT int cx_strcasecmp_p(const void *s1, const void *s2);
-
+CX_EXTERN CX_NODISCARD CX_NONNULL
+int cx_strcasecmp_p(const void *s1, const void *s2);
 
 /**
  * Creates a duplicate of the specified string.
@@ -1022,8 +1022,8 @@
  * @return a duplicate of the string
  * @see cx_strdup()
  */
-cx_attr_nodiscard cx_attr_nonnull
-CX_EXPORT cxmutstr cx_strdup_a_(const CxAllocator *allocator, cxstring string);
+CX_EXTERN CX_NODISCARD CX_NONNULL
+cxmutstr cx_strdup_a_(const CxAllocator *allocator, cxstring string);
 
 /**
  * Creates a duplicate of the specified string.
@@ -1064,8 +1064,8 @@
  * @param string the string that shall be trimmed
  * @return the trimmed string
  */
-cx_attr_nodiscard
-CX_EXPORT cxstring cx_strtrim(cxstring string);
+CX_EXTERN CX_NODISCARD
+cxstring cx_strtrim(cxstring string);
 
 /**
  * Omits leading and trailing spaces.
@@ -1076,8 +1076,8 @@
  * @param string the string that shall be trimmed
  * @return the trimmed string
  */
-cx_attr_nodiscard
-CX_EXPORT cxmutstr cx_strtrim_m(cxmutstr string);
+CX_EXTERN CX_NODISCARD
+cxmutstr cx_strtrim_m(cxmutstr string);
 
 /**
  * Checks if a string has a specific prefix.
@@ -1087,8 +1087,8 @@
  * @return @c true, if and only if the string has the specified prefix,
  * @c false otherwise
  */
-cx_attr_nodiscard
-CX_EXPORT bool cx_strprefix_(cxstring string, cxstring prefix);
+CX_EXTERN CX_NODISCARD
+bool cx_strprefix_(cxstring string, cxstring prefix);
 
 /**
  * Checks if a string has a specific prefix.
@@ -1108,8 +1108,8 @@
  * @return @c true, if and only if the string has the specified suffix,
  * @c false otherwise
  */
-cx_attr_nodiscard
-CX_EXPORT bool cx_strsuffix_(cxstring string, cxstring suffix);
+CX_EXTERN CX_NODISCARD
+bool cx_strsuffix_(cxstring string, cxstring suffix);
 
 /**
  * Checks if a string has a specific suffix.
@@ -1129,8 +1129,8 @@
  * @return @c true, if and only if the string has the specified prefix,
  * @c false otherwise
  */
-cx_attr_nodiscard
-CX_EXPORT bool cx_strcaseprefix_(cxstring string, cxstring prefix);
+CX_EXTERN CX_NODISCARD
+bool cx_strcaseprefix_(cxstring string, cxstring prefix);
 
 /**
  * Checks if a string has a specific prefix, ignoring the case.
@@ -1150,8 +1150,8 @@
  * @return @c true, if and only if the string has the specified suffix,
  * @c false otherwise
  */
-cx_attr_nodiscard
-CX_EXPORT bool cx_strcasesuffix_(cxstring string, cxstring suffix);
+CX_EXTERN CX_NODISCARD
+bool cx_strcasesuffix_(cxstring string, cxstring suffix);
 
 /**
  * Checks, if a string has a specific suffix, ignoring the case.
@@ -1163,7 +1163,6 @@
  */
 #define cx_strcasesuffix(string, suffix) cx_strcasesuffix_(cx_strcast(string), cx_strcast(suffix))
 
-
 /**
  * Replaces a string with another string.
  *
@@ -1180,8 +1179,8 @@
  * @see cx_strreplacen_a()
  * @see cx_strreplacen()
  */
-cx_attr_nodiscard cx_attr_nonnull
-CX_EXPORT cxmutstr cx_strreplace_(const CxAllocator *allocator,
+CX_EXTERN CX_NODISCARD CX_NONNULL
+cxmutstr cx_strreplace_(const CxAllocator *allocator,
         cxstring str, cxstring search, cxstring replacement, size_t replmax);
 
 /**
@@ -1268,8 +1267,8 @@
  * @param limit the maximum number of tokens that shall be returned
  * @return a new string tokenization context
  */
-cx_attr_nodiscard
-CX_EXPORT CxStrtokCtx cx_strtok_(cxstring str, cxstring delim, size_t limit);
+CX_EXTERN CX_NODISCARD
+CxStrtokCtx cx_strtok_(cxstring str, cxstring delim, size_t limit);
 
 /**
  * Creates a string tokenization context.
@@ -1292,11 +1291,10 @@
  * @return true if successful, false if the limit or the end of the string
  * has been reached
  */
-cx_attr_nonnull  cx_attr_nodiscard  cx_attr_access_w(2)
-CX_EXPORT bool cx_strtok_next_(CxStrtokCtx *ctx, cxstring *token);
+CX_EXTERN CX_NONNULL CX_NODISCARD CX_ACCESS_W(2)
+bool cx_strtok_next_(CxStrtokCtx *ctx, cxstring *token);
 
 #ifdef __cplusplus
-} // extern "C"
 CX_CPPDECL cx_strtok_next(CxStrtokCtx *ctx, cxstring *token) {
     return cx_strtok_next_(ctx, token);
 }
@@ -1305,7 +1303,6 @@
     //       but it works on all supported platforms
     return cx_strtok_next_(ctx, reinterpret_cast<cxstring*>(token));
 }
-extern "C" {
 #else // ! __cplusplus
 /**
  * Returns the next token.
@@ -1330,8 +1327,8 @@
  * @param delim array of more delimiters
  * @param count number of elements in the array
  */
-cx_attr_nonnull cx_attr_access_r(2, 3)
-CX_EXPORT void cx_strtok_delim(CxStrtokCtx *ctx, const cxstring *delim, size_t count);
+CX_EXTERN CX_NONNULL CX_ACCESS_R(2, 3)
+void cx_strtok_delim(CxStrtokCtx *ctx, const cxstring *delim, size_t count);
 
 /* ------------------------------------------------------------------------- *
  *                string to number conversion functions                      *
@@ -1351,8 +1348,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtos_lc_(cxstring str, short *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtos_lc_(cxstring str, short *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1368,8 +1365,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoi_lc_(cxstring str, int *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoi_lc_(cxstring str, int *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1385,8 +1382,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtol_lc_(cxstring str, long *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtol_lc_(cxstring str, long *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1402,8 +1399,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoll_lc_(cxstring str, long long *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoll_lc_(cxstring str, long long *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1419,8 +1416,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoi8_lc_(cxstring str, int8_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoi8_lc_(cxstring str, int8_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1436,8 +1433,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoi16_lc_(cxstring str, int16_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoi16_lc_(cxstring str, int16_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1453,8 +1450,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoi32_lc_(cxstring str, int32_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoi32_lc_(cxstring str, int32_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1470,8 +1467,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoi64_lc_(cxstring str, int64_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoi64_lc_(cxstring str, int64_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1487,8 +1484,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtous_lc_(cxstring str, unsigned short *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtous_lc_(cxstring str, unsigned short *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1504,8 +1501,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtou_lc_(cxstring str, unsigned int *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtou_lc_(cxstring str, unsigned int *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1521,8 +1518,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoul_lc_(cxstring str, unsigned long *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoul_lc_(cxstring str, unsigned long *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1538,8 +1535,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoull_lc_(cxstring str, unsigned long long *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoull_lc_(cxstring str, unsigned long long *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1555,8 +1552,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtou8_lc_(cxstring str, uint8_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtou8_lc_(cxstring str, uint8_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1572,8 +1569,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtou16_lc_(cxstring str, uint16_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtou16_lc_(cxstring str, uint16_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1589,8 +1586,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtou32_lc_(cxstring str, uint32_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtou32_lc_(cxstring str, uint32_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1606,8 +1603,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtou64_lc_(cxstring str, uint64_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtou64_lc_(cxstring str, uint64_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -1623,8 +1620,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtoz_lc_(cxstring str, size_t *output, int base, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtoz_lc_(cxstring str, size_t *output, int base, const char *groupsep);
 
 /**
  * Converts a string to a single precision floating-point number.
@@ -1640,8 +1637,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtof_lc_(cxstring str, float *output, char decsep, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtof_lc_(cxstring str, float *output, char decsep, const char *groupsep);
 
 /**
  * Converts a string to a double precision floating-point number.
@@ -1657,8 +1654,8 @@
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2)
-CX_EXPORT int cx_strtod_lc_(cxstring str, double *output, char decsep, const char *groupsep);
+CX_EXTERN CX_ACCESS_W(2) CX_NONNULL_ARG(2)
+int cx_strtod_lc_(cxstring str, double *output, char decsep, const char *groupsep);
 
 /**
  * Converts a string to a number.
@@ -2304,8 +2301,4 @@
  */
 #define cx_strtod(str, output) cx_strtod_lc_(cx_strcast(str), output, '.', ",")
 
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
 #endif //UCX_STRING_H

mercurial