Blender  V3.3
bpath.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 /* TODO:
8  * currently there are some cases we don't support.
9  * - passing output paths to the visitor?, like render out.
10  * - passing sequence strips with many images.
11  * - passing directory paths - visitors don't know which path is a dir or a file.
12  */
13 
14 #include <sys/stat.h>
15 
16 #include <string.h>
17 
18 /* path/file handling stuff */
19 #ifndef WIN32
20 # include <dirent.h>
21 # include <unistd.h>
22 #else
23 # include "BLI_winstuff.h"
24 # include <io.h>
25 #endif
26 
27 #include "MEM_guardedalloc.h"
28 
29 #include "DNA_brush_types.h"
30 #include "DNA_cachefile_types.h"
31 #include "DNA_fluid_types.h"
32 #include "DNA_freestyle_types.h"
33 #include "DNA_image_types.h"
34 #include "DNA_material_types.h"
35 #include "DNA_mesh_types.h"
36 #include "DNA_modifier_types.h"
37 #include "DNA_movieclip_types.h"
38 #include "DNA_node_types.h"
40 #include "DNA_object_force_types.h"
41 #include "DNA_object_types.h"
42 #include "DNA_particle_types.h"
43 #include "DNA_pointcache_types.h"
44 #include "DNA_scene_types.h"
45 #include "DNA_sequence_types.h"
46 #include "DNA_sound_types.h"
47 #include "DNA_text_types.h"
48 #include "DNA_texture_types.h"
49 #include "DNA_vfont_types.h"
50 #include "DNA_volume_types.h"
51 
52 #include "BLI_blenlib.h"
53 #include "BLI_utildefines.h"
54 
55 #include "BKE_idtype.h"
56 #include "BKE_image.h"
57 #include "BKE_lib_id.h"
58 #include "BKE_library.h"
59 #include "BKE_main.h"
60 #include "BKE_node.h"
61 #include "BKE_report.h"
62 #include "BKE_vfont.h"
63 
64 #include "BKE_bpath.h" /* own include */
65 
66 #include "CLG_log.h"
67 
68 #include "SEQ_iterator.h"
69 
70 #ifndef _MSC_VER
71 # include "BLI_strict_flags.h"
72 #endif
73 
74 static CLG_LogRef LOG = {"bke.bpath"};
75 
76 /* -------------------------------------------------------------------- */
81 {
82  const eBPathForeachFlag flag = bpath_data->flag;
83  const char *absbase = (flag & BKE_BPATH_FOREACH_PATH_ABSOLUTE) ?
84  ID_BLEND_PATH(bpath_data->bmain, id) :
85  NULL;
86  bpath_data->absolute_base_path = absbase;
87 
89  return;
90  }
91 
92  if (id->library_weak_reference != NULL &&
95  }
96 
97  bNodeTree *embedded_node_tree = ntreeFromID(id);
98  if (embedded_node_tree != NULL) {
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 != NULL);
105  if (id_type == NULL || id_type->foreach_path == NULL) {
106  return;
107  }
108 
109  id_type->foreach_path(id, bpath_data);
110 }
111 
113 {
114  ID *id;
115  FOREACH_MAIN_ID_BEGIN (bpath_data->bmain, id) {
116  BKE_bpath_foreach_path_id(bpath_data, id);
117  }
119 }
120 
122 {
123  const char *absolute_base_path = bpath_data->absolute_base_path;
124 
125  char path_src_buf[FILE_MAX];
126  const char *path_src;
127  char path_dst[FILE_MAX];
128 
129  if (absolute_base_path) {
130  BLI_strncpy(path_src_buf, path, sizeof(path_src_buf));
131  BLI_path_abs(path_src_buf, absolute_base_path);
132  path_src = path_src_buf;
133  }
134  else {
135  path_src = path;
136  }
137 
138  /* so functions can check old value */
139  BLI_strncpy(path_dst, path, FILE_MAX);
140 
141  if (bpath_data->callback_function(bpath_data, path_dst, path_src)) {
142  BLI_strncpy(path, path_dst, FILE_MAX);
143  return true;
144  }
145 
146  return false;
147 }
148 
150  char *path_dir,
151  char *path_file)
152 {
153  const char *absolute_base_path = bpath_data->absolute_base_path;
154 
155  char path_src[FILE_MAX];
156  char path_dst[FILE_MAX];
157 
158  BLI_join_dirfile(path_src, sizeof(path_src), path_dir, path_file);
159 
160  /* So that functions can access the old value. */
161  BLI_strncpy(path_dst, path_src, FILE_MAX);
162 
163  if (absolute_base_path) {
164  BLI_path_abs(path_src, absolute_base_path);
165  }
166 
167  if (bpath_data->callback_function(bpath_data, path_dst, (const char *)path_src)) {
168  BLI_split_dirfile(path_dst, path_dir, path_file, FILE_MAXDIR, FILE_MAXFILE);
169  return true;
170  }
171 
172  return false;
173 }
174 
176 {
177  const char *absolute_base_path = bpath_data->absolute_base_path;
178 
179  char path_src_buf[FILE_MAX];
180  const char *path_src;
181  char path_dst[FILE_MAX];
182 
183  if (absolute_base_path) {
184  BLI_strncpy(path_src_buf, *path, sizeof(path_src_buf));
185  BLI_path_abs(path_src_buf, absolute_base_path);
186  path_src = path_src_buf;
187  }
188  else {
189  path_src = *path;
190  }
191 
192  if (bpath_data->callback_function(bpath_data, path_dst, path_src)) {
193  MEM_freeN(*path);
194  (*path) = BLI_strdup(path_dst);
195  return true;
196  }
197 
198  return false;
199 }
200 
203 /* -------------------------------------------------------------------- */
208  char *UNUSED(path_dst),
209  const char *path_src)
210 {
211  ReportList *reports = (ReportList *)bpath_data->user_data;
212 
213  if (!BLI_exists(path_src)) {
214  BKE_reportf(reports, RPT_WARNING, "Path '%s' not found", path_src);
215  }
216 
217  return false;
218 }
219 
221 {
223  .bmain = bmain,
224  .callback_function = check_missing_files_foreach_path_cb,
227  .user_data = reports});
228 }
229 
232 /* -------------------------------------------------------------------- */
236 #define MAX_DIR_RECURSE 16
237 #define FILESIZE_INVALID_DIRECTORY -1
238 
253 static bool missing_files_find__recursive(const char *search_directory,
254  const char *filename_src,
255  char r_filename_new[FILE_MAX],
256  int64_t *r_filesize,
257  int *r_recurse_depth)
258 {
259  /* TODO: Move this function to BLI_path_utils? The 'biggest size' behavior is quite specific
260  * though... */
261  DIR *dir;
262  BLI_stat_t status;
263  char path[FILE_MAX];
264  int64_t size;
265  bool found = false;
266 
267  dir = opendir(search_directory);
268 
269  if (dir == NULL) {
270  return found;
271  }
272 
273  if (*r_filesize == FILESIZE_INVALID_DIRECTORY) {
274  *r_filesize = 0; /* The directory opened fine. */
275  }
276 
277  for (struct dirent *de = readdir(dir); de != NULL; de = readdir(dir)) {
278  if (FILENAME_IS_CURRPAR(de->d_name)) {
279  continue;
280  }
281 
282  BLI_join_dirfile(path, sizeof(path), search_directory, de->d_name);
283 
284  if (BLI_stat(path, &status) == -1) {
285  CLOG_WARN(&LOG, "Cannot get file status (`stat()`) of '%s'", path);
286  continue;
287  }
288 
289  if (S_ISREG(status.st_mode)) { /* It is a file. */
290  if (BLI_path_ncmp(filename_src, de->d_name, FILE_MAX) == 0) { /* Names match. */
291  size = status.st_size;
292  if ((size > 0) && (size > *r_filesize)) { /* Find the biggest matching file. */
293  *r_filesize = size;
294  BLI_strncpy(r_filename_new, path, FILE_MAX);
295  found = true;
296  }
297  }
298  }
299  else if (S_ISDIR(status.st_mode)) { /* It is a sub-directory. */
300  if (*r_recurse_depth <= MAX_DIR_RECURSE) {
301  (*r_recurse_depth)++;
303  path, filename_src, r_filename_new, r_filesize, r_recurse_depth);
304  (*r_recurse_depth)--;
305  }
306  }
307  }
308 
309  closedir(dir);
310  return found;
311 }
312 
313 typedef struct BPathFind_Data {
314  const char *basedir;
315  const char *searchdir;
317  bool find_all; /* Also search for files which current path is still valid. */
319 
321  char *path_dst,
322  const char *path_src)
323 {
324  BPathFind_Data *data = (BPathFind_Data *)bpath_data->user_data;
325  char filename_new[FILE_MAX];
326 
328  int recurse_depth = 0;
329  bool is_found;
330 
331  if (!data->find_all && BLI_exists(path_src)) {
332  return false;
333  }
334 
335  filename_new[0] = '\0';
336 
338  data->searchdir, BLI_path_basename(path_src), filename_new, &filesize, &recurse_depth);
339 
340  if (filesize == FILESIZE_INVALID_DIRECTORY) {
341  BKE_reportf(data->reports,
342  RPT_WARNING,
343  "Could not open the directory '%s'",
344  BLI_path_basename(data->searchdir));
345  return false;
346  }
347  if (is_found == false) {
348  BKE_reportf(data->reports,
349  RPT_WARNING,
350  "Could not find '%s' in '%s'",
351  BLI_path_basename(path_src),
352  data->searchdir);
353  return false;
354  }
355 
356  bool was_relative = BLI_path_is_rel(path_dst);
357 
358  BLI_strncpy(path_dst, filename_new, FILE_MAX);
359 
360  /* Keep the path relative if the previous one was relative. */
361  if (was_relative) {
362  BLI_path_rel(path_dst, data->basedir);
363  }
364 
365  return true;
366 }
367 
369  const char *searchpath,
370  ReportList *reports,
371  const bool find_all)
372 {
373  struct BPathFind_Data data = {NULL};
376 
377  data.basedir = BKE_main_blendfile_path(bmain);
378  data.reports = reports;
379  data.searchdir = searchpath;
380  data.find_all = find_all;
381 
383  &(BPathForeachPathData){.bmain = bmain,
384  .callback_function = missing_files_find_foreach_path_cb,
385  .flag = flag,
386  .user_data = &data});
387 }
388 
389 #undef MAX_DIR_RECURSE
390 #undef FILESIZE_INVALID_DIRECTORY
391 
394 /* -------------------------------------------------------------------- */
398 typedef struct BPathRebase_Data {
399  const char *basedir_src;
400  const char *basedir_dst;
402 
407 
409  char *path_dst,
410  const char *path_src)
411 {
413 
414  data->count_tot++;
415 
416  if (!BLI_path_is_rel(path_src)) {
417  /* Absolute, leave this as-is. */
418  return false;
419  }
420 
421  char filepath[(FILE_MAXDIR * 2) + FILE_MAXFILE];
422  BLI_strncpy(filepath, path_src, FILE_MAX);
423  if (!BLI_path_abs(filepath, data->basedir_src)) {
424  BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made absolute", path_src);
425  data->count_failed++;
426  return false;
427  }
428 
429  BLI_path_normalize(NULL, filepath);
430 
431  /* This may fail, if so it's fine to leave absolute since the path is still valid. */
432  BLI_path_rel(filepath, data->basedir_dst);
433 
434  BLI_strncpy(path_dst, filepath, FILE_MAX);
435  data->count_changed++;
436  return true;
437 }
438 
440  const char *basedir_src,
441  const char *basedir_dst,
442  ReportList *reports)
443 {
446 
447  BLI_assert(basedir_src[0] != '\0');
448  BLI_assert(basedir_dst[0] != '\0');
449 
450  data.basedir_src = basedir_src;
451  data.basedir_dst = basedir_dst;
452  data.reports = reports;
453 
455  &(BPathForeachPathData){.bmain = bmain,
456  .callback_function = relative_rebase_foreach_path_cb,
457  .flag = flag,
458  .user_data = &data});
459 
460  BKE_reportf(reports,
461  data.count_failed ? RPT_WARNING : RPT_INFO,
462  "Total files %d | Changed %d | Failed %d",
463  data.count_tot,
464  data.count_changed,
465  data.count_failed);
466 }
467 
470 /* -------------------------------------------------------------------- */
474 typedef struct BPathRemap_Data {
475  const char *basedir;
477 
482 
484  char *path_dst,
485  const char *path_src)
486 {
487  BPathRemap_Data *data = (BPathRemap_Data *)bpath_data->user_data;
488 
489  data->count_tot++;
490 
491  if (BLI_path_is_rel(path_src)) {
492  return false; /* Already relative. */
493  }
494 
495  BLI_strncpy(path_dst, path_src, FILE_MAX);
496  BLI_path_rel(path_dst, data->basedir);
497  if (BLI_path_is_rel(path_dst)) {
498  data->count_changed++;
499  }
500  else {
501  BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made relative", path_src);
502  data->count_failed++;
503  }
504  return true;
505 }
506 
508  char *path_dst,
509  const char *path_src)
510 {
511  BPathRemap_Data *data = (BPathRemap_Data *)bpath_data->user_data;
512 
513  data->count_tot++;
514 
515  if (!BLI_path_is_rel(path_src)) {
516  return false; /* Already absolute. */
517  }
518 
519  BLI_strncpy(path_dst, path_src, FILENAME_MAX);
520  BLI_path_abs(path_dst, data->basedir);
521  if (BLI_path_is_rel(path_dst) == false) {
522  data->count_changed++;
523  }
524  else {
525  BKE_reportf(data->reports, RPT_WARNING, "Path '%s' cannot be made absolute", path_src);
526  data->count_failed++;
527  }
528  return true;
529 }
530 
532  const char *basedir,
533  ReportList *reports,
534  BPathForeachPathFunctionCallback callback_function)
535 {
537  const int flag = BKE_BPATH_FOREACH_PATH_SKIP_LINKED;
538 
539  BLI_assert(basedir[0] != '\0');
540  if (basedir[0] == '\0') {
541  CLOG_ERROR(&LOG, "basedir='', this is a bug");
542  return;
543  }
544 
545  data.basedir = basedir;
546  data.reports = reports;
547 
549  .bmain = bmain, .callback_function = callback_function, .flag = flag, .user_data = &data});
550 
551  BKE_reportf(reports,
552  data.count_failed ? RPT_WARNING : RPT_INFO,
553  "Total files %d | Changed %d | Failed %d",
554  data.count_tot,
555  data.count_changed,
556  data.count_failed);
557 }
558 
559 void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports)
560 {
562 }
563 
564 void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports)
565 {
567 }
568 
571 /* -------------------------------------------------------------------- */
576 struct PathStore {
577  struct PathStore *next, *prev;
578 };
579 
580 static bool bpath_list_append(BPathForeachPathData *bpath_data,
581  char *UNUSED(path_dst),
582  const char *path_src)
583 {
584  ListBase *path_list = bpath_data->user_data;
585  size_t path_size = strlen(path_src) + 1;
586 
587  /* NOTE: the PathStore and its string are allocated together in a single alloc. */
588  struct PathStore *path_store = MEM_mallocN(sizeof(struct PathStore) + path_size, __func__);
589  char *filepath = (char *)(path_store + 1);
590 
591  BLI_strncpy(filepath, path_src, path_size);
592  BLI_addtail(path_list, path_store);
593  return false;
594 }
595 
596 static bool bpath_list_restore(BPathForeachPathData *bpath_data,
597  char *path_dst,
598  const char *path_src)
599 {
600  ListBase *path_list = bpath_data->user_data;
601 
602  /* `ls->first` should never be NULL, because the number of paths should not change.
603  * If this happens, there is a bug in caller code. */
604  BLI_assert(!BLI_listbase_is_empty(path_list));
605 
606  struct PathStore *path_store = path_list->first;
607  const char *filepath = (char *)(path_store + 1);
608  bool is_path_changed = false;
609 
610  if (!STREQ(path_src, filepath)) {
611  BLI_strncpy(path_dst, filepath, FILE_MAX);
612  is_path_changed = true;
613  }
614 
615  BLI_freelinkN(path_list, path_store);
616  return is_path_changed;
617 }
618 
620 {
621  ListBase *path_list = MEM_callocN(sizeof(ListBase), __func__);
622 
624  .callback_function = bpath_list_append,
625  .flag = flag,
626  .user_data = path_list});
627 
628  return path_list;
629 }
630 
631 void BKE_bpath_list_restore(Main *bmain, const eBPathForeachFlag flag, void *path_list_handle)
632 {
633  ListBase *path_list = path_list_handle;
634 
636  .callback_function = bpath_list_restore,
637  .flag = flag,
638  .user_data = path_list});
639 }
640 
641 void BKE_bpath_list_free(void *path_list_handle)
642 {
643  ListBase *path_list = path_list_handle;
644  /* The whole list should have been consumed by #BKE_bpath_list_restore, see also comment in
645  * #bpath_list_restore. */
646  BLI_assert(BLI_listbase_is_empty(path_list));
647 
648  BLI_freelistN(path_list);
649  MEM_freeN(path_list);
650 }
651 
bool(* BPathForeachPathFunctionCallback)(struct BPathForeachPathData *bpath_data, char *r_path_dst, const char *path_src)
Definition: BKE_bpath.h:69
eBPathForeachFlag
Definition: BKE_bpath.h:27
@ BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES
Definition: BKE_bpath.h:45
@ BKE_BPATH_FOREACH_PATH_SKIP_LINKED
Definition: BKE_bpath.h:35
@ BKE_BPATH_FOREACH_PATH_ABSOLUTE
Definition: BKE_bpath.h:33
@ BKE_BPATH_FOREACH_PATH_SKIP_PACKED
Definition: BKE_bpath.h:37
@ BKE_BPATH_FOREACH_PATH_SKIP_MULTIFILE
Definition: BKE_bpath.h:55
@ BKE_BPATH_FOREACH_PATH_RESOLVE_TOKEN
Definition: BKE_bpath.h:39
@ BKE_BPATH_FOREACH_PATH_RELOAD_EDITED
Definition: BKE_bpath.h:58
const struct IDTypeInfo * BKE_idtype_get_info_from_id(const struct ID *id)
#define FOREACH_MAIN_ID_END
Definition: BKE_main.h:367
const char * BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL()
#define FOREACH_MAIN_ID_BEGIN(_bmain, _id)
Definition: BKE_main.h:361
struct bNodeTree * ntreeFromID(struct ID *id)
Definition: node.cc:3231
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert(a)
Definition: BLI_assert.h:46
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: storage.c:314
int BLI_stat(const char *path, BLI_stat_t *buffer) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
struct stat BLI_stat_t
Definition: BLI_fileops.h:73
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:239
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1653
#define BLI_path_ncmp
bool BLI_path_is_rel(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:347
#define FILE_MAXFILE
void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen)
Definition: path_util.c:1465
#define FILE_MAX
void BLI_path_normalize(const char *relabase, char *path) ATTR_NONNULL(2)
Definition: path_util.c:131
#define FILENAME_IS_CURRPAR(_n)
void BLI_path_rel(char *file, const char *relfile) ATTR_NONNULL()
Definition: path_util.c:450
#define FILE_MAXDIR
bool BLI_path_abs(char *path, const char *basepath) ATTR_NONNULL()
Definition: path_util.c:897
void BLI_join_dirfile(char *__restrict dst, size_t maxlen, const char *__restrict dir, const char *__restrict file) ATTR_NONNULL()
Definition: path_util.c:1531
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
#define UNUSED(x)
#define STREQ(a, b)
Compatibility-like things for windows.
struct __dirstream DIR
Definition: BLI_winstuff.h:84
int closedir(DIR *dp)
#define S_ISDIR(x)
Definition: BLI_winstuff.h:48
#define S_ISREG(x)
Definition: BLI_winstuff.h:45
struct dirent * readdir(DIR *dp)
DIR * opendir(const char *path)
#define CLOG_ERROR(clg_ref,...)
Definition: CLG_log.h:190
#define CLOG_WARN(clg_ref,...)
Definition: CLG_log.h:189
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:566
#define ID_BLEND_PATH(_bmain, _id)
Definition: DNA_ID.h:559
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
void BKE_bpath_relative_rebase(Main *bmain, const char *basedir_src, const char *basedir_dst, ReportList *reports)
Definition: bpath.c:439
void BKE_bpath_relative_convert(Main *bmain, const char *basedir, ReportList *reports)
Definition: bpath.c:559
static bool missing_files_find_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
Definition: bpath.c:320
static bool absolute_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
Definition: bpath.c:507
#define MAX_DIR_RECURSE
Definition: bpath.c:236
bool BKE_bpath_foreach_path_fixed_process(BPathForeachPathData *bpath_data, char *path)
Definition: bpath.c:121
static bool relative_rebase_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
Definition: bpath.c:408
bool BKE_bpath_foreach_path_dirfile_fixed_process(BPathForeachPathData *bpath_data, char *path_dir, char *path_file)
Definition: bpath.c:149
static bool check_missing_files_foreach_path_cb(BPathForeachPathData *bpath_data, char *UNUSED(path_dst), const char *path_src)
Definition: bpath.c:207
void BKE_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *reports)
Definition: bpath.c:564
void * BKE_bpath_list_backup(Main *bmain, const eBPathForeachFlag flag)
Definition: bpath.c:619
struct BPathRemap_Data BPathRemap_Data
void BKE_bpath_list_restore(Main *bmain, const eBPathForeachFlag flag, void *path_list_handle)
Definition: bpath.c:631
static bool bpath_list_append(BPathForeachPathData *bpath_data, char *UNUSED(path_dst), const char *path_src)
Definition: bpath.c:580
static bool bpath_list_restore(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
Definition: bpath.c:596
void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id)
Definition: bpath.c:80
struct BPathRebase_Data BPathRebase_Data
static bool missing_files_find__recursive(const char *search_directory, const char *filename_src, char r_filename_new[FILE_MAX], int64_t *r_filesize, int *r_recurse_depth)
Definition: bpath.c:253
static void bpath_absolute_relative_convert(Main *bmain, const char *basedir, ReportList *reports, BPathForeachPathFunctionCallback callback_function)
Definition: bpath.c:531
static CLG_LogRef LOG
Definition: bpath.c:74
static bool relative_convert_foreach_path_cb(BPathForeachPathData *bpath_data, char *path_dst, const char *path_src)
Definition: bpath.c:483
void BKE_bpath_list_free(void *path_list_handle)
Definition: bpath.c:641
struct BPathFind_Data BPathFind_Data
#define FILESIZE_INVALID_DIRECTORY
Definition: bpath.c:237
void BKE_bpath_missing_files_check(Main *bmain, ReportList *reports)
Definition: bpath.c:220
bool BKE_bpath_foreach_path_allocated_process(BPathForeachPathData *bpath_data, char **path)
Definition: bpath.c:175
void BKE_bpath_foreach_path_main(BPathForeachPathData *bpath_data)
Definition: bpath.c:112
void BKE_bpath_missing_files_find(Main *bmain, const char *searchpath, ReportList *reports, const bool find_all)
Definition: bpath.c:368
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
__int64 int64_t
Definition: stdint.h:89
const char * searchdir
Definition: bpath.c:315
const char * basedir
Definition: bpath.c:314
ReportList * reports
Definition: bpath.c:316
bool find_all
Definition: bpath.c:317
const char * absolute_base_path
Definition: BKE_bpath.h:86
eBPathForeachFlag flag
Definition: BKE_bpath.h:78
struct Main * bmain
Definition: BKE_bpath.h:75
BPathForeachPathFunctionCallback callback_function
Definition: BKE_bpath.h:77
int count_changed
Definition: bpath.c:404
const char * basedir_dst
Definition: bpath.c:400
ReportList * reports
Definition: bpath.c:401
int count_failed
Definition: bpath.c:405
const char * basedir_src
Definition: bpath.c:399
int count_failed
Definition: bpath.c:480
ReportList * reports
Definition: bpath.c:476
int count_tot
Definition: bpath.c:478
const char * basedir
Definition: bpath.c:475
int count_changed
Definition: bpath.c:479
IDTypeForeachPathFunction foreach_path
Definition: BKE_idtype.h:184
Definition: DNA_ID.h:368
struct LibraryWeakReference * library_weak_reference
Definition: DNA_ID.h:443
char library_filepath[1024]
Definition: DNA_ID.h:507
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
struct PathStore * next
Definition: bpath.c:577
struct PathStore * prev
Definition: bpath.c:577