~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/blenlib/BLI_bpath.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-07-23 08:54:18 UTC
  • mfrom: (14.2.16 sid)
  • mto: (14.2.19 sid)
  • mto: This revision was merged to the branch mainline in revision 42.
  • Revision ID: package-import@ubuntu.com-20120723085418-9foz30v6afaf5ffs
Tags: 2.63a-2
* debian/: Cycles support added (Closes: #658075)
  For now, this top feature has been enabled only
  on [any-amd64 any-i386] architectures because
  of OpenImageIO failing on all others
* debian/: scripts installation path changed
  from /usr/lib to /usr/share:
  + debian/patches/: patchset re-worked for path changing
  + debian/control: "Breaks" field added on yafaray-exporter

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 *
 
1
/*
3
2
 * ***** BEGIN GPL LICENSE BLOCK *****
4
3
 *
5
4
 * This program is free software; you can redistribute it and/or
26
25
 * ***** END GPL LICENSE BLOCK *****
27
26
 */
28
27
 
29
 
/* Based on ghash, difference is ghash is not a fixed size,
30
 
 * so for BPath we dont need to malloc  */
31
 
 
32
 
#ifndef BLI_BPATH_H
33
 
#define BLI_BPATH_H
34
 
 
35
 
struct BPathIteratorSeqData {
36
 
        int totseq;
37
 
        int seq;
38
 
        struct Sequence **seqar; /* Sequence */
39
 
        struct Scene *scene;                    /* Current scene */
40
 
};
41
 
 
42
 
struct BPathIterator {
43
 
        char*   path;
44
 
        char*   lib;
45
 
        char*   name;
46
 
        void*   data;
47
 
        int             len;
48
 
        int             type;
49
 
        
50
 
        void (*setpath_callback)(struct BPathIterator *, char *);
51
 
        void (*getpath_callback)(struct BPathIterator *, char *);
52
 
        
53
 
        char*   base_path; /* base path, the directry the blend file is in - normally G.sce */
54
 
 
55
 
        /* only for seq data */
56
 
        struct BPathIteratorSeqData seqdata;
57
 
};
58
 
 
59
 
void                    BLI_bpathIterator_init                          (struct BPathIterator *bpi, char *base_path);
60
 
void                    BLI_bpathIterator_free                          (struct BPathIterator *bpi);
61
 
char*                   BLI_bpathIterator_getLib                        (struct BPathIterator *bpi);
62
 
char*                   BLI_bpathIterator_getName                       (struct BPathIterator *bpi);
63
 
int                             BLI_bpathIterator_getType                       (struct BPathIterator *bpi);
64
 
int                             BLI_bpathIterator_getPathMaxLen         (struct BPathIterator *bpi);
65
 
void                    BLI_bpathIterator_step                          (struct BPathIterator *bpi);
66
 
int                             BLI_bpathIterator_isDone                        (struct BPathIterator *bpi);
67
 
void                    BLI_bpathIterator_getPath                       (struct BPathIterator *bpi, char *path);
68
 
void                    BLI_bpathIterator_getPathExpanded       (struct BPathIterator *bpi, char *path_expanded);
69
 
void                    BLI_bpathIterator_setPath                       (struct BPathIterator *bpi, char *path);
 
28
/** \file BLI_bpath.h
 
29
 *  \ingroup bli
 
30
 *  \attention Based on ghash, difference is ghash is not a fixed size,
 
31
 *   so for BPath we don't need to malloc
 
32
 */
 
33
 
 
34
#ifndef __BLI_BPATH_H__
 
35
#define __BLI_BPATH_H__
 
36
 
 
37
struct ID;
 
38
struct ListBase;
 
39
struct Main;
 
40
struct ReportList;
 
41
 
 
42
/* Function that does something with an ID's file path. Should return 1 if the
 
43
 * path has changed, and in that case, should write the result to pathOut. */
 
44
typedef int (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
 
45
/* Executes 'visit' for each path associated with 'id'. */
 
46
void bpath_traverse_id(struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata);
 
47
void bpath_traverse_id_list(struct Main *bmain, struct ListBase *lb, BPathVisitor visit_cb, const int flag, void *userdata);
 
48
void bpath_traverse_main(struct Main *bmain, BPathVisitor visit_cb, const int flag, void *userdata);
 
49
int bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src);
 
50
 
 
51
#define BPATH_TRAVERSE_ABS             (1<<0) /* convert paths to absolute */
 
52
#define BPATH_TRAVERSE_SKIP_LIBRARY    (1<<2) /* skip library paths */
 
53
#define BPATH_TRAVERSE_SKIP_PACKED     (1<<3) /* skip packed data */
 
54
#define BPATH_TRAVERSE_SKIP_MULTIFILE  (1<<4) /* skip paths where a single dir is used with an array of files, eg.
 
55
                                               * sequence strip images and pointcache. in this case only use the first
 
56
                                               * file, this is needed for directory manipulation functions which might
 
57
                                               * otherwise modify the same directory multiple times */
70
58
 
71
59
/* high level funcs */
72
60
 
73
61
/* creates a text file with missing files if there are any */
74
 
void checkMissingFiles(char *basepath, ReportList *reports);
75
 
void makeFilesRelative(char *basepath, ReportList *reports);
76
 
void makeFilesAbsolute(char *basepath, ReportList *reports);
77
 
void findMissingFiles(char *basepath, char *str);
 
62
void checkMissingFiles(struct Main *bmain, struct ReportList *reports);
 
63
void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportList *reports);
 
64
void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports);
 
65
void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports);
78
66
 
79
 
#endif // BLI_BPATH_H
 
67
#endif // __BLI_BPATH_H__