29# define _WIN32_IE 0x0501
45static bool BLI_path_is_abs_win32(
const char *path);
46static int BLI_path_win32_prefix_len(
const char *path);
55#define FILENAME_FRAME_CHARS_MAX FILE_MAX
59 const size_t head_maxncpy,
61 const size_t tail_maxncpy,
71 uint nums = 0, nume = 0;
73 bool found_digit =
false;
76 const uint lslash_len = lslash !=
nullptr ?
int(lslash - path) : 0;
77 const uint name_end =
uint(extension - path);
79 for (i = name_end - 1; i >=
int(lslash_len); i--) {
80 if (isdigit(path[i])) {
98 const long long int ret = strtoll(&(path[nums]),
nullptr, 10);
99 if (
ret >= INT_MIN &&
ret <= INT_MAX) {
104 BLI_strncpy(head, path, std::min<size_t>(head_maxncpy, nums + 1));
107 *r_digits_len = nume - nums + 1;
119 BLI_strncpy(head, path, std::min<size_t>(head_maxncpy, name_end + 1));
128 const size_t path_maxncpy,
136 BLI_snprintf(path, path_maxncpy,
"%s%.*d%s", head, numlen, std::max(0, pic), tail);
145 const char *path_orig = path;
146 int path_len = strlen(path);
152 if (check_blend_relative_prefix && (path[0] ==
'/' && path[1] ==
'/')) {
159 while (path[i] ==
SEP) {
164 memmove(path, path + i, (path_len - i) + 1);
173 if (path_orig == path) {
178 path += path_unc_len;
179 path_len -= path_unc_len;
188 const bool is_relative = path[0] && (path[0] !=
SEP);
207 for (
int i = path_len - 1; i > 0; i--) {
209 if (path[i] ==
SEP) {
214 if (path[i - 1] ==
SEP) {
217 else if (i >= 2 && path[i - 1] ==
'.' && path[i - 2] ==
SEP) {
226 memmove(path + i, path + i_end, (path_len - i_end) + 1);
227 path_len -= i_end - i;
235 if ((path_len > 2) && (path[0] ==
'.') && (path[1] ==
SEP)) {
236 memmove(path, path + 2, (path_len - 2) + 1);
252#define IS_PARENT_DIR(p) ((p)[0] == '.' && (p)[1] == '.' && ELEM((p)[2], SEP, '\0'))
255 char *path_first_non_slash_part = path;
256 while (*path_first_non_slash_part && *path_first_non_slash_part ==
SEP) {
257 path_first_non_slash_part++;
262 char *start_base = path_first_non_slash_part;
269 if (start_base < path + path_len) {
271 char *start = start_base;
275 (start_temp = ((start <= &path[path_len - 3]) &&
277 &path[path_len - 3] :
280 start = start_temp + 1;
284 char *end_all = start;
299 }
while (start_base < start && *(start - 1) !=
SEP);
303 }
while ((start != start_base) && (end < end_all));
305 if (end > path + path_len) {
310 BLI_assert(start < end && start >= start_base);
311 const size_t start_len = path_len - (end - path);
312 memmove(start, end, start_len + 1);
313 path_len -= end - start;
316 if (
UNLIKELY(start == start_base && (end != end_all))) {
317 start_base += (end_all - end);
318 start = (start_base < path + path_len) ? start_base : start_base - 1;
325 BLI_assert((start_base - path_first_non_slash_part) % 3 == 0);
329 !(path_len >= 3 &&
STREQ(&path[path_len - 3],
SEP_STR ".."))));
336 if (path_len == 0 && (path == path_orig)) {
347 if (start_base != path_first_non_slash_part) {
348 char *start = start_base > path + path_len ? start_base - 1 : start_base;
352 const size_t start_len = path_len - (start - path);
354 memmove(path_first_non_slash_part, start, start_len + 1);
355 path_len -= start - path_first_non_slash_part;
364 return (path - path_orig) + path_len;
380 if (dir[0] ==
'\0') {
398 if (path_len > 1 && path[path_len - 1] ==
SEP) {
401 if (BLI_path_win32_prefix_len(path) + 1 < path_len)
405 path[path_len] =
'\0';
413#define INVALID_CHARS \
414 "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" \
415 "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" \
417#define INVALID_TOKENS "<>"
425 bool changed =
false;
427 if (*filename ==
'\0') {
431 for (fn = filename; *fn && (fn = strpbrk(fn, invalid)); fn++) {
437 for (fn = filename; *fn ==
'.'; fn++) {
447 const char *invalid_names[] = {
448 "con",
"prn",
"aux",
"null",
"com1",
"com2",
"com3",
"com4",
449 "com5",
"com6",
"com7",
"com8",
"com9",
"lpt1",
"lpt2",
"lpt3",
450 "lpt4",
"lpt5",
"lpt6",
"lpt7",
"lpt8",
"lpt9",
NULL,
452 const size_t len = strlen(filename);
457 if (filename[
len - 1] ==
'.') {
458 filename[
len - 1] =
'_';
466 for (iname = invalid_names; *iname; iname++) {
467 if (strstr(filename_lower, *iname) == filename_lower) {
468 const size_t iname_len = strlen(*iname);
472 if ((iname_len ==
len) || (filename_lower[iname_len] ==
'.')) {
496 char *curr_slash, *curr_path = path;
497 bool changed =
false;
498 bool skip_first =
false;
501 if (BLI_path_is_abs_win32(path)) {
510 const char backup = *curr_slash;
516 curr_path = curr_slash + 1;
517 *curr_slash = backup;
528 return path[0] ==
'/' && path[1] ==
'/';
533 return path[0] ==
'\\' && path[1] ==
'\\';
545 if ((path[2] ==
'?') && (path[3] ==
'\\')) {
557static int BLI_path_win32_prefix_len(
const char *path)
568 return isalpha(path[0]) && (path[1] ==
':');
573 return isalpha(path[0]) && (path[1] ==
':') && (path[2] ==
'\0');
578 return isalpha(path[0]) && (path[1] ==
':') &&
ELEM(path[2],
'\\',
'/');
591static bool BLI_path_is_abs_win32(
const char *path)
598static wchar_t *next_slash(
wchar_t *path)
600 wchar_t *slash = path;
601 while (*slash && *slash !=
L'\\') {
608static void BLI_path_add_slash_to_share(
wchar_t *uncpath)
610 wchar_t *slash_after_server = next_slash(uncpath + 2);
611 if (*slash_after_server) {
612 wchar_t *slash_after_share = next_slash(slash_after_server + 1);
613 if (!(*slash_after_share)) {
614 slash_after_share[0] =
L'\\';
615 slash_after_share[1] =
L'\0';
620static void BLI_path_unc_to_short(
wchar_t *unc)
624 int len = wcslen(unc);
630 if ((
len > 3) && (unc[0] ==
L'\\') && (unc[1] ==
L'\\') && (unc[2] ==
L'?') &&
631 ELEM(unc[3],
L'\\',
L'/'))
633 if ((
len > 5) && (unc[5] ==
L':')) {
634 wcsncpy(tmp, unc + 4,
len - 4);
635 tmp[
len - 4] =
L'\0';
638 else if ((
len > 7) && (wcsncmp(&unc[4],
L"UNC", 3) == 0) &&
ELEM(unc[7],
L'\\',
L'/')) {
641 wcsncpy(tmp + 2, unc + 8,
len - 8);
642 tmp[
len - 6] =
L'\0';
648void BLI_path_normalize_unc(
char *path,
int path_maxncpy)
651 BLI_path_normalize_unc_16(tmp_16);
655void BLI_path_normalize_unc_16(
wchar_t *path_16)
657 BLI_path_unc_to_short(path_16);
658 BLI_path_add_slash_to_share(path_16);
677 if (basepath[0] ==
'\0') {
682 if (
BLI_strnlen(basepath, 3) > 2 && !BLI_path_is_abs_win32(basepath)) {
688 if (!
ELEM(basepath[0],
'\\',
'/')) {
709 for (off = 0; temp[off] && slash < 4; off++) {
710 if (temp[off] != path[off]) {
714 if (temp[off] ==
'\\') {
719 else if ((temp[1] ==
':' && path[1] ==
':') && (tolower(temp[0]) != tolower(path[0]))) {
740 const char *p = temp;
741 const char *q = path;
744 while (tolower(*p) == tolower(*q))
753 if ((*p ==
'\0') || (*q ==
'\0')) {
761 while ((q >= path) && (*q !=
'/')) {
766 else if (*p !=
'/') {
767 while ((p >= temp) && (*p !=
'/')) {
783 while (p && p < lslash) {
801bool BLI_path_suffix(
char *path,
size_t path_maxncpy,
const char *suffix,
const char *sep)
805 const size_t suffix_len = strlen(suffix);
806 const size_t sep_len = strlen(sep);
808 const size_t extension_len = strlen(extension);
809 const size_t path_end = extension - path;
810 const size_t path_len = path_end + extension_len;
811 if (path_len + sep_len + suffix_len >= path_maxncpy) {
816 memmove(extension + (sep_len + suffix_len), extension, extension_len);
818 char *c = path + path_end;
820 memcpy(c, sep, sep_len);
824 memcpy(c, suffix, suffix_len);
834 const char *path_end = path + path_len - 1;
835 const char *p = path_end;
853 if ((p > path) && (p != path_end)) {
867 int tail_ofs = 0, tail_len = 0;
874 if (path[tail_ofs] ==
'.') {
880 BLI_assert(!((tail_len == 2) && (path[tail_ofs] ==
'.') && (path[tail_ofs + 1] ==
'.')));
881 path[tail_ofs] =
'\0';
887 bool valid_path =
true;
893 return (valid_path && path[0]);
908 uint ch_sta, ch_end, i;
911 for (i = 0; path[i] !=
'\0'; i++) {
912 if (
ELEM(path[i],
'\\',
'/')) {
915 else if (path[i] ==
'#') {
918 while (path[ch_end] ==
'#') {
928 *r_char_start = ch_sta;
929 *r_char_end = ch_end;
945 if (strrchr(file,
'#') ==
nullptr) {
946 int len = strlen(file);
968 SNPRINTF(frame_str,
"%.*d", ch_span, frame);
988 SNPRINTF(frame_str,
"%.*d-%.*d", ch_span, sta, ch_span, end);
1005 const char *c = file_ext;
1009 while (c-- != file && isdigit(*c)) {
1014 if (digits_len == 0) {
1020 *r_digits_len = digits_len;
1028 if (*path ==
'\0') {
1038 while (c-- != file && isdigit(*c)) {
1046 while (digits_len--) {
1054 int ch_sta_dummy, ch_end_dummy;
1063 int strip_offset = 0;
1064 while (
ELEM(name[strip_offset],
'_',
' ')) {
1068 BLI_strncpy(display_name, name + strip_offset, display_name_maxncpy);
1076 bool all_lower =
true;
1077 for (
int i = 0; display_name[i]; i++) {
1078 if (isupper(display_name[i])) {
1086 bool prevspace =
true;
1087 for (
int i = 0; display_name[i]; i++) {
1089 display_name[i] = toupper(display_name[i]);
1092 prevspace = isspace(display_name[i]);
1109 if (*path ==
'\0') {
1115 if (!wasrelative && !BLI_path_is_abs_win32(path)) {
1116 const size_t root_dir_len = 3;
1123 BLI_strncpy(tmp + root_dir_len, p,
sizeof(tmp) - root_dir_len);
1139 tmp[1] = tolower(tmp[0]);
1170 const int baselen =
int(lslash - base) + 1;
1174 memcpy(tmp, base, baselen);
1175 BLI_strncpy(tmp + baselen, path,
sizeof(tmp) - baselen);
1203 bool is_abs =
false;
1206 if (BLI_path_is_abs_win32(path)) {
1210 if (path[0] ==
'/') {
1230 printf(
"Could not get the current working directory - $PWD for an unknown reason.\n");
1244bool BLI_path_program_extensions_add_win32(
char *program_name,
const size_t program_name_maxncpy)
1246 bool retval =
false;
1250 if ((type == 0) ||
S_ISDIR(type)) {
1252 const int ext_max = 12;
1255 const int program_name_len = strlen(program_name);
1256 char *filename =
static_cast<char *
>(alloca(program_name_len + ext_max));
1258 const char *ext_next;
1261 memcpy(filename, program_name, program_name_len);
1262 filename_ext = filename + program_name_len;
1266 ext_next = strchr(ext,
';');
1267 ext_len = ext_next ? ((ext_next++) - ext) : strlen(ext);
1269 if (
LIKELY(ext_len < ext_max)) {
1270 memcpy(filename_ext, ext, ext_len);
1271 filename_ext[ext_len] =
'\0';
1274 if (type && (!
S_ISDIR(type))) {
1276 BLI_strncpy(program_name, filename, program_name_maxncpy);
1280 }
while ((ext = ext_next));
1292 const size_t program_filepath_maxncpy,
1293 const char *program_name)
1298 bool retval =
false;
1301 const char separator =
';';
1303 const char separator =
':';
1312 temp = strchr(path, separator);
1314 memcpy(filepath_test, path, temp - path);
1315 filepath_test[temp - path] = 0;
1322 BLI_path_append(filepath_test, program_filepath_maxncpy, program_name);
1325 BLI_path_program_extensions_add_win32(filepath_test,
sizeof(filepath_test))
1338 if (retval ==
false) {
1347#if (defined(_WIN32) || defined(_WIN64))
1353 setenv(env, val, 1);
1371 const char *result =
NULL;
1374 static wchar_t buffer[32768];
1377 if (GetEnvironmentVariableW(env_16, buffer,
ARRAY_SIZE(buffer))) {
1381 if (strlen(res_utf8) + 1 <
sizeof(buffer)) {
1384 memcpy(buffer, res_utf8, strlen(res_utf8) + 1);
1385 result = (
const char *)buffer;
1398 const size_t path_len,
1400 const size_t ext_len)
1405 return (((path_len == 0 || ext_len == 0 || ext_len >= path_len) == 0) &&
1416 const size_t path_len = strlen(path);
1422 va_start(args, path);
1424 while ((ext = (
const char *)va_arg(args,
void *))) {
1438 const size_t path_len = strlen(path);
1441 while (ext_array[i]) {
1453 const char *ext_step = ext_fnmatch;
1456 while (ext_step[0]) {
1457 const char *ext_next;
1460 if ((ext_next = strchr(ext_step,
';'))) {
1461 len_ext = ext_next - ext_step + 1;
1462 BLI_strncpy(pattern, ext_step, (len_ext >
sizeof(pattern)) ?
sizeof(pattern) : len_ext);
1468 if (fnmatch(pattern, path, FNM_CASEFOLD) == 0) {
1471 ext_step += len_ext;
1479 bool only_wildcards =
false;
1481 for (
size_t i = strlen(ext_fnmatch); i-- > 0;) {
1482 if (ext_fnmatch[i] ==
';') {
1485 if (only_wildcards) {
1486 ext_fnmatch[i] =
'\0';
1491 if (!
ELEM(ext_fnmatch[i],
'?',
'*')) {
1496 only_wildcards =
true;
1508 const size_t ext_len = strlen(ext);
1509 if ((path_ext - path) + ext_len >= path_maxncpy) {
1513 memcpy(path_ext, ext, ext_len + 1);
1520 if (path_ext ==
nullptr) {
1534 if (
STREQ(path_ext, ext)) {
1538 const size_t path_len = strlen(path);
1539 const size_t ext_len = strlen(ext);
1542 for (a = path_len - 1; a >= 0; a--) {
1543 if (path[a] ==
'.') {
1552 if (a + ext_len >= path_maxncpy) {
1556 memcpy(path + a, ext, ext_len + 1);
1564 const size_t filename_size = strlen(filename) + 1;
1565 if (filename_size <= filepath_maxncpy - (c - filepath)) {
1566 memcpy(c, filename, filename_size);
1574 const size_t dir_maxncpy,
1576 const size_t file_maxncpy)
1582 if (basename != filepath) {
1583 const size_t dir_size = (basename - filepath) + 1;
1584 BLI_strncpy(dir, filepath, std::min(dir_maxncpy, dir_size));
1596 if (basename != filepath) {
1597 const size_t dir_size = (basename - filepath) + 1;
1598 BLI_strncpy(dir, filepath, std::min(dir_maxncpy, dir_size));
1619 const char *ext =
nullptr;
1620 bool has_non_ext =
false;
1621 const char *c = filepath;
1633 has_non_ext =
false;
1652 return *ext ? ext :
nullptr;
1655size_t BLI_path_append(
char *__restrict dst,
const size_t dst_maxncpy,
const char *__restrict file)
1659 if (dst_len + 1 < dst_maxncpy) {
1666 const size_t dst_maxncpy,
1667 const char *__restrict dir)
1674 const size_t dst_maxncpy,
1675 const char *path_array[],
1676 const int path_array_num)
1684 const char *path = path_array[0];
1686 const size_t dst_last = dst_maxncpy - 1;
1689 if (ofs == dst_last) {
1699 for (i = 0; i < ofs; i++) {
1700 if (dst[i] !=
'/') {
1706 return path_array_num > 1 ?
1708 dst + ofs, dst_maxncpy - ofs, &path_array[1], path_array_num - 1) :
1716 bool has_trailing_slash =
false;
1726 has_trailing_slash = (path[
len] !=
'\0');
1729 for (
int path_index = 1; path_index < path_array_num; path_index++) {
1730 path = path_array[path_index];
1731 has_trailing_slash =
false;
1736 size_t len = strlen(path);
1746 if (ofs == dst_last) {
1750 has_trailing_slash = (path[
len] !=
'\0');
1751 if (ofs +
len >= dst_last) {
1752 len = dst_last - ofs;
1754 memcpy(&dst[ofs], path,
len);
1756 if (ofs == dst_last) {
1762 has_trailing_slash = (
path_init != path);
1766 if (has_trailing_slash) {
1781 return filename ? filename + 1 : path;
1786 int *__restrict r_offset,
1787 int *__restrict r_len)
1794 const char c = path[i];
1796 if (prev + 1 != i) {
1799 if (!((i - prev == 1) && (prev != 0) && (path[prev] ==
'.'))) {
1800 if (index_step == index) {
1820 int *__restrict r_offset,
1821 int *__restrict r_len)
1825 int index_step = -1;
1826 int prev = strlen(path);
1829 const char c = i >= 0 ? path[i] :
'\0';
1831 if (prev - 1 != i) {
1834 if (!((prev - i == 1) && (i != 0) && (path[i] ==
'.'))) {
1835 if (index_step == index) {
1855 int *__restrict r_offset,
1856 int *__restrict r_len)
1870 STRNCPY(containee_native, containee_path);
1883 if (
STREQ(container_native, containee_native)) {
1897 const char *
const ffslash = strchr(path,
'/');
1898 const char *
const fbslash = strchr(path,
'\\');
1907 return (ffslash < fbslash) ? ffslash : fbslash;
1912 const char *
const lfslash = strrchr(path,
'/');
1913 const char *
const lbslash = strrchr(path,
'\\');
1922 return (lfslash > lbslash) ? lfslash : lbslash;
1932 if (path_len + 1 < path_maxncpy) {
1933 path[path_len++] =
SEP;
1934 path[path_len] =
'\0';
1947 int len = strlen(path);
1950 path[
len - 1] =
'\0';
1984 char norm_p1_buf[256];
1985 char norm_p2_buf[256];
1987 const size_t p1_size = strlen(p1) + 1;
1988 const size_t p2_size = strlen(p2) + 1;
1990 char *norm_p1 = (p1_size <=
sizeof(norm_p1_buf)) ? norm_p1_buf :
1991 MEM_cnew_array<char>(p1_size, __func__);
1992 char *norm_p2 = (p2_size <=
sizeof(norm_p2_buf)) ? norm_p2_buf :
1993 MEM_cnew_array<char>(p2_size, __func__);
1995 memcpy(norm_p1, p1, p1_size);
1996 memcpy(norm_p2, p2, p2_size);
2010 if (norm_p1 != norm_p1_buf) {
2013 if (norm_p2 != norm_p2_buf) {
2021 bool component_start =
true;
2022 char cur_char = path[0];
2023 char prev_char =
'\0';
2025 while (cur_char !=
'\0') {
2026 char next_char = path[1];
2029 if (component_start && cur_char ==
'.') {
2030 if (!
ELEM(path[1],
'.',
'\0',
'/',
'\\')) {
2035 component_start =
ELEM(cur_char,
'/',
'\\');
2037 if (component_start && prev_char ==
'~') {
2042 prev_char = cur_char;
2043 cur_char = next_char;
2047 if (prev_char ==
'~') {
#define BLI_assert_msg(a, msg)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
char * BLI_current_working_dir(char *dir, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_access(const char *filepath, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void BLI_kdtree_nd_ free(KDTree *tree)
#define BLI_path_join(...)
BLI_INLINE bool BLI_path_slash_is_native_compat(const char ch)
int bool BLI_str_startswith(const char *__restrict str, const char *__restrict start) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define STRNCPY(dst, src)
#define STRNCPY_RLEN(dst, src)
char * BLI_strdupn(const char *str, size_t len) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define SNPRINTF(dst, format,...)
int char char int int int int size_t BLI_strnlen(const char *str, size_t maxlen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define BLI_string_debug_size_after_nil(str, str_maxncpy)
#define BLI_string_debug_size(str, str_maxncpy)
int char char int BLI_strcasecmp(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_str_tolower_ascii(char *str, size_t len) ATTR_NONNULL(1)
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void BLI_string_replace_char(char *str, char src, char dst) ATTR_NONNULL(1)
size_t BLI_string_replace_range(char *string, size_t string_maxncpy, int src_beg, int src_end, const char *dst)
Compatibility-like things for windows.
void BLI_windows_get_default_root_dir(char root_dir[4])
Read Guarded memory(de)allocation.
char program_filepath[FILE_MAX]
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
void MEM_freeN(void *vmemh)
void path_init(const string &path, const string &user_path)
bool BLI_path_extension_check(const char *path, const char *ext)
size_t BLI_path_join_array(char *__restrict dst, const size_t dst_maxncpy, const char *path_array[], const int path_array_num)
bool BLI_path_is_unc(const char *path)
void BLI_path_slash_rstrip(char *path)
bool BLI_path_make_safe(char *path)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath)
void BLI_path_split_dir_part(const char *filepath, char *dir, const size_t dir_maxncpy)
void BLI_path_sequence_encode(char *path, const size_t path_maxncpy, const char *head, const char *tail, ushort numlen, int pic)
const char * BLI_path_parent_dir_end(const char *path, size_t path_len)
void BLI_path_slash_native(char *path)
void BLI_path_frame_strip(char *path, char *r_ext, const size_t ext_maxncpy)
bool BLI_path_parent_dir(char *path)
bool BLI_path_suffix(char *path, size_t path_maxncpy, const char *suffix, const char *sep)
static bool path_name_at_index_forward(const char *__restrict path, const int index, int *__restrict r_offset, int *__restrict r_len)
bool BLI_path_extension_ensure(char *path, size_t path_maxncpy, const char *ext)
bool BLI_path_is_abs_from_cwd(const char *path)
const char * BLI_path_slash_skip(const char *path)
static bool path_frame_chars_find_range(const char *path, int *r_char_start, int *r_char_end)
const char * BLI_getenv(const char *env)
bool BLI_path_extension_check_array(const char *path, const char **ext_array)
int BLI_path_cmp_normalized(const char *p1, const char *p2)
static int path_normalize_impl(char *path, bool check_blend_relative_prefix)
bool BLI_path_is_win32_drive(const char *path)
size_t BLI_path_append_dir(char *__restrict dst, const size_t dst_maxncpy, const char *__restrict dir)
bool BLI_path_extension_strip(char *path)
#define FILENAME_FRAME_CHARS_MAX
int BLI_path_sequence_decode(const char *path, char *head, const size_t head_maxncpy, char *tail, const size_t tail_maxncpy, ushort *r_digits_len)
bool BLI_path_contains(const char *container_path, const char *containee_path)
bool BLI_path_extension_replace(char *path, size_t path_maxncpy, const char *ext)
bool BLI_path_parent_dir_until_exists(char *path)
int BLI_path_canonicalize_native(char *path, int path_maxncpy)
const char * BLI_path_extension_or_end(const char *filepath)
static bool path_extension_check_ex(const char *path, const size_t path_len, const char *ext, const size_t ext_len)
size_t BLI_path_append(char *__restrict dst, const size_t dst_maxncpy, const char *__restrict file)
bool BLI_path_abs_from_cwd(char *path, const size_t path_maxncpy)
const char * BLI_path_slash_find(const char *path)
bool BLI_path_frame_check_chars(const char *path)
bool BLI_path_make_safe_filename_ex(char *filename, bool allow_tokens)
int BLI_path_slash_ensure(char *path, size_t path_maxncpy)
bool BLI_path_extension_glob_validate(char *ext_fnmatch)
bool BLI_path_extension_check_glob(const char *path, const char *ext_fnmatch)
const char * BLI_path_extension(const char *filepath)
static void ensure_digits(char *path, int digits)
bool BLI_path_is_rel(const char *path)
static int BLI_path_unc_prefix_len(const char *path)
void BLI_path_rel(char path[FILE_MAX], const char *basepath)
void BLI_path_split_dir_file(const char *filepath, char *dir, const size_t dir_maxncpy, char *file, const size_t file_maxncpy)
bool BLI_path_filename_ensure(char *filepath, size_t filepath_maxncpy, const char *filename)
int BLI_path_slash_ensure_ex(char *path, size_t path_maxncpy, size_t path_len)
bool BLI_path_is_win32_drive_only(const char *path)
int BLI_path_normalize_native(char *path)
void BLI_path_split_file_part(const char *filepath, char *file, const size_t file_maxncpy)
void BLI_setenv(const char *env, const char *val)
void BLI_path_to_display_name(char *display_name, int display_name_maxncpy, const char *name)
void BLI_setenv_if_new(const char *env, const char *val)
bool BLI_path_make_safe_filename(char *filename)
bool BLI_path_is_win32_drive_with_slash(const char *path)
bool BLI_path_program_search(char *program_filepath, const size_t program_filepath_maxncpy, const char *program_name)
static bool path_name_at_index_backward(const char *__restrict path, const int index, int *__restrict r_offset, int *__restrict r_len)
bool BLI_path_has_hidden_component(const char *path)
bool BLI_path_frame(char *path, size_t path_maxncpy, int frame, int digits)
bool BLI_path_name_at_index(const char *__restrict path, const int index, int *__restrict r_offset, int *__restrict r_len)
int BLI_path_normalize(char *path)
bool BLI_path_frame_range(char *path, size_t path_maxncpy, int sta, int end, int digits)
const char * BLI_path_slash_rfind(const char *path)
bool BLI_path_extension_check_n(const char *path,...)
bool BLI_path_frame_get(const char *path, int *r_frame, int *r_digits_len)
int BLI_path_normalize_dir(char *dir, size_t dir_maxncpy)
const char * BLI_path_basename(const char *path)
int uputenv(const char *name, const char *value)
wchar_t * alloc_utf16_from_8(const char *in8, size_t add)
char * alloc_utf_8_from_16(const wchar_t *in16, size_t add)
int conv_utf_16_to_8(const wchar_t *in16, char *out8, size_t size8)