eolian: add API to check for @owned

This commit is contained in:
Daniel Kolesa 2017-09-15 16:33:57 +02:00
parent 010650663b
commit 4b27fe6571
2 changed files with 19 additions and 0 deletions

View File

@ -1845,6 +1845,18 @@ EAPI size_t eolian_type_array_size_get(const Eolian_Type *tp);
*/
EAPI Eina_Bool eolian_type_is_own(const Eolian_Type *tp);
/*
* @brief Get whether the given type is owned.
*
* This is true when a parameter, return or whatever is marked as @owned.
*
* @param[in] tp the type.
* @return EINA_TRUE when the type is marked owned, EINA_FALSE otherwise.
*
* @ingroup Eolian
*/
EAPI Eina_Bool eolian_type_is_owned(const Eolian_Type *tp);
/*
* @brief Get whether the given type is const.
*

View File

@ -333,6 +333,13 @@ eolian_type_is_own(const Eolian_Type *tp)
return tp->is_own;
}
EAPI Eina_Bool
eolian_type_is_owned(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);
return tp->owned;
}
EAPI Eina_Bool
eolian_type_is_const(const Eolian_Type *tp)
{