summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-07-03 17:52:04 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-07-08 16:06:42 +0200
commit61f39eef49a93c266b217ec5a49dd12579046c8b (patch)
tree3f624336cd76c9b776960eeb511a315a6bf27073 /src
parent2bfa55582cb2286dced2b97be6b80d96ae8f5a91 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/bin/eolian/sources.c2
-rw-r--r--src/bindings/luajit/eolian.lua8
-rw-r--r--src/lib/eolian/Eolian.h14
-rw-r--r--src/lib/eolian/database_type_api.c7
-rw-r--r--src/lib/eolian/database_validate.c4
-rw-r--r--src/scripts/pyolian/eolian.py4
-rw-r--r--src/scripts/pyolian/eolian_lib.py4
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py3
8 files changed, 1 insertions, 45 deletions
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index d060eed..88a9fc8 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -183,7 +183,7 @@ _free_func_get(const Eolian_Type *type)
183 if (eolian_type_type_get(ab) == EOLIAN_TYPE_CLASS) 183 if (eolian_type_type_get(ab) == EOLIAN_TYPE_CLASS)
184 return "efl_del"; 184 return "efl_del";
185 else 185 else
186 return eolian_type_free_func_get(ab); 186 return eolian_typedecl_free_func_get(eolian_type_typedecl_get(ab));
187 /* no free func */ 187 /* no free func */
188 default: 188 default:
189 return NULL; 189 return NULL;
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index e92e587..2be1b6a 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -449,8 +449,6 @@ ffi.cdef [[
449 449
450 const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype); 450 const char *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype);
451 const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp); 451 const char *eolian_typedecl_c_type_get(const Eolian_Typedecl *tp);
452
453 const char *eolian_type_free_func_get(const Eolian_Type *tp);
454 const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp); 452 const char *eolian_typedecl_free_func_get(const Eolian_Typedecl *tp);
455 453
456 const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp); 454 const Eolian_Function *eolian_typedecl_function_pointer_get(const Eolian_Typedecl *tp);
@@ -1168,12 +1166,6 @@ M.Type = ffi.metatype("Eolian_Type", {
1168 local v = eolian.eolian_type_c_type_get(self, ctype) 1166 local v = eolian.eolian_type_c_type_get(self, ctype)
1169 if v == nil then return nil end 1167 if v == nil then return nil end
1170 return ffi_stringshare(v) 1168 return ffi_stringshare(v)
1171 end,
1172
1173 free_func_get = function(self)
1174 local v = eolian.eolian_type_free_func_get(self)
1175 if v == nil then return nil end
1176 return ffi.string(v)
1177 end 1169 end
1178 } 1170 }
1179}) 1171})
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 4c9535d..0816812 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2931,20 +2931,6 @@ eolian_type_namespaces_get(const Eolian_Type *tp)
2931} 2931}
2932 2932
2933/* 2933/*
2934 * @brief Get the name of the function used to free this type.
2935 *
2936 * @param[in] tp the type.
2937 * @return the free func name.
2938 *
2939 * For types that translate to C pointers, this is the function used to
2940 * free them. For other types, this is the function to free a pointer to
2941 * those types.
2942 *
2943 * @ingroup Eolian
2944 */
2945EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
2946
2947/*
2948 * @brief Evaluate an Eolian expression. 2934 * @brief Evaluate an Eolian expression.
2949 * 2935 *
2950 * @param[in] expr the expression. 2936 * @param[in] expr the expression.
diff --git a/src/lib/eolian/database_type_api.c b/src/lib/eolian/database_type_api.c
index d4869e2..527afc5 100644
--- a/src/lib/eolian/database_type_api.c
+++ b/src/lib/eolian/database_type_api.c
@@ -261,13 +261,6 @@ eolian_typedecl_c_type_get(const Eolian_Typedecl *tp)
261} 261}
262 262
263EAPI Eina_Stringshare * 263EAPI Eina_Stringshare *
264eolian_type_free_func_get(const Eolian_Type *tp)
265{
266 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
267 return tp->freefunc;
268}
269
270EAPI Eina_Stringshare *
271eolian_typedecl_free_func_get(const Eolian_Typedecl *tp) 264eolian_typedecl_free_func_get(const Eolian_Typedecl *tp)
272{ 265{
273 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL); 266 EINA_SAFETY_ON_NULL_RETURN_VAL(tp, NULL);
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 7e73347..c6a399b 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -165,8 +165,6 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp)
165 case EOLIAN_TYPEDECL_ALIAS: 165 case EOLIAN_TYPEDECL_ALIAS:
166 if (!_validate_type(vals, tp->base_type)) 166 if (!_validate_type(vals, tp->base_type))
167 return _reset_stable(vals, was_stable, EINA_FALSE); 167 return _reset_stable(vals, was_stable, EINA_FALSE);
168 if (!tp->freefunc && tp->base_type->freefunc)
169 tp->freefunc = eina_stringshare_ref(tp->base_type->freefunc);
170 if (tp->base_type->ownable) 168 if (tp->base_type->ownable)
171 tp->ownable = EINA_TRUE; 169 tp->ownable = EINA_TRUE;
172 _reset_stable(vals, was_stable, EINA_TRUE); 170 _reset_stable(vals, was_stable, EINA_TRUE);
@@ -311,8 +309,6 @@ _validate_type(Validate_State *vals, Eolian_Type *tp)
311 } 309 }
312 if (!_validate_typedecl(vals, tp->tdecl)) 310 if (!_validate_typedecl(vals, tp->tdecl))
313 return EINA_FALSE; 311 return EINA_FALSE;
314 if (tp->tdecl->freefunc && !tp->freefunc)
315 tp->freefunc = eina_stringshare_ref(tp->tdecl->freefunc);
316 if (tp->tdecl->ownable || tp->freefunc) 312 if (tp->tdecl->ownable || tp->freefunc)
317 tp->ownable = EINA_TRUE; 313 tp->ownable = EINA_TRUE;
318 tp->base.c_name = eina_stringshare_ref(tp->tdecl->base.c_name); 314 tp->base.c_name = eina_stringshare_ref(tp->tdecl->base.c_name);
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index d5c99a1..c287b57 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -1044,10 +1044,6 @@ class Type(Object):
1044 return "<eolian.Type '{0.name}', type={0.type!s}>".format(self) 1044 return "<eolian.Type '{0.name}', type={0.type!s}>".format(self)
1045 1045
1046 @cached_property 1046 @cached_property
1047 def free_func(self):
1048 return _str_to_py(lib.eolian_type_free_func_get(self))
1049
1050 @cached_property
1051 def type(self): 1047 def type(self):
1052 return Eolian_Type_Type(lib.eolian_type_type_get(self)) 1048 return Eolian_Type_Type(lib.eolian_type_type_get(self))
1053 1049
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index d8ee7f0..b9ba5f2 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -607,10 +607,6 @@ lib.eolian_type_is_ptr.restype = c_bool
607lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int) 607lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int)
608lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED 608lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED
609 609
610# EAPI Eina_Stringshare *eolian_type_free_func_get(const Eolian_Type *tp);
611lib.eolian_type_free_func_get.argtypes = (c_void_p,)
612lib.eolian_type_free_func_get.restype = c_char_p
613
614### Eolian_Expression ####################################################### 610### Eolian_Expression #######################################################
615 611
616# EAPI Eina_Stringshare *eolian_expression_serialize(const Eolian_Expression *expr); 612# EAPI Eina_Stringshare *eolian_expression_serialize(const Eolian_Expression *expr);
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index de58a1c..23a618b 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -566,7 +566,6 @@ class TestEolianType(unittest.TestCase):
566 self.assertFalse(t.is_const) 566 self.assertFalse(t.is_const)
567 self.assertFalse(t.is_ptr) 567 self.assertFalse(t.is_ptr)
568 self.assertEqual(list(t.namespaces), []) 568 self.assertEqual(list(t.namespaces), [])
569 self.assertIsNone(t.free_func)
570 self.assertIsNone(t.class_) 569 self.assertIsNone(t.class_)
571 self.assertEqual(t, t.aliased_base) # TODO find a better test 570 self.assertEqual(t, t.aliased_base) # TODO find a better test
572 571
@@ -586,7 +585,6 @@ class TestEolianType(unittest.TestCase):
586 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID) 585 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
587 self.assertEqual(t.file, 'efl_gfx_entity.eo') # TODO is this correct ? 586 self.assertEqual(t.file, 'efl_gfx_entity.eo') # TODO is this correct ?
588 self.assertEqual(list(t.namespaces), ['Eina']) 587 self.assertEqual(list(t.namespaces), ['Eina'])
589 self.assertEqual(t.free_func, 'eina_rectangle_free')
590 self.assertIsNone(t.class_) 588 self.assertIsNone(t.class_)
591 self.assertEqual(t, t.aliased_base) 589 self.assertEqual(t, t.aliased_base)
592 590
@@ -610,7 +608,6 @@ class TestEolianType(unittest.TestCase):
610 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID) 608 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
611 self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ? 609 self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ?
612 self.assertEqual(list(t.namespaces), ['Efl', 'Gfx']) 610 self.assertEqual(list(t.namespaces), ['Efl', 'Gfx'])
613 self.assertEqual(t.free_func, 'efl_del')
614 self.assertEqual(t, t.aliased_base) 611 self.assertEqual(t, t.aliased_base)
615 612
616 self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test 613 self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test