summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-07-07 10:56:53 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-07-07 10:57:24 +0100
commitcd7a78f2a5ea44f458b51e88bcdb9c7d6b0d67b8 (patch)
tree076c07abe5b487905ca5d87f9f5f7b27855a23a5 /src/bindings
parent786ab74d6daa18bc1c04e2c97f5ca5212d707b78 (diff)
eolian: add API: eolian_declaration_get_by_name
Sorry for last minute new API, but this one is necessary to implement proper verification of references in docs, which I would like to have in 1.15. It allows you to retrieve any kind of declaration by full namespace, so that you can check for an existence of an Eolian decl, rather than checking every type individually. @feature
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/luajit/eolian.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index fa78cc2dcf..6cf150002d 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -313,6 +313,7 @@ ffi.cdef [[
313 const char *eolian_variable_full_name_get(const Eolian_Variable *var); 313 const char *eolian_variable_full_name_get(const Eolian_Variable *var);
314 Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var); 314 Eina_Iterator *eolian_variable_namespaces_get(const Eolian_Variable *var);
315 Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var); 315 Eina_Bool eolian_variable_is_extern(const Eolian_Variable *var);
316 const Eolian_Declaration *eolian_declaration_get_by_name(const char *name);
316 Eina_Iterator *eolian_declarations_get_by_file(const char *fname); 317 Eina_Iterator *eolian_declarations_get_by_file(const char *fname);
317 Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl); 318 Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl);
318 const char *eolian_declaration_name_get(const Eolian_Declaration *decl); 319 const char *eolian_declaration_name_get(const Eolian_Declaration *decl);
@@ -1266,6 +1267,14 @@ M.Variable = ffi.metatype("Eolian_Variable", {
1266 } 1267 }
1267}) 1268})
1268 1269
1270M.declaration_get_by_name = function(name)
1271 local v = eolian.eolian_declaration_get_by_name(name)
1272 if v == nil then
1273 return nil
1274 end
1275 return v
1276end
1277
1269M.declarations_get_by_file = function(fname) 1278M.declarations_get_by_file = function(fname)
1270 return Ptr_ITerator("const Eolian_Declaration*", 1279 return Ptr_ITerator("const Eolian_Declaration*",
1271 eolian.eolian_declarations_get_by_file(fname)) 1280 eolian.eolian_declarations_get_by_file(fname))