Blender
V3.3
|
blenloader genfile private function prototypes More...
#include "intern/dna_utils.h"
Go to the source code of this file.
Macros | |
#define | SDNA_TYPE_VOID 9 |
Typedefs | |
typedef enum eSDNA_Type | eSDNA_Type |
Enumerations | |
enum | eSDNA_Type { SDNA_TYPE_CHAR = 0 , SDNA_TYPE_UCHAR = 1 , SDNA_TYPE_SHORT = 2 , SDNA_TYPE_USHORT = 3 , SDNA_TYPE_INT = 4 , SDNA_TYPE_FLOAT = 7 , SDNA_TYPE_DOUBLE = 8 , SDNA_TYPE_INT64 = 10 , SDNA_TYPE_UINT64 = 11 , SDNA_TYPE_INT8 = 12 } |
enum | eSDNA_StructCompare { SDNA_CMP_REMOVED = 0 , SDNA_CMP_EQUAL = 1 , SDNA_CMP_NOT_EQUAL = 2 , SDNA_CMP_UNKNOWN = 3 } |
Functions | |
struct SDNA * | DNA_sdna_from_data (const void *data, int data_len, bool do_endian_swap, bool data_alloc, const char **r_error_message) |
void | DNA_sdna_free (struct SDNA *sdna) |
void | DNA_sdna_current_init (void) |
const struct SDNA * | DNA_sdna_current_get (void) |
void | DNA_sdna_current_free (void) |
struct DNA_ReconstructInfo * | DNA_reconstruct_info_create (const struct SDNA *oldsdna, const struct SDNA *newsdna, const char *compare_flags) |
void | DNA_reconstruct_info_free (struct DNA_ReconstructInfo *reconstruct_info) |
int | DNA_struct_find_nr_ex (const struct SDNA *sdna, const char *str, unsigned int *index_last) |
int | DNA_struct_find_nr (const struct SDNA *sdna, const char *str) |
void | DNA_struct_switch_endian (const struct SDNA *sdna, int struct_nr, char *data) |
const char * | DNA_struct_get_compareflags (const struct SDNA *sdna, const struct SDNA *newsdna) |
void * | DNA_struct_reconstruct (const struct DNA_ReconstructInfo *reconstruct_info, int old_struct_nr, int blocks, const void *old_blocks) |
int | DNA_elem_offset (struct SDNA *sdna, const char *stype, const char *vartype, const char *name) |
int | DNA_elem_size_nr (const struct SDNA *sdna, short type, short name) |
bool | DNA_struct_find (const struct SDNA *sdna, const char *stype) |
bool | DNA_struct_elem_find (const struct SDNA *sdna, const char *stype, const char *vartype, const char *name) |
int | DNA_elem_type_size (eSDNA_Type elem_nr) |
bool | DNA_sdna_patch_struct (struct SDNA *sdna, const char *struct_name_old, const char *struct_name_new) |
bool | DNA_sdna_patch_struct_member (struct SDNA *sdna, const char *struct_name, const char *elem_old, const char *elem_new) |
void | DNA_sdna_alias_data_ensure (struct SDNA *sdna) |
int | DNA_struct_alias_find_nr_ex (const struct SDNA *sdna, const char *str, unsigned int *index_last) |
int | DNA_struct_alias_find_nr (const struct SDNA *sdna, const char *str) |
bool | DNA_struct_alias_elem_find (const struct SDNA *sdna, const char *stype, const char *vartype, const char *name) |
void | DNA_sdna_alias_data_ensure_structs_map (struct SDNA *sdna) |
Variables | |
const unsigned char | DNAstr [] |
const int | DNAlen |
blenloader genfile private function prototypes
Definition in file DNA_genfile.h.
#define SDNA_TYPE_VOID 9 |
Definition at line 47 of file DNA_genfile.h.
typedef enum eSDNA_Type eSDNA_Type |
Primitive (non-struct, non-pointer/function/array) types,
enum eSDNA_StructCompare |
For use with DNA_struct_reconstruct & DNA_struct_get_compareflags
Enumerator | |
---|---|
SDNA_CMP_REMOVED | |
SDNA_CMP_EQUAL | |
SDNA_CMP_NOT_EQUAL | |
SDNA_CMP_UNKNOWN |
Definition at line 56 of file DNA_genfile.h.
enum eSDNA_Type |
Primitive (non-struct, non-pointer/function/array) types,
Enumerator | |
---|---|
SDNA_TYPE_CHAR | |
SDNA_TYPE_UCHAR | |
SDNA_TYPE_SHORT | |
SDNA_TYPE_USHORT | |
SDNA_TYPE_INT | |
SDNA_TYPE_FLOAT | |
SDNA_TYPE_DOUBLE | |
SDNA_TYPE_INT64 | |
SDNA_TYPE_UINT64 | |
SDNA_TYPE_INT8 |
Definition at line 35 of file DNA_genfile.h.
int DNA_elem_offset | ( | struct SDNA * | sdna, |
const char * | stype, | ||
const char * | vartype, | ||
const char * | name | ||
) |
Returns the offset of the field with the specified name and type within the specified struct type in SDNA, -1 on failure.
Definition at line 1571 of file dna_genfile.c.
References BLI_assert, DNA_struct_find_nr(), elem_offset(), and SDNA::structs.
Referenced by read_file_dna().
int DNA_elem_size_nr | ( | const struct SDNA * | sdna, |
short | type, | ||
short | name | ||
) |
Returns the size of struct fields of the specified type and name.
type | Index into sdna->types/types_size |
name | Index into sdna->names, needed to extract possible pointer/array information. |
Referenced by rna_find_sdna_member().
int DNA_elem_type_size | ( | eSDNA_Type | elem_nr | ) |
Returns the size in bytes of a primitive type.
Definition at line 1620 of file dna_genfile.c.
References SDNA_TYPE_CHAR, SDNA_TYPE_DOUBLE, SDNA_TYPE_FLOAT, SDNA_TYPE_INT, SDNA_TYPE_INT64, SDNA_TYPE_INT8, SDNA_TYPE_SHORT, SDNA_TYPE_UCHAR, SDNA_TYPE_UINT64, and SDNA_TYPE_USHORT.
Referenced by cast_primitive_type().
struct DNA_ReconstructInfo* DNA_reconstruct_info_create | ( | const struct SDNA * | oldsdna, |
const struct SDNA * | newsdna, | ||
const char * | compare_flags | ||
) |
Pre-process information about how structs in newsdna can be reconstructed from structs in oldsdna. This information is then used to speedup DNA_struct_reconstruct.
Referenced by read_file_dna().
void DNA_reconstruct_info_free | ( | struct DNA_ReconstructInfo * | reconstruct_info | ) |
Definition at line 1559 of file dna_genfile.c.
References Freestyle::a, MEM_freeN, DNA_ReconstructInfo::newsdna, NULL, DNA_ReconstructInfo::step_counts, DNA_ReconstructInfo::steps, and SDNA::structs_len.
Referenced by blo_filedata_free().
Definition at line 1810 of file dna_genfile.c.
References Freestyle::a, SDNA::alias, BLI_ghash_free(), BLI_ghash_lookup_default(), BLI_memarena_new(), BLI_MEMARENA_STD_BUFSIZE, DNA_alias_maps(), DNA_RENAME_ALIAS_FROM_STATIC, dna_sdna_alias_from_static_elem_full(), DNA_struct_rename_legacy_hack_alias_from_static(), elem_map_alias_from_static, SDNA::mem_arena, MEM_freeN, MEM_mallocN, SDNA_Struct::members, SDNA_Struct::members_len, SDNA_StructMember::name, SDNA::names, SDNA::names_len, NULL, sdna_expand_names(), struct_map_alias_from_static, SDNA::structs, SDNA::structs_len, SDNA_Struct::type, SDNA::types, and SDNA::types_len.
Referenced by DNA_sdna_alias_data_ensure_structs_map(), and RNA_create().
Separated from DNA_sdna_alias_data_ensure because it's not needed unless we want to lookup aliased struct names (DNA_struct_alias_find_nr and friends).
Definition at line 1867 of file dna_genfile.c.
References SDNA::alias, BLI_ghash_insert(), BLI_ghash_str_new_ex(), DNA_sdna_alias_data_ensure(), POINTER_FROM_INT, SDNA::structs, SDNA::structs_len, SDNA::structs_map, SDNA_Struct::type, SDNA::types, and UNUSED_VARS.
Definition at line 572 of file dna_genfile.c.
References DNA_sdna_free(), g_sdna, and NULL.
Referenced by BlendfileLoadingBaseTest::TearDownTestCase(), and WM_exit_ex().
Definition at line 566 of file dna_genfile.c.
References BLI_assert, g_sdna, and NULL.
Referenced by DNA_sdna_patch_struct_nr(), filedata_new(), and writedata_new().
Definition at line 561 of file dna_genfile.c.
References DNA_sdna_from_data(), DNAlen, DNAstr, g_sdna, and NULL.
Referenced by main(), and BlendfileLoadingBaseTest::SetUpTestCase().
Definition at line 123 of file dna_genfile.c.
References SDNA::alias, BLI_ghash_free(), BLI_memarena_free(), SDNA::data, SDNA::data_alloc, SDNA::mem_arena, MEM_freeN, MEM_SAFE_FREE, SDNA::names, SDNA::names_array_len, NULL, SDNA::structs, SDNA::structs_map, and SDNA::types.
Referenced by blo_filedata_free(), DNA_sdna_current_free(), DNA_sdna_from_data(), and RNA_define_free().
struct SDNA* DNA_sdna_from_data | ( | const void * | data, |
int | data_len, | ||
bool | do_endian_swap, | ||
bool | data_alloc, | ||
const char ** | r_error_message | ||
) |
Constructs and returns a decoded SDNA structure from the given encoded SDNA data block.
Definition at line 519 of file dna_genfile.c.
References data, SDNA::data, SDNA::data_alloc, SDNA::data_len, DNA_sdna_free(), init_structDNA(), MEM_mallocN, and NULL.
Referenced by DNA_sdna_current_init(), read_file_dna(), and RNA_create().
bool DNA_sdna_patch_struct | ( | struct SDNA * | sdna, |
const char * | struct_name_old, | ||
const char * | struct_name_new | ||
) |
Rename a struct
Definition at line 1662 of file dna_genfile.c.
References DNA_sdna_patch_struct_nr(), and DNA_struct_find_nr().
Referenced by blo_do_versions_dna().
bool DNA_sdna_patch_struct_member | ( | struct SDNA * | sdna, |
const char * | struct_name, | ||
const char * | elem_old, | ||
const char * | elem_new | ||
) |
Replace elem_old with elem_new for struct struct_name handles search & replace, maintaining surrounding non-identifier characters such as pointer & array size.
Definition at line 1719 of file dna_genfile.c.
References DNA_sdna_patch_struct_member_nr(), and DNA_struct_find_nr().
Referenced by blo_do_versions_dna().
bool DNA_struct_alias_elem_find | ( | const struct SDNA * | sdna, |
const char * | stype, | ||
const char * | vartype, | ||
const char * | name | ||
) |
int DNA_struct_alias_find_nr | ( | const struct SDNA * | sdna, |
const char * | str | ||
) |
int DNA_struct_alias_find_nr_ex | ( | const struct SDNA * | sdna, |
const char * | str, | ||
unsigned int * | index_last | ||
) |
bool DNA_struct_elem_find | ( | const struct SDNA * | sdna, |
const char * | stype, | ||
const char * | vartype, | ||
const char * | name | ||
) |
Referenced by blo_do_versions_260(), blo_do_versions_270(), blo_do_versions_280(), blo_do_versions_290(), and blo_do_versions_300().
Referenced by blo_do_versions_280(), blo_do_versions_290(), and blo_do_versions_300().
int DNA_struct_find_nr | ( | const struct SDNA * | sdna, |
const char * | str | ||
) |
int DNA_struct_find_nr_ex | ( | const struct SDNA * | sdna, |
const char * | str, | ||
unsigned int * | index_last | ||
) |
Returns the index of the struct info for the struct with the specified name.
Constructs and returns an array of byte flags with one element for each struct in oldsdna, indicating how it compares to newsdna.
Referenced by read_file_dna().
void* DNA_struct_reconstruct | ( | const struct DNA_ReconstructInfo * | reconstruct_info, |
int | old_struct_nr, | ||
int | blocks, | ||
const void * | old_blocks | ||
) |
reconstruct_info | Information preprocessed by DNA_reconstruct_info_create. |
old_struct_nr | Index of struct info within oldsdna. |
blocks | The number of array elements. |
old_blocks | Array of struct data. |
Referenced by read_struct().
Does endian swapping on the fields of a struct value.
sdna | SDNA of the struct_nr belongs to |
struct_nr | Index of struct info within sdna |
data | Struct data that is to be converted |
Referenced by switch_endian_structs().
|
extern |
Length of DNAstr.
Referenced by DNA_sdna_current_init(), and RNA_create().
|
extern |
DNAstr contains the prebuilt SDNA structure defining the layouts of the types used by this version of Blender. It is defined in a file dna.c, which is generated by the makesdna program during the build process (see makesdna.c).
Referenced by DNA_sdna_current_init(), and RNA_create().