Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

customdata_file.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_customdata_file.h"
#include "BKE_global.h"

Go to the source code of this file.

Classes

struct  CDataFileHeader
struct  CDataFileImageHeader
struct  CDataFileMeshHeader
struct  CDataFileLayer
struct  CDataFile

Defines

#define CDF_ENDIAN_LITTLE   0
#define CDF_ENDIAN_BIG   1
#define CDF_DATA_FLOAT   0
#define CDF_VERSION   0
#define CDF_SUBVERSION   0
#define CDF_TILE_SIZE   64

Typedefs

typedef struct CDataFileHeader CDataFileHeader
typedef struct CDataFileImageHeader CDataFileImageHeader
typedef struct CDataFileMeshHeader CDataFileMeshHeader

Functions

static int cdf_endian (void)
CDataFilecdf_create (int type)
void cdf_free (CDataFile *cdf)
static int cdf_read_header (CDataFile *cdf)
static int cdf_write_header (CDataFile *cdf)
int cdf_read_open (CDataFile *cdf, const char *filename)
int cdf_read_layer (CDataFile *cdf, CDataFileLayer *blay)
int cdf_read_data (CDataFile *cdf, unsigned int size, void *data)
void cdf_read_close (CDataFile *cdf)
int cdf_write_open (CDataFile *cdf, const char *filename)
int cdf_write_layer (CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay))
int cdf_write_data (CDataFile *cdf, unsigned int size, void *data)
void cdf_write_close (CDataFile *cdf)
void cdf_remove (const char *filename)
CDataFileLayercdf_layer_find (CDataFile *cdf, int type, const char *name)
CDataFileLayercdf_layer_add (CDataFile *cdf, int type, const char *name, size_t datasize)

Detailed Description

Definition in file customdata_file.c.


Define Documentation

#define CDF_DATA_FLOAT   0

Definition at line 45 of file customdata_file.c.

Referenced by cdf_layer_add(), and cdf_read_header().

#define CDF_ENDIAN_BIG   1

Definition at line 43 of file customdata_file.c.

Referenced by cdf_endian().

#define CDF_ENDIAN_LITTLE   0

Definition at line 42 of file customdata_file.c.

Referenced by cdf_endian().

#define CDF_SUBVERSION   0

Definition at line 81 of file customdata_file.c.

Referenced by cdf_write_open().

#define CDF_TILE_SIZE   64

Definition at line 82 of file customdata_file.c.

Referenced by cdf_write_open().

#define CDF_VERSION   0

Definition at line 80 of file customdata_file.c.

Referenced by cdf_read_header(), and cdf_write_open().


Typedef Documentation


Function Documentation

CDataFile* cdf_create ( int  type)

Definition at line 120 of file customdata_file.c.

References MEM_callocN(), and CDataFile::type.

Referenced by CustomData_external_read(), and CustomData_external_write().

static int cdf_endian ( void  ) [static]

Definition at line 104 of file customdata_file.c.

References CDF_ENDIAN_BIG, CDF_ENDIAN_LITTLE, ENDIAN_ORDER, and L_ENDIAN.

Referenced by cdf_read_header(), and cdf_write_open().

void cdf_free ( CDataFile cdf)
CDataFileLayer* cdf_layer_add ( CDataFile cdf,
int  type,
const char *  name,
size_t  datasize 
)
CDataFileLayer* cdf_layer_find ( CDataFile cdf,
int  type,
const char *  name 
)
void cdf_read_close ( CDataFile cdf)

Definition at line 336 of file customdata_file.c.

References NULL, and CDataFile::readf.

Referenced by cdf_free(), cdf_read_open(), and CustomData_external_read().

int cdf_read_data ( CDataFile cdf,
unsigned int  size,
void *  data 
)

Definition at line 316 of file customdata_file.c.

References data, CDataFile::readf, SWITCH_INT, and CDataFile::switchendian.

Referenced by layerRead_mdisps().

static int cdf_read_header ( CDataFile cdf) [static]
int cdf_read_layer ( CDataFile cdf,
CDataFileLayer blay 
)
int cdf_read_open ( CDataFile cdf,
const char *  filename 
)
void cdf_remove ( const char *  filename)

Definition at line 408 of file customdata_file.c.

References BLI_delete().

Referenced by CustomData_external_remove().

void cdf_write_close ( CDataFile cdf)

Definition at line 400 of file customdata_file.c.

References NULL, and CDataFile::writef.

Referenced by cdf_free(), and CustomData_external_write().

int cdf_write_data ( CDataFile cdf,
unsigned int  size,
void *  data 
)

Definition at line 391 of file customdata_file.c.

References CDataFile::writef.

Referenced by layerWrite_mdisps().

static int cdf_write_header ( CDataFile cdf) [static]
int cdf_write_layer ( CDataFile UNUSEDcdf,
CDataFileLayer UNUSEDblay 
)

Definition at line 386 of file customdata_file.c.

int cdf_write_open ( CDataFile cdf,
const char *  filename 
)