|
Blender
V2.93
|
#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_assert.h"#include "BLI_ghash.h"#include "BLI_sys_types.h"#include "BLI_utildefines.h"#include "BLI_memarena.h"#include "dna_utils.h"#include "dna_rename_defs.h"Go to the source code of this file.
Macros | |
| #define | DNA_STRUCT_RENAME(old, new) {#old, #new}, |
| #define | DNA_STRUCT_RENAME_ELEM(struct_name, old, new) |
| #define | DNA_STRUCT_RENAME(old, new) |
| #define | DNA_STRUCT_RENAME_ELEM(struct_name, old, new) {#struct_name, #old, #new}, |
Functions | |
Struct Member Evaluation | |
| int | DNA_elem_array_size (const char *str) |
Struct Member Manipulation | |
| static bool | is_identifier (const char c) |
| 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) |
Versioning | |
| static uint | strhash_pair_p (const void *ptr) |
| static bool | strhash_pair_cmp (const void *a, const void *b) |
| void | DNA_alias_maps (enum eDNA_RenameDir version_dir, GHash **r_struct_map, GHash **r_elem_map) |
Struct Name Legacy Hack | |
| const char * | DNA_struct_rename_legacy_hack_static_from_alias (const char *name) |
| const char * | DNA_struct_rename_legacy_hack_alias_from_static (const char *name) |
Utilities for stand-alone makesdna.c and Blender to share.
Definition in file dna_utils.c.
| #define DNA_STRUCT_RENAME | ( | old, | |
| new | |||
| ) |
| #define DNA_STRUCT_RENAME_ELEM | ( | struct_name, | |
| old, | |||
| new | |||
| ) |
| void DNA_alias_maps | ( | enum eDNA_RenameDir | version_dir, |
| GHash ** | r_struct_map, | ||
| GHash ** | r_elem_map | ||
| ) |
Definition at line 210 of file dna_utils.c.
References ARRAY_SIZE, BLI_ghash_free(), BLI_ghash_insert(), BLI_ghash_lookup_default(), BLI_ghash_new_ex(), BLI_ghash_str_new_ex(), data, DNA_RENAME_ALIAS_FROM_STATIC, DNA_RENAME_STATIC_FROM_ALIAS, MEM_mallocN, NULL, strhash_pair_cmp(), and strhash_pair_p().
Referenced by DNA_sdna_alias_data_ensure(), make_structDNA(), and RNA_create().
| 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().
| 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().
| 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().
| uint DNA_elem_id_offset_start | ( | const char * | elem_full | ) |
Definition at line 91 of file dna_utils.c.
References is_identifier().
Referenced by DNA_elem_id_match(), DNA_elem_id_rename(), DNA_elem_id_strip(), DNA_elem_id_strip_copy(), dna_sdna_alias_from_static_elem_full(), and version_elem_static_from_alias().
| 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 | ||
| ) |
Return a renamed dna name, allocated from mem_arena.
Definition at line 157 of file dna_utils.c.
References BLI_assert, BLI_memarena_alloc(), DNA_elem_id_offset_start(), mem_arena, and UNUSED_VARS_NDEBUG.
Referenced by dna_sdna_alias_from_static_elem_full(), DNA_sdna_patch_struct_member_nr(), and version_elem_static_from_alias().
| 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().
| 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().
| 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().
| const char* DNA_struct_rename_legacy_hack_static_from_alias | ( | const char * | name | ) |
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().
|
static |
Definition at line 85 of file dna_utils.c.
References Freestyle::c.
Referenced by DNA_elem_id_match(), DNA_elem_id_offset_end(), and DNA_elem_id_offset_start().
|
static |
Definition at line 203 of file dna_utils.c.
References Freestyle::a, and STREQ.
Referenced by DNA_alias_maps().
|
static |
Definition at line 197 of file dna_utils.c.
References BLI_ghashutil_strhash_p(), and ptr.
Referenced by DNA_alias_maps().