summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorq66 <daniel@octaforge.org>2018-08-03 01:24:25 +0200
committerq66 <daniel@octaforge.org>2018-08-03 01:24:25 +0200
commit158f4cc690af89d7565d664fcfaaad0a0973937f (patch)
tree4d07b96e80312bb7a1c16dc5aaf175e56f00c80b
parentb6b9eaac4a1b91d633979eb6df4746b9e10b7714 (diff)
enable the scripts to work in efl 1.20 environment
-rw-r--r--list_beta_c_names.lua3
-rw-r--r--list_used_beta_api.lua3
-rw-r--r--utils/eolian_extras.lua78
3 files changed, 74 insertions, 10 deletions
diff --git a/list_beta_c_names.lua b/list_beta_c_names.lua
index 612baf1..5f989eb 100644
--- a/list_beta_c_names.lua
+++ b/list_beta_c_names.lua
@@ -1,4 +1,3 @@
1local eolian = require("eolian")
2local getopt = require("getopt") 1local getopt = require("getopt")
3 2
4local eou = require("utils.eolian_extras") 3local eou = require("utils.eolian_extras")
@@ -34,7 +33,7 @@ if exit then
34 return true 33 return true
35end 34end
36 35
37local eos = eolian.new() 36local eos = eou.new()
38 37
39if #pargs >= 1 then 38if #pargs >= 1 then
40 eos:directory_add(pargs[1]) 39 eos:directory_add(pargs[1])
diff --git a/list_used_beta_api.lua b/list_used_beta_api.lua
index f742134..7c43588 100644
--- a/list_used_beta_api.lua
+++ b/list_used_beta_api.lua
@@ -1,4 +1,3 @@
1local eolian = require("eolian")
2local getopt = require("getopt") 1local getopt = require("getopt")
3 2
4local eou = require("utils.eolian_extras") 3local eou = require("utils.eolian_extras")
@@ -39,7 +38,7 @@ if exit then
39 return true 38 return true
40end 39end
41 40
42local eos = eolian.new() 41local eos = eou.new()
43 42
44if #pargs > 1 then 43if #pargs > 1 then
45 eos:directory_add(pargs[2]) 44 eos:directory_add(pargs[2])
diff --git a/utils/eolian_extras.lua b/utils/eolian_extras.lua
index 130f7ee..35be202 100644
--- a/utils/eolian_extras.lua
+++ b/utils/eolian_extras.lua
@@ -2,6 +2,61 @@ local eolian = require("eolian")
2 2
3local M = {} 3local M = {}
4 4
5-- check for pre-state eolian api
6local legacy = not eolian.new
7
8-- wrapper for legacy eolian api to mimic modern
9local legacy_eos = {
10 directory_add = function(self, dir)
11 eolian.directory_scan(dir)
12 end,
13
14 system_directory_add = function(self)
15 eolian.system_directory_scan()
16 end,
17
18 all_eo_files_parse = function(self)
19 assert(eolian.all_eo_files_parse())
20 assert(eolian.database_validate())
21 end,
22
23 all_eot_files_parse = function(self)
24 assert(eolian.all_eot_files_parse())
25 assert(eolian.database_validate())
26 end,
27
28 classes_get = function(self)
29 return eolian.all_classes_get(nil)
30 end,
31
32 aliases_get = function(self)
33 return eolian.typedecl_all_aliases_get(nil)
34 end,
35
36 structs_get = function(self)
37 return eolian.typedecl_all_structs_get(nil)
38 end,
39
40 enums_get = function(self)
41 return eolian.typedecl_all_enums_get(nil)
42 end,
43
44 globals_get = function(self)
45 return eolian.variable_all_globals_get(nil)
46 end,
47
48 constants_get = function(self)
49 return eolian.variable_all_constants_get(nil)
50 end
51}
52
53M.new = function()
54 if legacy then
55 return legacy_eos
56 end
57 return eolian.new()
58end
59
5M.get_c_functions = function(eos) 60M.get_c_functions = function(eos)
6 local ret = {} 61 local ret = {}
7 for cl in eos:classes_get() do 62 for cl in eos:classes_get() do
@@ -32,11 +87,22 @@ M.get_c_events = function(eos)
32 return ret 87 return ret
33end 88end
34 89
90local full_name_get = function(obj)
91 if legacy then
92 return obj:full_name_get()
93 end
94 return obj:name_get()
95end
96
35M.get_c_function_pointers = function(eos) 97M.get_c_function_pointers = function(eos)
98 if legacy then
99 -- no function pointer support in pre-state api
100 return {}
101 end
36 local ret = {} 102 local ret = {}
37 for tp in eos:aliases_get() do 103 for tp in eos:aliases_get() do
38 if tp:type_get() == eolian.typedecl_type.FUNCTION_POINTER then 104 if tp:type_get() == eolian.typedecl_type.FUNCTION_POINTER then
39 ret[#ret + 1] = tp:name_get():gsub("%.", "_") 105 ret[#ret + 1] = full_name_get(tp):gsub("%.", "_")
40 end 106 end
41 end 107 end
42 return ret 108 return ret
@@ -46,7 +112,7 @@ M.get_c_aliases = function(eos)
46 local ret = {} 112 local ret = {}
47 for tp in eos:aliases_get() do 113 for tp in eos:aliases_get() do
48 if tp:type_get() ~= eolian.typedecl_type.FUNCTION_POINTER then 114 if tp:type_get() ~= eolian.typedecl_type.FUNCTION_POINTER then
49 ret[#ret + 1] = tp:name_get():gsub("%.", "_") 115 ret[#ret + 1] = full_name_get(tp):gsub("%.", "_")
50 end 116 end
51 end 117 end
52 return ret 118 return ret
@@ -55,7 +121,7 @@ end
55M.get_c_structs = function(eos) 121M.get_c_structs = function(eos)
56 local ret = {} 122 local ret = {}
57 for tp in eos:structs_get() do 123 for tp in eos:structs_get() do
58 ret[#ret + 1] = tp:name_get():gsub("%.", "_") 124 ret[#ret + 1] = full_name_get(tp):gsub("%.", "_")
59 end 125 end
60 return ret 126 return ret
61end 127end
@@ -63,7 +129,7 @@ end
63M.get_c_enums = function(eos) 129M.get_c_enums = function(eos)
64 local ret = {} 130 local ret = {}
65 for tp in eos:enums_get() do 131 for tp in eos:enums_get() do
66 ret[#ret + 1] = tp:name_get():gsub("%.", "_") 132 ret[#ret + 1] = full_name_get(tp):gsub("%.", "_")
67 end 133 end
68 return ret 134 return ret
69end 135end
@@ -71,7 +137,7 @@ end
71M.get_c_globals = function(eos) 137M.get_c_globals = function(eos)
72 local ret = {} 138 local ret = {}
73 for v in eos:globals_get() do 139 for v in eos:globals_get() do
74 ret[#ret + 1] = v:name_get():gsub("%.", "_"):upper() 140 ret[#ret + 1] = full_name_get(v):gsub("%.", "_"):upper()
75 end 141 end
76 return ret 142 return ret
77end 143end
@@ -79,7 +145,7 @@ end
79M.get_c_constants = function(eos) 145M.get_c_constants = function(eos)
80 local ret = {} 146 local ret = {}
81 for v in eos:constants_get() do 147 for v in eos:constants_get() do
82 ret[#ret + 1] = v:name_get():gsub("%.", "_"):upper() 148 ret[#ret + 1] = full_name_get(v):gsub("%.", "_"):upper()
83 end 149 end
84 return ret 150 return ret
85end 151end