45 char *
BLI_strncpy(
char *__restrict dst, const
char *__restrict src, const
size_t maxncpy)
49 const
char *__restrict src,
54 const
char *__restrict src,
65 const
char *__restrict substr_old,
72 const
size_t string_len,
73 const
char *replace_table[][2],
74 int replace_table_len);
83 const
char *__restrict
format,
87 const
char *__restrict
format,
93 size_t BLI_str_escape(
char *__restrict dst, const
char *__restrict src, const
size_t dst_maxncpy)
95 size_t BLI_str_unescape(
char *__restrict dst, const
char *__restrict src, const
size_t src_maxncpy)
124 const
char **__restrict str_array,
134 size_t BLI_str_partition(const
char *
str, const
char delim[], const
char **sep, const
char **suf)
150 const
int words_len);
163 #define STRNCPY(dst, src) BLI_strncpy(dst, src, ARRAY_SIZE(dst))
164 #define STRNCPY_RLEN(dst, src) BLI_strncpy_rlen(dst, src, ARRAY_SIZE(dst))
165 #define SNPRINTF(dst, format, ...) BLI_snprintf(dst, ARRAY_SIZE(dst), format, __VA_ARGS__)
166 #define SNPRINTF_RLEN(dst, format, ...) \
167 BLI_snprintf_rlen(dst, ARRAY_SIZE(dst), format, __VA_ARGS__)
168 #define STR_CONCAT(dst, len, suffix) \
169 len += BLI_strncpy_rlen(dst + len, suffix, ARRAY_SIZE(dst) - len)
170 #define STR_CONCATF(dst, len, format, ...) \
171 len += BLI_snprintf_rlen(dst + len, ARRAY_SIZE(dst) - len, format, __VA_ARGS__)
184 #define _VA_STR_ELEM2(v, a) (strcmp(v, a) == 0)
185 #define _VA_STR_ELEM3(v, a, b) \
186 (_VA_STR_ELEM2(v, a) || (_VA_STR_ELEM2(v, b)))
187 #define _VA_STR_ELEM4(v, a, b, c) \
188 (_VA_STR_ELEM3(v, a, b) || (_VA_STR_ELEM2(v, c)))
189 #define _VA_STR_ELEM5(v, a, b, c, d) \
190 (_VA_STR_ELEM4(v, a, b, c) || (_VA_STR_ELEM2(v, d)))
191 #define _VA_STR_ELEM6(v, a, b, c, d, e) \
192 (_VA_STR_ELEM5(v, a, b, c, d) || (_VA_STR_ELEM2(v, e)))
193 #define _VA_STR_ELEM7(v, a, b, c, d, e, f) \
194 (_VA_STR_ELEM6(v, a, b, c, d, e) || (_VA_STR_ELEM2(v, f)))
195 #define _VA_STR_ELEM8(v, a, b, c, d, e, f, g) \
196 (_VA_STR_ELEM7(v, a, b, c, d, e, f) || (_VA_STR_ELEM2(v, g)))
197 #define _VA_STR_ELEM9(v, a, b, c, d, e, f, g, h) \
198 (_VA_STR_ELEM8(v, a, b, c, d, e, f, g) || (_VA_STR_ELEM2(v, h)))
199 #define _VA_STR_ELEM10(v, a, b, c, d, e, f, g, h, i) \
200 (_VA_STR_ELEM9(v, a, b, c, d, e, f, g, h) || (_VA_STR_ELEM2(v, i)))
201 #define _VA_STR_ELEM11(v, a, b, c, d, e, f, g, h, i, j) \
202 (_VA_STR_ELEM10(v, a, b, c, d, e, f, g, h, i) || (_VA_STR_ELEM2(v, j)))
203 #define _VA_STR_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) \
204 (_VA_STR_ELEM11(v, a, b, c, d, e, f, g, h, i, j) || (_VA_STR_ELEM2(v, k)))
205 #define _VA_STR_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) \
206 (_VA_STR_ELEM12(v, a, b, c, d, e, f, g, h, i, j, k) || (_VA_STR_ELEM2(v, l)))
207 #define _VA_STR_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) \
208 (_VA_STR_ELEM13(v, a, b, c, d, e, f, g, h, i, j, k, l) || (_VA_STR_ELEM2(v, m)))
209 #define _VA_STR_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) \
210 (_VA_STR_ELEM14(v, a, b, c, d, e, f, g, h, i, j, k, l, m) || (_VA_STR_ELEM2(v, n)))
211 #define _VA_STR_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) \
212 (_VA_STR_ELEM15(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n) || (_VA_STR_ELEM2(v, o)))
213 #define _VA_STR_ELEM17(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) \
214 (_VA_STR_ELEM16(v, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) || (_VA_STR_ELEM2(v, p)))
218 #define STR_ELEM(...) VA_NARGS_CALL_OVERLOAD(_VA_STR_ELEM, __VA_ARGS__)
#define ATTR_NONNULL(...)
void BLI_kdtree_nd_() int BLI_kdtree_nd_() int BLI_kdtree_nd_() int BLI_kdtree_nd_() ATTR_WARN_UNUSED_RESULT
int BLI_str_index_in_array(const char *__restrict str, const char **__restrict str_array) ATTR_NONNULL()
bool BLI_str_startswith(const char *__restrict str, const char *__restrict start) ATTR_NONNULL()
size_t size_t BLI_vsnprintf_rlen(char *__restrict buffer, size_t maxncpy, const char *__restrict format, va_list arg) ATTR_PRINTF_FORMAT(3
size_t BLI_str_partition_ex(const char *str, const char *end, const char delim[], const char **sep, const char **suf, const bool from_right) ATTR_NONNULL(1
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
void BLI_str_format_byte_unit(char dst[15], long long int bytes, const bool base_10) ATTR_NONNULL()
bool BLI_str_replace_table_exact(char *string, const size_t string_len, const char *replace_table[][2], int replace_table_len)
size_t ATTR_PRINTF_FORMAT(3, 4)
char * BLI_strncasestr(const char *s, const char *find, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_str_rstrip(char *str) ATTR_NONNULL()
bool BLI_string_has_word_prefix(const char *haystack, const char *needle, size_t needle_len)
bool BLI_string_all_words_matched(const char *name, const char *str, int(*words)[2], const int words_len)
int BLI_strncasecmp(const char *s1, const char *s2, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_str_tolower_ascii(char *str, const size_t len) ATTR_NONNULL()
char * BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strdupn(const char *str, const size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t int BLI_string_max_possible_word_count(const int str_len)
int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool BLI_strn_endswith(const char *__restrict str, const char *__restrict end, size_t length) ATTR_NONNULL()
size_t BLI_strcpy_rlen(char *__restrict dst, const char *__restrict src) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_str_replaceN(const char *__restrict str, const char *__restrict substr_old, const char *__restrict substr_new) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
int BLI_string_find_split_words(const char *str, const size_t len, const char delim, int r_words[][2], int words_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
int BLI_strcmp_ignore_pad(const char *str1, const char *str2, const char pad) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_strncpy_ensure_pad(char *__restrict dst, const char *__restrict src, const char pad, size_t maxncpy) ATTR_NONNULL()
int BLI_strcaseeq(const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_str_index_in_array_n(const char *__restrict str, const char **__restrict str_array, const int str_array_len) ATTR_NONNULL()
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
size_t BLI_strnlen(const char *str, const size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_str_rstrip_float_zero(char *str, const char pad) ATTR_NONNULL()
size_t BLI_str_partition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL()
size_t BLI_vsnprintf(char *__restrict buffer, size_t maxncpy, const char *__restrict format, va_list arg) ATTR_PRINTF_FORMAT(3
char * BLI_strdupcat(const char *__restrict str1, const char *__restrict str2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
size_t BLI_str_unescape(char *__restrict dst, const char *__restrict src, const size_t src_maxncpy) ATTR_NONNULL()
bool BLI_str_endswith(const char *__restrict str, const char *__restrict end) ATTR_NONNULL()
void BLI_str_replace_char(char *string, char src, char dst) ATTR_NONNULL()
size_t BLI_str_format_uint64_grouped(char dst[16], uint64_t num) ATTR_NONNULL()
char * BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict prefix) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
size_t BLI_str_format_int_grouped(char dst[16], int num) ATTR_NONNULL()
size_t BLI_str_rpartition(const char *str, const char delim[], const char **sep, const char **suf) ATTR_NONNULL()
void BLI_str_toupper_ascii(char *str, const size_t len) ATTR_NONNULL()
const char * BLI_str_escape_find_quote(const char *str) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
unsigned __int64 uint64_t