src/cx/string.h

changeset 589
c290f8fd979e
parent 584
184e9ebfc3cc
child 645
ec50abb285ad
     1.1 --- a/src/cx/string.h	Tue Sep 20 10:37:29 2022 +0200
     1.2 +++ b/src/cx/string.h	Tue Oct 04 18:49:14 2022 +0200
     1.3 @@ -241,6 +241,7 @@
     1.4    * So developers \em must pass the return value to cx_strfree() eventually.
     1.5    *
     1.6    * \note It is guaranteed that there is only one allocation.
     1.7 +  * It is also guaranteed that the returned string is zero-terminated.
     1.8   *
     1.9   * @param alloc the allocator to use
    1.10   * @param count   the total number of strings to concatenate
    1.11 @@ -260,6 +261,9 @@
    1.12   * The resulting string will be allocated by standard \c malloc().
    1.13   * So developers \em must pass the return value to cx_strfree() eventually.
    1.14   *
    1.15 + * \note It is guaranteed that there is only one allocation.
    1.16 + * It is also guaranteed that the returned string is zero-terminated.
    1.17 + *
    1.18   * @param count   the total number of strings to concatenate
    1.19   * @param ...     all strings
    1.20   * @return the concatenated string
    1.21 @@ -608,8 +612,7 @@
    1.22   *
    1.23   * The new string will contain a copy allocated by \p allocator.
    1.24   *
    1.25 - * \note The returned string is guaranteed to be zero-terminated and can safely
    1.26 - * be passed to other APIs.
    1.27 + * \note The returned string is guaranteed to be zero-terminated.
    1.28   *
    1.29   * @param allocator the allocator to use
    1.30   * @param string the string to duplicate
    1.31 @@ -628,8 +631,7 @@
    1.32   * The new string will contain a copy allocated by standard
    1.33   * \c malloc(). So developers \em must pass the return value to cx_strfree().
    1.34   *
    1.35 - * \note The returned string is guaranteed to be zero-terminated and can safely
    1.36 - * be passed to other APIs.
    1.37 + * \note The returned string is guaranteed to be zero-terminated.
    1.38   *
    1.39   * @param string the string to duplicate
    1.40   * @return a duplicate of the string
    1.41 @@ -743,7 +745,8 @@
    1.42   * The pattern is taken literally and is no regular expression.
    1.43   * Replaces at most \p replmax occurrences.
    1.44   *
    1.45 - * The returned string will be allocated by \p allocator.
    1.46 + * The returned string will be allocated by \p allocator and is guaranteed
    1.47 + * to be zero-terminated.
    1.48   *
    1.49   * If allocation fails, or the input string is empty,
    1.50   * the returned string will be empty.
    1.51 @@ -770,8 +773,8 @@
    1.52   * The pattern is taken literally and is no regular expression.
    1.53   * Replaces at most \p replmax occurrences.
    1.54   *
    1.55 - * The returned string will be allocated by \c malloc() and \em must be passed
    1.56 - * to cx_strfree() eventually.
    1.57 + * The returned string will be allocated by \c malloc() and is guaranteed
    1.58 + * to be zero-terminated.
    1.59   *
    1.60   * If allocation fails, or the input string is empty,
    1.61   * the returned string will be empty.
    1.62 @@ -790,7 +793,8 @@
    1.63   *
    1.64   * The pattern is taken literally and is no regular expression.
    1.65   *
    1.66 - * The returned string will be allocated by \p allocator.
    1.67 + * The returned string will be allocated by \p allocator and is guaranteed
    1.68 + * to be zero-terminated.
    1.69   *
    1.70   * If allocation fails, or the input string is empty,
    1.71   * the returned string will be empty.
    1.72 @@ -810,8 +814,8 @@
    1.73   * The pattern is taken literally and is no regular expression.
    1.74   * Replaces at most \p replmax occurrences.
    1.75   *
    1.76 - * The returned string will be allocated by \c malloc() and \em must be passed
    1.77 - * to cx_strfree() eventually.
    1.78 + * The returned string will be allocated by \c malloc() and is guaranteed
    1.79 + * to be zero-terminated.
    1.80   *
    1.81   * If allocation fails, or the input string is empty,
    1.82   * the returned string will be empty.

mercurial