summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:31:37 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:43:52 +0200
commit4ab1f2388eb303f8e5d9eae31cdcf39df683c736 (patch)
tree9dc1d113f199f97b1025e38a6c1479303b833a70 /src/bindings
parent7f45f94af0201d48f7fcae14c6320ce3b9bcab71 (diff)
eolian: add API to retrieve the C name of an object
This is to prepare for type/class renaming support. This adds the necessary API to retrieve C-specific names. Other refactoring is necessary elsewhere for now. This also renames the old API eolian_class_c_name_get to eolian_class_c_macro_get to avoid conflict as well as clarify the intention.
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/luajit/eolian.lua15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index a89946c1eb..d3edf8492b 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -301,6 +301,7 @@ ffi.cdef [[
301 int eolian_object_line_get(const Eolian_Object *obj); 301 int eolian_object_line_get(const Eolian_Object *obj);
302 int eolian_object_column_get(const Eolian_Object *obj); 302 int eolian_object_column_get(const Eolian_Object *obj);
303 const char *eolian_object_name_get(const Eolian_Object *obj); 303 const char *eolian_object_name_get(const Eolian_Object *obj);
304 const char *eolian_object_c_name_get(const Eolian_Object *obj);
304 const char *eolian_object_short_name_get(const Eolian_Object *obj); 305 const char *eolian_object_short_name_get(const Eolian_Object *obj);
305 Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj); 306 Eina_Iterator *eolian_object_namespaces_get(const Eolian_Object *obj);
306 Eina_Bool eolian_object_is_beta(const Eolian_Object *obj); 307 Eina_Bool eolian_object_is_beta(const Eolian_Object *obj);
@@ -409,7 +410,7 @@ ffi.cdef [[
409 const char *eolian_class_c_get_function_name_get(const Eolian_Class *klass); 410 const char *eolian_class_c_get_function_name_get(const Eolian_Class *klass);
410 Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp); 411 Eolian_Type_Type eolian_type_type_get(const Eolian_Type *tp);
411 Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp); 412 Eolian_Type_Builtin_Type eolian_type_builtin_type_get(const Eolian_Type *tp);
412 const char *eolian_class_c_name_get(const Eolian_Class *klass); 413 const char *eolian_class_c_macro_get(const Eolian_Class *klass);
413 const char *eolian_class_c_data_type_get(const Eolian_Class *klass); 414 const char *eolian_class_c_data_type_get(const Eolian_Class *klass);
414 Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp); 415 Eolian_Typedecl_Type eolian_typedecl_type_get(const Eolian_Typedecl *tp);
415 Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp); 416 Eina_Iterator *eolian_typedecl_struct_fields_get(const Eolian_Typedecl *tp);
@@ -587,6 +588,14 @@ local object_idx, wrap_object = gen_wrap {
587 return ffi.string(v) 588 return ffi.string(v)
588 end, 589 end,
589 590
591 c_name_get = function(self)
592 local v = eolian.eolian_object_c_name_get(cast_obj(self))
593 if v == nil then
594 return nil
595 end
596 return ffi.string(v)
597 end,
598
590 short_name_get = function(self) 599 short_name_get = function(self)
591 local v = eolian.eolian_object_short_name_get(cast_obj(self)) 600 local v = eolian.eolian_object_short_name_get(cast_obj(self))
592 if v == nil then 601 if v == nil then
@@ -1510,8 +1519,8 @@ M.Class = ffi.metatype("Eolian_Class", {
1510 return ffi_stringshare(v) 1519 return ffi_stringshare(v)
1511 end, 1520 end,
1512 1521
1513 c_name_get = function(self) 1522 c_macro_get = function(self)
1514 local v = eolian.eolian_class_c_name_get(self) 1523 local v = eolian.eolian_class_c_macro_get(self)
1515 if v == nil then return nil end 1524 if v == nil then return nil end
1516 return ffi_stringshare(v) 1525 return ffi_stringshare(v)
1517 end, 1526 end,