Blender  V2.59
Classes | Defines | Typedefs | Enumerations | Functions
bpath.c File Reference
#include <sys/stat.h>
#include <string.h>
#include <assert.h>
#include <dirent.h>
#include <unistd.h>
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
#include "DNA_scene_types.h"
#include "DNA_image_types.h"
#include "DNA_texture_types.h"
#include "DNA_text_types.h"
#include "DNA_sound_types.h"
#include "DNA_sequence_types.h"
#include "DNA_vfont_types.h"
#include "DNA_windowmanager_types.h"
#include "BLI_blenlib.h"
#include "BLI_bpath.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_sequencer.h"
#include "BKE_main.h"
#include "BKE_utildefines.h"
#include "BKE_report.h"

Go to the source code of this file.

Classes

struct  BPathIteratorSeqData
struct  BPathIterator

Defines

#define FILE_MAX   240
#define MAX_RECUR   16

Typedefs

typedef struct BPathIteratorSeqData BPathIteratorSeqData
typedef struct BPathIterator BPathIterator

Enumerations

enum  BPathTypes {
  BPATH_IMAGE = 0, BPATH_TEXTURE, BPATH_TEXT, BPATH_SOUND,
  BPATH_FONT, BPATH_LIB, BPATH_SEQ, BPATH_CDATA,
  BPATH_DONE
}

Functions

void BLI_bpathIterator_init (struct BPathIterator **bpi_pt, Main *bmain, const char *basedir, const int flag)
void BLI_bpathIterator_free (struct BPathIterator *bpi)
void BLI_bpathIterator_getPath (struct BPathIterator *bpi, char *path)
void BLI_bpathIterator_setPath (struct BPathIterator *bpi, const char *path)
void BLI_bpathIterator_getPathExpanded (struct BPathIterator *bpi, char *path_expanded)
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)
static struct Imageima_stepdata__internal (struct Image *ima, const int step_next, const int flag)
static struct Textex_stepdata__internal (struct Tex *tex, const int step_next, const int UNUSED(flag))
static struct Texttext_stepdata__internal (struct Text *text, const int step_next, const int UNUSED(flag))
static struct VFontvf_stepdata__internal (struct VFont *vf, const int step_next, const int flag)
static struct bSoundsnd_stepdata__internal (struct bSound *snd, int step_next, const int flag)
static struct Sequenceseq_stepdata__internal (struct BPathIterator *bpi, int step_next)
static void seq_getpath (struct BPathIterator *bpi, char *path)
static void seq_setpath (struct BPathIterator *bpi, const char *path)
static void text_getpath (struct BPathIterator *bpi, char *path)
static void text_setpath (struct BPathIterator *bpi, const char *path)
static struct Meshcdata_stepdata__internal (struct Mesh *me, int step_next)
static void bpi_type_step__internal (struct BPathIterator *bpi)
void BLI_bpathIterator_step (struct BPathIterator *bpi)
int BLI_bpathIterator_isDone (struct BPathIterator *bpi)
static void bpath_as_report (struct BPathIterator *bpi, const char *message, ReportList *reports)
void checkMissingFiles (Main *bmain, ReportList *reports)
void makeFilesRelative (Main *bmain, const char *basedir, ReportList *reports)
void makeFilesAbsolute (Main *bmain, const char *basedir, ReportList *reports)
static int findFileRecursive (char *filename_new, const char *dirname, const char *filename, int *filesize, int *recur_depth)
void findMissingFiles (Main *bmain, const char *str)

Detailed Description

Definition in file bpath.c.


Define Documentation

#define FILE_MAX   240
#define MAX_RECUR   16

Definition at line 838 of file bpath.c.

Referenced by findFileRecursive().


Typedef Documentation

typedef struct BPathIterator BPathIterator

Enumeration Type Documentation

enum BPathTypes
Enumerator:
BPATH_IMAGE 
BPATH_TEXTURE 
BPATH_TEXT 
BPATH_SOUND 
BPATH_FONT 
BPATH_LIB 
BPATH_SEQ 
BPATH_CDATA 
BPATH_DONE 

Definition at line 104 of file bpath.c.


Function Documentation

void BLI_bpathIterator_free ( struct BPathIterator bpi)
const char* BLI_bpathIterator_getBasePath ( struct BPathIterator bpi)

Definition at line 212 of file bpath.c.

References BPathIterator::base_path.

Referenced by bpy_blend_paths().

const char* BLI_bpathIterator_getLib ( struct BPathIterator bpi)
const char* BLI_bpathIterator_getName ( struct BPathIterator bpi)

Definition at line 200 of file bpath.c.

References BPathIterator::_name.

Referenced by bpath_as_report().

void BLI_bpathIterator_getPath ( struct BPathIterator bpi,
char *  path 
)
void BLI_bpathIterator_getPathExpanded ( struct BPathIterator bpi,
char *  path_expanded 
)
unsigned int BLI_bpathIterator_getPathMaxLen ( struct BPathIterator bpi)

Definition at line 208 of file bpath.c.

References BPathIterator::len.

Referenced by findMissingFiles(), makeFilesAbsolute(), and makeFilesRelative().

int BLI_bpathIterator_getType ( struct BPathIterator bpi)

Definition at line 204 of file bpath.c.

References BPathIterator::type.

Referenced by bpath_as_report().

void BLI_bpathIterator_init ( struct BPathIterator **  bpi_pt,
Main bmain,
const char *  basedir,
const int  flag 
)
int BLI_bpathIterator_isDone ( struct BPathIterator bpi)
void BLI_bpathIterator_setPath ( struct BPathIterator bpi,
const char *  path 
)
void BLI_bpathIterator_step ( struct BPathIterator bpi)
static void bpath_as_report ( struct BPathIterator bpi,
const char *  message,
ReportList reports 
) [static]
static void bpi_type_step__internal ( struct BPathIterator bpi) [static]
static struct Mesh* cdata_stepdata__internal ( struct Mesh me,
int  step_next 
) [static, read]

Definition at line 436 of file bpath.c.

References CustomData::external, Mesh::fdata, Mesh::id, ID::next, and NULL.

Referenced by BLI_bpathIterator_step().

void checkMissingFiles ( Main bmain,
ReportList reports 
)
static int findFileRecursive ( char *  filename_new,
const char *  dirname,
const char *  filename,
int *  filesize,
int *  recur_depth 
) [static]

Definition at line 839 of file bpath.c.

References BLI_join_dirfile(), BLI_strncpy(), FILE_MAX, MAX_RECUR, NULL, and size().

Referenced by findMissingFiles().

void findMissingFiles ( Main bmain,
const char *  str 
)
static struct Image* ima_stepdata__internal ( struct Image ima,
const int  step_next,
const int  flag 
) [static, read]
void makeFilesAbsolute ( Main bmain,
const char *  basedir,
ReportList reports 
)
void makeFilesRelative ( Main bmain,
const char *  basedir,
ReportList reports 
)
static void seq_getpath ( struct BPathIterator bpi,
char *  path 
) [static]
static void seq_setpath ( struct BPathIterator bpi,
const char *  path 
) [static]
static struct Sequence* seq_stepdata__internal ( struct BPathIterator bpi,
int  step_next 
) [static, read]
static struct bSound* snd_stepdata__internal ( struct bSound snd,
int  step_next,
const int  flag 
) [static, read]

Definition at line 293 of file bpath.c.

References BPATH_USE_PACKED, bSound::id, ID::next, NULL, and bSound::packedfile.

Referenced by BLI_bpathIterator_step().

static struct Tex* tex_stepdata__internal ( struct Tex tex,
const int  step_next,
const int   UNUSEDflag 
) [static, read]
static void text_getpath ( struct BPathIterator bpi,
char *  path 
) [static]

Definition at line 415 of file bpath.c.

References BPathIterator::data, and Text::name.

Referenced by bpi_type_step__internal().

static void text_setpath ( struct BPathIterator bpi,
const char *  path 
) [static]

Definition at line 424 of file bpath.c.

References BLI_strdup(), BPathIterator::data, if(), MEM_freeN(), Text::name, and NULL.

Referenced by bpi_type_step__internal().

static struct Text* text_stepdata__internal ( struct Text text,
const int  step_next,
const int   UNUSEDflag 
) [static, read]

Definition at line 255 of file bpath.c.

References Text::id, Text::name, ID::next, and NULL.

Referenced by BLI_bpathIterator_step().

static struct VFont* vf_stepdata__internal ( struct VFont vf,
const int  step_next,
const int  flag 
) [static, read]

Definition at line 272 of file bpath.c.

References BPATH_USE_PACKED, FO_BUILTIN_NAME, VFont::id, VFont::name, ID::next, NULL, and VFont::packedfile.

Referenced by BLI_bpathIterator_step().