Move from all instances of Eolian_Type to Eolian_Type*.
char descname[0xFF];
char *tmpstr = malloc(0x1FF);
Eina_Bool var_as_ret = EINA_FALSE;
- Eolian_Type rettypet = NULL;
+ Eolian_Type *rettypet = NULL;
const char *rettype = NULL;
Eina_Bool ret_const = EINA_FALSE;
Eolian_Function_Scope scope = eolian_function_scope_get(func);
EINA_LIST_FOREACH(eolian_property_keys_list_get(func), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
const char *pdesc = NULL;
{
EINA_LIST_FOREACH(eolian_parameters_list_get(func), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
const char *pdesc;
_eolian_class_func_vars func_env;
const char *suffix = "";
Eina_Bool var_as_ret = EINA_FALSE;
- Eolian_Type rettypet = NULL;
+ Eolian_Type *rettypet = NULL;
const char *rettype = NULL;
const char *retname = NULL;
Eina_Bool ret_const = EINA_FALSE;
EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, NULL);
{
EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
Eolian_Parameter_Dir pdir;
eina_strbuf_reset(short_params);
EINA_LIST_FOREACH(eolian_property_keys_list_get(foo), itr, param)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
eolian_parameter_information_get(param, NULL, &ptypet, &pname, NULL);
Eina_Bool add_star = (ftype == EOLIAN_PROP_GET);
EINA_LIST_FOREACH(eolian_parameters_list_get(foo), itr, param)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
Eolian_Parameter_Dir pdir;
if (_function_exists(func_name, buffer)) goto end;
printf("Generation of function %s\n", func_name);
- Eolian_Type rettypet = eolian_function_return_type_get(foo, ftype);
+ Eolian_Type *rettypet = eolian_function_return_type_get(foo, ftype);
if (ftype == EOLIAN_PROP_GET && !rettypet)
{
const Eina_List *l = eolian_parameters_list_get(foo);
_eolian_class_func_vars func_env;
const char *funcname = eolian_function_name_get(funcid);
const char *suffix = "";
- Eolian_Type rettypet = NULL;
+ Eolian_Type *rettypet = NULL;
const char *rettype = NULL;
Eina_Bool var_as_ret = EINA_FALSE;
Eina_Bool add_star = EINA_FALSE;
EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *pdesc;
const char *ptype;
{
EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *pdesc;
const char *ptype;
_eolian_class_func_vars func_env;
char tmpstr[0xFF];
Eina_Bool var_as_ret = EINA_FALSE;
- Eolian_Type rettypet = NULL;
+ Eolian_Type *rettypet = NULL;
const char *rettype = NULL;
const char *retname = NULL;
Eina_Bool ret_const = EINA_FALSE;
EINA_LIST_FOREACH(eolian_property_keys_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
eolian_parameter_information_get((Eolian_Function_Parameter*)data, NULL, &ptypet, &pname, NULL);
{
EINA_LIST_FOREACH(eolian_parameters_list_get(funcid), l, data)
{
- Eolian_Type ptypet;
+ Eolian_Type *ptypet;
const char *pname;
const char *ptype;
Eolian_Parameter_Dir pdir;
_comment_return(Eolian_Function function,
Eolian_Function_Type rettype)
{
- Eolian_Type rettypet = eolian_function_return_type_get(function, rettype);
+ Eolian_Type *rettypet = eolian_function_return_type_get(function, rettype);
const char *rettypes = NULL;
if (rettypet) rettypes = eolian_type_c_type_get(rettypet);
std::string doc = "";
namespace eolian_cxx {
inline std::string
-type_lookup(Eolian_Type type)
+type_lookup(Eolian_Type *type)
{
if (type == NULL)
return "void";
*
* @ingroup Eolian
*/
-typedef struct _Eolian_Type* Eolian_Type;
+typedef struct _Eolian_Type Eolian_Type;
/* Class function parameter information
*
*
* @ingroup Eolian
*/
-EAPI void eolian_parameter_information_get(const Eolian_Function_Parameter *param_desc, Eolian_Parameter_Dir *param_dir, Eolian_Type *type, const char **name, const char **description);
+EAPI void eolian_parameter_information_get(const Eolian_Function_Parameter *param_desc, Eolian_Parameter_Dir *param_dir, Eolian_Type **type, const char **name, const char **description);
/*
* @brief Get type of a parameter
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_parameter_type_get(const Eolian_Function_Parameter *param);
+EAPI Eolian_Type *eolian_parameter_type_get(const Eolian_Function_Parameter *param);
/*
* @brief Get name of a parameter
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_function_return_type_get(Eolian_Function function_id, Eolian_Function_Type ftype);
+EAPI Eolian_Type *eolian_function_return_type_get(Eolian_Function function_id, Eolian_Function_Type ftype);
/*
* @brief Get the return default value of a function.
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_type_find_by_alias(const char *alias);
+EAPI Eolian_Type *eolian_type_find_by_alias(const char *alias);
/*
* @brief Find a struct by name
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_type_struct_find_by_name(const char *name);
+EAPI Eolian_Type *eolian_type_struct_find_by_name(const char *name);
/*
* @brief Get the type of a type (regular, function, pointer)
*
* @ingroup Eolian
*/
-EAPI Eolian_Type_Type eolian_type_type_get(Eolian_Type tp);
+EAPI Eolian_Type_Type eolian_type_type_get(Eolian_Type *tp);
/*
* @brief Get an iterator to all arguments of a function type.
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_type_arguments_list_get(Eolian_Type tp);
+EAPI Eina_Iterator *eolian_type_arguments_list_get(Eolian_Type *tp);
/*
* @brief Get an iterator to all subtypes of a type.
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_type_subtypes_list_get(Eolian_Type tp);
+EAPI Eina_Iterator *eolian_type_subtypes_list_get(Eolian_Type *tp);
/*
* @brief Get an iterator to all field names of a struct type.
*
* @ingroup Eolian
*/
-EAPI Eina_Iterator *eolian_type_struct_field_names_list_get(Eolian_Type tp);
+EAPI Eina_Iterator *eolian_type_struct_field_names_list_get(Eolian_Type *tp);
/*
* @brief Get a field of a struct type.
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_type_struct_field_get(Eolian_Type tp, const char *field);
+EAPI Eolian_Type *eolian_type_struct_field_get(Eolian_Type *tp, const char *field);
/*
* @brief Get the description of a field of a struct type.
*
* @ingroup Eolian
*/
-EAPI const char *eolian_type_struct_field_description_get(Eolian_Type tp, const char *field);
+EAPI const char *eolian_type_struct_field_description_get(Eolian_Type *tp, const char *field);
/*
* @brief Get the description of a struct type.
*
* @ingroup Eolian
*/
-EAPI const char *eolian_type_struct_description_get(Eolian_Type tp);
+EAPI const char *eolian_type_struct_description_get(Eolian_Type *tp);
/*
* @brief Get the return type of a function type.
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_type_return_type_get(Eolian_Type tp);
+EAPI Eolian_Type *eolian_type_return_type_get(Eolian_Type *tp);
/*
* @brief Get the base type of a function type.
*
* @ingroup Eolian
*/
-EAPI Eolian_Type eolian_type_base_type_get(Eolian_Type tp);
+EAPI Eolian_Type *eolian_type_base_type_get(Eolian_Type *tp);
/*
* @brief Get whether the given type is @own.
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_type_is_own(Eolian_Type tp);
+EAPI Eina_Bool eolian_type_is_own(Eolian_Type *tp);
/*
* @brief Get whether the given type is const.
*
* @ingroup Eolian
*/
-EAPI Eina_Bool eolian_type_is_const(Eolian_Type tp);
+EAPI Eina_Bool eolian_type_is_const(Eolian_Type *tp);
/*
* @brief Get the full C type name of the given type with a name.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_c_type_named_get(Eolian_Type tp, const char *name);
+EAPI Eina_Stringshare *eolian_type_c_type_named_get(Eolian_Type *tp, const char *name);
/*
* @brief Get the full C type name of the given type without a name.
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_c_type_get(Eolian_Type tp);
+EAPI Eina_Stringshare *eolian_type_c_type_get(Eolian_Type *tp);
/*
* @brief Get the type name of the given type. You have to manually delete
*
* @ingroup Eolian
*/
-EAPI Eina_Stringshare *eolian_type_name_get(Eolian_Type tp);
+EAPI Eina_Stringshare *eolian_type_name_get(Eolian_Type *tp);
#endif
if (meth->ret)
{
printf(" return: ");
- database_type_print((Eolian_Type)meth->ret->type);
+ database_type_print((Eolian_Type*)meth->ret->type);
printf(" (%s)\n", meth->ret->comment);
}
printf(" legacy : %s\n", meth->legacy);
EINA_LIST_FOREACH(meth->params, m, param)
{
printf(" param: %s %s : ", _param_way_str[param->way], param->name);
- database_type_print((Eolian_Type)param->type);
+ database_type_print((Eolian_Type*)param->type);
printf(" (%s)\n", param->comment);
}
}
EINA_LIST_FOREACH(prop->keys, m, param)
{
printf(" key: %s : ", param->name);
- database_type_print((Eolian_Type)param->type);
+ database_type_print((Eolian_Type*)param->type);
printf(" (%s)\n", param->comment);
}
EINA_LIST_FOREACH(prop->values, m, param)
{
printf(" value: %s : ", param->name);
- database_type_print((Eolian_Type)param->type);
+ database_type_print((Eolian_Type*)param->type);
printf(" (%s)\n", param->comment);
}
EINA_LIST_FOREACH(prop->accessors, m, accessor)
{
printf(" accessor: ");
if (accessor->ret)
- database_type_print((Eolian_Type)accessor->ret->type);
+ database_type_print((Eolian_Type*)accessor->ret->type);
printf(" : %s (%s)\n", _accessor_type_str[accessor->type], accessor->comment);
printf(" legacy : %s\n", accessor->legacy);
}
if (meth->ret)
{
printf(" return: ");
- database_type_print((Eolian_Type)meth->ret->type);
+ database_type_print((Eolian_Type*)meth->ret->type);
printf(" (%s)\n", meth->ret->comment);
}
printf(" legacy : %s\n", meth->legacy);
EINA_LIST_FOREACH(meth->params, m, param)
{
printf(" param: %s %s : ", _param_way_str[param->way], param->name);
- database_type_print((Eolian_Type)param->type);
+ database_type_print((Eolian_Type*)param->type);
printf(" (%s)\n", param->comment);
}
}
_dump_type(Eo_Typedef_Def *type)
{
printf("Typedef: %s ", type->alias);
- database_type_print((Eolian_Type)type->type);
+ database_type_print((Eolian_Type*)type->type);
printf("\n");
}
static void
_dump_struct(Eo_Type_Def *type)
{
- database_type_print((Eolian_Type)type);
+ database_type_print((Eolian_Type*)type);
}
void
database_function_data_set(foo_id, EOLIAN_LEGACY, meth->legacy);
EINA_LIST_FOREACH(meth->params, m, param)
{
- database_method_parameter_add(foo_id, (Eolian_Parameter_Dir)param->way, (Eolian_Type)param->type, param->name, param->comment);
+ database_method_parameter_add(foo_id, (Eolian_Parameter_Dir)param->way, (Eolian_Type*)param->type, param->name, param->comment);
param->type = NULL;
}
}
EINA_LIST_FOREACH(prop->keys, m, param)
{
Eolian_Function_Parameter *p = database_property_key_add(
- foo_id, (Eolian_Type)param->type, param->name, param->comment);
+ foo_id, (Eolian_Type*)param->type, param->name, param->comment);
database_parameter_nonull_set(p, param->nonull);
param->type = NULL;
}
EINA_LIST_FOREACH(prop->values, m, param)
{
Eolian_Function_Parameter *p = database_property_value_add(
- foo_id, (Eolian_Type)param->type, param->name, param->comment);
+ foo_id, (Eolian_Type*)param->type, param->name, param->comment);
database_parameter_nonull_set(p, param->nonull);
param->type = NULL;
}
accessor->type == SETTER?EOLIAN_PROP_SET:EOLIAN_PROP_GET;
if (accessor->ret && accessor->ret->type)
{
- database_function_return_type_set(foo_id, ftype, (Eolian_Type)accessor->ret->type);
+ database_function_return_type_set(foo_id, ftype, (Eolian_Type*)accessor->ret->type);
database_function_return_comment_set(foo_id,
ftype, accessor->ret->comment);
database_function_return_flag_set_as_warn_unused(foo_id,
database_class_function_add(class, foo_id);
if (meth->ret)
{
- database_function_return_type_set(foo_id, EOLIAN_METHOD, (Eolian_Type)meth->ret->type);
+ database_function_return_type_set(foo_id, EOLIAN_METHOD, (Eolian_Type*)meth->ret->type);
database_function_return_comment_set(foo_id, EOLIAN_METHOD, meth->ret->comment);
database_function_return_flag_set_as_warn_unused(foo_id,
EOLIAN_METHOD, meth->ret->warn_unused);
EINA_LIST_FOREACH(meth->params, m, param)
{
Eolian_Function_Parameter *p = database_method_parameter_add(foo_id,
- (Eolian_Parameter_Dir)param->way, (Eolian_Type)param->type, param->name, param->comment);
+ (Eolian_Parameter_Dir)param->way, (Eolian_Type*)param->type, param->name, param->comment);
database_parameter_nonull_set(p, param->nonull);
param->type = NULL;
}
static Eina_Bool
_db_fill_type(Eo_Typedef_Def *type_def)
{
- Eina_Bool ret = database_type_add(type_def->alias, (Eolian_Type)type_def->type);
+ Eina_Bool ret = database_type_add(type_def->alias, (Eolian_Type*)type_def->type);
type_def->type = NULL;
return ret;
}
static Eina_Bool
_db_fill_struct(Eo_Type_Def *struct_def)
{
- return database_struct_add((Eolian_Type)struct_def);
+ return database_struct_add((Eolian_Type*)struct_def);
}
Eina_Bool
typedef struct
{
Eina_Stringshare *alias;
- Eolian_Type type;
+ Eolian_Type *type;
} Type_Desc;
typedef struct
Eina_List *params; /* list of Eolian_Function_Parameter */
Eolian_Function_Type type;
Eolian_Function_Scope scope;
- Eolian_Type get_ret_type;
- Eolian_Type set_ret_type;
+ Eolian_Type *get_ret_type;
+ Eolian_Type *set_ret_type;
Eina_Hash *data;
Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
Eina_Bool get_virtual_pure :1;
typedef struct _Eolian_Function_Parameter
{
Eina_Stringshare *name;
- Eolian_Type type;
+ Eolian_Type *type;
Eina_Stringshare *description;
Eolian_Parameter_Dir param_dir;
Eina_Bool is_const_on_get :1; /* True if const in this the get property */
typedef struct
{
- Eolian_Type type;
+ Eolian_Type *type;
const char *comment;
} _Struct_Field_Type;
-typedef struct
+typedef struct _Eolian_Type
{
const char *name;
Eolian_Type_Type type;
union {
struct {
Eina_List *subtypes;
- Eolian_Type base_type;
+ Eolian_Type *base_type;
};
struct {
Eina_List *arguments;
- Eolian_Type ret_type;
+ Eolian_Type *ret_type;
};
struct {
Eina_Hash *fields;
};
Eina_Bool is_const :1;
Eina_Bool is_own :1;
-} _Eolian_Type;
+} Eolian_Type;
typedef struct _Eolian_Implement
{
}
void
-database_type_del(Eolian_Type type)
+database_type_del(Eolian_Type *type)
{
if (!type) return;
eo_definitions_type_free((Eo_Type_Def*)type);
}
Eina_Bool
-database_type_add(const char *alias, Eolian_Type type)
+database_type_add(const char *alias, Eolian_Type *type)
{
if (_types)
{
return EINA_FALSE;
}
-Eina_Bool database_struct_add(Eolian_Type type)
+Eina_Bool database_struct_add(Eolian_Type *tp)
{
- _Eolian_Type *tp = (_Eolian_Type*)type;
if (_structs)
{
eina_hash_set(_structs, tp->name, tp);
return EINA_FALSE;
}
-EAPI Eolian_Type
+EAPI Eolian_Type *
eolian_type_find_by_alias(const char *alias)
{
if (!_types) return NULL;
return cl?cl->type:NULL;
}
-EAPI Eolian_Type
+EAPI Eolian_Type *
eolian_type_struct_find_by_name(const char *name)
{
if (!_structs) return NULL;
Eina_Stringshare *shr = eina_stringshare_add(name);
- Eolian_Type tp = eina_hash_find(_structs, shr);
+ Eolian_Type *tp = eina_hash_find(_structs, shr);
eina_stringshare_del(shr);
return tp;
}
}
static Eolian_Function_Parameter *
-_parameter_new(Eolian_Type type, const char *name, const char *description)
+_parameter_new(Eolian_Type *type, const char *name, const char *description)
{
Eolian_Function_Parameter *param = NULL;
param = calloc(1, sizeof(*param));
}
Eolian_Function_Parameter *
-database_property_key_add(Eolian_Function foo_id, Eolian_Type type, const char *name, const char *description)
+database_property_key_add(Eolian_Function foo_id, Eolian_Type *type, const char *name, const char *description)
{
_Eolian_Function *fid = (_Eolian_Function *)foo_id;
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
}
Eolian_Function_Parameter *
-database_property_value_add(Eolian_Function foo_id, Eolian_Type type, const char *name, const char *description)
+database_property_value_add(Eolian_Function foo_id, Eolian_Type *type, const char *name, const char *description)
{
_Eolian_Function *fid = (_Eolian_Function *)foo_id;
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
}
Eolian_Function_Parameter *
-database_method_parameter_add(Eolian_Function foo_id, Eolian_Parameter_Dir param_dir, Eolian_Type type, const char *name, const char *description)
+database_method_parameter_add(Eolian_Function foo_id, Eolian_Parameter_Dir param_dir, Eolian_Type *type, const char *name, const char *description)
{
_Eolian_Function *fid = (_Eolian_Function *)foo_id;
EINA_SAFETY_ON_NULL_RETURN_VAL(fid, NULL);
return NULL;
}
-EAPI Eolian_Type
+EAPI Eolian_Type *
eolian_parameter_type_get(const Eolian_Function_Parameter *param)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(param, NULL);
/* Get parameter information */
EAPI void
-eolian_parameter_information_get(const Eolian_Function_Parameter *param, Eolian_Parameter_Dir *param_dir, Eolian_Type *type, const char **name, const char **description)
+eolian_parameter_information_get(const Eolian_Function_Parameter *param, Eolian_Parameter_Dir *param_dir, Eolian_Type **type, const char **name, const char **description)
{
EINA_SAFETY_ON_NULL_RETURN(param);
if (param_dir) *param_dir = param->param_dir;
}
void
-database_parameter_type_set(Eolian_Function_Parameter *param, Eolian_Type types)
+database_parameter_type_set(Eolian_Function_Parameter *param, Eolian_Type *types)
{
EINA_SAFETY_ON_NULL_RETURN(param);
param->type = types;
return param->nonull;
}
-void database_function_return_type_set(Eolian_Function foo_id, Eolian_Function_Type ftype, Eolian_Type ret_type)
+void database_function_return_type_set(Eolian_Function foo_id, Eolian_Function_Type ftype, Eolian_Type *ret_type)
{
_Eolian_Function *fid = (_Eolian_Function *)foo_id;
switch (ftype)
}
}
-EAPI Eolian_Type
+EAPI Eolian_Type *
eolian_function_return_type_get(Eolian_Function foo_id, Eolian_Function_Type ftype)
{
_Eolian_Function *fid = (_Eolian_Function *)foo_id;
}
EAPI Eolian_Type_Type
-eolian_type_type_get(Eolian_Type tp)
+eolian_type_type_get(Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EOLIAN_TYPE_UNKNOWN_TYPE);
- return ((_Eolian_Type*)tp)->type;
+ return tp->type;
}
EAPI Eina_Iterator *
-eolian_type_arguments_list_get(Eolian_Type tp)
+eolian_type_arguments_list_get(Eolian_Type *tp)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_type_type_get(tp) == EOLIAN_TYPE_FUNCTION, NULL);
- if (!tpp->arguments) return NULL;
- return eina_list_iterator_new(tpp->arguments);
+ if (!tp->arguments) return NULL;
+ return eina_list_iterator_new(tp->arguments);
}
EAPI Eina_Iterator *
-eolian_type_subtypes_list_get(Eolian_Type tp)
+eolian_type_subtypes_list_get(Eolian_Type *tp)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
Eolian_Type_Type tpt;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- tpt = tpp->type;
+ tpt = tp->type;
EINA_SAFETY_ON_FALSE_RETURN_VAL(tpt == EOLIAN_TYPE_REGULAR
|| tpt == EOLIAN_TYPE_POINTER
|| tpt == EOLIAN_TYPE_REGULAR_STRUCT, NULL);
- if (!tpp->subtypes) return NULL;
- return eina_list_iterator_new(tpp->subtypes);
+ if (!tp->subtypes) return NULL;
+ return eina_list_iterator_new(tp->subtypes);
}
EAPI Eina_Iterator *
-eolian_type_struct_field_names_list_get(Eolian_Type tp)
+eolian_type_struct_field_names_list_get(Eolian_Type *tp)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(tpp->type == EOLIAN_TYPE_STRUCT, NULL);
- return eina_hash_iterator_key_new(tpp->fields);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
+ return eina_hash_iterator_key_new(tp->fields);
}
-EAPI Eolian_Type
-eolian_type_struct_field_get(Eolian_Type tp, const char *field)
+EAPI Eolian_Type *
+eolian_type_struct_field_get(Eolian_Type *tp, const char *field)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
_Struct_Field_Type *sf = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(field, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(tpp->type == EOLIAN_TYPE_STRUCT, NULL);
- sf = eina_hash_find(tpp->fields, field);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
+ sf = eina_hash_find(tp->fields, field);
if (!sf) return NULL;
return sf->type;
}
EAPI const char *
-eolian_type_struct_field_description_get(Eolian_Type tp, const char *field)
+eolian_type_struct_field_description_get(Eolian_Type *tp, const char *field)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
_Struct_Field_Type *sf = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(field, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(tpp->type == EOLIAN_TYPE_STRUCT, NULL);
- sf = eina_hash_find(tpp->fields, field);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
+ sf = eina_hash_find(tp->fields, field);
if (!sf) return NULL;
return sf->comment;
}
EAPI const char *
-eolian_type_struct_description_get(Eolian_Type tp)
+eolian_type_struct_description_get(Eolian_Type *tp)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- EINA_SAFETY_ON_FALSE_RETURN_VAL(tpp->type == EOLIAN_TYPE_STRUCT, NULL);
- return tpp->comment;
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(tp->type == EOLIAN_TYPE_STRUCT, NULL);
+ return tp->comment;
}
-EAPI Eolian_Type
-eolian_type_return_type_get(Eolian_Type tp)
+EAPI Eolian_Type *
+eolian_type_return_type_get(Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
EINA_SAFETY_ON_FALSE_RETURN_VAL(eolian_type_type_get(tp) == EOLIAN_TYPE_FUNCTION, NULL);
- return ((_Eolian_Type*)tp)->ret_type;
+ return tp->ret_type;
}
-EAPI Eolian_Type
-eolian_type_base_type_get(Eolian_Type tp)
+EAPI Eolian_Type *
+eolian_type_base_type_get(Eolian_Type *tp)
{
Eolian_Type_Type tpt;
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
tpt = eolian_type_type_get(tp);
EINA_SAFETY_ON_FALSE_RETURN_VAL(tpt == EOLIAN_TYPE_POINTER, NULL);
- return ((_Eolian_Type*)tp)->base_type;
+ return tp->base_type;
}
EAPI Eina_Bool
-eolian_type_is_own(Eolian_Type tp)
+eolian_type_is_own(Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
- return ((_Eolian_Type*)tp)->is_own;
+ return tp->is_own;
}
EAPI Eina_Bool
-eolian_type_is_const(Eolian_Type tp)
+eolian_type_is_const(Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
- return ((_Eolian_Type*)tp)->is_const;
+ return tp->is_const;
}
-static void _type_to_str(Eolian_Type tp, Eina_Strbuf *buf, const char *name);
+static void _type_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
static void
-_ftype_to_str(Eolian_Type tp, Eina_Strbuf *buf, const char *name)
+_ftype_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
Eina_List *l;
- Eolian_Type stp;
+ Eolian_Type *stp;
Eina_Bool first = EINA_TRUE;
- if (tpp->ret_type)
- _type_to_str(tpp->ret_type, buf, NULL);
+ if (tp->ret_type)
+ _type_to_str(tp->ret_type, buf, NULL);
else
eina_strbuf_append(buf, "void");
eina_strbuf_append(buf, " (*");
if (name) eina_strbuf_append(buf, name);
eina_strbuf_append(buf, ")(");
- EINA_LIST_FOREACH(tpp->arguments, l, stp)
+ EINA_LIST_FOREACH(tp->arguments, l, stp)
{
if (!first) eina_strbuf_append(buf, ", ");
first = EINA_FALSE;
_stype_field_cb(const Eina_Hash *hash EINA_UNUSED, const void *key, void *data,
void *fdata)
{
- _type_to_str((Eolian_Type)((_Struct_Field_Type*)data)->type,
+ _type_to_str((Eolian_Type*)((_Struct_Field_Type*)data)->type,
(Eina_Strbuf*)fdata, (const char*)key);
eina_strbuf_append((Eina_Strbuf*)fdata, "; ");
return EINA_TRUE;
}
static void
-_stype_to_str(Eolian_Type tp, Eina_Strbuf *buf, const char *name)
+_stype_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
eina_strbuf_append(buf, "struct ");
- if (tpp->name)
+ if (tp->name)
{
- eina_strbuf_append(buf, tpp->name);
+ eina_strbuf_append(buf, tp->name);
eina_strbuf_append_char(buf, ' ');
}
eina_strbuf_append(buf, "{ ");
- eina_hash_foreach(tpp->fields, _stype_field_cb, buf);
+ eina_hash_foreach(tp->fields, _stype_field_cb, buf);
eina_strbuf_append(buf, "}");
if (name)
{
}
static void
-_type_to_str(Eolian_Type tp, Eina_Strbuf *buf, const char *name)
+_type_to_str(Eolian_Type *tp, Eina_Strbuf *buf, const char *name)
{
- _Eolian_Type *tpp = (_Eolian_Type*)tp;
- if (tpp->type == EOLIAN_TYPE_FUNCTION)
+ if (tp->type == EOLIAN_TYPE_FUNCTION)
{
_ftype_to_str(tp, buf, name);
return;
}
- else if (tpp->type == EOLIAN_TYPE_STRUCT)
+ else if (tp->type == EOLIAN_TYPE_STRUCT)
{
_stype_to_str(tp, buf, name);
return;
}
- if ((tpp->type == EOLIAN_TYPE_REGULAR
- || tpp->type == EOLIAN_TYPE_REGULAR_STRUCT
- || tpp->type == EOLIAN_TYPE_VOID)
- && tpp->is_const)
+ if ((tp->type == EOLIAN_TYPE_REGULAR
+ || tp->type == EOLIAN_TYPE_REGULAR_STRUCT
+ || tp->type == EOLIAN_TYPE_VOID)
+ && tp->is_const)
{
eina_strbuf_append(buf, "const ");
}
- if (tpp->type == EOLIAN_TYPE_REGULAR)
- eina_strbuf_append(buf, tpp->name);
- else if (tpp->type == EOLIAN_TYPE_REGULAR_STRUCT)
+ if (tp->type == EOLIAN_TYPE_REGULAR)
+ eina_strbuf_append(buf, tp->name);
+ else if (tp->type == EOLIAN_TYPE_REGULAR_STRUCT)
{
eina_strbuf_append(buf, "struct ");
- eina_strbuf_append(buf, tpp->name);
+ eina_strbuf_append(buf, tp->name);
}
- else if (tpp->type == EOLIAN_TYPE_VOID)
+ else if (tp->type == EOLIAN_TYPE_VOID)
eina_strbuf_append(buf, "void");
else
{
- _Eolian_Type *btpp = (_Eolian_Type*)tpp->base_type;
- _type_to_str(tpp->base_type, buf, NULL);
- if (btpp->type != EOLIAN_TYPE_POINTER || btpp->is_const)
+ Eolian_Type *btp = tp->base_type;
+ _type_to_str(tp->base_type, buf, NULL);
+ if (btp->type != EOLIAN_TYPE_POINTER || btp->is_const)
eina_strbuf_append_char(buf, ' ');
eina_strbuf_append_char(buf, '*');
- if (tpp->is_const) eina_strbuf_append(buf, " const");
+ if (tp->is_const) eina_strbuf_append(buf, " const");
}
if (name)
{
}
EAPI Eina_Stringshare *
-eolian_type_c_type_named_get(Eolian_Type tp, const char *name)
+eolian_type_c_type_named_get(Eolian_Type *tp, const char *name)
{
Eina_Stringshare *ret;
Eina_Strbuf *buf;
}
EAPI Eina_Stringshare *
-eolian_type_c_type_get(Eolian_Type tp)
+eolian_type_c_type_get(Eolian_Type *tp)
{
return eolian_type_c_type_named_get(tp, NULL);
}
EAPI Eina_Stringshare *
-eolian_type_name_get(Eolian_Type tp)
+eolian_type_name_get(Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
- eina_stringshare_ref(((_Eolian_Type*)tp)->name);
- return ((_Eolian_Type*)tp)->name;
+ eina_stringshare_ref(tp->name);
+ return tp->name;
}
static Eina_Bool
void *fdata EINA_UNUSED)
{
printf("%s: ", (const char*)key);
- database_type_print((Eolian_Type)data);
+ database_type_print((Eolian_Type*)data);
puts("; ");
return EINA_TRUE;
}
void
-database_type_print(Eolian_Type type)
+database_type_print(Eolian_Type *tp)
{
Eina_List *l;
- Eolian_Type stp;
- _Eolian_Type *tp = (_Eolian_Type*)type;
+ Eolian_Type *stp;
if (tp->is_own)
puts("own(");
if (tp->is_const)
break;
}
printf("%*s%s <%s> <", nb_spaces + 5, "", param_dir, param->name);
- database_type_print((Eolian_Type)param->type);
+ database_type_print((Eolian_Type*)param->type);
printf("> <%s>\n", param->description?param->description:"");
}
return EINA_TRUE;
int database_shutdown();
/* Add a type in the database */
-Eina_Bool database_type_add(const char *alias, Eolian_Type type);
+Eina_Bool database_type_add(const char *alias, Eolian_Type *type);
/* Add a struct in the database */
-Eina_Bool database_struct_add(Eolian_Type type);
+Eina_Bool database_struct_add(Eolian_Type *type);
/* Add a class in the database */
Eolian_Class *database_class_add(const char *class_name, Eolian_Class_Type type);
#define database_function_description_set(foo_id, key, desc) database_function_data_set((foo_id), (key), (desc))
/* Add a key to a property */
-Eolian_Function_Parameter *database_property_key_add(Eolian_Function foo_id, Eolian_Type type, const char *name, const char *description);
+Eolian_Function_Parameter *database_property_key_add(Eolian_Function foo_id, Eolian_Type *type, const char *name, const char *description);
/* Add a value to a property */
-Eolian_Function_Parameter *database_property_value_add(Eolian_Function foo_id, Eolian_Type type, const char *name, const char *description);
+Eolian_Function_Parameter *database_property_value_add(Eolian_Function foo_id, Eolian_Type *type, const char *name, const char *description);
/* Add a parameter to a method */
-Eolian_Function_Parameter *database_method_parameter_add(Eolian_Function foo_id, Eolian_Parameter_Dir param_dir, Eolian_Type type, const char *name, const char *description);
+Eolian_Function_Parameter *database_method_parameter_add(Eolian_Function foo_id, Eolian_Parameter_Dir param_dir, Eolian_Type *type, const char *name, const char *description);
-void database_type_del(Eolian_Type type);
+void database_type_del(Eolian_Type *type);
void database_parameter_const_attribute_set(Eolian_Function_Parameter *param, Eina_Bool is_get, Eina_Bool is_const);
void database_parameter_nonull_set(Eolian_Function_Parameter *param, Eina_Bool nonull);
-void database_function_return_type_set(Eolian_Function foo_id, Eolian_Function_Type ftype, Eolian_Type ret_type);
+void database_function_return_type_set(Eolian_Function foo_id, Eolian_Function_Type ftype, Eolian_Type *ret_type);
void database_function_return_comment_set(Eolian_Function foo_id, Eolian_Function_Type ftype, const char *ret_comment);
database_class_event_add(Eolian_Class *class, Eolian_Event *event_desc);
void
-database_type_print(Eolian_Type type);
+database_type_print(Eolian_Type *type);
#endif
START_TEST(eolian_typedef)
{
- Eolian_Type type = NULL;
+ Eolian_Type *type = NULL;
const char *type_name = NULL;
Eina_Iterator *iter = NULL;
Eolian_Class *class;
Eolian_Function fid = NULL;
Eolian_Function_Parameter *param = NULL;
const Eina_List *params_list = NULL;
- Eolian_Type type = NULL;
+ Eolian_Type *type = NULL;
const char *type_name = NULL;
Eina_Iterator *iter = NULL;
Eolian_Class *class;
START_TEST(eolian_simple_parsing)
{
Eolian_Function fid = NULL;
- Eolian_Type ptypep = NULL;
+ Eolian_Type *ptypep = NULL;
const char *string = NULL, *ptype = NULL, *pname = NULL;
Eolian_Parameter_Dir dir = EOLIAN_IN_PARAM;
const Eina_List *list = NULL;
Eolian_Function_Parameter *param = NULL;
Eolian_Class *class;
- Eolian_Type tp;
+ Eolian_Type *tp;
eolian_init();
/* Parsing */