diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-27 05:25:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-27 05:25:07 +0400 |
commit | cd852ce1a199da11f119394ea719f9699c76c995 (patch) | |
tree | 4c23079e83b758bce8ffb9a3c4bb030d3c5d3fbf /source/blender/blenlib/BLI_bpath.h | |
parent | 4772b72951513d6554a79b94d401414265698daf (diff) |
- remove bpath iterator and replace all uses with visitor.
- added flag to optionally receive all paths as absolute.
Diffstat (limited to 'source/blender/blenlib/BLI_bpath.h')
-rw-r--r-- | source/blender/blenlib/BLI_bpath.h | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h index 478fe0a4c59..6a167d6b284 100644 --- a/source/blender/blenlib/BLI_bpath.h +++ b/source/blender/blenlib/BLI_bpath.h @@ -34,38 +34,28 @@ #ifndef BLI_BPATH_H #define BLI_BPATH_H -struct BPathIterator; struct ReportList; struct Main; struct ID; -void BLI_bpathIterator_init (struct BPathIterator **bpi, struct Main *bmain, const char *basedir, const int flag); -void BLI_bpathIterator_free (struct BPathIterator *bpi); -const char* BLI_bpathIterator_getLib (struct BPathIterator *bpi); -const char* BLI_bpathIterator_getName (struct BPathIterator *bpi); -int BLI_bpathIterator_getType (struct BPathIterator *bpi); -unsigned int BLI_bpathIterator_getPathMaxLen (struct BPathIterator *bpi); -const char* BLI_bpathIterator_getBasePath (struct BPathIterator *bpi); -void BLI_bpathIterator_step (struct BPathIterator *bpi); -int BLI_bpathIterator_isDone (struct BPathIterator *bpi); -void BLI_bpathIterator_getPath (struct BPathIterator *bpi, char *path); -void BLI_bpathIterator_getPathExpanded (struct BPathIterator *bpi, char *path_expanded); -void BLI_bpathIterator_setPath (struct BPathIterator *bpi, const char *path); - /* Function that does something with an ID's file path. Should return 1 if the path has changed, and in that case, should write the result to pathOut. */ typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src); /* Executes 'visit' for each path associated with 'id'. */ -void bpath_traverse_id(struct ID *id, BPathVisitor visit, void *userdata); +void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, int flag, void *userdata); +void bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, int flag, void *userdata); +void bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, int flag, void *userdata); int bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); +#define BPATH_TRAVERSE_ABS 1 /* convert paths to absolute */ + /* high level funcs */ /* creates a text file with missing files if there are any */ void checkMissingFiles(struct Main *bmain, struct ReportList *reports); void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportList *reports); void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports); -void findMissingFiles(struct Main *bmain, const char *str); +void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports); #define BPATH_USE_PACKED 1 |