| 
									
										
										
										
											2011-02-18 13:58:08 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2008-04-16 22:40:48 +00:00
										 |  |  |  * ***** BEGIN GPL LICENSE BLOCK ***** | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							| 
									
										
										
										
											2008-04-16 22:40:48 +00:00
										 |  |  |  * of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							| 
									
										
										
										
											2010-02-12 13:34:04 +00:00
										 |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. | 
					
						
							|  |  |  |  * All rights reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * The Original Code is: all of this file. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): Campbell Barton | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2008-04-16 22:40:48 +00:00
										 |  |  |  * ***** END GPL LICENSE BLOCK ***** | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-02-18 13:58:08 +00:00
										 |  |  | /** \file BLI_bpath.h
 | 
					
						
							|  |  |  |  *  \ingroup bli | 
					
						
							|  |  |  |  *  \attention Based on ghash, difference is ghash is not a fixed size, | 
					
						
							|  |  |  |  *   so for BPath we dont need to malloc | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-17 18:59:41 +00:00
										 |  |  | #ifndef __BLI_BPATH_H__
 | 
					
						
							|  |  |  | #define __BLI_BPATH_H__
 | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-23 17:52:20 +00:00
										 |  |  | struct ID; | 
					
						
							| 
									
										
										
										
											2011-10-27 05:34:39 +00:00
										 |  |  | struct ListBase; | 
					
						
							|  |  |  | struct Main; | 
					
						
							|  |  |  | struct ReportList; | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-23 17:52:20 +00:00
										 |  |  | /* Function that does something with an ID's file path. Should return 1 if the
 | 
					
						
							| 
									
										
										
										
											2012-03-03 20:19:11 +00:00
										 |  |  |  * path has changed, and in that case, should write the result to pathOut. */ | 
					
						
							| 
									
										
										
										
											2011-10-26 21:22:35 +00:00
										 |  |  | typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src); | 
					
						
							| 
									
										
										
										
											2011-10-23 17:52:20 +00:00
										 |  |  | /* Executes 'visit' for each path associated with 'id'. */ | 
					
						
							| 
									
										
										
										
											2011-10-27 03:40:12 +00:00
										 |  |  | void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata); | 
					
						
							|  |  |  | void bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *userdata); | 
					
						
							|  |  |  | void bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata); | 
					
						
							| 
									
										
										
										
											2011-10-26 21:22:35 +00:00
										 |  |  | int bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); | 
					
						
							| 
									
										
										
										
											2011-10-23 17:52:20 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-01 06:26:55 +00:00
										 |  |  | #define BPATH_TRAVERSE_ABS             (1<<0) /* convert paths to absolute */
 | 
					
						
							|  |  |  | #define BPATH_TRAVERSE_SKIP_LIBRARY    (1<<2) /* skip library paths */
 | 
					
						
							|  |  |  | #define BPATH_TRAVERSE_SKIP_PACKED     (1<<3) /* skip packed data */
 | 
					
						
							|  |  |  | #define BPATH_TRAVERSE_SKIP_MULTIFILE  (1<<4) /* skip paths where a single dir is used with an array of files, eg.
 | 
					
						
							|  |  |  |                                                * sequence strip images and pointcache. in this case only use the first | 
					
						
							|  |  |  |                                                * file, this is needed for directory manipulation functions which might | 
					
						
							|  |  |  |                                                * otherwise modify the same directory multiple times */ | 
					
						
							| 
									
										
										
										
											2011-10-27 01:25:07 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | /* high level funcs */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* creates a text file with missing files if there are any */ | 
					
						
							| 
									
										
										
										
											2010-12-06 00:52:30 +00:00
										 |  |  | 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); | 
					
						
							| 
									
										
										
										
											2011-10-27 01:25:07 +00:00
										 |  |  | void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports); | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-02-17 18:59:41 +00:00
										 |  |  | #endif // __BLI_BPATH_H__
 |