eolian: add some missing typedecl APIs

This commit is contained in:
Daniel Kolesa 2016-02-11 15:32:02 +00:00
parent cf9dbaa7da
commit c0287a2752
4 changed files with 42 additions and 0 deletions

View File

@ -1626,6 +1626,7 @@ EAPI Eina_Bool eolian_typedecl_is_extern(const Eolian_Typedecl *tp);
* @ingroup Eolian * @ingroup Eolian
*/ */
EAPI Eina_Stringshare *eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name); EAPI Eina_Stringshare *eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name);
EAPI Eina_Stringshare *eolian_typedecl_c_type_named_get(const Eolian_Typedecl *tp, const char *name);
/* /*
* @brief Get the full C type name of the given type without a name. * @brief Get the full C type name of the given type without a name.
@ -1643,6 +1644,7 @@ EAPI Eina_Stringshare *eolian_type_c_type_named_get(const Eolian_Type *tp, const
* @ingroup Eolian * @ingroup Eolian
*/ */
EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp); EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp);
EAPI Eina_Stringshare *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
/* /*
* @brief Get the name of the given type. For regular or complex types, this * @brief Get the name of the given type. For regular or complex types, this
@ -1657,6 +1659,7 @@ EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp);
* @ingroup Eolian * @ingroup Eolian
*/ */
EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp); EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp);
EAPI Eina_Stringshare *eolian_typedecl_name_get(const Eolian_Typedecl *tp);
/* /*
* @brief Get the full (namespaced) name of a function. Only works on named * @brief Get the full (namespaced) name of a function. Only works on named
@ -1668,6 +1671,7 @@ EAPI Eina_Stringshare *eolian_type_name_get(const Eolian_Type *tp);
* @ingroup Eolian * @ingroup Eolian
*/ */
EAPI Eina_Stringshare *eolian_type_full_name_get(const Eolian_Type *tp); EAPI Eina_Stringshare *eolian_type_full_name_get(const Eolian_Type *tp);
EAPI Eina_Stringshare *eolian_typedecl_full_name_get(const Eolian_Typedecl *tp);
/* /*
* @brief Get an iterator to the list of namespaces of the given type. Only * @brief Get an iterator to the list of namespaces of the given type. Only
@ -1679,6 +1683,7 @@ EAPI Eina_Stringshare *eolian_type_full_name_get(const Eolian_Type *tp);
* @ingroup Eolian * @ingroup Eolian
*/ */
EAPI Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp); EAPI Eina_Iterator *eolian_type_namespaces_get(const Eolian_Type *tp);
EAPI Eina_Iterator *eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp);
/* /*
* @brief Get the name of the function used to free this type. * @brief Get the name of the function used to free this type.

View File

@ -84,6 +84,7 @@ _typedecl_add(Eolian_Type *type)
ret->doc = type->doc; ret->doc = type->doc;
ret->legacy = eina_stringshare_ref(type->legacy); ret->legacy = eina_stringshare_ref(type->legacy);
ret->is_extern = type->is_extern; ret->is_extern = type->is_extern;
ret->parent = type;
return ret; return ret;
} }

View File

@ -465,12 +465,25 @@ eolian_type_c_type_named_get(const Eolian_Type *tp, const char *name)
return ret; return ret;
} }
EAPI Eina_Stringshare *
eolian_typedecl_c_type_named_get(const Eolian_Typedecl *tp, const char *name)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
return eolian_type_c_type_named_get(tp->parent, name);
}
EAPI Eina_Stringshare * EAPI Eina_Stringshare *
eolian_type_c_type_get(const Eolian_Type *tp) eolian_type_c_type_get(const Eolian_Type *tp)
{ {
return eolian_type_c_type_named_get(tp, NULL); return eolian_type_c_type_named_get(tp, NULL);
} }
EAPI Eina_Stringshare *
eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
{
return eolian_typedecl_c_type_named_get(tp, NULL);
}
EAPI Eina_Stringshare * EAPI Eina_Stringshare *
eolian_type_name_get(const Eolian_Type *tp) eolian_type_name_get(const Eolian_Type *tp)
{ {
@ -478,6 +491,13 @@ eolian_type_name_get(const Eolian_Type *tp)
return tp->name; return tp->name;
} }
EAPI Eina_Stringshare *
eolian_typedecl_name_get(const Eolian_Typedecl *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
return tp->name;
}
EAPI Eina_Stringshare * EAPI Eina_Stringshare *
eolian_type_full_name_get(const Eolian_Type *tp) eolian_type_full_name_get(const Eolian_Type *tp)
{ {
@ -485,6 +505,13 @@ eolian_type_full_name_get(const Eolian_Type *tp)
return tp->full_name; return tp->full_name;
} }
EAPI Eina_Stringshare *
eolian_typedecl_full_name_get(const Eolian_Typedecl *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
return tp->full_name;
}
EAPI Eina_Iterator * EAPI Eina_Iterator *
eolian_type_namespaces_get(const Eolian_Type *tp) eolian_type_namespaces_get(const Eolian_Type *tp)
{ {
@ -493,6 +520,14 @@ eolian_type_namespaces_get(const Eolian_Type *tp)
return eina_list_iterator_new(tp->namespaces); return eina_list_iterator_new(tp->namespaces);
} }
EAPI Eina_Iterator *
eolian_typedecl_namespaces_get(const Eolian_Typedecl *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
if (!tp->namespaces) return NULL;
return eina_list_iterator_new(tp->namespaces);
}
EAPI Eina_Stringshare * EAPI Eina_Stringshare *
eolian_type_free_func_get(const Eolian_Type *tp) eolian_type_free_func_get(const Eolian_Type *tp)
{ {

View File

@ -188,6 +188,7 @@ struct _Eolian_Typedecl
{ {
Eolian_Object base; Eolian_Object base;
Eolian_Typedecl_Type type; Eolian_Typedecl_Type type;
Eolian_Type *parent;
Eolian_Type *base_type; Eolian_Type *base_type;
Eina_Stringshare *name; Eina_Stringshare *name;
Eina_Stringshare *full_name; Eina_Stringshare *full_name;