#define EET_G_LIST 103 /**< Linked list group type */
#define EET_G_HASH 104 /**< Hash table group type */
#define EET_G_UNION 105 /**< Union group type */
-#define EET_G_INHERIT 106 /**< Inherit object group type */
-#define EET_G_VARIANT 107 /**< Selectable subtype group */
-#define EET_G_LAST 108 /**< Last group type */
+#define EET_G_VARIANT 106 /**< Selectable subtype group */
+#define EET_G_LAST 107 /**< Last group type */
#define EET_I_LIMIT 128 /**< Other type exist but are reserved for internal purpose. */
}
/**
- * Make a structure variable in size/content depend on it's type
- * @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 type_member The member that give hints on what is in the union.
- * @param unified_type Describe all possible type the union could handle.
- *
- * This macro lets you easily add a switch for an object oriented representation. The position
- * of the member that define the type must be fixed for all possible type. Eet will then choose
- * in the unified_type the structure that need to be allocated to match the detected type.
- * The type_get and type_set callback of unified_type should be defined. This should be the only
- * type in edd.
- *
- * @since 1.2.4
- * @ingroup Eet_Data_Group
- * @see Eet_Data_Descriptor_Class
- */
-#define EET_DATA_DESCRIPTOR_ADD_INHERIT(edd, struct_type, name, member, type_member, unified_type) \
- { \
- struct_type ___ett; \
- \
- eet_data_descriptor_element_add(edd, name, EET_T_UNKNOW, EET_G_INHERIT, \
- (char *) (&(___ett.member)) - (char *)(&(___ett)), \
- (char *) (&(___ett.type_member)) - (char *)(&(___ett)), \
- NULL, unified_type); \
- }
-
- /**
* Add a automatically selectable type to a data descriptor
* @param edd The data descriptor to add the type to.
* @param struct_type The type of the struct.
static int eet_data_get_hash(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Chunk *echnk, int type, int group_type, void *data, char **p, int *size);
static void eet_data_put_union(Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Stream *ds, void *data_in);
static int eet_data_get_union(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Chunk *echnk, int type, int group_type, void *data, char **p, int *size);
-static void eet_data_put_inherit(Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Stream *ds, void *data_in);
-static int eet_data_get_inherit(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Chunk *echnk, int type, int group_type, void *data, char **p, int *size);
static void eet_data_put_variant(Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Stream *ds, void *data_in);
static int eet_data_get_variant(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede, Eet_Data_Chunk *echnk, int type, int group_type, void *data, char **p, int *size);
{ eet_data_get_list, eet_data_put_list },
{ eet_data_get_hash, eet_data_put_hash },
{ eet_data_get_union, eet_data_put_union },
- { eet_data_get_inherit, eet_data_put_inherit },
{ eet_data_get_variant, eet_data_put_variant }
};
Eet_Data_Element *ede;
Eet_Data_Element *tmp;
- /* UNION, INHERITED or VARIANT type would not work with simple type, we need a way to map the type. */
- if ((group_type == EET_G_INHERIT
- || group_type == EET_G_UNION
+ /* UNION, VARIANT type would not work with simple type, we need a way to map the type. */
+ if ((group_type == EET_G_UNION
|| group_type == EET_G_VARIANT)
&&
(type != EET_T_UNKNOW
|| subtype->func.type_set == NULL))
return ;
- /* Only one element is allowed with INHERITED type */
- if (group_type == EET_G_INHERIT && edd->elements.num != 0)
- return ;
- if (edd->elements.num > 0 && edd->elements.set[0].group_type == EET_G_INHERIT)
- return ;
-
- /* VARIANT type will only work if the map only contains EET_G_*, but not INHERIT, UNION, VARIANT and ARRAY. */
+ /* VARIANT type will only work if the map only contains EET_G_*, but not UNION, VARIANT and ARRAY. */
if (group_type == EET_G_VARIANT)
{
int i;
ede->group_type = group_type;
ede->offset = offset;
ede->count = count;
- /* FIXME: For the time being, VAR_ARRAY, INHERIT, UNION and VARIANT will put the counter_offset in count. */
+ /* FIXME: For the time being, VAR_ARRAY, UNION and VARIANT will put the counter_offset in count. */
ede->counter_offset = count;
/* ede->counter_offset = counter_offset; */
ede->counter_name = counter_name;
break;
case EET_G_VAR_ARRAY:
return eet_node_var_array_new(chnk.name, NULL);
- case EET_G_INHERIT:
- /* This one should work */
- goto error;
case EET_G_LIST:
case EET_G_HASH:
case EET_G_ARRAY:
}
static void
-eet_data_put_inherit(Eet_Dictionary *ed, Eet_Data_Descriptor *edd, Eet_Data_Element *ede,
- Eet_Data_Stream *ds, void *data_in)
-{
- /* FIXME */
- fprintf(stderr, "wrong !!!\n");
-}
-
-static int
-eet_data_get_inherit(Eet_Free_Context *context, const Eet_Dictionary *ed, Eet_Data_Descriptor *edd,
- Eet_Data_Element *ede, Eet_Data_Chunk *echnk,
- int type, int group_type, void *data,
- char **p, int *size)
-{
- /* FIXME */
- return 0;
-}
-
-static void
eet_data_put_variant(Eet_Dictionary *ed,
__UNUSED__ Eet_Data_Descriptor *edd,
Eet_Data_Element *ede, Eet_Data_Stream *ds, void *data_in)