|
Blender V5.0
|
#include "BLI_sys_types.h"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_member_array_num (const char *str) |
| uint | DNA_member_id_offset_start (const char *member_full) |
| uint | DNA_member_id_offset_end (const char *member_full_trimmed) |
| uint | DNA_member_id_strip_copy (char *member_id_dst, const char *member_full_src) |
| uint | DNA_member_id_strip (char *member) |
| bool | DNA_member_id_match (const char *member_id, int member_id_len, const char *member_full, uint *r_member_full_offset) |
| char * | DNA_member_id_rename (struct MemArena *mem_arena, const char *member_id_src, int member_id_src_len, const char *member_id_dst, int member_id_dst_len, const char *member_full_src, int member_full_src_len, uint member_full_src_offset_len) |
| void | DNA_alias_maps (enum eDNA_RenameDir version_dir, struct GHash **r_type_map, struct GHash **r_member_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) |
| enum eDNA_RenameDir |
When requesting version info, support both directions.
| Enumerator | |
|---|---|
| DNA_RENAME_STATIC_FROM_ALIAS | |
| DNA_RENAME_ALIAS_FROM_STATIC | |
Definition at line 89 of file dna_utils.h.
| void DNA_alias_maps | ( | enum eDNA_RenameDir | version_dir, |
| struct GHash ** | r_type_map, | ||
| struct GHash ** | r_member_map ) |
References name.
Referenced by DNA_sdna_alias_data_ensure(), make_structDNA(), and RNA_create().
| int DNA_member_array_num | ( | const char * | str | ) |
Naming convention in this header:
Definition at line 29 of file dna_utils.cc.
Referenced by calculate_struct_sizes(), init_structDNA(), and rna_find_sdna_member().
| bool DNA_member_id_match | ( | const char * | member_id, |
| int | member_id_len, | ||
| const char * | member_full, | ||
| uint * | r_member_full_offset ) |
Check if the member identifier given in member_id matches the full name given in member_full. E.g. var matches full names like var or *var[3], but not variable.
Definition at line 116 of file dna_utils.cc.
References BLI_assert, DNA_member_id_offset_start(), and is_identifier().
Referenced by DNA_sdna_patch_struct_member().
| uint DNA_member_id_offset_end | ( | const char * | member_full_trimmed | ) |
Find the end offset of the member id (the name) within the trimmed full member definition.
WARNING: Expects an input string which has already been trimmed from its non-identifier prefixes. E.g. passing *var[n1] to this function will return 0, while passing var[n1] will return the expected 3 value.
Definition at line 87 of file dna_utils.cc.
References is_identifier().
Referenced by DNA_member_id_rename(), DNA_member_id_strip(), and DNA_member_id_strip_copy().
| uint DNA_member_id_offset_start | ( | const char * | member_full | ) |
Find the start offset of the member id (the name) within the full member definition.
Definition at line 74 of file dna_utils.cc.
References is_identifier().
Referenced by DNA_member_id_match(), DNA_member_id_rename(), DNA_member_id_strip(), DNA_member_id_strip_copy(), dna_sdna_alias_from_static_elem_full(), and version_member_static_from_alias().
| char * DNA_member_id_rename | ( | struct MemArena * | mem_arena, |
| const char * | member_id_src, | ||
| int | member_id_src_len, | ||
| const char * | member_id_dst, | ||
| int | member_id_dst_len, | ||
| const char * | member_full_src, | ||
| int | member_full_src_len, | ||
| uint | member_full_src_offset_len ) |
Rename a struct member to a different name.
Replace the source member identifier (member_id_src) by the destination one (member_id_dst), while preserving the potential prefixes and suffixes.
Definition at line 134 of file dna_utils.cc.
References BLI_assert, BLI_memarena_alloc(), DNA_member_id_offset_end(), DNA_member_id_offset_start(), i, mem_arena, and UNUSED_VARS_NDEBUG.
Referenced by dna_sdna_alias_from_static_elem_full(), DNA_sdna_patch_struct_member(), and version_member_static_from_alias().
| uint DNA_member_id_strip | ( | char * | member | ) |
Same as DNA_member_id_strip_copy, but modifies the given member string in place.
Definition at line 106 of file dna_utils.cc.
References DNA_member_id_offset_end(), and DNA_member_id_offset_start().
Referenced by make_structDNA().
| uint DNA_member_id_strip_copy | ( | char * | member_id_dst, |
| const char * | member_full_src ) |
Copy the member id part (the bare name) of the full source member into member_id_dst.
| member_id_dst | destination char buffer, must be at least the size of member_src_full. |
Definition at line 96 of file dna_utils.cc.
References DNA_member_id_offset_end(), and DNA_member_id_offset_start().
Referenced by calculate_struct_sizes(), dna_sdna_alias_from_static_elem_full(), is_name_legal(), and version_member_static_from_alias().
| const char * DNA_struct_rename_legacy_hack_alias_from_static | ( | const char * | name | ) |
DNA Compatibility Hack.
Definition at line 308 of file dna_utils.cc.
Referenced by DNA_sdna_alias_data_ensure().
| const char * DNA_struct_rename_legacy_hack_static_from_alias | ( | const char * | name | ) |
Definition at line 292 of file dna_utils.cc.
Referenced by DNA_struct_find_index_wrapper(), and init_structDNA().