forked from enlightenment/efl
eolian: add typedecl delete func and init hashes correctly
This commit is contained in:
parent
67f17f1068
commit
8944cc44c1
|
@ -105,6 +105,12 @@ typedef struct _Eolian_Function Eolian_Function;
|
||||||
*/
|
*/
|
||||||
typedef struct _Eolian_Type Eolian_Type;
|
typedef struct _Eolian_Type Eolian_Type;
|
||||||
|
|
||||||
|
/* Type declaration.
|
||||||
|
*
|
||||||
|
* @ingroup Eolian
|
||||||
|
*/
|
||||||
|
typedef struct _Eolian_Typedecl Eolian_Typedecl;
|
||||||
|
|
||||||
/* Class function parameter information
|
/* Class function parameter information
|
||||||
*
|
*
|
||||||
* @ingroup Eolian
|
* @ingroup Eolian
|
||||||
|
|
|
@ -14,8 +14,7 @@ database_type_del(Eolian_Type *tp)
|
||||||
if (tp->base.file) eina_stringshare_del(tp->base.file);
|
if (tp->base.file) eina_stringshare_del(tp->base.file);
|
||||||
if (tp->subtypes) EINA_LIST_FREE(tp->subtypes, stp)
|
if (tp->subtypes) EINA_LIST_FREE(tp->subtypes, stp)
|
||||||
database_type_del(stp);
|
database_type_del(stp);
|
||||||
if (tp->base_type)
|
database_type_del(tp->base_type);
|
||||||
database_type_del(tp->base_type);
|
|
||||||
if (tp->name) eina_stringshare_del(tp->name);
|
if (tp->name) eina_stringshare_del(tp->name);
|
||||||
if (tp->full_name) eina_stringshare_del(tp->full_name);
|
if (tp->full_name) eina_stringshare_del(tp->full_name);
|
||||||
if (tp->fields) eina_hash_free(tp->fields);
|
if (tp->fields) eina_hash_free(tp->fields);
|
||||||
|
@ -28,6 +27,24 @@ database_type_del(Eolian_Type *tp)
|
||||||
free(tp);
|
free(tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
database_typedecl_del(Eolian_Typedecl *tp)
|
||||||
|
{
|
||||||
|
if (!tp) return;
|
||||||
|
const char *sp;
|
||||||
|
if (tp->base.file) eina_stringshare_del(tp->base.file);
|
||||||
|
database_type_del(tp->base_type);
|
||||||
|
if (tp->name) eina_stringshare_del(tp->name);
|
||||||
|
if (tp->full_name) eina_stringshare_del(tp->full_name);
|
||||||
|
if (tp->fields) eina_hash_free(tp->fields);
|
||||||
|
if (tp->field_list) eina_list_free(tp->field_list);
|
||||||
|
if (tp->namespaces) EINA_LIST_FREE(tp->namespaces, sp)
|
||||||
|
eina_stringshare_del(sp);
|
||||||
|
if (tp->legacy) eina_stringshare_del(tp->legacy);
|
||||||
|
database_doc_del(tp->doc);
|
||||||
|
free(tp);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
database_typedef_del(Eolian_Type *tp)
|
database_typedef_del(Eolian_Type *tp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,8 +47,11 @@ database_init()
|
||||||
eina_init();
|
eina_init();
|
||||||
_classes = eina_hash_stringshared_new(EINA_FREE_CB(database_class_del));
|
_classes = eina_hash_stringshared_new(EINA_FREE_CB(database_class_del));
|
||||||
_aliases = eina_hash_stringshared_new(EINA_FREE_CB(database_typedef_del));
|
_aliases = eina_hash_stringshared_new(EINA_FREE_CB(database_typedef_del));
|
||||||
|
_aliasesd = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
|
||||||
_structs = eina_hash_stringshared_new(EINA_FREE_CB(database_type_del));
|
_structs = eina_hash_stringshared_new(EINA_FREE_CB(database_type_del));
|
||||||
|
_structsd = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
|
||||||
_enums = eina_hash_stringshared_new(EINA_FREE_CB(database_type_del));
|
_enums = eina_hash_stringshared_new(EINA_FREE_CB(database_type_del));
|
||||||
|
_enumsd = eina_hash_stringshared_new(EINA_FREE_CB(database_typedecl_del));
|
||||||
_globals = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
|
_globals = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
|
||||||
_constants = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
|
_constants = eina_hash_stringshared_new(EINA_FREE_CB(database_var_del));
|
||||||
_classesf = eina_hash_stringshared_new(NULL);
|
_classesf = eina_hash_stringshared_new(NULL);
|
||||||
|
|
|
@ -187,6 +187,7 @@ struct _Eolian_Typedecl
|
||||||
{
|
{
|
||||||
Eolian_Object base;
|
Eolian_Object base;
|
||||||
Eolian_Typedecl_Type type;
|
Eolian_Typedecl_Type type;
|
||||||
|
Eolian_Type *base_type;
|
||||||
Eina_Stringshare *name;
|
Eina_Stringshare *name;
|
||||||
Eina_Stringshare *full_name;
|
Eina_Stringshare *full_name;
|
||||||
Eina_List *namespaces;
|
Eina_List *namespaces;
|
||||||
|
@ -304,6 +305,8 @@ void database_enum_add(Eolian_Type *tp);
|
||||||
void database_type_del(Eolian_Type *tp);
|
void database_type_del(Eolian_Type *tp);
|
||||||
void database_typedef_del(Eolian_Type *tp);
|
void database_typedef_del(Eolian_Type *tp);
|
||||||
|
|
||||||
|
void database_typedecl_del(Eolian_Typedecl *tp);
|
||||||
|
|
||||||
void database_type_print(Eolian_Type *type);
|
void database_type_print(Eolian_Type *type);
|
||||||
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
|
void database_type_to_str(const Eolian_Type *tp, Eina_Strbuf *buf, const char *name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue