diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2010-11-25 15:59:46 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2010-11-25 15:59:46 +0000 |
commit | 16d9526ad591bbdf103f2e27ea006de1f8c88766 (patch) | |
tree | 1192dff4359e0016ced0567e2f55c3197ef3e52a | |
parent | 24e8972bd87724e5eaea5a736e854d1d7a355084 (diff) | |
download | eet-16d9526ad591bbdf103f2e27ea006de1f8c88766.tar.gz |
* eet: add EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING.
SVN revision: 54989
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/lib/Eet.h | 29 |
2 files changed, 32 insertions, 0 deletions
@@ -454,3 +454,6 @@ * Fix another bug related to cipher and compression (leak and bad free) +2010-11-25 Cedric BAIL + + * Add EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING. diff --git a/src/lib/Eet.h b/src/lib/Eet.h index 68d942a..6159cf0 100644 --- a/src/lib/Eet.h +++ b/src/lib/Eet.h @@ -2528,6 +2528,35 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd, } while (0) /** + * Add a variable size array type to a data descriptor + * @param edd The data descriptor to add the type to. + * @param struct_type The type of the struct. + * @param name The string name to use to encode/decode this member + * (must be a constant global and never change). + * @param member The struct member itself to be encoded. + * + * This macro lets you easily add a fixed size array of string. All + * the parameters are the same as for EET_DATA_DESCRIPTOR_ADD_BASIC(). + * + * @since 1.4.0 + * @ingroup Eet_Data_Group + */ +#define EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY_STRING(edd, struct_type, name, member) \ + do { \ + struct_type ___ett; \ + eet_data_descriptor_element_add(edd, \ + name, \ + EET_T_STRING, \ + EET_G_VAR_ARRAY, \ + (char *)(& (___ett.member)) - \ + (char *)(& (___ett)), \ + (char *)(& (___ett.member ## _count)) - \ + (char *)(& (___ett)), \ + /* 0, */ NULL, \ + NULL); \ + } while (0) + +/** * Add an union type to a data descriptor * @param edd The data descriptor to add the type to. * @param struct_type The type of the struct. |