forked from enlightenment/efl
eet: added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED().
This commit is contained in:
parent
a7fe49139d
commit
87b17f1ce9
|
@ -1,3 +1,7 @@
|
||||||
|
2013-09-06 Christophe Sadoine
|
||||||
|
|
||||||
|
* Eet: Added EET_DATA_DESCRIPTOR_ADD_SUB_NESTED().
|
||||||
|
|
||||||
2013-09-24 Jorge Zapata
|
2013-09-24 Jorge Zapata
|
||||||
|
|
||||||
* Eina: add a substraction in rectangles and more helpers,
|
* Eina: add a substraction in rectangles and more helpers,
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -45,6 +45,7 @@ Additions:
|
||||||
- Add eet_mmap()
|
- Add eet_mmap()
|
||||||
- Add eet_data_descriptor_name_get()
|
- Add eet_data_descriptor_name_get()
|
||||||
- Add support EET_T_VALUE
|
- Add support EET_T_VALUE
|
||||||
|
- Add EET_DATA_DESCRIPTOR_ADD_SUB_NESTED()
|
||||||
* Eo:
|
* Eo:
|
||||||
- Add generic efl object infrastructure
|
- Add generic efl object infrastructure
|
||||||
- Add debugging facility
|
- Add debugging facility
|
||||||
|
|
|
@ -2391,7 +2391,8 @@ eet_identity_certificate_print(const unsigned char *certificate,
|
||||||
#define EET_G_HASH 104 /**< Hash table group type */
|
#define EET_G_HASH 104 /**< Hash table group type */
|
||||||
#define EET_G_UNION 105 /**< Union group type */
|
#define EET_G_UNION 105 /**< Union group type */
|
||||||
#define EET_G_VARIANT 106 /**< Selectable subtype group */
|
#define EET_G_VARIANT 106 /**< Selectable subtype group */
|
||||||
#define EET_G_LAST 107 /**< Last group type */
|
#define EET_G_UNKNOWN_NESTED 107 /**< Unknown nested group type. @since 1.8 */
|
||||||
|
#define EET_G_LAST 108 /**< Last group type */
|
||||||
|
|
||||||
#define EET_I_LIMIT 128 /**< Other type exist but are reserved for internal purpose. */
|
#define EET_I_LIMIT 128 /**< Other type exist but are reserved for internal purpose. */
|
||||||
|
|
||||||
|
@ -3097,6 +3098,32 @@ eet_data_descriptor_encode(Eet_Data_Descriptor *edd,
|
||||||
0, /* 0, */ NULL, subtype); \
|
0, /* 0, */ NULL, subtype); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a nested sub-element 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.
|
||||||
|
* @param subtype The type of sub-type struct to add.
|
||||||
|
*
|
||||||
|
* This macro lets you easily add a sub-type: a struct that is nested into
|
||||||
|
* this one. If your data is pointed by this element instead of being nested,
|
||||||
|
* you should use EET_DATA_DESCRIPTOR_ADD_SUB().
|
||||||
|
* All the parameters are the same as for EET_DATA_DESCRIPTOR_ADD_SUB().
|
||||||
|
*
|
||||||
|
* @since 1.8.0
|
||||||
|
* @ingroup Eet_Data_Group
|
||||||
|
*/
|
||||||
|
#define EET_DATA_DESCRIPTOR_ADD_SUB_NESTED(edd, struct_type, name, member, subtype) \
|
||||||
|
do { \
|
||||||
|
struct_type ___ett; \
|
||||||
|
eet_data_descriptor_element_add(edd, name, EET_T_UNKNOW, EET_G_UNKNOWN_NESTED, \
|
||||||
|
(char *)(& (___ett.member)) - \
|
||||||
|
(char *)(& (___ett)), \
|
||||||
|
0, /* 0, */ NULL, subtype); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a linked list type to a data descriptor
|
* Add a linked list type to a data descriptor
|
||||||
* @param edd The data descriptor to add the type to.
|
* @param edd The data descriptor to add the type to.
|
||||||
|
|
|
@ -548,7 +548,8 @@ static const Eet_Data_Group_Type_Codec eet_group_codec[] =
|
||||||
{ eet_data_get_list, eet_data_put_list },
|
{ eet_data_get_list, eet_data_put_list },
|
||||||
{ eet_data_get_hash, eet_data_put_hash },
|
{ eet_data_get_hash, eet_data_put_hash },
|
||||||
{ eet_data_get_union, eet_data_put_union },
|
{ eet_data_get_union, eet_data_put_union },
|
||||||
{ eet_data_get_variant, eet_data_put_variant }
|
{ eet_data_get_variant, eet_data_put_variant },
|
||||||
|
{ eet_data_get_unknown, eet_data_put_unknown }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int _eet_data_words_bigendian = -1;
|
static int _eet_data_words_bigendian = -1;
|
||||||
|
@ -4570,8 +4571,16 @@ eet_data_get_unknown(Eet_Free_Context *context,
|
||||||
|
|
||||||
if (edd)
|
if (edd)
|
||||||
{
|
{
|
||||||
ptr = (void **)(((char *)data));
|
if (subtype && ede->group_type == EET_G_UNKNOWN_NESTED)
|
||||||
*ptr = (void *)data_ret;
|
{
|
||||||
|
memcpy(data, data_ret, subtype->size);
|
||||||
|
free(data_ret);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ptr = (void **)(((char *)data));
|
||||||
|
*ptr = (void *)data_ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -4680,11 +4689,18 @@ eet_data_put_unknown(Eet_Dictionary *ed,
|
||||||
if (IS_SIMPLE_TYPE(ede->type))
|
if (IS_SIMPLE_TYPE(ede->type))
|
||||||
data = eet_data_put_type(ed, ede->type, data_in, &size);
|
data = eet_data_put_type(ed, ede->type, data_in, &size);
|
||||||
else if (ede->subtype)
|
else if (ede->subtype)
|
||||||
if (*((char **)data_in))
|
{
|
||||||
data = _eet_data_descriptor_encode(ed,
|
if (ede->group_type == EET_G_UNKNOWN_NESTED)
|
||||||
ede->subtype,
|
data = _eet_data_descriptor_encode(ed,
|
||||||
*((char **)((char *)(data_in))),
|
ede->subtype,
|
||||||
&size);
|
data_in,
|
||||||
|
&size);
|
||||||
|
else if (*((char **)data_in))
|
||||||
|
data = _eet_data_descriptor_encode(ed,
|
||||||
|
ede->subtype,
|
||||||
|
*((char **)((char *)(data_in))),
|
||||||
|
&size);
|
||||||
|
}
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
eet_data_encode(ed,
|
eet_data_encode(ed,
|
||||||
|
|
Loading…
Reference in New Issue