Blender  V3.3
Classes | Macros | Typedefs | Functions
customdata_file.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_endian_defines.h"
#include "BLI_endian_switch.h"
#include "BLI_fileops.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "BKE_customdata_file.h"

Go to the source code of this file.

Classes

struct  CDataFileHeader
 
struct  CDataFileImageHeader
 
struct  CDataFileMeshHeader
 
struct  CDataFileLayer
 
struct  CDataFile
 

Macros

#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 bool cdf_read_header (CDataFile *cdf)
 
static bool cdf_write_header (CDataFile *cdf)
 
bool cdf_read_open (CDataFile *cdf, const char *filepath)
 
bool cdf_read_layer (CDataFile *cdf, CDataFileLayer *blay)
 
bool cdf_read_data (CDataFile *cdf, unsigned int size, void *data)
 
void cdf_read_close (CDataFile *cdf)
 
bool cdf_write_open (CDataFile *cdf, const char *filepath)
 
bool cdf_write_layer (CDataFile *UNUSED(cdf), CDataFileLayer *UNUSED(blay))
 
bool cdf_write_data (CDataFile *cdf, unsigned int size, void *data)
 
void cdf_write_close (CDataFile *cdf)
 
void cdf_remove (const char *filepath)
 
CDataFileLayercdf_layer_find (CDataFile *cdf, int type, const char *name)
 
CDataFileLayercdf_layer_add (CDataFile *cdf, int type, const char *name, size_t datasize)
 

Macro Definition Documentation

◆ CDF_DATA_FLOAT

#define CDF_DATA_FLOAT   0

Definition at line 26 of file customdata_file.c.

◆ CDF_ENDIAN_BIG

#define CDF_ENDIAN_BIG   1

Definition at line 24 of file customdata_file.c.

◆ CDF_ENDIAN_LITTLE

#define CDF_ENDIAN_LITTLE   0

Definition at line 23 of file customdata_file.c.

◆ CDF_SUBVERSION

#define CDF_SUBVERSION   0

Definition at line 62 of file customdata_file.c.

◆ CDF_TILE_SIZE

#define CDF_TILE_SIZE   64

Definition at line 63 of file customdata_file.c.

◆ CDF_VERSION

#define CDF_VERSION   0

Definition at line 61 of file customdata_file.c.

Typedef Documentation

◆ CDataFileHeader

◆ CDataFileImageHeader

◆ CDataFileMeshHeader

Function Documentation

◆ cdf_create()

CDataFile* cdf_create ( int  type)

Definition at line 94 of file customdata_file.c.

References MEM_callocN, CDataFile::type, and type.

Referenced by CustomData_external_read(), and CustomData_external_write().

◆ cdf_endian()

static int cdf_endian ( void  )
static

Definition at line 85 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().

◆ cdf_free()

void cdf_free ( CDataFile cdf)

◆ cdf_layer_add()

CDataFileLayer* cdf_layer_add ( CDataFile cdf,
int  type,
const char *  name,
size_t  datasize 
)

◆ cdf_layer_find()

CDataFileLayer* cdf_layer_find ( CDataFile cdf,
int  type,
const char *  name 
)

◆ cdf_read_close()

void cdf_read_close ( CDataFile cdf)

Definition at line 328 of file customdata_file.c.

References NULL, and CDataFile::readf.

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

◆ cdf_read_data()

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

◆ cdf_read_header()

static bool cdf_read_header ( CDataFile cdf)
static

◆ cdf_read_layer()

bool cdf_read_layer ( CDataFile cdf,
CDataFileLayer blay 
)

◆ cdf_read_open()

bool cdf_read_open ( CDataFile cdf,
const char *  filepath 
)

◆ cdf_remove()

void cdf_remove ( const char *  filepath)

Definition at line 405 of file customdata_file.c.

References BLI_delete().

◆ cdf_write_close()

void cdf_write_close ( CDataFile cdf)

Definition at line 397 of file customdata_file.c.

References NULL, and CDataFile::writef.

Referenced by cdf_free(), and CustomData_external_write().

◆ cdf_write_data()

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

Definition at line 387 of file customdata_file.c.

References data, size(), and CDataFile::writef.

Referenced by layerWrite_mdisps().

◆ cdf_write_header()

static bool cdf_write_header ( CDataFile cdf)
static

◆ cdf_write_layer()

bool cdf_write_layer ( CDataFile UNUSEDcdf,
CDataFileLayer UNUSEDblay 
)

Definition at line 382 of file customdata_file.c.

◆ cdf_write_open()

bool cdf_write_open ( CDataFile cdf,
const char *  filepath 
)