summaryrefslogtreecommitdiff
path: root/src/bindings/luajit
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-03 16:55:59 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-03 17:06:49 +0200
commitdb57523e7846a6729f0ca0681e7e998b537e5b81 (patch)
tree8c424d54c287ec05a65530f56dfb2f507cba12a7 /src/bindings/luajit
parent767631e304b7142669d4f44f13cb97010348de11 (diff)
eolian: refactor parsing API and path handling
This splits the eolian_file_parse API into two, one for parsing files already present in the database (always by filename) and one for parsing paths. It fixes several bugs/leaks on the way (incorrect use of stringshare etc.) as well as adds checking for whether there are no conflicting filenames at scan time, for free. That means it is now no longer possible to scan two paths which have an eo or eot file of the same name in them. It should also be faster now. It also fixes T7820. @fix
Diffstat (limited to 'src/bindings/luajit')
-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 0b99715ed9..a89946c1eb 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -310,7 +310,8 @@ ffi.cdef [[
310 Eina_Iterator *eolian_state_eot_file_paths_get(const Eolian_State *state); 310 Eina_Iterator *eolian_state_eot_file_paths_get(const Eolian_State *state);
311 Eina_Iterator *eolian_state_eo_files_get(const Eolian_State *state); 311 Eina_Iterator *eolian_state_eo_files_get(const Eolian_State *state);
312 Eina_Iterator *eolian_state_eot_files_get(const Eolian_State *state); 312 Eina_Iterator *eolian_state_eot_files_get(const Eolian_State *state);
313 const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filepath); 313 const Eolian_Unit *eolian_state_file_parse(Eolian_State *state, const char *filename);
314 const Eolian_Unit *eolian_state_file_path_parse(Eolian_State *state, const char *filepath);
314 Eina_Bool eolian_state_all_eo_files_parse(Eolian_State *state); 315 Eina_Bool eolian_state_all_eo_files_parse(Eolian_State *state);
315 Eina_Bool eolian_state_all_eot_files_parse(Eolian_State *state); 316 Eina_Bool eolian_state_all_eot_files_parse(Eolian_State *state);
316 Eina_Bool eolian_state_check(const Eolian_State *state); 317 Eina_Bool eolian_state_check(const Eolian_State *state);
@@ -755,8 +756,16 @@ ffi.metatype("Eolian_State", {
755 return eolian.eolian_state_system_directory_add(self) ~= 0 756 return eolian.eolian_state_system_directory_add(self) ~= 0
756 end, 757 end,
757 758
758 file_parse = function(self, fpath) 759 file_parse = function(self, fname)
759 local v = eolian.eolian_state_file_parse(self, fpath) 760 local v = eolian.eolian_state_file_parse(self, fname)
761 if v == nil then
762 return nil
763 end
764 return v
765 end,
766
767 file_path_parse = function(self, fpath)
768 local v = eolian.eolian_state_file_path_parse(self, fpath)
760 if v == nil then 769 if v == nil then
761 return nil 770 return nil
762 end 771 end