53 #define IDP_ARRAY_REALLOC_LIMIT 200
74 #define GETPROP(prop, i) &(IDP_IDPArray(prop)[i])
101 for (
int i = 0; i < narray->
len; i++) {
120 for (
int i = 0; i < prop->
len; i++) {
134 if (index >= prop->
len || index < 0) {
166 if (newlen <= prop->totallen) {
168 for (
int i = newlen; i < prop->
len; i++) {
175 if (newlen >= prop->
len) {
182 if (newlen < prop->
len) {
184 for (
int i = newlen; i < prop->
len; i++) {
197 int newsize = newlen;
198 newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
211 if (newlen >= prop->
len) {
216 for (
int a = prop->
len;
a < newlen;
a++) {
225 for (
int a = newlen;
a < prop->
len;
a++) {
234 const bool is_grow = newlen >= prop->
len;
251 int newsize = newlen;
252 newsize = (newsize >> 3) + (newsize < 9 ? 3 : 6) + newsize;
254 if (is_grow ==
false) {
261 if (is_grow ==
true) {
301 for (
a = 0;
a < prop->
len;
a++) {
337 int stlen = (int)strlen(st) + 1;
339 if (maxlen > 0 && maxlen < stlen) {
372 int stlen = (int)strlen(st);
373 if (maxlen > 0 && maxlen < stlen) {
392 int newlen = prop->
len + (int)strlen(st);
405 int newlen = str1->
len + append->
len - 1;
484 if (other && prop->
type == other->
type) {
485 switch (prop->
type) {
508 if (prop_src !=
NULL) {
510 if ((prop_dst->type != prop_src->
type || prop_dst->subtype != prop_src->
subtype) ||
512 (prop_src->
len != prop_dst->len))) {
562 if (prop_exist !=
NULL) {
585 const bool do_overwrite,
596 if (prop_exist !=
NULL) {
609 if (prop_exist !=
NULL) {
706 return (idprop && idprop->
type ==
type) ? idprop :
NULL;
730 switch (prop->
type) {
772 return id->properties;
775 if (create_if_needed) {
783 return id->properties;
790 if (prop1 ==
NULL && prop2 ==
NULL) {
793 if (prop1 ==
NULL || prop2 ==
NULL) {
794 return is_strict ? false :
true;
800 switch (prop1->
type) {
804 #if !defined(NDEBUG) && defined(WITH_PYTHON)
808 if ((p1 != p2) && ((
fabsf(p1 - p2) /
max_ff(p1, p2)) < 0.001f)) {
810 "WARNING: Comparing two float properties that have nearly the same value (%f vs. "
825 return (((prop1->
len == prop2->
len) &&
836 if (is_strict && prop1->
len != prop2->
len) {
854 if (prop1->
len != prop2->
len) {
858 for (
int i = 0; i < prop1->
len; i++) {
922 *(
double *)&prop->
data.
val = val->
d;
1008 switch (prop->
type) {
1059 if (reference !=
NULL) {
1073 const int type_filter,
1077 if (!id_property_root) {
1081 if (type_filter == 0 || (1 << id_property_root->
type) & type_filter) {
1086 switch (id_property_root->
type) {
1095 for (
int i = 0; i < id_property_root->
len; i++) {
1117 for (
a = 0;
a < prop->
len;
a++) {
1132 for (
int a = 0;
a < prop->
len;
a++) {
1154 switch (prop->
type) {
1193 for (
int i = 0; i < prop->
len; i++) {
1207 for (
int i = 0; i < prop->
len; i++) {
1241 switch (prop->
type) {
1276 "%s: found unknown IDProperty type %d, reset to Integer one !\n", __func__, prop->
type);
1292 printf(
"%s: found non group data, freeing type %d!\n", caller_func_id, (*prop)->type);
1306 switch (prop->
type) {
1310 if (
IDP_Id(prop) && !newaddr &&
G.debug) {
1311 printf(
"Error while loading \"%s\". Data not found in file!\n", prop->
name);
1319 for (
int i = 0; i < prop->
len; i++) {
1342 switch (prop->
type) {
1348 for (
int i = 0; i < prop->
len; i++) {
#define IDP_IDPArray(prop)
void(* IDPForeachPropertyCallback)(struct IDProperty *id_property, void *user_data)
void IDP_print(const struct IDProperty *prop)
void id_us_min(struct ID *id)
@ LIB_ID_CREATE_NO_USER_REFCOUNT
void id_us_plus(struct ID *id)
BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_NONNULL(1)
BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1)
#define LISTBASE_FOREACH(type, var, list)
void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink) ATTR_NONNULL(1
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void * BLI_findstring(const struct ListBase *listbase, const char *id, const int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE float max_ff(float a, float b)
Strict compiler flags for areas of code we want to ensure don't do conversions without us knowing abo...
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define STREQLEN(a, b, n)
#define BLO_read_data_address(reader, ptr_p)
ID * BLO_read_get_new_id_address(BlendLibReader *reader, struct Library *lib, struct ID *id)
void BLO_read_double_array(BlendDataReader *reader, int array_size, double **ptr_p)
void BLO_read_int32_array(BlendDataReader *reader, int array_size, int32_t **ptr_p)
#define BLO_write_struct(writer, struct_name, data_ptr)
void BLO_read_list(BlendDataReader *reader, struct ListBase *list)
#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr)
#define BLO_expand(expander, id)
bool BLO_read_requires_endian_switch(BlendDataReader *reader)
void BLO_write_raw(BlendWriter *writer, size_t size_in_bytes, const void *data_ptr)
void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
typedef double(DMatrix)[4][4]
#define CLOG_ERROR(clg_ref,...)
#define DEFAULT_ALLOC_FOR_NULL_STRINGS
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
DEGForeachIDComponentCallback callback
#define IDP_ARRAY_REALLOC_LIMIT
void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, const bool do_arraylen)
void IDP_Reset(IDProperty *prop, const IDProperty *reference)
bool IDP_InsertToGroup(IDProperty *group, IDProperty *previous, IDProperty *pnew)
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop)
static void IDP_WriteGroup(const IDProperty *prop, BlendWriter *writer)
IDProperty * IDP_GetProperties(ID *id, const bool create_if_needed)
void IDP_ConcatStringC(IDProperty *prop, const char *st)
void IDP_ConcatString(IDProperty *str1, IDProperty *append)
void IDP_BlendReadExpand(struct BlendExpander *expander, IDProperty *prop)
bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is_strict)
static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
IDProperty * IDP_NewString(const char *st, const char *name, int maxlen)
void IDP_SyncGroupValues(IDProperty *dest, const IDProperty *src)
IDProperty * IDP_CopyProperty(const IDProperty *prop)
void IDP_ReplaceGroupInGroup(IDProperty *dest, const IDProperty *src)
void IDP_MergeGroup_ex(IDProperty *dest, const IDProperty *src, const bool do_overwrite, const int flag)
static IDProperty * IDP_CopyArray(const IDProperty *prop, const int flag)
void IDP_foreach_property(IDProperty *id_property_root, const int type_filter, IDPForeachPropertyCallback callback, void *user_data)
static IDProperty * IDP_CopyID(const IDProperty *prop, const int flag)
static void IDP_FreeIDPArray(IDProperty *prop, const bool do_id_user)
void IDP_BlendReadLib(BlendLibReader *reader, IDProperty *prop)
void IDP_FreeString(IDProperty *prop)
static IDProperty * IDP_CopyGroup(const IDProperty *prop, const int flag)
static void IDP_DirectLinkIDPArray(IDProperty *prop, BlendDataReader *reader)
void IDP_WriteProperty_OnlyData(const IDProperty *prop, BlendWriter *writer)
void IDP_CopyPropertyContent(IDProperty *dst, IDProperty *src)
void IDP_RemoveFromGroup(IDProperty *group, IDProperty *prop)
IDProperty * IDP_NewIDPArray(const char *name)
void IDP_FreeProperty(IDProperty *prop)
static size_t idp_size_table[]
void IDP_AssignID(IDProperty *prop, ID *id, const int flag)
IDProperty * IDP_CopyProperty_ex(const IDProperty *prop, const int flag)
void IDP_FreeProperty_ex(IDProperty *prop, const bool do_id_user)
void IDP_AssignString(IDProperty *prop, const char *st, int maxlen)
static IDProperty * IDP_CopyString(const IDProperty *prop, const int flag)
void IDP_FreePropertyContent(IDProperty *prop)
void IDP_ReplaceInGroup_ex(IDProperty *group, IDProperty *prop, IDProperty *prop_exist)
void IDP_FreePropertyContent_ex(IDProperty *prop, const bool do_id_user)
static void IDP_DirectLinkGroup(IDProperty *prop, BlendDataReader *reader)
void IDP_FreeFromGroup(IDProperty *group, IDProperty *prop)
static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader)
void IDP_ClearProperty(IDProperty *prop)
static IDProperty * idp_generic_copy(const IDProperty *prop, const int UNUSED(flag))
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, const char *name)
void IDP_ResizeIDPArray(IDProperty *prop, int newlen)
static void IDP_DirectLinkProperty(IDProperty *prop, BlendDataReader *reader)
static void IDP_FreeGroup(IDProperty *prop, const bool do_id_user)
void IDP_MergeGroup(IDProperty *dest, const IDProperty *src, const bool do_overwrite)
static void IDP_DirectLinkArray(IDProperty *prop, BlendDataReader *reader)
IDProperty * IDP_GetIndexArray(IDProperty *prop, int index)
void IDP_AppendArray(IDProperty *prop, IDProperty *item)
static void IDP_WriteString(const IDProperty *prop, BlendWriter *writer)
IDProperty * IDP_GetPropertyTypeFromGroup(const IDProperty *prop, const char *name, const char type)
void IDP_SetIndexArray(IDProperty *prop, int index, IDProperty *item)
void IDP_ResizeArray(IDProperty *prop, int newlen)
void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
static void IDP_WriteArray(const IDProperty *prop, BlendWriter *writer)
void IDP_BlendWrite(BlendWriter *writer, const IDProperty *prop)
IDProperty * IDP_CopyIDPArray(const IDProperty *array, const int flag)
void IDP_FreeArray(IDProperty *prop)
static void IDP_WriteIDPArray(const IDProperty *prop, BlendWriter *writer)
void IDP_BlendReadData_impl(BlendDataReader *reader, IDProperty **prop, const char *caller_func_id)
bool IDP_EqualsProperties(IDProperty *prop1, IDProperty *prop2)
IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_dupallocN)(const void *vmemh)
size_t(* MEM_allocN_len)(const void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)
struct IDPropertyTemplate::@28 array
struct IDPropertyTemplate::@27 string