DNA: add alias version of DNA_struct_exists

This commit is contained in:
Campbell Barton
2023-09-25 12:25:31 +10:00
parent 3f8443ed6b
commit 59210c18bc
2 changed files with 9 additions and 0 deletions

View File

@@ -187,6 +187,10 @@ int DNA_struct_find_with_alias_ex(const struct SDNA *sdna,
* \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
*/
int DNA_struct_find_with_alias(const struct SDNA *sdna, const char *str);
/**
* \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
*/
bool DNA_struct_exists_with_alias(const struct SDNA *sdna, const char *str);
/**
* \note requires #DNA_sdna_alias_data_ensure_structs_map to be called.
*/

View File

@@ -288,6 +288,11 @@ int DNA_struct_find_with_alias(const SDNA *sdna, const char *str)
return DNA_struct_find_with_alias_ex(sdna, str, &index_last_dummy);
}
bool DNA_struct_exists_with_alias(const SDNA *sdna, const char *str)
{
return DNA_struct_find_with_alias(sdna, str) != -1;
}
/* ************************* END DIV ********************** */
/* ************************* READ DNA ********************** */