Blender V4.5
bpath.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9/* TODO:
10 * currently there are some cases we don't support.
11 * - passing output paths to the visitor?, like render out.
12 * - passing sequence strips with many images.
13 * - passing directory paths - visitors don't know which path is a dir or a file.
14 */
15
16#include <sys/stat.h>
17
18#include <cstring>
19
20/* path/file handling stuff */
21#ifndef WIN32
22# include <dirent.h>
23# include <unistd.h>
24#else
25# include "BLI_winstuff.h"
26# include <io.h>
27#endif
28
29#include "MEM_guardedalloc.h"
30
31#include "BLI_fileops.h"
32#include "BLI_listbase.h"
33#include "BLI_path_utils.hh"
34#include "BLI_string.h"
35#include "BLI_utildefines.h"
36
37#include "DEG_depsgraph.hh"
38
39#include "BKE_idtype.hh"
40#include "BKE_library.hh"
41#include "BKE_main.hh"
42#include "BKE_node.hh"
43#include "BKE_report.hh"
44
45#include "BKE_bpath.hh" /* own include */
46
47#include "CLG_log.h"
48
49#ifndef _MSC_VER
50# include "BLI_strict_flags.h" /* IWYU pragma: keep. Keep last. */
51#endif
52
53static CLG_LogRef LOG = {"bke.bpath"};
54
55/* -------------------------------------------------------------------- */
58
60{
63 "Total files %d | Changed %d | Failed %d",
64 summary.count_total,
65 summary.count_changed,
66 summary.count_failed);
67}
68
70
71/* -------------------------------------------------------------------- */
74
76{
77 const eBPathForeachFlag flag = bpath_data->flag;
78 const char *absbase = (flag & BKE_BPATH_FOREACH_PATH_ABSOLUTE) ?
79 ID_BLEND_PATH(bpath_data->bmain, id) :
80 nullptr;
81 bpath_data->absolute_base_path = absbase;
82 bpath_data->owner_id = id;
83 bpath_data->is_path_modified = false;
84
86 return;
87 }
88
89 if (id->library_weak_reference != nullptr &&
91 {
95 }
96
97 bNodeTree *embedded_node_tree = blender::bke::node_tree_from_id(id);
98 if (embedded_node_tree != nullptr) {
99 BKE_bpath_foreach_path_id(bpath_data, &embedded_node_tree->id);
100 }
101
102 const IDTypeInfo *id_type = BKE_idtype_get_info_from_id(id);
103
104 BLI_assert(id_type != nullptr);
105 if (id_type == nullptr || id_type->foreach_path == nullptr) {
106 return;
107 }
108
109 id_type->foreach_path(id, bpath_data);
110
111 if (bpath_data->is_path_modified) {
113 }
114}
115
117{
118 ID *id;
119 FOREACH_MAIN_ID_BEGIN (bpath_data->bmain, id) {
120 BKE_bpath_foreach_path_id(bpath_data, id);
121 }
123}
124
126 char *path,
127 size_t path_maxncpy)
128{
129 const char *absolute_base_path = bpath_data->absolute_base_path;
130
131 char path_src_buf[FILE_MAX];
132 const char *path_src;
133 char path_dst[FILE_MAX];
134
135 if (absolute_base_path) {
136 STRNCPY(path_src_buf, path);
137 BLI_path_abs(path_src_buf, absolute_base_path);
138 path_src = path_src_buf;
139 }
140 else {
141 path_src = path;
142 }
143
144 /* so functions can check old value */
145 STRNCPY(path_dst, path);
146
147 if (bpath_data->callback_function(bpath_data, path_dst, sizeof(path_dst), path_src)) {
148 BLI_strncpy(path, path_dst, path_maxncpy);
149 bpath_data->is_path_modified = true;
150 return true;
151 }
152
153 return false;
154}
155
157 char *path_dir,
158 size_t path_dir_maxncpy,
159 char *path_file,
160 size_t path_file_maxncpy)
161{
162 const char *absolute_base_path = bpath_data->absolute_base_path;
163
164 char path_src[FILE_MAX];
165 char path_dst[FILE_MAX];
166
167 BLI_path_join(path_src, sizeof(path_src), path_dir, path_file);
168
169 /* So that functions can access the old value. */
170 STRNCPY(path_dst, path_src);
171
172 if (absolute_base_path) {
173 BLI_path_abs(path_src, absolute_base_path);
174 }
175
176 if (bpath_data->callback_function(
177 bpath_data, path_dst, sizeof(path_dst), (const char *)path_src))
178 {
179 BLI_path_split_dir_file(path_dst, path_dir, path_dir_maxncpy, path_file, path_file_maxncpy);
180 bpath_data->is_path_modified = true;
181 return true;
182 }
183
184 return false;
185}
186
188{
189 const char *absolute_base_path = bpath_data->absolute_base_path;
190
191 char path_src_buf[FILE_MAX];
192 const char *path_src;
193 char path_dst[FILE_MAX];
194
195 if (absolute_base_path) {
196 STRNCPY(path_src_buf, *path);
197 BLI_path_abs(path_src_buf, absolute_base_path);
198 path_src = path_src_buf;
199 }
200 else {
201 path_src = *path;
202 }
203
204 if (bpath_data->callback_function(bpath_data, path_dst, sizeof(path_dst), path_src)) {
205 MEM_freeN(*path);
206 (*path) = BLI_strdup(path_dst);
207 bpath_data->is_path_modified = true;
208 return true;
209 }
210
211 return false;
212}
213
215
216/* -------------------------------------------------------------------- */
219
221 char * /*path_dst*/,
222 size_t /*path_dst_maxncpy*/,
223 const char *path_src)
224{
225 ReportList *reports = (ReportList *)bpath_data->user_data;
226
227 if (!BLI_exists(path_src)) {
228 ID *owner_id = bpath_data->owner_id;
229 if (owner_id) {
230 if (ID_IS_LINKED(owner_id)) {
233 "Path '%s' not found, from linked data-block '%s' (from library '%s')",
234 path_src,
235 owner_id->name,
236 owner_id->lib->runtime->filepath_abs);
237 }
238 else {
241 "Path '%s' not found, from local data-block '%s'",
242 path_src,
243 owner_id->name);
244 }
245 }
246 else {
248 reports, RPT_WARNING, "Path '%s' not found (no known owner data-block)", path_src);
249 }
250 }
251
252 return false;
253}
254
269
271
272/* -------------------------------------------------------------------- */
275
276#define MAX_DIR_RECURSE 16
277#define FILESIZE_INVALID_DIRECTORY -1
278
294static bool missing_files_find__recursive(const char *search_directory,
295 const char *filename_src,
296 char r_filepath_new[FILE_MAX],
297 int64_t *r_filesize,
298 int *r_recurse_depth)
299{
300 /* TODO: Move this function to BLI_path_utils? The 'biggest size' behavior is quite specific
301 * though... */
302 DIR *dir;
303 BLI_stat_t status;
304 char path[FILE_MAX];
306 bool found = false;
307
308 dir = opendir(search_directory);
309
310 if (dir == nullptr) {
311 return found;
312 }
313
314 if (*r_filesize == FILESIZE_INVALID_DIRECTORY) {
315 *r_filesize = 0; /* The directory opened fine. */
316 }
317
318 for (dirent *de = readdir(dir); de != nullptr; de = readdir(dir)) {
319 if (FILENAME_IS_CURRPAR(de->d_name)) {
320 continue;
321 }
322
323 BLI_path_join(path, sizeof(path), search_directory, de->d_name);
324
325 if (BLI_stat(path, &status) == -1) {
326 CLOG_WARN(&LOG, "Cannot get file status (`stat()`) of '%s'", path);
327 continue;
328 }
329
330 if (S_ISREG(status.st_mode)) { /* It is a file. */
331 if (BLI_path_ncmp(filename_src, de->d_name, FILE_MAX) == 0) { /* Names match. */
332 size = status.st_size;
333 if ((size > 0) && (size > *r_filesize)) { /* Find the biggest matching file. */
334 *r_filesize = size;
335 BLI_strncpy(r_filepath_new, path, FILE_MAX);
336 found = true;
337 }
338 }
339 }
340 else if (S_ISDIR(status.st_mode)) { /* It is a sub-directory. */
341 if (*r_recurse_depth <= MAX_DIR_RECURSE) {
342 (*r_recurse_depth)++;
344 path, filename_src, r_filepath_new, r_filesize, r_recurse_depth);
345 (*r_recurse_depth)--;
346 }
347 }
348 }
349
350 closedir(dir);
351 return found;
352}
353
355 const char *basedir;
356 const char *searchdir;
358 bool find_all; /* Also search for files which current path is still valid. */
359};
360
362 char *path_dst,
363 size_t path_dst_maxncpy,
364 const char *path_src)
365{
367 char filepath_new[FILE_MAX];
368
370 int recurse_depth = 0;
371 bool is_found;
372
373 if (!data->find_all && BLI_exists(path_src)) {
374 return false;
375 }
376
377 filepath_new[0] = '\0';
378
380 data->searchdir, BLI_path_basename(path_src), filepath_new, &filesize, &recurse_depth);
381
382 if (filesize == FILESIZE_INVALID_DIRECTORY) {
383 BKE_reportf(data->reports,
385 "Could not open the directory '%s'",
386 BLI_path_basename(data->searchdir));
387 return false;
388 }
389 if (is_found == false) {
390 BKE_reportf(data->reports,
392 "Could not find '%s' in '%s'",
393 BLI_path_basename(path_src),
394 data->searchdir);
395 return false;
396 }
397
398 /* Keep the path relative if the previous one was relative. */
399 if (BLI_path_is_rel(path_dst)) {
400 BLI_path_rel(filepath_new, data->basedir);
401 }
402 BLI_strncpy(path_dst, filepath_new, path_dst_maxncpy);
403 return true;
404}
405
407 const char *searchpath,
409 const bool find_all)
410{
411 BPathFind_Data data = {nullptr};
414
415 data.basedir = BKE_main_blendfile_path(bmain);
416 data.reports = reports;
417 data.searchdir = searchpath;
418 data.find_all = find_all;
419
420 BPathForeachPathData path_data{};
421 path_data.bmain = bmain;
423 path_data.flag = eBPathForeachFlag(flag);
424 path_data.user_data = &data;
425 BKE_bpath_foreach_path_main(&path_data);
426}
427
428#undef MAX_DIR_RECURSE
429#undef FILESIZE_INVALID_DIRECTORY
430
432
433/* -------------------------------------------------------------------- */
436
444
446 char *path_dst,
447 size_t path_dst_maxncpy,
448 const char *path_src)
449{
451
452 data->summary.count_total++;
453
454 if (!BLI_path_is_rel(path_src)) {
455 /* Absolute, leave this as-is. */
456 return false;
457 }
458
459 char filepath[(FILE_MAXDIR * 2) + FILE_MAXFILE];
460 BLI_strncpy(filepath, path_src, FILE_MAX);
461 if (!BLI_path_abs(filepath, data->basedir_src)) {
462 BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made absolute", path_src);
463 data->summary.count_failed++;
464 return false;
465 }
466
467 BLI_path_normalize(filepath);
468
469 /* This may fail, if so it's fine to leave absolute since the path is still valid. */
470 BLI_path_rel(filepath, data->basedir_dst);
471
472 BLI_strncpy(path_dst, filepath, path_dst_maxncpy);
473 data->summary.count_changed++;
474 return true;
475}
476
478 const char *basedir_src,
479 const char *basedir_dst,
481 BPathSummary *r_summary)
482{
483 BPathRebase_Data data = {nullptr};
485
486 BLI_assert(basedir_src[0] != '\0');
487 BLI_assert(basedir_dst[0] != '\0');
488
489 data.basedir_src = basedir_src;
490 data.basedir_dst = basedir_dst;
491 data.reports = reports;
492
493 BPathForeachPathData path_data{};
494 path_data.bmain = bmain;
496 path_data.flag = eBPathForeachFlag(flag);
497 path_data.user_data = &data;
498 BKE_bpath_foreach_path_main(&path_data);
499
500 if (r_summary) {
501 *r_summary = data.summary;
502 }
503}
504
506
507/* -------------------------------------------------------------------- */
510
517
519 char *path_dst,
520 size_t path_dst_maxncpy,
521 const char *path_src)
522{
524
525 data->summary.count_total++;
526
527 if (BLI_path_is_rel(path_src)) {
528 return false; /* Already relative. */
529 }
530
531 char path_test[FILE_MAX];
532 STRNCPY(path_test, path_src);
533
534 BLI_path_rel(path_test, data->basedir);
535 if (!BLI_path_is_rel(path_test)) {
536 const char *type_name = BKE_idtype_get_info_from_id(bpath_data->owner_id)->name;
537 const char *id_name = bpath_data->owner_id->name + 2;
538 BKE_reportf(data->reports,
540 "Path '%s' cannot be made relative for %s '%s'",
541 path_src,
542 type_name,
543 id_name);
544 data->summary.count_failed++;
545 return false;
546 }
547
548 BLI_strncpy(path_dst, path_test, path_dst_maxncpy);
549 data->summary.count_changed++;
550 return true;
551}
552
554 char *path_dst,
555 size_t path_dst_maxncpy,
556 const char *path_src)
557{
559
560 data->summary.count_total++;
561
562 if (!BLI_path_is_rel(path_src)) {
563 return false; /* Already absolute. */
564 }
565
566 char path_test[FILE_MAX];
567 STRNCPY(path_test, path_src);
568 BLI_path_abs(path_test, data->basedir);
569 if (BLI_path_is_rel(path_test)) {
570 const char *type_name = BKE_idtype_get_info_from_id(bpath_data->owner_id)->name;
571 const char *id_name = bpath_data->owner_id->name + 2;
572 BKE_reportf(data->reports,
574 "Path '%s' cannot be made absolute for %s '%s'",
575 path_src,
576 type_name,
577 id_name);
578 data->summary.count_failed++;
579 return false;
580 }
581
582 BLI_strncpy(path_dst, path_test, path_dst_maxncpy);
583 data->summary.count_changed++;
584 return true;
585}
586
588 const char *basedir,
590 BPathForeachPathFunctionCallback callback_function,
591 BPathSummary *r_summary)
592{
593 BPathRemap_Data data = {nullptr};
595
596 BLI_assert(basedir[0] != '\0');
597 if (basedir[0] == '\0') {
598 CLOG_ERROR(&LOG, "basedir='', this is a bug");
599 return;
600 }
601
602 data.basedir = basedir;
603 data.reports = reports;
604
605 BPathForeachPathData path_data{};
606 path_data.bmain = bmain;
607 path_data.callback_function = callback_function;
608 path_data.flag = eBPathForeachFlag(flag);
609 path_data.user_data = &data;
610 BKE_bpath_foreach_path_main(&path_data);
611
612 if (r_summary) {
613 *r_summary = data.summary;
614 }
615}
616
618 const char *basedir,
620 BPathSummary *r_summary)
621{
623 bmain, basedir, reports, relative_convert_foreach_path_cb, r_summary);
624}
625
627 const char *basedir,
629 BPathSummary *r_summary)
630{
632 bmain, basedir, reports, absolute_convert_foreach_path_cb, r_summary);
633}
634
636
637/* -------------------------------------------------------------------- */
641
642struct PathStore {
645 char filepath[0];
646};
647
649 char * /*path_dst*/,
650 size_t /*path_dst_maxncpy*/,
651 const char *path_src)
652{
653 ListBase *path_list = static_cast<ListBase *>(bpath_data->user_data);
654 size_t path_size = strlen(path_src) + 1;
655
656 /* NOTE: the PathStore and its string are allocated together in a single alloc. */
657 PathStore *path_store = static_cast<PathStore *>(
658 MEM_mallocN(sizeof(PathStore) + path_size, __func__));
659
660 char *filepath = path_store->filepath;
661
662 memcpy(filepath, path_src, path_size);
663 BLI_addtail(path_list, path_store);
664 return false;
665}
666
668 char *path_dst,
669 size_t path_dst_maxncpy,
670 const char *path_src)
671{
672 ListBase *path_list = static_cast<ListBase *>(bpath_data->user_data);
673
674 /* `ls->first` should never be nullptr, because the number of paths should not change.
675 * If this happens, there is a bug in caller code. */
677
678 PathStore *path_store = static_cast<PathStore *>(path_list->first);
679 const char *filepath = path_store->filepath;
680 bool is_path_changed = false;
681
682 if (!STREQ(path_src, filepath)) {
683 BLI_strncpy(path_dst, filepath, path_dst_maxncpy);
684 is_path_changed = true;
685 }
686
687 BLI_freelinkN(path_list, path_store);
688 return is_path_changed;
689}
690
692{
693 ListBase *path_list = MEM_callocN<ListBase>(__func__);
694
695 BPathForeachPathData path_data{};
696 path_data.bmain = bmain;
698 path_data.flag = flag;
699 path_data.user_data = path_list;
700 BKE_bpath_foreach_path_main(&path_data);
701
702 return path_list;
703}
704
705void BKE_bpath_list_restore(Main *bmain, const eBPathForeachFlag flag, void *path_list_handle)
706{
707 ListBase *path_list = static_cast<ListBase *>(path_list_handle);
708
709 BPathForeachPathData path_data{};
710 path_data.bmain = bmain;
712 path_data.flag = flag;
713 path_data.user_data = path_list;
714 BKE_bpath_foreach_path_main(&path_data);
715}
716
717void BKE_bpath_list_free(void *path_list_handle)
718{
719 ListBase *path_list = static_cast<ListBase *>(path_list_handle);
720 /* The whole list should have been consumed by #BKE_bpath_list_restore, see also comment in
721 * #bpath_list_restore. */
723
724 BLI_freelistN(path_list);
725 MEM_freeN(path_list);
726}
727
bool(*)(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src) BPathForeachPathFunctionCallback
Definition BKE_bpath.hh:84
eBPathForeachFlag
Definition BKE_bpath.hh:27
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
Definition BKE_bpath.hh:47
@ BKE_BPATH_FOREACH_PATH_SKIP_LINKED
Definition BKE_bpath.hh:35
@ BKE_BPATH_FOREACH_PATH_ABSOLUTE
Definition BKE_bpath.hh:33
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
Definition BKE_bpath.hh:37
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
Definition BKE_bpath.hh:61
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
Definition BKE_bpath.hh:39
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
Definition BKE_bpath.hh:66
const IDTypeInfo * BKE_idtype_get_info_from_id(const ID *id)
Definition idtype.cc:147
#define FOREACH_MAIN_ID_END
Definition BKE_main.hh:563
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Definition BKE_main.hh:557
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:877
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert(a)
Definition BLI_assert.h:46
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:373
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct stat BLI_stat_t
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:270
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
Definition listbase.cc:497
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:111
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
#define BLI_path_ncmp
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define FILE_MAXFILE
#define FILE_MAX
int BLI_path_normalize(char *path) ATTR_NONNULL(1)
#define BLI_path_join(...)
#define FILENAME_IS_CURRPAR(_n)
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
#define FILE_MAXDIR
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
Definition string.cc:41
char * STRNCPY(char(&dst)[N], const char *src)
Definition BLI_string.h:688
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STREQ(a, b)
Compatibility-like things for windows.
struct __dirstream DIR
struct dirent * readdir(DIR *dp)
int closedir(DIR *dp)
#define S_ISDIR(x)
DIR * opendir(const char *path)
#define S_ISREG(x)
#define CLOG_ERROR(clg_ref,...)
Definition CLG_log.h:182
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:181
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_SOURCE
Definition DNA_ID.h:1051
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1026
Read Guarded memory(de)allocation.
ReportList * reports
Definition WM_types.hh:1025
BMesh const char void * data
static bool bpath_list_restore(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
Definition bpath.cc:667
static bool missing_files_find_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
Definition bpath.cc:361
static bool relative_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
Definition bpath.cc:518
bool BKE_bpath_foreach_path_dirfile_fixed_process(BPathForeachPathData *bpath_data, char *path_dir, size_t path_dir_maxncpy, char *path_file, size_t path_file_maxncpy)
Definition bpath.cc:156
static void bpath_absolute_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathForeachPathFunctionCallback callback_function, BPathSummary *r_summary)
Definition bpath.cc:587
#define MAX_DIR_RECURSE
Definition bpath.cc:276
void * BKE_bpath_list_backup(Main *bmain, const eBPathForeachFlag flag)
Definition bpath.cc:691
void BKE_bpath_summary_report(const BPathSummary &summary, ReportList *reports)
Definition bpath.cc:59
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path, size_t path_maxncpy)
Definition bpath.cc:125
void BKE_bpath_relative_rebase(Main *bmain, const char *basedir_src, const char *basedir_dst, ReportList *reports, BPathSummary *r_summary)
Definition bpath.cc:477
void BKE_bpath_list_restore(Main *bmain, const eBPathForeachFlag flag, void *path_list_handle)
Definition bpath.cc:705
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
Definition bpath.cc:75
void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary)
Definition bpath.cc:617
static bool absolute_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
Definition bpath.cc:553
static bool relative_rebase_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, size_t path_dst_maxncpy, const char *path_src)
Definition bpath.cc:445
void BKE_bpath_list_free(void *path_list_handle)
Definition bpath.cc:717
static bool check_missing_files_foreach_path_cb(BPathForeachPathData *bpath_data, char *, size_t, const char *path_src)
Definition bpath.cc:220
#define FILESIZE_INVALID_DIRECTORY
Definition bpath.cc:277
void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports)
Definition bpath.cc:255
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
Definition bpath.cc:187
static bool missing_files_find__recursive(const char *search_directory, const char *filename_src, char r_filepath_new[FILE_MAX], int64_t *r_filesize, int *r_recurse_depth)
Definition bpath.cc:294
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
Definition bpath.cc:116
static bool bpath_list_append(BPathForeachPathData *bpath_data, char *, size_t, const char *path_src)
Definition bpath.cc:648
void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports, BPathSummary *r_summary)
Definition bpath.cc:626
void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports, const bool find_all)
Definition bpath.cc:406
long long int int64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
std::string id_name(void *id)
#define ID_IS_LINKED(_id)
#define ID_BLEND_PATH(_bmain, _id)
#define LOG(severity)
Definition log.h:32
void * MEM_mallocN(size_t len, const char *str)
Definition mallocn.cc:128
void * MEM_callocN(size_t len, const char *str)
Definition mallocn.cc:118
void MEM_freeN(void *vmemh)
Definition mallocn.cc:113
bNodeTree * node_tree_from_id(ID *id)
Definition node.cc:4840
const char * searchdir
Definition bpath.cc:356
const char * basedir
Definition bpath.cc:355
ReportList * reports
Definition bpath.cc:357
bool find_all
Definition bpath.cc:358
const char * absolute_base_path
Definition BKE_bpath.hh:104
eBPathForeachFlag flag
Definition BKE_bpath.hh:94
BPathForeachPathFunctionCallback callback_function
Definition BKE_bpath.hh:93
BPathSummary summary
Definition bpath.cc:442
const char * basedir_dst
Definition bpath.cc:439
ReportList * reports
Definition bpath.cc:440
const char * basedir_src
Definition bpath.cc:438
BPathSummary summary
Definition bpath.cc:515
ReportList * reports
Definition bpath.cc:513
const char * basedir
Definition bpath.cc:512
const char * name
IDTypeForeachPathFunction foreach_path
Definition DNA_ID.h:404
struct Library * lib
Definition DNA_ID.h:410
char name[66]
Definition DNA_ID.h:415
struct LibraryWeakReference * library_weak_reference
Definition DNA_ID.h:491
char library_filepath[1024]
Definition DNA_ID.h:531
LibraryRuntimeHandle * runtime
Definition DNA_ID.h:516
void * first
PathStore * next
Definition bpath.cc:643
char filepath[0]
Definition bpath.cc:645
PathStore * prev
Definition bpath.cc:643
uint8_t flag
Definition wm_window.cc:139