ucx/cx/string.h

branch
dav-2
changeset 889
42cdbf9bbd49
parent 886
da79af4baec8
--- a/ucx/cx/string.h	Tue Oct 14 21:02:26 2025 +0200
+++ b/ucx/cx/string.h	Sat Nov 08 23:06:11 2025 +0100
@@ -48,8 +48,7 @@
 /**
  * The maximum length of the "needle" in cx_strstr() that can use SBO.
  */
-cx_attr_export
-extern const unsigned cx_strstr_sbo_size;
+CX_EXPORT extern const unsigned cx_strstr_sbo_size;
 
 /**
  * The UCX string structure.
@@ -112,10 +111,10 @@
      */
     size_t pos;
     /**
-     * Position of next delimiter in the source string.
+     * Position of the next delimiter in the source string.
      *
      * If the tokenizer has not yet returned a token, the content of this field
-     * is undefined. If the tokenizer reached the end of the string, this field
+     * is undefined. If the tokenizer reaches the end of the string, this field
      * contains the length of the source string.
      */
     size_t delim_pos;
@@ -174,15 +173,13 @@
  *
  * If you need to wrap a constant string, use cx_str().
  *
- * @param cstring the string to wrap, must be zero-terminated
+ * @param cstring the string to wrap (must be zero-terminated)
  * @return the wrapped string
  *
  * @see cx_mutstrn()
  */
-cx_attr_nodiscard
-cx_attr_cstr_arg(1)
-cx_attr_export
-cxmutstr cx_mutstr(char *cstring);
+cx_attr_nodiscard cx_attr_cstr_arg(1)
+CX_EXPORT cxmutstr cx_mutstr(char *cstring);
 
 /**
  * Wraps a string that does not need to be zero-terminated.
@@ -200,13 +197,8 @@
  *
  * @see cx_mutstr()
  */
-cx_attr_nodiscard
-cx_attr_access_rw(1, 2)
-cx_attr_export
-cxmutstr cx_mutstrn(
-        char *cstring,
-        size_t length
-);
+cx_attr_nodiscard cx_attr_access_rw(1, 2)
+CX_EXPORT cxmutstr cx_mutstrn(char *cstring, size_t length);
 
 /**
  * Wraps a string that must be zero-terminated.
@@ -220,15 +212,13 @@
  *
  * If you need to wrap a non-constant string, use cx_mutstr().
  *
- * @param cstring the string to wrap, must be zero-terminated
+ * @param cstring the string to wrap (must be zero-terminated)
  * @return the wrapped string
  *
  * @see cx_strn()
  */
-cx_attr_nodiscard
-cx_attr_cstr_arg(1)
-cx_attr_export
-cxstring cx_str(const char *cstring);
+cx_attr_nodiscard cx_attr_cstr_arg(1)
+CX_EXPORT cxstring cx_str(const char *cstring);
 
 
 /**
@@ -247,28 +237,27 @@
  *
  * @see cx_str()
  */
-cx_attr_nodiscard
-cx_attr_access_r(1, 2)
-cx_attr_export
-cxstring cx_strn(
-        const char *cstring,
-        size_t length
-);
+cx_attr_nodiscard cx_attr_access_r(1, 2)
+CX_EXPORT cxstring cx_strn(const char *cstring, size_t length);
 
 #ifdef __cplusplus
 } // extern "C"
 cx_attr_nodiscard
-static inline cxstring cx_strcast(cxmutstr str) {
+CX_CPPDECL cxstring cx_strcast(cxmutstr str) {
     return cx_strn(str.ptr, str.length);
 }
 cx_attr_nodiscard
-static inline cxstring cx_strcast(cxstring str) {
+CX_CPPDECL cxstring cx_strcast(cxstring str) {
     return str;
 }
 cx_attr_nodiscard
-static inline cxstring cx_strcast(const char *str) {
+CX_CPPDECL cxstring cx_strcast(const char *str) {
     return cx_str(str);
 }
+cx_attr_nodiscard
+CX_CPPDECL cxstring cx_strcast(const unsigned char *str) {
+    return cx_str(static_cast<const char*>(str));
+}
 extern "C" {
 #else
 /**
@@ -278,7 +267,7 @@
  * @see cx_strcast()
  */
 cx_attr_nodiscard
-static inline cxstring cx_strcast_m(cxmutstr str) {
+CX_INLINE cxstring cx_strcast_m(cxmutstr str) {
     return (cxstring) {str.ptr, str.length};
 }
 /**
@@ -288,7 +277,7 @@
  * @see cx_strcast()
  */
 cx_attr_nodiscard
-static inline cxstring cx_strcast_c(cxstring str) {
+CX_INLINE cxstring cx_strcast_c(cxstring str) {
     return str;
 }
 
@@ -299,25 +288,32 @@
  * @see cx_strcast()
  */
 cx_attr_nodiscard
-static inline cxstring cx_strcast_z(const char *str) {
+CX_INLINE cxstring cx_strcast_u(const unsigned char *str) {
+    return cx_str((const char*)str);
+}
+
+/**
+ * Internal function, do not use.
+ * @param str
+ * @return
+ * @see cx_strcast()
+ */
+cx_attr_nodiscard
+CX_INLINE cxstring cx_strcast_z(const char *str) {
     return cx_str(str);
 }
 
 /**
-* Casts a mutable string to an immutable string.
-*
-* Does nothing for already immutable strings.
-*
-* @note This is not seriously a cast. Instead, you get a copy
-* of the struct with the desired pointer type. Both structs still
-* point to the same location, though!
-*
-* @param str (@c cxstring or @c cxmutstr) the string to cast
-* @return (@c cxstring) an immutable copy of the string pointer
-*/
+ * Wraps any string into an UCX string.
+ *
+ * @param str (any supported string type) the string to cast
+ * @return (@c cxstring) the string wrapped as UCX string
+ */
 #define cx_strcast(str) _Generic((str), \
         cxmutstr: cx_strcast_m, \
         cxstring: cx_strcast_c, \
+        const unsigned char*: cx_strcast_u, \
+        unsigned char *: cx_strcast_u, \
         const char*: cx_strcast_z, \
         char *: cx_strcast_z) (str)
 #endif
@@ -325,37 +321,32 @@
 /**
  * Passes the pointer in this string to the cxDefaultAllocator's @c free() function.
  *
- * The pointer in the struct is set to @c NULL and the length is set to zero
+ * The pointer in the struct is set to @c NULL, and the length is set to zero,
  * which means that this function protects you against double-free.
  *
  * @note There is no implementation for cxstring, because it is unlikely that
  * you ever have a <code>const char*</code> you are really supposed to free.
- * If you encounter such situation, you should double-check your code.
+ * If you encounter such a situation, you should double-check your code.
  *
  * @param str the string to free
  */
-cx_attr_export
-void cx_strfree(cxmutstr *str);
+CX_EXPORT void cx_strfree(cxmutstr *str);
 
 /**
- * Passes the pointer in this string to the allocators free function.
+ * Passes the pointer in this string to the allocator's free function.
  *
- * The pointer in the struct is set to @c NULL and the length is set to zero
+ * The pointer in the struct is set to @c NULL, and the length is set to zero,
  * which means that this function protects you against double-free.
  *
  * @note There is no implementation for cxstring, because it is unlikely that
  * you ever have a <code>const char*</code> you are really supposed to free.
- * If you encounter such situation, you should double-check your code.
+ * If you encounter such a situation, you should double-check your code.
  *
  * @param alloc the allocator
  * @param str the string to free
  */
 cx_attr_nonnull_arg(1)
-cx_attr_export
-void cx_strfree_a(
-        const CxAllocator *alloc,
-        cxmutstr *str
-);
+CX_EXPORT void cx_strfree_a(const CxAllocator *alloc, cxmutstr *str);
 
 /**
  * Copies a string.
@@ -373,12 +364,7 @@
  * @retval non-zero if re-allocation failed
  */
 cx_attr_nonnull_arg(1)
-cx_attr_export
-int cx_strcpy_a(
-        const CxAllocator *alloc,
-        cxmutstr *dest,
-        cxstring src
-);
+CX_EXPORT int cx_strcpy_a(const CxAllocator *alloc, cxmutstr *dest, cxstring src);
 
 
 /**
@@ -410,11 +396,7 @@
  * @return the accumulated length of all strings
  */
 cx_attr_nodiscard
-cx_attr_export
-size_t cx_strlen(
-        size_t count,
-        ...
-);
+CX_EXPORT size_t cx_strlen(size_t count, ...);
 
 /**
  * Concatenates strings.
@@ -438,15 +420,9 @@
  * @param ...   all other UCX strings
  * @return the concatenated string
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_export
-cxmutstr cx_strcat_ma(
-        const CxAllocator *alloc,
-        cxmutstr str,
-        size_t count,
-        ...
-);
+cx_attr_nodiscard cx_attr_nonnull
+CX_EXPORT cxmutstr cx_strcat_ma(const CxAllocator *alloc,
+        cxmutstr str, size_t count, ...);
 
 /**
  * Concatenates strings and returns a new string.
@@ -467,7 +443,7 @@
  * @return (@c cxmutstr) the concatenated string
  */
 #define cx_strcat_a(alloc, count, ...) \
-cx_strcat_ma(alloc, cx_mutstrn(NULL, 0), count, __VA_ARGS__)
+        cx_strcat_ma(alloc, cx_mutstrn(NULL, 0), count, __VA_ARGS__)
 
 /**
  * Concatenates strings and returns a new string.
@@ -487,7 +463,7 @@
  * @return (@c cxmutstr) the concatenated string
  */
 #define cx_strcat(count, ...) \
-cx_strcat_ma(cxDefaultAllocator, cx_mutstrn(NULL, 0), count, __VA_ARGS__)
+        cx_strcat_ma(cxDefaultAllocator, cx_mutstrn(NULL, 0), count, __VA_ARGS__)
 
 /**
  * Concatenates strings.
@@ -511,7 +487,7 @@
  * @return (@c cxmutstr) the concatenated string
  */
 #define cx_strcat_m(str, count, ...) \
-cx_strcat_ma(cxDefaultAllocator, str, count, __VA_ARGS__)
+        cx_strcat_ma(cxDefaultAllocator, str, count, __VA_ARGS__)
 
 /**
  * Returns a substring starting at the specified location.
@@ -529,11 +505,7 @@
  * @see cx_strsubsl_m()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strsubs(
-        cxstring string,
-        size_t start
-);
+CX_EXPORT cxstring cx_strsubs(cxstring string, size_t start);
 
 /**
  * Returns a substring starting at the specified location.
@@ -555,12 +527,7 @@
  * @see cx_strsubsl_m()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strsubsl(
-        cxstring string,
-        size_t start,
-        size_t length
-);
+CX_EXPORT cxstring cx_strsubsl(cxstring string, size_t start, size_t length);
 
 /**
  * Returns a substring starting at the specified location.
@@ -578,11 +545,7 @@
  * @see cx_strsubsl()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strsubs_m(
-        cxmutstr string,
-        size_t start
-);
+CX_EXPORT cxmutstr cx_strsubs_m(cxmutstr string, size_t start);
 
 /**
  * Returns a substring starting at the specified location.
@@ -604,12 +567,7 @@
  * @see cx_strsubsl()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strsubsl_m(
-        cxmutstr string,
-        size_t start,
-        size_t length
-);
+CX_EXPORT cxmutstr cx_strsubsl_m(cxmutstr string, size_t start, size_t length);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -624,11 +582,7 @@
  * @see cx_strchr_m()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strchr(
-        cxstring string,
-        int chr
-);
+CX_EXPORT cxstring cx_strchr(cxstring string, int chr);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -643,11 +597,7 @@
  * @see cx_strchr()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strchr_m(
-        cxmutstr string,
-        int chr
-);
+CX_EXPORT cxmutstr cx_strchr_m(cxmutstr string, int chr);
 
 /**
  * Returns a substring starting at the location of the last occurrence of the
@@ -662,11 +612,7 @@
  * @see cx_strrchr_m()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strrchr(
-        cxstring string,
-        int chr
-);
+CX_EXPORT cxstring cx_strrchr(cxstring string, int chr);
 
 /**
  * Returns a substring starting at the location of the last occurrence of the
@@ -681,11 +627,7 @@
  * @see cx_strrchr()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strrchr_m(
-        cxmutstr string,
-        int chr
-);
+CX_EXPORT cxmutstr cx_strrchr_m(cxmutstr string, int chr);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -704,11 +646,7 @@
  * @see cx_strstr_m()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strstr(
-        cxstring haystack,
-        cxstring needle
-);
+CX_EXPORT cxstring cx_strstr(cxstring haystack, cxstring needle);
 
 /**
  * Returns a substring starting at the location of the first occurrence of the
@@ -727,11 +665,7 @@
  * @see cx_strstr()
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strstr_m(
-        cxmutstr haystack,
-        cxstring needle
-);
+CX_EXPORT cxmutstr cx_strstr_m(cxmutstr haystack, cxstring needle);
 
 /**
  * Splits a given string using a delimiter string.
@@ -745,16 +679,9 @@
  * @param output a preallocated array of at least @p limit length
  * @return the actual number of split items
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_access_w(4, 3)
-cx_attr_export
-size_t cx_strsplit(
-        cxstring string,
-        cxstring delim,
-        size_t limit,
-        cxstring *output
-);
+cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(4, 3)
+CX_EXPORT size_t cx_strsplit(cxstring string, cxstring delim,
+        size_t limit, cxstring *output);
 
 /**
  * Splits a given string using a delimiter string.
@@ -775,17 +702,10 @@
  * written to
  * @return the actual number of split items
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_access_w(5)
-cx_attr_export
-size_t cx_strsplit_a(
-        const CxAllocator *allocator,
-        cxstring string,
-        cxstring delim,
-        size_t limit,
-        cxstring **output
-);
+cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(5)
+CX_EXPORT size_t cx_strsplit_a(const CxAllocator *allocator,
+        cxstring string, cxstring delim,
+        size_t limit, cxstring **output);
 
 
 /**
@@ -800,16 +720,9 @@
  * @param output a preallocated array of at least @p limit length
  * @return the actual number of split items
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_access_w(4, 3)
-cx_attr_export
-size_t cx_strsplit_m(
-        cxmutstr string,
-        cxstring delim,
-        size_t limit,
-        cxmutstr *output
-);
+cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(4, 3)
+CX_EXPORT size_t cx_strsplit_m(cxmutstr string, cxstring delim,
+        size_t limit, cxmutstr *output);
 
 /**
  * Splits a given string using a delimiter string.
@@ -830,17 +743,10 @@
  * written to
  * @return the actual number of split items
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_access_w(5)
-cx_attr_export
-size_t cx_strsplit_ma(
-        const CxAllocator *allocator,
-        cxmutstr string,
-        cxstring delim,
-        size_t limit,
-        cxmutstr **output
-);
+cx_attr_nodiscard cx_attr_nonnull cx_attr_access_w(5)
+CX_EXPORT size_t cx_strsplit_ma(const CxAllocator *allocator,
+        cxmutstr string, cxstring delim, size_t limit,
+        cxmutstr **output);
 
 /**
  * Compares two strings.
@@ -851,11 +757,17 @@
  * than @p s2, zero if both strings equal
  */
 cx_attr_nodiscard
-cx_attr_export
-int cx_strcmp(
-        cxstring s1,
-        cxstring s2
-);
+CX_EXPORT int cx_strcmp_(cxstring s1, cxstring s2);
+
+/**
+ * Compares two strings.
+ *
+ * @param s1 the first string
+ * @param s2 the second string
+ * @return negative if @p s1 is smaller than @p s2, positive if @p s1 is larger
+ * than @p s2, zero if both strings equal
+ */
+#define cx_strcmp(s1, s2) cx_strcmp_(cx_strcast(s1), cx_strcast(s2))
 
 /**
  * Compares two strings ignoring case.
@@ -866,29 +778,33 @@
  * than @p s2, zero if both strings equal ignoring case
  */
 cx_attr_nodiscard
-cx_attr_export
-int cx_strcasecmp(
-        cxstring s1,
-        cxstring s2
-);
+CX_EXPORT int cx_strcasecmp_(cxstring s1, cxstring s2);
+
+/**
+ * Compares two strings ignoring case.
+ *
+ * @param s1 the first string
+ * @param s2 the second string
+ * @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
+ */
+#define cx_strcasecmp(s1, s2) cx_strcasecmp_(cx_strcast(s1), cx_strcast(s2))
 
 /**
  * Compares two strings.
  *
  * This function has a compatible signature for the use as a cx_compare_func.
  *
+ * @attention This function can @em only compare UCX strings. It is unsafe to
+ * pass normal C-strings to this function.
+ *
  * @param s1 the first string
  * @param s2 the second string
  * @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_attr_export
-int cx_strcmp_p(
-        const void *s1,
-        const void *s2
-);
+cx_attr_nodiscard  cx_attr_nonnull
+CX_EXPORT int cx_strcmp_p(const void *s1, const void *s2);
 
 /**
  * Compares two strings ignoring case.
@@ -900,13 +816,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_attr_export
-int cx_strcasecmp_p(
-        const void *s1,
-        const void *s2
-);
+cx_attr_nodiscard cx_attr_nonnull
+CX_EXPORT int cx_strcasecmp_p(const void *s1, const void *s2);
 
 
 /**
@@ -921,13 +832,8 @@
  * @return a duplicate of the string
  * @see cx_strdup()
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_export
-cxmutstr cx_strdup_a_(
-        const CxAllocator *allocator,
-        cxstring string
-);
+cx_attr_nodiscard cx_attr_nonnull
+CX_EXPORT cxmutstr cx_strdup_a_(const CxAllocator *allocator, cxstring string);
 
 /**
  * Creates a duplicate of the specified string.
@@ -942,8 +848,7 @@
  * @see cx_strdup()
  * @see cx_strfree_a()
  */
-#define cx_strdup_a(allocator, string) \
-    cx_strdup_a_((allocator), cx_strcast(string))
+#define cx_strdup_a(allocator, string) cx_strdup_a_((allocator), cx_strcast(string))
 
 /**
  * Creates a duplicate of the specified string.
@@ -970,8 +875,7 @@
  * @return the trimmed string
  */
 cx_attr_nodiscard
-cx_attr_export
-cxstring cx_strtrim(cxstring string);
+CX_EXPORT cxstring cx_strtrim(cxstring string);
 
 /**
  * Omits leading and trailing spaces.
@@ -983,11 +887,10 @@
  * @return the trimmed string
  */
 cx_attr_nodiscard
-cx_attr_export
-cxmutstr cx_strtrim_m(cxmutstr string);
+CX_EXPORT cxmutstr cx_strtrim_m(cxmutstr string);
 
 /**
- * Checks, if a string has a specific prefix.
+ * Checks if a string has a specific prefix.
  *
  * @param string the string to check
  * @param prefix the prefix the string should have
@@ -995,14 +898,20 @@
  * @c false otherwise
  */
 cx_attr_nodiscard
-cx_attr_export
-bool cx_strprefix(
-        cxstring string,
-        cxstring prefix
-);
+CX_EXPORT bool cx_strprefix_(cxstring string, cxstring prefix);
 
 /**
- * Checks, if a string has a specific suffix.
+ * Checks if a string has a specific prefix.
+ *
+ * @param string the string to check
+ * @param prefix the prefix the string should have
+ * @return @c true, if and only if the string has the specified prefix,
+ * @c false otherwise
+ */
+#define cx_strprefix(string, prefix) cx_strprefix_(cx_strcast(string), cx_strcast(prefix))
+
+/**
+ * Checks if a string has a specific suffix.
  *
  * @param string the string to check
  * @param suffix the suffix the string should have
@@ -1010,14 +919,20 @@
  * @c false otherwise
  */
 cx_attr_nodiscard
-cx_attr_export
-bool cx_strsuffix(
-        cxstring string,
-        cxstring suffix
-);
+CX_EXPORT bool cx_strsuffix_(cxstring string, cxstring suffix);
 
 /**
- * Checks, if a string has a specific prefix, ignoring the case.
+ * Checks if a string has a specific suffix.
+ *
+ * @param string the string to check
+ * @param suffix the suffix the string should have
+ * @return @c true, if and only if the string has the specified suffix,
+ * @c false otherwise
+ */
+#define cx_strsuffix(string, suffix) cx_strsuffix_(cx_strcast(string), cx_strcast(suffix))
+
+/**
+ * Checks if a string has a specific prefix, ignoring the case.
  *
  * @param string the string to check
  * @param prefix the prefix the string should have
@@ -1025,11 +940,17 @@
  * @c false otherwise
  */
 cx_attr_nodiscard
-cx_attr_export
-bool cx_strcaseprefix(
-        cxstring string,
-        cxstring prefix
-);
+CX_EXPORT bool cx_strcaseprefix_(cxstring string, cxstring prefix);
+
+/**
+ * Checks if a string has a specific prefix, ignoring the case.
+ *
+ * @param string the string to check
+ * @param prefix the prefix the string should have
+ * @return @c true, if and only if the string has the specified prefix,
+ * @c false otherwise
+ */
+#define cx_strcaseprefix(string, prefix) cx_strcaseprefix_(cx_strcast(string), cx_strcast(prefix))
 
 /**
  * Checks, if a string has a specific suffix, ignoring the case.
@@ -1040,16 +961,22 @@
  * @c false otherwise
  */
 cx_attr_nodiscard
-cx_attr_export
-bool cx_strcasesuffix(
-        cxstring string,
-        cxstring suffix
-);
+CX_EXPORT bool cx_strcasesuffix_(cxstring string, cxstring suffix);
+
+/**
+ * Checks, if a string has a specific suffix, ignoring the case.
+ *
+ * @param string the string to check
+ * @param suffix the suffix the string should have
+ * @return @c true, if and only if the string has the specified suffix,
+ * @c false otherwise
+ */
+#define cx_strcasesuffix(string, suffix) cx_strcasesuffix_(cx_strcast(string), cx_strcast(suffix))
 
 /**
  * Replaces a string with another string.
  *
- * Replaces at most @p replmax occurrences.
+ * The function replaces at most @p replmax occurrences.
  *
  * The returned string will be allocated by @p allocator and is guaranteed
  * to be zero-terminated.
@@ -1064,21 +991,14 @@
  * @param replmax maximum number of replacements
  * @return the resulting string after applying the replacements
  */
-cx_attr_nodiscard
-cx_attr_nonnull
-cx_attr_export
-cxmutstr cx_strreplacen_a(
-        const CxAllocator *allocator,
-        cxstring str,
-        cxstring search,
-        cxstring replacement,
-        size_t replmax
-);
+cx_attr_nodiscard cx_attr_nonnull
+CX_EXPORT cxmutstr cx_strreplacen_a(const CxAllocator *allocator,
+        cxstring str, cxstring search, cxstring replacement, size_t replmax);
 
 /**
  * Replaces a string with another string.
  *
- * Replaces at most @p replmax occurrences.
+ * The function replaces at most @p replmax occurrences.
  *
  * The returned string will be allocated by the cxDefaultAllocator and is guaranteed
  * to be zero-terminated.
@@ -1093,7 +1013,7 @@
  * @return (@c cxmutstr) the resulting string after applying the replacements
  */
 #define cx_strreplacen(str, search, replacement, replmax) \
-cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, replmax)
+        cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, replmax)
 
 /**
  * Replaces a string with another string.
@@ -1111,7 +1031,7 @@
  * @return (@c cxmutstr) the resulting string after applying the replacements
  */
 #define cx_strreplace_a(allocator, str, search, replacement) \
-cx_strreplacen_a(allocator, str, search, replacement, SIZE_MAX)
+        cx_strreplacen_a(allocator, str, search, replacement, SIZE_MAX)
 
 /**
  * Replaces a string with another string.
@@ -1128,7 +1048,7 @@
  * @return (@c cxmutstr) the resulting string after applying the replacements
  */
 #define cx_strreplace(str, search, replacement) \
-cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, SIZE_MAX)
+        cx_strreplacen_a(cxDefaultAllocator, str, search, replacement, SIZE_MAX)
 
 /**
  * Creates a string tokenization context.
@@ -1139,12 +1059,7 @@
  * @return a new string tokenization context
  */
 cx_attr_nodiscard
-cx_attr_export
-CxStrtokCtx cx_strtok_(
-        cxstring str,
-        cxstring delim,
-        size_t limit
-);
+CX_EXPORT CxStrtokCtx cx_strtok_(cxstring str, cxstring delim, size_t limit);
 
 /**
  * Creates a string tokenization context.
@@ -1155,7 +1070,7 @@
  * @return (@c CxStrtokCtx) a new string tokenization context
  */
 #define cx_strtok(str, delim, limit) \
-    cx_strtok_(cx_strcast(str), cx_strcast(delim), (limit))
+        cx_strtok_(cx_strcast(str), cx_strcast(delim), (limit))
 
 /**
  * Returns the next token.
@@ -1167,14 +1082,8 @@
  * @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_attr_export
-bool cx_strtok_next(
-        CxStrtokCtx *ctx,
-        cxstring *token
-);
+cx_attr_nonnull  cx_attr_nodiscard  cx_attr_access_w(2)
+CX_EXPORT bool cx_strtok_next(CxStrtokCtx *ctx, cxstring *token);
 
 /**
  * Returns the next token of a mutable string.
@@ -1190,14 +1099,8 @@
  * @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_attr_export
-bool cx_strtok_next_m(
-        CxStrtokCtx *ctx,
-        cxmutstr *token
-);
+cx_attr_nonnull  cx_attr_nodiscard  cx_attr_access_w(2)
+CX_EXPORT bool cx_strtok_next_m(CxStrtokCtx *ctx, cxmutstr *token);
 
 /**
  * Defines an array of more delimiters for the specified tokenization context.
@@ -1206,14 +1109,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_attr_export
-void cx_strtok_delim(
-        CxStrtokCtx *ctx,
-        const cxstring *delim,
-        size_t count
-);
+cx_attr_nonnull cx_attr_access_r(2, 3)
+CX_EXPORT void cx_strtok_delim(CxStrtokCtx *ctx, const cxstring *delim, size_t count);
 
 /* ------------------------------------------------------------------------- *
  *                string to number conversion functions                      *
@@ -1229,12 +1126,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtos_lc_(cxstring str, short *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1246,12 +1143,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoi_lc_(cxstring str, int *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1263,12 +1160,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtol_lc_(cxstring str, long *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1280,12 +1177,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoll_lc_(cxstring str, long long *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1297,12 +1194,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoi8_lc_(cxstring str, int8_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1314,12 +1211,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoi16_lc_(cxstring str, int16_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1331,12 +1228,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoi32_lc_(cxstring str, int32_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1348,12 +1245,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoi64_lc_(cxstring str, int64_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1365,12 +1262,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtous_lc_(cxstring str, unsigned short *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1382,12 +1279,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtou_lc_(cxstring str, unsigned int *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1399,12 +1296,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoul_lc_(cxstring str, unsigned long *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1416,12 +1313,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoull_lc_(cxstring str, unsigned long long *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1433,12 +1330,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtou8_lc_(cxstring str, uint8_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1450,12 +1347,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtou16_lc_(cxstring str, uint16_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1467,12 +1364,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtou32_lc_(cxstring str, uint32_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1484,12 +1381,12 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtou64_lc_(cxstring str, uint64_t *output, int base, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1501,15 +1398,15 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtoz_lc_(cxstring str, size_t *output, int base, const char *groupsep);
+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);
 
 /**
- * Converts a string to a single precision floating point number.
+ * Converts a string to a single precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
@@ -1518,15 +1415,15 @@
  * @param str the string to convert
  * @param output a pointer to the float variable where the result shall be stored
  * @param decsep the decimal separator
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtof_lc_(cxstring str, float *output, char decsep, const char *groupsep);
+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);
 
 /**
- * Converts a string to a double precision floating point number.
+ * Converts a string to a double precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
@@ -1535,12 +1432,12 @@
  * @param str the string to convert
  * @param output a pointer to the float variable where the result shall be stored
  * @param decsep the decimal separator
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
-cx_attr_access_w(2) cx_attr_nonnull_arg(2) cx_attr_export
-int cx_strtod_lc_(cxstring str, double *output, char decsep, const char *groupsep);
+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);
 
 /**
  * Converts a string to a number.
@@ -1552,7 +1449,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1568,7 +1465,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1584,7 +1481,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1600,7 +1497,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1616,7 +1513,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1632,7 +1529,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1648,7 +1545,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1664,7 +1561,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1680,7 +1577,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1696,7 +1593,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1712,7 +1609,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1728,7 +1625,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1744,7 +1641,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1760,7 +1657,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1776,7 +1673,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1792,7 +1689,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1808,7 +1705,7 @@
  * @param str the string to convert
  * @param output a pointer to the integer variable where the result shall be stored
  * @param base 2, 8, 10, or 16
- * @param groupsep (@c const @c char*) each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep (@c const @c char*) each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
@@ -1821,7 +1718,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1839,7 +1736,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1857,7 +1754,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1875,7 +1772,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1893,7 +1790,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1911,7 +1808,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1929,7 +1826,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1947,7 +1844,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1965,7 +1862,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -1983,7 +1880,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2001,7 +1898,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2019,7 +1916,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2037,7 +1934,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2055,7 +1952,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2073,7 +1970,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2091,7 +1988,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2109,7 +2006,7 @@
  * In that case the function sets errno to EINVAL when the reason is an invalid character or an unsupported base.
  * It sets errno to ERANGE when the target datatype is too small.
  *
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose the set of group separators, use the @c _lc variant of this function (e.g. cx_strtoz_lc()).
  *
  * @param str the string to convert
@@ -2121,7 +2018,7 @@
 #define cx_strtou64(str, output, base) cx_strtou64_lc_(cx_strcast(str), output, base, ",")
 
 /**
- * Converts a string to a single precision floating point number.
+ * Converts a string to a single precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
@@ -2130,14 +2027,14 @@
  * @param str the string to convert
  * @param output a pointer to the float variable where the result shall be stored
  * @param decsep the decimal separator
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
 #define cx_strtof_lc(str, output, decsep, groupsep) cx_strtof_lc_(cx_strcast(str), output, decsep, groupsep)
 
 /**
- * Converts a string to a double precision floating point number.
+ * Converts a string to a double precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
@@ -2145,21 +2042,21 @@
  * @param str the string to convert
  * @param output a pointer to the double variable where the result shall be stored
  * @param decsep the decimal separator
- * @param groupsep each character in this string is treated as group separator and ignored during conversion
+ * @param groupsep each character in this string is treated as a group separator and ignored during conversion
  * @retval zero success
  * @retval non-zero conversion was not possible
  */
 #define cx_strtod_lc(str, output, decsep, groupsep) cx_strtod_lc_(cx_strcast(str), output, decsep, groupsep)
 
 /**
- * Converts a string to a single precision floating point number.
+ * Converts a string to a single precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
  * It sets errno to ERANGE when the necessary representation would exceed the limits defined in libc's float.h.
  *
  * The decimal separator is assumed to be a dot character.
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose a different format, use cx_strtof_lc().
  *
  * @param str the string to convert
@@ -2170,13 +2067,13 @@
 #define cx_strtof(str, output) cx_strtof_lc_(cx_strcast(str), output, '.', ",")
 
 /**
- * Converts a string to a double precision floating point number.
+ * Converts a string to a double precision floating-point number.
  *
  * The function returns non-zero when conversion is not possible.
  * In that case the function sets errno to EINVAL when the reason is an invalid character.
  *
  * The decimal separator is assumed to be a dot character.
- * The comma character is treated as group separator and ignored during parsing.
+ * The comma character is treated as a group separator and ignored during parsing.
  * If you want to choose a different format, use cx_strtof_lc().
  *
  * @param str the string to convert

mercurial