Welcome to mirror list, hosted at ThFree Co, Russian Federation.

BLI_bpath.h « blenlib « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 34b9e28206124ed4e05948e2c0dc170dd48a94a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 *
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * 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
 * of the License, or (at your option) any later version.
 *
 * 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,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * 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
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/* Based on ghash, difference is ghash is not a fixed size,
 * so for BPath we dont need to malloc  */

#ifndef BLI_BPATH_H
#define BLI_BPATH_H

struct BPathIteratorSeqData {
	int totseq;
	int seq;
	struct Sequence **seqar; /* Sequence */
	struct Scene *scene;			/* Current scene */
};

struct BPathIterator {
	char*	path;
	char*	lib;
	char*	name;
	void*	data;
	int		len;
	int		type;
	
	void (*setpath_callback)(struct BPathIterator *, char *);
	void (*getpath_callback)(struct BPathIterator *, char *);
	
	char*	base_path; /* base path, the directry the blend file is in - normally G.main->name */

	/* only for seq data */
	struct BPathIteratorSeqData seqdata;
};

void			BLI_bpathIterator_init				(struct BPathIterator *bpi, char *base_path);
void			BLI_bpathIterator_free				(struct BPathIterator *bpi);
char*			BLI_bpathIterator_getLib			(struct BPathIterator *bpi);
char*			BLI_bpathIterator_getName			(struct BPathIterator *bpi);
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);
void			BLI_bpathIterator_setPath			(struct BPathIterator *bpi, char *path);

/* high level funcs */

/* creates a text file with missing files if there are any */
void checkMissingFiles(char *basepath, ReportList *reports);
void makeFilesRelative(char *basepath, ReportList *reports);
void makeFilesAbsolute(char *basepath, ReportList *reports);
void findMissingFiles(char *basepath, char *str);

#endif // BLI_BPATH_H