eolian: add API to check for @owned
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 15 Sep 2017 14:33:57 +0000 (16:33 +0200)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Fri, 15 Sep 2017 14:33:57 +0000 (16:33 +0200)
src/lib/eolian/Eolian.h
src/lib/eolian/database_type_api.c

index 554f84c..06299b8 100644 (file)
@@ -1846,6 +1846,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.
  *
  * @param[in] tp the type.
index e986611..2f6a86f 100644 (file)
@@ -334,6 +334,13 @@ eolian_type_is_own(const Eolian_Type *tp)
 }
 
 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)
 {
    EINA_SAFETY_ON_NULL_RETURN_VAL(tp, EINA_FALSE);