| 
									
										
										
										
											2007-12-20 10:27:13 +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
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Based on ghash, difference is ghash is not a fixed size,
 | 
					
						
							|  |  |  |  * so for BPath we dont need to malloc  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | #ifndef BLI_BPATH_H
 | 
					
						
							|  |  |  | #define BLI_BPATH_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | struct BPathIteratorSeqData { | 
					
						
							|  |  |  | 	int totseq; | 
					
						
							|  |  |  | 	int seq; | 
					
						
							|  |  |  | 	struct Sequence **seqar; /* Sequence */ | 
					
						
							| 
									
										
										
										
											2008-04-27 20:43:25 +00:00
										 |  |  | 	struct Scene *scene;			/* Current scene */ | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | struct BPathIterator { | 
					
						
							|  |  |  | 	char*	path; | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | 	const char*	lib; | 
					
						
							|  |  |  | 	const char*	name; | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | 	void*	data; | 
					
						
							|  |  |  | 	int		len; | 
					
						
							|  |  |  | 	int		type; | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | 	 | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | 	void (*setpath_callback)(struct BPathIterator *, const char *); | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | 	void (*getpath_callback)(struct BPathIterator *, char *); | 
					
						
							|  |  |  | 	 | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | 	const char*	base_path; /* base path, the directry the blend file is in - normally G.main->name */ | 
					
						
							| 
									
										
										
										
											2010-01-08 17:50:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | 	/* only for seq data */ | 
					
						
							|  |  |  | 	struct BPathIteratorSeqData seqdata; | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | void			BLI_bpathIterator_init				(struct BPathIterator *bpi, const char *base_path); | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | void			BLI_bpathIterator_free				(struct BPathIterator *bpi); | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | const char*		BLI_bpathIterator_getLib			(struct BPathIterator *bpi); | 
					
						
							|  |  |  | const char*		BLI_bpathIterator_getName			(struct BPathIterator *bpi); | 
					
						
							| 
									
										
										
										
											2008-04-25 16:09:16 +00:00
										 |  |  | int				BLI_bpathIterator_getType			(struct BPathIterator *bpi); | 
					
						
							|  |  |  | int				BLI_bpathIterator_getPathMaxLen		(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); | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | void			BLI_bpathIterator_setPath			(struct BPathIterator *bpi, const char *path); | 
					
						
							| 
									
										
										
										
											2007-12-20 10:27:13 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* high level funcs */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* creates a text file with missing files if there are any */ | 
					
						
							| 
									
										
										
										
											2010-11-11 07:51:12 +00:00
										 |  |  | void checkMissingFiles(const char *basepath, ReportList *reports); | 
					
						
							|  |  |  | void makeFilesRelative(const char *basepath, ReportList *reports); | 
					
						
							|  |  |  | void makeFilesAbsolute(const char *basepath, ReportList *reports); | 
					
						
							|  |  |  | void findMissingFiles(const char *basepath, const char *str); | 
					
						
							| 
									
										
										
										
											2010-05-11 07:08:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #endif // BLI_BPATH_H
 |