diff options
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index c1696a912ba..66b9cee50c3 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -54,8 +54,8 @@ * into a newly mallocN'd string and returns it. \a str * is assumed to be at least len bytes long. * - * \param str The string to be duplicated - * \param len The number of bytes to duplicate + * \param str: The string to be duplicated + * \param len: The number of bytes to duplicate * \retval Returns the duplicated string */ char *BLI_strdupn(const char *str, const size_t len) @@ -71,7 +71,7 @@ char *BLI_strdupn(const char *str, const size_t len) * Duplicates the cstring \a str into a newly mallocN'd * string and returns it. * - * \param str The string to be duplicated + * \param str: The string to be duplicated * \retval Returns the duplicated string */ char *BLI_strdup(const char *str) @@ -81,8 +81,8 @@ char *BLI_strdup(const char *str) /** * Appends the two strings, and returns new mallocN'ed string - * \param str1 first string for copy - * \param str2 second string for append + * \param str1: first string for copy + * \param str2: second string for append * \retval Returns dst */ char *BLI_strdupcat(const char *__restrict str1, const char *__restrict str2) @@ -105,9 +105,9 @@ char *BLI_strdupcat(const char *__restrict str1, const char *__restrict str2) * Like strncpy but ensures dst is always * '\0' terminated. * - * \param dst Destination for copy - * \param src Source string to copy - * \param maxncpy Maximum number of characters to copy (generally + * \param dst: Destination for copy + * \param src: Source string to copy + * \param maxncpy: Maximum number of characters to copy (generally * the size of dst) * \retval Returns dst */ @@ -128,10 +128,10 @@ char *BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t /** * Like BLI_strncpy but ensures dst is always padded by given char, on both sides (unless src is empty). * - * \param dst Destination for copy - * \param src Source string to copy - * \param pad the char to use for padding - * \param maxncpy Maximum number of characters to copy (generally the size of dst) + * \param dst: Destination for copy + * \param src: Source string to copy + * \param pad: the char to use for padding + * \param maxncpy: Maximum number of characters to copy (generally the size of dst) * \retval Returns dst */ char *BLI_strncpy_ensure_pad(char *__restrict dst, const char *__restrict src, const char pad, size_t maxncpy) @@ -180,9 +180,9 @@ char *BLI_strncpy_ensure_pad(char *__restrict dst, const char *__restrict src, c * \note This is a duplicate of #BLI_strncpy that returns bytes copied. * And is a drop in replacement for 'snprintf(str, sizeof(str), "%s", arg);' * - * \param dst Destination for copy - * \param src Source string to copy - * \param maxncpy Maximum number of characters to copy (generally + * \param dst: Destination for copy + * \param src: Source string to copy + * \param maxncpy: Maximum number of characters to copy (generally * the size of dst) * \retval The number of bytes copied (The only difference from BLI_strncpy). */ @@ -412,9 +412,9 @@ char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict * \note A rather wasteful string-replacement utility, though this shall do for now... * Feel free to replace this with an even safe + nicer alternative * - * \param str The string to replace occurrences of substr_old in - * \param substr_old The text in the string to find and replace - * \param substr_new The text in the string to find and replace + * \param str: The string to replace occurrences of substr_old in + * \param substr_old: The text in the string to find and replace + * \param substr_new: The text in the string to find and replace * \retval Returns the duplicated string */ char *BLI_str_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) @@ -783,8 +783,8 @@ void BLI_str_toupper_ascii(char *str, const size_t len) * 0.0000 -> 0.0 * 2.0010 -> 2.001 * - * \param str - * \param pad + * \param str: + * \param pad: * \return The number of zeros stripped. */ int BLI_str_rstrip_float_zero(char *str, const char pad) @@ -810,9 +810,9 @@ int BLI_str_rstrip_float_zero(char *str, const char pad) /** * Return index of a string in a string array. * - * \param str The string to find. - * \param str_array Array of strings. - * \param str_array_len The length of the array, or -1 for a NULL-terminated array. + * \param str: The string to find. + * \param str_array: Array of strings. + * \param str_array_len: The length of the array, or -1 for a NULL-terminated array. * \return The index of str in str_array or -1. */ int BLI_str_index_in_array_n(const char *__restrict str, const char **__restrict str_array, const int str_array_len) @@ -831,8 +831,8 @@ int BLI_str_index_in_array_n(const char *__restrict str, const char **__restrict /** * Return index of a string in a string array. * - * \param str The string to find. - * \param str_array Array of strings, (must be NULL-terminated). + * \param str: The string to find. + * \param str_array: Array of strings, (must be NULL-terminated). * \return The index of str in str_array or -1. */ int BLI_str_index_in_array(const char *__restrict str, const char **__restrict str_array) @@ -867,8 +867,8 @@ bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, s /** * Find if a string ends with another string. * - * \param str The string to search within. - * \param end The string we look for at the end. + * \param str: The string to search within. + * \param end: The string we look for at the end. * \return If str ends with end. */ bool BLI_str_endswith(const char *__restrict str, const char * __restrict end) @@ -880,10 +880,10 @@ bool BLI_str_endswith(const char *__restrict str, const char * __restrict end) /** * Find the first char matching one of the chars in \a delim, from left. * - * \param str The string to search within. - * \param delim The set of delimiters to search for, as unicode values. - * \param sep Return value, set to the first delimiter found (or NULL if none found). - * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). + * \param str: The string to search within. + * \param delim: The set of delimiters to search for, as unicode values. + * \param sep: Return value, set to the first delimiter found (or NULL if none found). + * \param suf: Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) @@ -894,10 +894,10 @@ size_t BLI_str_partition(const char *str, const char delim[], const char **sep, /** * Find the first char matching one of the chars in \a delim, from right. * - * \param str The string to search within. - * \param delim The set of delimiters to search for, as unicode values. - * \param sep Return value, set to the first delimiter found (or NULL if none found). - * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). + * \param str: The string to search within. + * \param delim: The set of delimiters to search for, as unicode values. + * \param sep: Return value, set to the first delimiter found (or NULL if none found). + * \param suf: Return value, set to next char after the first delimiter found (or NULL if none found). * \return The length of the prefix (i.e. *sep - str). */ size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) @@ -908,12 +908,12 @@ size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, /** * Find the first char matching one of the chars in \a delim, either from left or right. * - * \param str The string to search within. - * \param end If non-NULL, the right delimiter of the string. - * \param delim The set of delimiters to search for, as unicode values. - * \param sep Return value, set to the first delimiter found (or NULL if none found). - * \param suf Return value, set to next char after the first delimiter found (or NULL if none found). - * \param from_right If %true, search from the right of \a str, else, search from its left. + * \param str: The string to search within. + * \param end: If non-NULL, the right delimiter of the string. + * \param delim: The set of delimiters to search for, as unicode values. + * \param sep: Return value, set to the first delimiter found (or NULL if none found). + * \param suf: Return value, set to next char after the first delimiter found (or NULL if none found). + * \param from_right: If %true, search from the right of \a str, else, search from its left. * \return The length of the prefix (i.e. *sep - str). */ size_t BLI_str_partition_ex( @@ -964,8 +964,8 @@ size_t BLI_str_partition_ex( * Format ints with decimal grouping. * 1000 -> 1,000 * - * \param dst The resulting string - * \param num Number to format + * \param dst: The resulting string + * \param num: Number to format * \return The length of \a dst */ size_t BLI_str_format_int_grouped(char dst[16], int num) @@ -1000,9 +1000,9 @@ size_t BLI_str_format_int_grouped(char dst[16], int num) * 1000 -> 1 KB * Number of decimal places grows with the used unit (e.g. 1.5 MB, 1.55 GB, 1.545 TB). * - * \param dst The resulting string. Dimension of 14 to support largest possible value for \a bytes (LLONG_MAX). - * \param bytes Number to format - * \param base_10 Calculate using base 10 (GB, MB, ...) or 2 (GiB, MiB, ...) + * \param dst: The resulting string. Dimension of 14 to support largest possible value for \a bytes (LLONG_MAX). + * \param bytes: Number to format + * \param base_10: Calculate using base 10 (GB, MB, ...) or 2 (GiB, MiB, ...) */ void BLI_str_format_byte_unit(char dst[15], long long int bytes, const bool base_10) { |