diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-12 04:55:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-12 05:02:09 +0300 |
commit | 49490e5cfbeb2b0b823aa2042401891001870a6e (patch) | |
tree | a1d32562af2dea0c336ebd3d017a387834e936cc /source/blender/blenlib/intern/string.c | |
parent | 16fc62e15f0a749d6d64e784ea048e07d6ea3397 (diff) | |
parent | e757c4a3bec8b0e8d198531a28327332af00a9ba (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 25375278901..a92b226d033 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -55,8 +55,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) @@ -72,7 +72,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) @@ -82,8 +82,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) @@ -106,9 +106,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 */ @@ -129,10 +129,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) @@ -181,9 +181,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). */ @@ -413,9 +413,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) @@ -799,8 +799,8 @@ void BLI_str_rstrip(char *str) * 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) @@ -826,9 +826,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) @@ -847,8 +847,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) @@ -883,8 +883,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) @@ -896,10 +896,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) @@ -910,10 +910,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) @@ -924,12 +924,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( @@ -1004,8 +1004,8 @@ static size_t BLI_str_format_int_grouped_ex(char src[16], char dst[16], int num_ * 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) @@ -1020,8 +1020,8 @@ size_t BLI_str_format_int_grouped(char dst[16], int num) * Format uint64_t 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_uint64_grouped(char dst[16], uint64_t num) @@ -1037,9 +1037,9 @@ size_t BLI_str_format_uint64_grouped(char dst[16], uint64_t 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) { |