summaryrefslogtreecommitdiff
path: root/legacy/eet/src
diff options
context:
space:
mode:
authorDavid Walter Seikel <onefang@gmail.com>2012-03-29 11:18:52 +0000
committerDavid Walter Seikel <onefang@gmail.com>2012-03-29 11:18:52 +0000
commit7c55a30d70b50065e2da31481a9fab6dd627f248 (patch)
tree08576ba1dcef1f7b6b39dea8124c1d7f2d7d700a /legacy/eet/src
parent74f07c68930c8927cce4276286814af9eca359f5 (diff)
Added a new macro for adding variable arrays of basic types.
EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY SVN revision: 69745
Diffstat (limited to 'legacy/eet/src')
-rw-r--r--legacy/eet/src/lib/Eet.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/legacy/eet/src/lib/Eet.h b/legacy/eet/src/lib/Eet.h
index 7495090997..c49def7b66 100644
--- a/legacy/eet/src/lib/Eet.h
+++ b/legacy/eet/src/lib/Eet.h
@@ -3157,6 +3157,38 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
3157 } while(0) 3157 } while(0)
3158 3158
3159/** 3159/**
3160 * Add a variable array of basic data elements to a data descriptor.
3161 * @param edd The data descriptor to add the type to.
3162 * @param struct_type The type of the struct.
3163 * @param name The string name to use to encode/decode this member
3164 * (must be a constant global and never change).
3165 * @param member The struct member itself to be encoded.
3166 * @param type The type of the member to encode.
3167 *
3168 * This macro lets you easily add a variable size array of basic data
3169 * types. All the parameters are the same as for
3170 * EET_DATA_DESCRIPTOR_ADD_BASIC(). This assumes you have
3171 * a struct member (of type EET_T_INT) called member_count (note the
3172 * _count appended to the member) that holds the number of items in
3173 * the array. This array will be allocated separately to the struct it
3174 * is in.
3175 *
3176 * @since 1.5.0
3177 * @ingroup Eet_Data_Group
3178 */
3179#define EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY(edd, struct_type, name, member, type) \
3180 do { \
3181 struct_type ___ett; \
3182 eet_data_descriptor_element_add(edd, name, type, EET_G_VAR_ARRAY, \
3183 (char *)(& (___ett.member)) - \
3184 (char *)(& (___ett)), \
3185 (char *)(& (___ett.member ## _count)) - \
3186 (char *)(& (___ett)), \
3187 NULL, \
3188 NULL); \
3189 } while(0)
3190
3191/**
3160 * Add a fixed size array type to a data descriptor 3192 * Add a fixed size array type to a data descriptor
3161 * @param edd The data descriptor to add the type to. 3193 * @param edd The data descriptor to add the type to.
3162 * @param struct_type The type of the struct. 3194 * @param struct_type The type of the struct.