eolian: remove API to get freefunc of type

This is not supported anymore. For now, the syntax is kept
around because of broken C++ tests, but afterwards it will
also be removed.
This commit is contained in:
Daniel Kolesa 2019-07-03 17:52:04 +02:00
parent 2bfa55582c
commit 61f39eef49
8 changed files with 1 additions and 45 deletions

View File

@ -183,7 +183,7 @@ _free_func_get(const Eolian_Type *type)
if (eolian_type_type_get(ab) == EOLIAN_TYPE_CLASS)
return "efl_del";
else
return eolian_type_free_func_get(ab);
return eolian_typedecl_free_func_get(eolian_type_typedecl_get(ab));
/* no free func */
default:
return NULL;

View File

@ -449,8 +449,6 @@ ffi.cdef [[
const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
const char *eolian_type_free_func_get(const Eolian_Type *tp);
const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
@ -1168,12 +1166,6 @@ M.Type = ffi.metatype("Eolian_Type", {
local v = eolian.eolian_type_c_type_get(self, ctype)
if v == nil then return nil end
return ffi_stringshare(v)
end,
free_func_get = function(self)
local v = eolian.eolian_type_free_func_get(self)
if v == nil then return nil end
return ffi.string(v)
end
}
})

View File

@ -2930,20 +2930,6 @@ eolian_type_namespaces_get(const Eolian_Type *tp)
return eolian_object_namespaces_get(EOLIAN_OBJECT(tp));
}
/*
* @brief Get the name of the function used to free this type.
*
* @param[in] tp the type.
* @return the free func name.
*
* For types that translate to C pointers, this is the function used to
* free them. For other types, this is the function to free a pointer to
* those types.
*
* @ingroup Eolian
*/
EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
/*
* @brief Evaluate an Eolian expression.
*

View File

@ -260,13 +260,6 @@ eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
return ret;
}
EAPI Eina_Stringshare *
eolian_type_free_func_get(const Eolian_Type *tp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
return tp->freefunc;
}
EAPI Eina_Stringshare *
eolian_typedecl_free_func_get(const Eolian_Typedecl *tp)
{

View File

@ -165,8 +165,6 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp)
case EOLIAN_TYPEDECL_ALIAS:
if (!_validate_type(vals, tp->base_type))
return _reset_stable(vals, was_stable, EINA_FALSE);
if (!tp->freefunc && tp->base_type->freefunc)
tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc);
if (tp->base_type->ownable)
tp->ownable = EINA_TRUE;
_reset_stable(vals, was_stable, EINA_TRUE);
@ -311,8 +309,6 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
}
if (!_validate_typedecl(vals, tp->tdecl))
return EINA_FALSE;
if (tp->tdecl->freefunc && !tp->freefunc)
tp->freefunc = eina_stringshare_ref(tp->tdecl->freefunc);
if (tp->tdecl->ownable || tp->freefunc)
tp->ownable = EINA_TRUE;
tp->base.c_name = eina_stringshare_ref(tp->tdecl->base.c_name);

View File

@ -1043,10 +1043,6 @@ class Type(Object):
# return "<eolian.Type '{0.name}', type: {0.type!s}, c_type: '{0.c_type}'>".format(self)
return "<eolian.Type '{0.name}', type={0.type!s}>".format(self)
@cached_property
def free_func(self):
return _str_to_py(lib.eolian_type_free_func_get(self))
@cached_property
def type(self):
return Eolian_Type_Type(lib.eolian_type_type_get(self))

View File

@ -607,10 +607,6 @@ lib.eolian_type_is_ptr.restype = c_bool
lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int)
lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED
# EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
lib.eolian_type_free_func_get.argtypes = (c_void_p,)
lib.eolian_type_free_func_get.restype = c_char_p
### Eolian_Expression #######################################################
# EAPI Eina_Stringshare *eolian_expression_serialize(const Eolian_Expression *expr);

View File

@ -566,7 +566,6 @@ class TestEolianType(unittest.TestCase):
self.assertFalse(t.is_const)
self.assertFalse(t.is_ptr)
self.assertEqual(list(t.namespaces), [])
self.assertIsNone(t.free_func)
self.assertIsNone(t.class_)
self.assertEqual(t, t.aliased_base) # TODO find a better test
@ -586,7 +585,6 @@ class TestEolianType(unittest.TestCase):
self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
self.assertEqual(t.file, 'efl_gfx_entity.eo') # TODO is this correct ?
self.assertEqual(list(t.namespaces), ['Eina'])
self.assertEqual(t.free_func, 'eina_rectangle_free')
self.assertIsNone(t.class_)
self.assertEqual(t, t.aliased_base)
@ -610,7 +608,6 @@ class TestEolianType(unittest.TestCase):
self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ?
self.assertEqual(list(t.namespaces), ['Efl', 'Gfx'])
self.assertEqual(t.free_func, 'efl_del')
self.assertEqual(t, t.aliased_base)
self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test