Blender V2.61 - r43446
Functions

dna_genfile.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_genfile.h"
#include "DNA_sdna_types.h"

Go to the source code of this file.

Functions

static int le_int (int temp)
static short le_short (short temp)
int DNA_elem_array_size (const char *astr, int len)
void DNA_sdna_free (SDNA *sdna)
static int ispointer (const char *name)
static int elementsize (SDNA *sdna, short type, short name)
static short * findstruct_name (SDNA *sdna, const char *str)
int DNA_struct_find_nr (SDNA *sdna, const char *str)
static void init_structDNA (SDNA *sdna, int do_endian_swap)
SDNADNA_sdna_from_data (void *data, int datalen, int do_endian_swap)
static void recurs_test_compflags (SDNA *sdna, char *compflags, int structnr)
char * DNA_struct_get_compareflags (SDNA *sdna, SDNA *newsdna)
static eSDNA_Type sdna_type_nr (const char *dna_type)
static void cast_elem (const char *ctype, const char *otype, const char *name, char *curdata, char *olddata)
static void cast_pointer (int curlen, int oldlen, const char *name, char *curdata, char *olddata)
static int elem_strcmp (const char *name, const char *oname)
static char * find_elem (SDNA *sdna, const char *type, const char *name, short *old, char *olddata, short **sppo)
static void reconstruct_elem (SDNA *newsdna, SDNA *oldsdna, char *type, const char *name, char *curdata, short *old, char *olddata)
static void reconstruct_struct (SDNA *newsdna, SDNA *oldsdna, char *compflags, int oldSDNAnr, char *data, int curSDNAnr, char *cur)
void DNA_struct_switch_endian (SDNA *oldsdna, int oldSDNAnr, char *data)
void * DNA_struct_reconstruct (SDNA *newsdna, SDNA *oldsdna, char *compflags, int oldSDNAnr, int blocks, void *data)
int DNA_elem_offset (SDNA *sdna, const char *stype, const char *vartype, const char *name)
int DNA_elem_type_size (const eSDNA_Type elem_nr)

Detailed Description

Definition in file dna_genfile.c.


Function Documentation

static void cast_elem ( const char *  ctype,
const char *  otype,
const char *  name,
char *  curdata,
char *  olddata 
) [static]
static void cast_pointer ( int  curlen,
int  oldlen,
const char *  name,
char *  curdata,
char *  olddata 
) [static]

Definition at line 752 of file dna_genfile.c.

References DNA_elem_array_size(), and strlen().

Referenced by reconstruct_elem().

int DNA_elem_array_size ( const char *  astr,
int  len 
)
int DNA_elem_offset ( SDNA sdna,
const char *  stype,
const char *  vartype,
const char *  name 
)

Definition at line 1154 of file dna_genfile.c.

References DNA_struct_find_nr(), find_elem(), NULL, and SDNA::structs.

Referenced by read_file_dna().

int DNA_elem_type_size ( const eSDNA_Type  elem_nr)
void DNA_sdna_free ( SDNA sdna)
SDNA* DNA_sdna_from_data ( void *  data,
int  datalen,
int  do_endian_swap 
) [read]
int DNA_struct_find_nr ( SDNA sdna,
const char *  str 
)
char* DNA_struct_get_compareflags ( SDNA sdna,
SDNA newsdna 
)
void* DNA_struct_reconstruct ( SDNA newsdna,
SDNA oldsdna,
char *  compflags,
int  oldSDNAnr,
int  blocks,
void *  data 
)
void DNA_struct_switch_endian ( SDNA oldsdna,
int  oldSDNAnr,
char *  data 
)
static int elem_strcmp ( const char *  name,
const char *  oname 
) [static]

Definition at line 795 of file dna_genfile.c.

Referenced by find_elem().

static int elementsize ( SDNA sdna,
short  type,
short  name 
) [static]
static char* find_elem ( SDNA sdna,
const char *  type,
const char *  name,
short *  old,
char *  olddata,
short **  sppo 
) [static]
static short* findstruct_name ( SDNA sdna,
const char *  str 
) [static]

Definition at line 266 of file dna_genfile.c.

References SDNA::nr_structs, NULL, SDNA::structs, and SDNA::types.

Referenced by DNA_struct_get_compareflags(), and init_structDNA().

static void init_structDNA ( SDNA sdna,
int  do_endian_swap 
) [static]
static int ispointer ( const char *  name) [static]
static int le_int ( int  temp) [static]

Definition at line 156 of file dna_genfile.c.

Referenced by init_structDNA().

static short le_short ( short  temp) [static]

Definition at line 144 of file dna_genfile.c.

Referenced by init_structDNA().

static void reconstruct_elem ( SDNA newsdna,
SDNA oldsdna,
char *  type,
const char *  name,
char *  curdata,
short *  old,
char *  olddata 
) [static]
static void reconstruct_struct ( SDNA newsdna,
SDNA oldsdna,
char *  compflags,
int  oldSDNAnr,
char *  data,
int  curSDNAnr,
char *  cur 
) [static]
static void recurs_test_compflags ( SDNA sdna,
char *  compflags,
int  structnr 
) [static]

Definition at line 529 of file dna_genfile.c.

References ispointer(), SDNA::names, SDNA::nr_structs, and SDNA::structs.

Referenced by DNA_struct_get_compareflags().

static eSDNA_Type sdna_type_nr ( const char *  dna_type) [static]