Blender V2.61 - r43446
|
#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) |
SDNA * | DNA_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) |
Definition in file dna_genfile.c.
static void cast_elem | ( | const char * | ctype, |
const char * | otype, | ||
const char * | name, | ||
char * | curdata, | ||
char * | olddata | ||
) | [static] |
Definition at line 674 of file dna_genfile.c.
References DNA_elem_array_size(), DNA_elem_type_size(), SDNA_TYPE_CHAR, SDNA_TYPE_DOUBLE, SDNA_TYPE_FLOAT, SDNA_TYPE_INT, SDNA_TYPE_INT64, SDNA_TYPE_LONG, sdna_type_nr(), SDNA_TYPE_SHORT, SDNA_TYPE_UCHAR, SDNA_TYPE_UINT64, SDNA_TYPE_ULONG, SDNA_TYPE_USHORT, strlen(), and simple_enum_gen::val.
Referenced by reconstruct_elem().
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 | ||
) |
Definition at line 173 of file dna_genfile.c.
References len(), mul(), NULL, and str.
Referenced by cast_elem(), cast_pointer(), DNA_struct_switch_endian(), elementsize(), reconstruct_elem(), reconstruct_struct(), and rna_find_sdna_member().
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 | ) |
Definition at line 1163 of file dna_genfile.c.
References SDNA_TYPE_CHAR, SDNA_TYPE_DOUBLE, SDNA_TYPE_FLOAT, SDNA_TYPE_INT, SDNA_TYPE_INT64, SDNA_TYPE_LONG, SDNA_TYPE_SHORT, SDNA_TYPE_UCHAR, SDNA_TYPE_UINT64, SDNA_TYPE_ULONG, and SDNA_TYPE_USHORT.
Referenced by cast_elem().
void DNA_sdna_free | ( | SDNA * | sdna | ) |
Definition at line 197 of file dna_genfile.c.
References BLI_ghash_free(), SDNA::data, MEM_freeN(), SDNA::names, NULL, SDNA::structs, SDNA::structs_map, and SDNA::types.
Referenced by blo_freefiledata(), RNA_define_free(), and writedata_free().
SDNA* DNA_sdna_from_data | ( | void * | data, |
int | datalen, | ||
int | do_endian_swap | ||
) | [read] |
Definition at line 510 of file dna_genfile.c.
References SDNA::data, SDNA::datalen, init_structDNA(), SDNA::lastfind, and MEM_mallocN().
Referenced by filedata_new(), read_file_dna(), RNA_create(), and writedata_new().
int DNA_struct_find_nr | ( | SDNA * | sdna, |
const char * | str | ||
) |
Definition at line 282 of file dna_genfile.c.
References BLI_ghash_lookup(), SDNA::lastfind, SDNA::nr_structs, NULL, SDNA::structs, SDNA::structs_map, and SDNA::types.
Referenced by BLO_blendhandle_get_previews(), DNA_elem_offset(), DNA_struct_reconstruct(), DNA_struct_switch_endian(), reconstruct_struct(), RNA_def_struct_sdna(), RNA_def_struct_sdna_from(), rna_find_sdna_member(), and writestruct().
Definition at line 569 of file dna_genfile.c.
References findstruct_name(), ispointer(), MEM_callocN(), SDNA::names, SDNA::nr_structs, NULL, SDNA::pointerlen, recurs_test_compflags(), SDNA::structs, SDNA::typelens, and SDNA::types.
Referenced by read_file_dna().
void* DNA_struct_reconstruct | ( | SDNA * | newsdna, |
SDNA * | oldsdna, | ||
char * | compflags, | ||
int | oldSDNAnr, | ||
int | blocks, | ||
void * | data | ||
) |
Definition at line 1121 of file dna_genfile.c.
References data, DNA_struct_find_nr(), MEM_callocN(), NULL, reconstruct_struct(), SDNA::structs, SDNA::typelens, and SDNA::types.
Referenced by read_struct().
void DNA_struct_switch_endian | ( | SDNA * | oldsdna, |
int | oldSDNAnr, | ||
char * | data | ||
) |
Definition at line 996 of file dna_genfile.c.
References data, DNA_elem_array_size(), DNA_struct_find_nr(), DNA_struct_switch_endian(), elementsize(), find_elem(), ispointer(), mul(), SDNA::names, NULL, SDNA::pointerlen, SDNA_TYPE_FLOAT, SDNA_TYPE_INT, SDNA_TYPE_INT64, SDNA_TYPE_LONG, SDNA_TYPE_SHORT, SDNA_TYPE_UINT64, SDNA_TYPE_ULONG, SDNA_TYPE_USHORT, strlen(), SDNA::structs, and SDNA::types.
Referenced by DNA_struct_switch_endian(), and switch_endian_structs().
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] |
Definition at line 217 of file dna_genfile.c.
References DNA_elem_array_size(), ispointer(), len(), mul(), SDNA::names, SDNA::pointerlen, strlen(), and SDNA::typelens.
Referenced by cdDM_drawMappedFacesGLSL(), DNA_struct_switch_endian(), find_elem(), GPU_attrib_element_size(), GPU_interleaved_attrib_setup(), reconstruct_elem(), and reconstruct_struct().
static char* find_elem | ( | SDNA * | sdna, |
const char * | type, | ||
const char * | name, | ||
short * | old, | ||
char * | olddata, | ||
short ** | sppo | ||
) | [static] |
Definition at line 810 of file dna_genfile.c.
References elem_strcmp(), elementsize(), len(), SDNA::names, NULL, and SDNA::types.
Referenced by DNA_elem_offset(), DNA_struct_switch_endian(), and reconstruct_struct().
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] |
Definition at line 315 of file dna_genfile.c.
References BLI_ghash_insert(), BLI_ghash_new(), BLI_ghashutil_strcmp(), BLI_ghashutil_strhash(), data, SDNA::data, findstruct_name(), le_int(), le_short(), MEM_callocN(), SDNA::names, nr_names, SDNA::nr_names, SDNA::nr_structs, nr_structs, nr_types, SDNA::nr_types, SDNA::pointerlen, SDNA_TYPE_VOID, str, SDNA::structs, SDNA::structs_map, SDNA::typelens, and SDNA::types.
Referenced by DNA_sdna_from_data().
static int ispointer | ( | const char * | name | ) | [static] |
Definition at line 211 of file dna_genfile.c.
Referenced by DNA_struct_get_compareflags(), DNA_struct_switch_endian(), elementsize(), reconstruct_elem(), reconstruct_struct(), and recurs_test_compflags().
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] |
Definition at line 841 of file dna_genfile.c.
References cast_elem(), cast_pointer(), DNA_elem_array_size(), elementsize(), ispointer(), len(), mul(), SDNA::names, SDNA::pointerlen, strlen(), and SDNA::types.
Referenced by reconstruct_struct().
static void reconstruct_struct | ( | SDNA * | newsdna, |
SDNA * | oldsdna, | ||
char * | compflags, | ||
int | oldSDNAnr, | ||
char * | data, | ||
int | curSDNAnr, | ||
char * | cur | ||
) | [static] |
Definition at line 916 of file dna_genfile.c.
References DNA_elem_array_size(), DNA_struct_find_nr(), elementsize(), find_elem(), ispointer(), mul(), SDNA::names, reconstruct_elem(), strlen(), SDNA::structs, SDNA::typelens, and SDNA::types.
Referenced by DNA_struct_reconstruct().
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] |
Definition at line 658 of file dna_genfile.c.
References SDNA_TYPE_CHAR, SDNA_TYPE_DOUBLE, SDNA_TYPE_FLOAT, SDNA_TYPE_INT, SDNA_TYPE_INT64, SDNA_TYPE_LONG, SDNA_TYPE_SHORT, SDNA_TYPE_UCHAR, SDNA_TYPE_UINT64, SDNA_TYPE_ULONG, and SDNA_TYPE_USHORT.
Referenced by cast_elem().