Blender  V2.93
Enumerations | Functions

Go to the source code of this file.

Enumerations

enum  eDNA_RenameDir { DNA_RENAME_STATIC_FROM_ALIAS = -1 , DNA_RENAME_ALIAS_FROM_STATIC = 1 }
 

Functions

int DNA_elem_array_size (const char *str)
 
uint DNA_elem_id_offset_start (const char *elem_full)
 
uint DNA_elem_id_offset_end (const char *elem_full)
 
uint DNA_elem_id_strip_copy (char *elem_dst, const char *elem_src)
 
uint DNA_elem_id_strip (char *elem)
 
bool DNA_elem_id_match (const char *elem_search, const int elem_search_len, const char *elem_full, uint *r_elem_full_offset)
 
char * DNA_elem_id_rename (struct MemArena *mem_arena, const char *elem_src, const int elem_src_len, const char *elem_dst, const int elem_dst_len, const char *elem_src_full, const int elem_src_full_len, const uint elem_src_full_offset_len)
 
void DNA_alias_maps (enum eDNA_RenameDir version_dir, struct GHash **r_struct_map, struct GHash **r_elem_map)
 
const char * DNA_struct_rename_legacy_hack_alias_from_static (const char *name)
 
const char * DNA_struct_rename_legacy_hack_static_from_alias (const char *name)
 

Enumeration Type Documentation

◆ eDNA_RenameDir

Enumerator
DNA_RENAME_STATIC_FROM_ALIAS 
DNA_RENAME_ALIAS_FROM_STATIC 

Definition at line 50 of file dna_utils.h.

Function Documentation

◆ DNA_alias_maps()

void DNA_alias_maps ( enum eDNA_RenameDir  version_dir,
struct GHash **  r_struct_map,
struct GHash **  r_elem_map 
)

◆ DNA_elem_array_size()

int DNA_elem_array_size ( const char *  str)

Parses the [n1][n2]... on the end of an array name and returns the number of array elements n1 * n2 ....

Definition at line 46 of file dna_utils.c.

References Freestyle::c, result, and str.

Referenced by calculate_struct_sizes(), init_structDNA(), and rna_find_sdna_member().

◆ DNA_elem_id_match()

bool DNA_elem_id_match ( const char *  elem_search,
const int  elem_search_len,
const char *  elem_full,
uint r_elem_full_offset 
)

Check if 'var' matches '*var[3]' for eg, return true if it does, with start/end offsets.

Definition at line 136 of file dna_utils.c.

References BLI_assert, Freestyle::c, DNA_elem_id_offset_start(), and is_identifier().

Referenced by DNA_sdna_patch_struct_member_nr().

◆ DNA_elem_id_offset_end()

uint DNA_elem_id_offset_end ( const char *  elem_full)

Definition at line 100 of file dna_utils.c.

References is_identifier().

Referenced by DNA_elem_id_strip(), and DNA_elem_id_strip_copy().

◆ DNA_elem_id_offset_start()

uint DNA_elem_id_offset_start ( const char *  elem_full)

◆ DNA_elem_id_rename()

char* DNA_elem_id_rename ( struct MemArena mem_arena,
const char *  elem_src,
const int  elem_src_len,
const char *  elem_dst,
const int  elem_dst_len,
const char *  elem_src_full,
const int  elem_src_full_len,
const uint  elem_src_full_offset_len 
)

◆ DNA_elem_id_strip()

uint DNA_elem_id_strip ( char *  elem)

Definition at line 122 of file dna_utils.c.

References DNA_elem_id_offset_end(), DNA_elem_id_offset_start(), and elem_offset().

Referenced by make_structDNA().

◆ DNA_elem_id_strip_copy()

uint DNA_elem_id_strip_copy ( char *  elem_dst,
const char *  elem_src 
)

elem_dst must be at least the size of elem_src.

Definition at line 112 of file dna_utils.c.

References DNA_elem_id_offset_end(), and DNA_elem_id_offset_start().

Referenced by calculate_struct_sizes(), dna_sdna_alias_from_static_elem_full(), is_name_legal(), and version_elem_static_from_alias().

◆ DNA_struct_rename_legacy_hack_alias_from_static()

const char* DNA_struct_rename_legacy_hack_alias_from_static ( const char *  name)

Definition at line 327 of file dna_utils.c.

References STREQ.

Referenced by DNA_sdna_alias_data_ensure().

◆ DNA_struct_rename_legacy_hack_static_from_alias()

const char* DNA_struct_rename_legacy_hack_static_from_alias ( const char *  name)

DNA Compatibility Hack

Only keep this for compatibility: NEVER ADD NEW STRINGS HERE.

The renaming here isn't complete, references to the old struct names are still included in DNA, now fixing these struct names properly breaks forward compatibility. Leave these as-is, but don't add to them! See D4342#98780

Definition at line 311 of file dna_utils.c.

References STREQ.

Referenced by DNA_struct_find_nr_wrapper(), and init_structDNA().