summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2020-05-21 17:45:43 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2020-05-21 17:45:43 +0200
commita928dba502776e7561b2de7a3ab606f68e31de07 (patch)
tree3c4dd8e069c40295c11765a799bd6b1fd7468d12
parenta7d475be472616f6b5e5d301f4a2646464370e5d (diff)
elua: prepare for compatibility with cffi-lua (use ffi.nullptr)
This is necessary because the LuaJIT FFI implements the null pointer to nil equality behavior, which is not possible to do in standard Lua (as equality metamethod needs identical types to trigger). So replace it with ffi.nullptr as cffi-lua implements; in luajit ffi.nullptr will just become nil and it'll work like before.
-rw-r--r--src/bindings/luajit/eina/accessor.lua6
-rw-r--r--src/bindings/luajit/eina/counter.lua2
-rw-r--r--src/bindings/luajit/eina/file.lua6
-rw-r--r--src/bindings/luajit/eina/iterator.lua4
-rw-r--r--src/bindings/luajit/eina/list.lua46
-rw-r--r--src/bindings/luajit/eina/xattr.lua4
-rw-r--r--src/bindings/luajit/eo.lua6
-rw-r--r--src/bindings/luajit/eolian.lua176
8 files changed, 128 insertions, 122 deletions
diff --git a/src/bindings/luajit/eina/accessor.lua b/src/bindings/luajit/eina/accessor.lua
index 55afa62427..d2068fc8b5 100644
--- a/src/bindings/luajit/eina/accessor.lua
+++ b/src/bindings/luajit/eina/accessor.lua
@@ -46,12 +46,12 @@ ffi.metatype("Eina_Accessor", {
46 unlock = function(self) return eina.eina_accessor_unlock(self) ~= 0 end, 46 unlock = function(self) return eina.eina_accessor_unlock(self) ~= 0 end,
47 clone = function(self) 47 clone = function(self)
48 local v = eina.eina_accessor_clone(self) 48 local v = eina.eina_accessor_clone(self)
49 if v == nil then return nil end 49 if v == ffi.nullptr then return nil end
50 return v 50 return v
51 end, 51 end,
52 container_get = function(self) 52 container_get = function(self)
53 local v = eina.eina_accessor_container_get(self) 53 local v = eina.eina_accessor_container_get(self)
54 if v == nil then return nil end 54 if v == ffi.nullptr then return nil end
55 return v 55 return v
56 end 56 end
57 } 57 }
@@ -64,7 +64,7 @@ local dgetmt = debug.getmetatable
64M.Accessor = util.Readonly_Object:clone { 64M.Accessor = util.Readonly_Object:clone {
65 __ctor = function(self, selfmt, acc) 65 __ctor = function(self, selfmt, acc)
66 -- prevent null stuff 66 -- prevent null stuff
67 if acc == nil then acc = nil end 67 if acc == ffi.nullptr then acc = nil end
68 if acc then ffi.gc(acc, acc.free) end 68 if acc then ffi.gc(acc, acc.free) end
69 selfmt.__eq = function(self, other) 69 selfmt.__eq = function(self, other)
70 return selfmt.__accessor == dgetmt(other).__accessor 70 return selfmt.__accessor == dgetmt(other).__accessor
diff --git a/src/bindings/luajit/eina/counter.lua b/src/bindings/luajit/eina/counter.lua
index b0b9829ad4..6a9ba33284 100644
--- a/src/bindings/luajit/eina/counter.lua
+++ b/src/bindings/luajit/eina/counter.lua
@@ -51,7 +51,7 @@ M.Counter = ffi.metatype("Eina_Counter", {
51 51
52 dump = function(self) 52 dump = function(self)
53 local v = eina.eina_counter_dump(self) 53 local v = eina.eina_counter_dump(self)
54 if v == nil then return nil end 54 if v == ffi.nullptr then return nil end
55 local r = ffi.string(v) 55 local r = ffi.string(v)
56 C.free(v) 56 C.free(v)
57 return r 57 return r
diff --git a/src/bindings/luajit/eina/file.lua b/src/bindings/luajit/eina/file.lua
index 675b810a17..3f59391b60 100644
--- a/src/bindings/luajit/eina/file.lua
+++ b/src/bindings/luajit/eina/file.lua
@@ -236,7 +236,7 @@ M.direct_ls = function(dir) return Direct_Ls_Iterator(dir) end
236 236
237M.path_sanitize = function(path) 237M.path_sanitize = function(path)
238 local v = eina.eina_file_path_sanitize(path) 238 local v = eina.eina_file_path_sanitize(path)
239 if v == nil then return nil end 239 if v == ffi.nullptr then return nil end
240 local r = ffi.string(v) 240 local r = ffi.string(v)
241 C.free(v) 241 C.free(v)
242 return r 242 return r
@@ -358,7 +358,7 @@ M.File = ffi.metatype("Eina_File", {
358 358
359 map_all = function(self, rule, raw) 359 map_all = function(self, rule, raw)
360 local v = ffi.cast("char*", eina.eina_file_map_all(self, rule or 0)) 360 local v = ffi.cast("char*", eina.eina_file_map_all(self, rule or 0))
361 if v == nil then return nil end 361 if v == ffi.nullptr then return nil end
362 if not raw then 362 if not raw then
363 local r = ffi.string(v) 363 local r = ffi.string(v)
364 self:map_free(v) 364 self:map_free(v)
@@ -370,7 +370,7 @@ M.File = ffi.metatype("Eina_File", {
370 map_new = function(self, rule, offset, length, raw) 370 map_new = function(self, rule, offset, length, raw)
371 local v = ffi.cast("char*", eina.eina_file_map_new(self, rule or 0, 371 local v = ffi.cast("char*", eina.eina_file_map_new(self, rule or 0,
372 offset or 0, length)) 372 offset or 0, length))
373 if v == nil then return nil end 373 if v == ffi.nullptr then return nil end
374 if not raw then 374 if not raw then
375 local r = ffi.string(v, length) 375 local r = ffi.string(v, length)
376 self:map_free(v) 376 self:map_free(v)
diff --git a/src/bindings/luajit/eina/iterator.lua b/src/bindings/luajit/eina/iterator.lua
index dc5d0da8b2..196a968500 100644
--- a/src/bindings/luajit/eina/iterator.lua
+++ b/src/bindings/luajit/eina/iterator.lua
@@ -43,7 +43,7 @@ ffi.metatype("Eina_Iterator", {
43 unlock = function(self) return eina.eina_iterator_unlock(self) ~= 0 end, 43 unlock = function(self) return eina.eina_iterator_unlock(self) ~= 0 end,
44 container_get = function(self) 44 container_get = function(self)
45 local v = eina.eina_iterator_container_get(self) 45 local v = eina.eina_iterator_container_get(self)
46 if v == nil then return nil end 46 if v == ffi.nullptr then return nil end
47 return v 47 return v
48 end 48 end
49 } 49 }
@@ -56,7 +56,7 @@ local dgetmt = debug.getmetatable
56M.Iterator = util.Readonly_Object:clone { 56M.Iterator = util.Readonly_Object:clone {
57 __ctor = function(self, selfmt, iter) 57 __ctor = function(self, selfmt, iter)
58 -- prevent null stuff 58 -- prevent null stuff
59 if iter == nil then iter = nil end 59 if iter == ffi.nullptr then iter = nil end
60 if iter then ffi.gc(iter, iter.free) end 60 if iter then ffi.gc(iter, iter.free) end
61 selfmt.__eq = function(self, other) 61 selfmt.__eq = function(self, other)
62 return selfmt.__iterator == dgetmt(other).__iterator 62 return selfmt.__iterator == dgetmt(other).__iterator
diff --git a/src/bindings/luajit/eina/list.lua b/src/bindings/luajit/eina/list.lua
index aebfa348c1..4c0bc6bd17 100644
--- a/src/bindings/luajit/eina/list.lua
+++ b/src/bindings/luajit/eina/list.lua
@@ -83,7 +83,9 @@ local dgetmt = debug.getmetatable
83 83
84local List_Iterator = Iterator:clone { 84local List_Iterator = Iterator:clone {
85 __ctor = function(self, selfmt, list) 85 __ctor = function(self, selfmt, list)
86 if list == nil then return Iterator.__ctor(self, selfmt, nil) end 86 if not list or list == ffi.nullptr then
87 return Iterator.__ctor(self, selfmt, nil)
88 end
87 selfmt.__list = list 89 selfmt.__list = list
88 return Iterator.__ctor(self, selfmt, 90 return Iterator.__ctor(self, selfmt,
89 eina.eina_list_iterator_new(dgetmt(list).__list)) 91 eina.eina_list_iterator_new(dgetmt(list).__list))
@@ -98,7 +100,9 @@ local List_Iterator = Iterator:clone {
98 100
99local List_Reverse_Iterator = Iterator:clone { 101local List_Reverse_Iterator = Iterator:clone {
100 __ctor = function(self, selfmt, list) 102 __ctor = function(self, selfmt, list)
101 if list == nil then return Iterator.__ctor(self, selfmt, nil) end 103 if not list or list == ffi.nullptr then
104 return Iterator.__ctor(self, selfmt, nil)
105 end
102 selfmt.__list = list 106 selfmt.__list = list
103 return Iterator.__ctor(self, selfmt, 107 return Iterator.__ctor(self, selfmt,
104 eina.eina_list_iterator_reversed_new(dgetmt(list).__list)) 108 eina.eina_list_iterator_reversed_new(dgetmt(list).__list))
@@ -115,7 +119,9 @@ local Accessor = accessor.Accessor
115 119
116local List_Accessor = Accessor:clone { 120local List_Accessor = Accessor:clone {
117 __ctor = function(self, selfmt, list) 121 __ctor = function(self, selfmt, list)
118 if list == nil then return Accessor.__ctor(self, selfmt, nil) end 122 if not list or list == ffi.nullptr then
123 return Accessor.__ctor(self, selfmt, nil)
124 end
119 selfmt.__list = list 125 selfmt.__list = list
120 return Accessor.__ctor(self, selfmt, 126 return Accessor.__ctor(self, selfmt,
121 eina.eina_list_accessor_new(dgetmt(list).__list)) 127 eina.eina_list_accessor_new(dgetmt(list).__list))
@@ -141,37 +147,37 @@ local List = ffi.metatype("Eina_List", {
141 data_get = function(self, ptr) 147 data_get = function(self, ptr)
142 if ptr ~= nil then return ptr end 148 if ptr ~= nil then return ptr end
143 local v = get_list_t(self).data 149 local v = get_list_t(self).data
144 if v == nil then return nil end 150 if v == ffi.nullptr then return nil end
145 return v 151 return v
146 end, 152 end,
147 153
148 nth = function(self, n) 154 nth = function(self, n)
149 local v = eina.eina_list_nth(self, n - 1) 155 local v = eina.eina_list_nth(self, n - 1)
150 if v == nil then return nil end 156 if v == ffi.nullptr then return nil end
151 return self:data_get(v) 157 return self:data_get(v)
152 end, 158 end,
153 159
154 nth_list = function(self, n) 160 nth_list = function(self, n)
155 local v = eina.eina_list_nth_list(self, n - 1) 161 local v = eina.eina_list_nth_list(self, n - 1)
156 if v == nil then return nil end 162 if v == ffi.nullptr then return nil end
157 return v 163 return v
158 end, 164 end,
159 165
160 last = function(self) 166 last = function(self)
161 local v = get_list_t(self).accounting.last 167 local v = get_list_t(self).accounting.last
162 if v == nil then return nil end 168 if v == ffi.nullptr then return nil end
163 return v 169 return v
164 end, 170 end,
165 171
166 next = function(self) 172 next = function(self)
167 local v = get_list_t(self).next 173 local v = get_list_t(self).next
168 if v == nil then return nil end 174 if v == ffi.nullptr then return nil end
169 return v 175 return v
170 end, 176 end,
171 177
172 prev = function(self) 178 prev = function(self)
173 local v = get_list_t(self).prev 179 local v = get_list_t(self).prev
174 if v == nil then return nil end 180 if v == ffi.nullptr then return nil end
175 return v 181 return v
176 end 182 end
177 } 183 }
@@ -183,7 +189,7 @@ local List_Base = util.Readonly_Object:clone {
183 list = ffi.gc(list, freefunc) 189 list = ffi.gc(list, freefunc)
184 selfmt.__free = freefunc 190 selfmt.__free = freefunc
185 end 191 end
186 if list == nil then return end 192 if not list or list == ffi.nullptr then return end
187 selfmt.__eq = function(self, other) 193 selfmt.__eq = function(self, other)
188 return selfmt.__list == dgetmt(other).__list 194 return selfmt.__list == dgetmt(other).__list
189 end 195 end
@@ -194,62 +200,62 @@ local List_Base = util.Readonly_Object:clone {
194 free = function(self) 200 free = function(self)
195 self = dgetmt(self) 201 self = dgetmt(self)
196 local ffunc, l = self.__free, self.__list 202 local ffunc, l = self.__free, self.__list
197 if not ffunc or l == nil then return end 203 if not ffunc or not l or l == ffi.nullptr then return end
198 ffunc(ffi.gc(self.__list, nil)) 204 ffunc(ffi.gc(self.__list, nil))
199 end, 205 end,
200 206
201 count = function(self) 207 count = function(self)
202 self = dgetmt(self) 208 self = dgetmt(self)
203 local l = self.__list 209 local l = self.__list
204 if l == nil then return 0 end 210 if not l or l == ffi.nullptr then return 0 end
205 return #l 211 return #l
206 end, 212 end,
207 213
208 nth = function(self, n) 214 nth = function(self, n)
209 self = dgetmt(self) 215 self = dgetmt(self)
210 local l = self.__list 216 local l = self.__list
211 if l == nil then return nil end 217 if not l or l == ffi.nullptr then return nil end
212 return l:nth() 218 return l:nth()
213 end, 219 end,
214 220
215 nth_list = function(self, n) 221 nth_list = function(self, n)
216 self = dgetmt(self) 222 self = dgetmt(self)
217 local l = self.__list 223 local l = self.__list
218 if l == nil then return nil end 224 if not l or l == ffi.nullptr then return nil end
219 return self.__index(l:nth_list()) 225 return self.__index(l:nth_list())
220 end, 226 end,
221 227
222 last = function(self, n) 228 last = function(self, n)
223 self = dgetmt(self) 229 self = dgetmt(self)
224 local l = self.__list 230 local l = self.__list
225 if l == nil then return nil end 231 if not l or l == ffi.nullptr then return nil end
226 return self.__index(l:last()) 232 return self.__index(l:last())
227 end, 233 end,
228 234
229 next = function(self, n) 235 next = function(self, n)
230 self = dgetmt(self) 236 self = dgetmt(self)
231 local l = self.__list 237 local l = self.__list
232 if l == nil then return nil end 238 if not l or l == ffi.nullptr then return nil end
233 return self.__index(l:next()) 239 return self.__index(l:next())
234 end, 240 end,
235 241
236 prev = function(self, n) 242 prev = function(self, n)
237 self = dgetmt(self) 243 self = dgetmt(self)
238 local l = self.__list 244 local l = self.__list
239 if l == nil then return nil end 245 if not l or l == ffi.nullptr then return nil end
240 return self.__index(l:prev()) 246 return self.__index(l:prev())
241 end, 247 end,
242 248
243 data_get = function(self, ptr) 249 data_get = function(self, ptr)
244 self = dgetmt(self) 250 self = dgetmt(self)
245 local l = self.__list 251 local l = self.__list
246 if l == nil then return nil end 252 if not l or l == ffi.nullptr then return nil end
247 return l:data_get(ptr) 253 return l:data_get(ptr)
248 end, 254 end,
249 255
250 to_array = function(self) 256 to_array = function(self)
251 local l = dgetmt(self).__list 257 local l = dgetmt(self).__list
252 if l == nil then return {}, 0 end 258 if not l or l == ffi.nullptr then return {}, 0 end
253 local n = 0 259 local n = 0
254 local r = {} 260 local r = {}
255 while l ~= nil do 261 while l ~= nil do
@@ -293,7 +299,7 @@ M.Ptr_List = List_Base:clone {
293M.String_List = List_Base:clone { 299M.String_List = List_Base:clone {
294 data_get = function(self, ptr) 300 data_get = function(self, ptr)
295 ptr = List_Base.data_get(self, ptr) 301 ptr = List_Base.data_get(self, ptr)
296 if ptr == nil then return nil end 302 if not ptr or ptr == ffi.nullptr then return nil end
297 return ffi.string(ptr) 303 return ffi.string(ptr)
298 end 304 end
299} 305}
diff --git a/src/bindings/luajit/eina/xattr.lua b/src/bindings/luajit/eina/xattr.lua
index 192d39b85f..3e2417d194 100644
--- a/src/bindings/luajit/eina/xattr.lua
+++ b/src/bindings/luajit/eina/xattr.lua
@@ -98,7 +98,7 @@ end
98M.get = function(file, attribute) 98M.get = function(file, attribute)
99 local size = ffi.new("size_t[1]") 99 local size = ffi.new("size_t[1]")
100 local v = eina.eina_xattr_get(file, attribute, size) 100 local v = eina.eina_xattr_get(file, attribute, size)
101 if v == nil then return nil end 101 if v == ffi.nullptr then return nil end
102 local r = ffi.string(v, size[0]) 102 local r = ffi.string(v, size[0])
103 C.free(v) 103 C.free(v)
104 return r 104 return r
@@ -126,7 +126,7 @@ end
126 126
127M.string_get = function(file, attribute) 127M.string_get = function(file, attribute)
128 local v = eina.eina_xattr_string_get(file, attribute) 128 local v = eina.eina_xattr_string_get(file, attribute)
129 if v == nil then return nil end 129 if v == ffi.nullptr then return nil end
130 local r = ffi.string(v) 130 local r = ffi.string(v)
131 C.free(v) 131 C.free(v)
132 return r 132 return r
diff --git a/src/bindings/luajit/eo.lua b/src/bindings/luajit/eo.lua
index bebe733853..42531aa153 100644
--- a/src/bindings/luajit/eo.lua
+++ b/src/bindings/luajit/eo.lua
@@ -337,7 +337,7 @@ end
337 337
338local get_obj_mt = function(obj) 338local get_obj_mt = function(obj)
339 local cl = eo.eo_class_get(obj) 339 local cl = eo.eo_class_get(obj)
340 if cl == nil then return nil end 340 if cl == ffi.nullptr then return nil end
341 return classes[eo_obj_addr_get(cl)] 341 return classes[eo_obj_addr_get(cl)]
342end 342end
343 343
@@ -416,7 +416,7 @@ ffi.metatype("Eo", {
416 -- handles property getting with no keys and also properties with keys 416 -- handles property getting with no keys and also properties with keys
417 __index = function(self, key) 417 __index = function(self, key)
418 local mt = get_obj_mt(self) 418 local mt = get_obj_mt(self)
419 if mt == nil then return nil end 419 if not mt then return nil end
420 local pt = mt.__properties 420 local pt = mt.__properties
421 local pp = pt[key] 421 local pp = pt[key]
422 if not pp then 422 if not pp then
@@ -444,7 +444,7 @@ ffi.metatype("Eo", {
444 -- handles property setting with no keys 444 -- handles property setting with no keys
445 __newindex = function(self, key, val) 445 __newindex = function(self, key, val)
446 local mt = get_obj_mt(self) 446 local mt = get_obj_mt(self)
447 if mt == nil then return nil end 447 if not mt then return nil end
448 local pt = mt.__properties 448 local pt = mt.__properties
449 local pp = pt[key] 449 local pp = pt[key]
450 if not pp then 450 if not pp then
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 93499df6a5..7bd8f96894 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -556,7 +556,7 @@ local object_idx, wrap_object = gen_wrap {
556 556
557 unit_get = function(self) 557 unit_get = function(self)
558 local v = eolian.eolian_object_unit_get(cast_obj(self)) 558 local v = eolian.eolian_object_unit_get(cast_obj(self))
559 if v == nil then 559 if v == ffi.nullptr then
560 return nil 560 return nil
561 end 561 end
562 return v 562 return v
@@ -572,7 +572,7 @@ local object_idx, wrap_object = gen_wrap {
572 572
573 file_get = function(self) 573 file_get = function(self)
574 local v = eolian.eolian_object_file_get(cast_obj(self)) 574 local v = eolian.eolian_object_file_get(cast_obj(self))
575 if v == nil then 575 if v == ffi.nullptr then
576 return nil 576 return nil
577 end 577 end
578 return ffi.string(v) 578 return ffi.string(v)
@@ -580,7 +580,7 @@ local object_idx, wrap_object = gen_wrap {
580 580
581 name_get = function(self) 581 name_get = function(self)
582 local v = eolian.eolian_object_name_get(cast_obj(self)) 582 local v = eolian.eolian_object_name_get(cast_obj(self))
583 if v == nil then 583 if v == ffi.nullptr then
584 return nil 584 return nil
585 end 585 end
586 return ffi.string(v) 586 return ffi.string(v)
@@ -588,7 +588,7 @@ local object_idx, wrap_object = gen_wrap {
588 588
589 c_name_get = function(self) 589 c_name_get = function(self)
590 local v = eolian.eolian_object_c_name_get(cast_obj(self)) 590 local v = eolian.eolian_object_c_name_get(cast_obj(self))
591 if v == nil then 591 if v == ffi.nullptr then
592 return nil 592 return nil
593 end 593 end
594 return ffi.string(v) 594 return ffi.string(v)
@@ -596,7 +596,7 @@ local object_idx, wrap_object = gen_wrap {
596 596
597 short_name_get = function(self) 597 short_name_get = function(self)
598 local v = eolian.eolian_object_short_name_get(cast_obj(self)) 598 local v = eolian.eolian_object_short_name_get(cast_obj(self))
599 if v == nil then 599 if v == ffi.nullptr then
600 return nil 600 return nil
601 end 601 end
602 return ffi.string(v) 602 return ffi.string(v)
@@ -617,7 +617,7 @@ ffi.metatype("Eolian_Object", { __index = object_idx })
617local unit_idx, wrap_unit = gen_wrap { 617local unit_idx, wrap_unit = gen_wrap {
618 state_get = function(self) 618 state_get = function(self)
619 local v = eolian.eolian_unit_state_get(cast_unit(self)) 619 local v = eolian.eolian_unit_state_get(cast_unit(self))
620 if v == nil then return nil end 620 if v == ffi.nullptr then return nil end
621 return v 621 return v
622 end, 622 end,
623 623
@@ -628,13 +628,13 @@ local unit_idx, wrap_unit = gen_wrap {
628 628
629 file_get = function(self) 629 file_get = function(self)
630 local v = eolian.eolian_unit_file_get(cast_unit(self)) 630 local v = eolian.eolian_unit_file_get(cast_unit(self))
631 if v == nil then return nil end 631 if v == ffi.nullptr then return nil end
632 return ffi.string(v) 632 return ffi.string(v)
633 end, 633 end,
634 634
635 file_path_get = function(self) 635 file_path_get = function(self)
636 local v = eolian.eolian_unit_file_path_get(cast_unit(self)) 636 local v = eolian.eolian_unit_file_path_get(cast_unit(self))
637 if v == nil then return nil end 637 if v == ffi.nullptr then return nil end
638 return ffi.string(v) 638 return ffi.string(v)
639 end, 639 end,
640 640
@@ -644,7 +644,7 @@ local unit_idx, wrap_unit = gen_wrap {
644 644
645 object_by_name_get = function(self, name) 645 object_by_name_get = function(self, name)
646 local v = eolian.eolian_unit_object_by_name_get(cast_unit(self), name) 646 local v = eolian.eolian_unit_object_by_name_get(cast_unit(self), name)
647 if v == nil then return nil end 647 if v == ffi.nullptr then return nil end
648 return v 648 return v
649 end, 649 end,
650 650
@@ -655,7 +655,7 @@ local unit_idx, wrap_unit = gen_wrap {
655 655
656 class_by_name_get = function(self, cname) 656 class_by_name_get = function(self, cname)
657 local v = eolian.eolian_unit_class_by_name_get(cast_unit(self), cname) 657 local v = eolian.eolian_unit_class_by_name_get(cast_unit(self), cname)
658 if v == nil then return nil end 658 if v == ffi.nullptr then return nil end
659 return v 659 return v
660 end, 660 end,
661 661
@@ -666,13 +666,13 @@ local unit_idx, wrap_unit = gen_wrap {
666 666
667 constant_by_name_get = function(self, name) 667 constant_by_name_get = function(self, name)
668 local v = eolian.eolian_unit_constant_by_name_get(cast_unit(self), name) 668 local v = eolian.eolian_unit_constant_by_name_get(cast_unit(self), name)
669 if v == nil then return nil end 669 if v == ffi.nullptr then return nil end
670 return v 670 return v
671 end, 671 end,
672 672
673 error_by_name_get = function(self, name) 673 error_by_name_get = function(self, name)
674 local v = eolian.eolian_unit_error_by_name_get(cast_unit(self), name) 674 local v = eolian.eolian_unit_error_by_name_get(cast_unit(self), name)
675 if v == nil then return nil end 675 if v == ffi.nullptr then return nil end
676 return v 676 return v
677 end, 677 end,
678 678
@@ -688,19 +688,19 @@ local unit_idx, wrap_unit = gen_wrap {
688 688
689 alias_by_name_get = function(self, name) 689 alias_by_name_get = function(self, name)
690 local v = eolian.eolian_unit_alias_by_name_get(cast_unit(self), name) 690 local v = eolian.eolian_unit_alias_by_name_get(cast_unit(self), name)
691 if v == nil then return nil end 691 if v == ffi.nullptr then return nil end
692 return v 692 return v
693 end, 693 end,
694 694
695 struct_by_name_get = function(self, name) 695 struct_by_name_get = function(self, name)
696 local v = eolian.eolian_unit_struct_by_name_get(cast_unit(self), name) 696 local v = eolian.eolian_unit_struct_by_name_get(cast_unit(self), name)
697 if v == nil then return nil end 697 if v == ffi.nullptr then return nil end
698 return v 698 return v
699 end, 699 end,
700 700
701 enum_by_name_get = function(self, name) 701 enum_by_name_get = function(self, name)
702 local v = eolian.eolian_unit_enum_by_name_get(cast_unit(self), name) 702 local v = eolian.eolian_unit_enum_by_name_get(cast_unit(self), name)
703 if v == nil then return nil end 703 if v == ffi.nullptr then return nil end
704 return v 704 return v
705 end, 705 end,
706 706
@@ -769,7 +769,7 @@ ffi.metatype("Eolian_State", {
769 769
770 file_parse = function(self, fname) 770 file_parse = function(self, fname)
771 local v = eolian.eolian_state_file_parse(self, fname) 771 local v = eolian.eolian_state_file_parse(self, fname)
772 if v == nil then 772 if v == ffi.nullptr then
773 return nil 773 return nil
774 end 774 end
775 return v 775 return v
@@ -777,7 +777,7 @@ ffi.metatype("Eolian_State", {
777 777
778 file_path_parse = function(self, fpath) 778 file_path_parse = function(self, fpath)
779 local v = eolian.eolian_state_file_path_parse(self, fpath) 779 local v = eolian.eolian_state_file_path_parse(self, fpath)
780 if v == nil then 780 if v == ffi.nullptr then
781 return nil 781 return nil
782 end 782 end
783 return v 783 return v
@@ -817,7 +817,7 @@ ffi.metatype("Eolian_State", {
817 817
818 unit_by_file_get = function(self, fname) 818 unit_by_file_get = function(self, fname)
819 local v = eolian.eolian_state_unit_by_file_get(state, fname) 819 local v = eolian.eolian_state_unit_by_file_get(state, fname)
820 if v == nil then 820 if v == ffi.nullptr then
821 return nil 821 return nil
822 end 822 end
823 return v 823 return v
@@ -835,7 +835,7 @@ ffi.metatype("Eolian_State", {
835 835
836 class_by_file_get = function(self, fname) 836 class_by_file_get = function(self, fname)
837 local v = eolian.eolian_state_class_by_file_get(self, fname) 837 local v = eolian.eolian_state_class_by_file_get(self, fname)
838 if v == nil then return nil end 838 if v == ffi.nullptr then return nil end
839 return v 839 return v
840 end, 840 end,
841 841
@@ -961,13 +961,13 @@ ffi.metatype("Eolian_Struct_Type_Field", {
961 __index = wrap_object { 961 __index = wrap_object {
962 documentation_get = function(self) 962 documentation_get = function(self)
963 local v = eolian.eolian_typedecl_struct_field_documentation_get(self) 963 local v = eolian.eolian_typedecl_struct_field_documentation_get(self)
964 if v == nil then return nil end 964 if v == ffi.nullptr then return nil end
965 return v 965 return v
966 end, 966 end,
967 967
968 type_get = function(self) 968 type_get = function(self)
969 local v = eolian.eolian_typedecl_struct_field_type_get(self) 969 local v = eolian.eolian_typedecl_struct_field_type_get(self)
970 if v == nil then return nil end 970 if v == ffi.nullptr then return nil end
971 return v 971 return v
972 end, 972 end,
973 973
@@ -985,19 +985,19 @@ ffi.metatype("Eolian_Enum_Type_Field", {
985 __index = wrap_object { 985 __index = wrap_object {
986 c_name_get = function(self) 986 c_name_get = function(self)
987 local v = eolian.eolian_typedecl_enum_field_c_constant_get(self) 987 local v = eolian.eolian_typedecl_enum_field_c_constant_get(self)
988 if v == nil then return nil end 988 if v == ffi.nullptr then return nil end
989 return ffi_stringshare(v) 989 return ffi_stringshare(v)
990 end, 990 end,
991 991
992 documentation_get = function(self) 992 documentation_get = function(self)
993 local v = eolian.eolian_typedecl_enum_field_documentation_get(self) 993 local v = eolian.eolian_typedecl_enum_field_documentation_get(self)
994 if v == nil then return nil end 994 if v == ffi.nullptr then return nil end
995 return v 995 return v
996 end, 996 end,
997 997
998 value_get = function(self, force) 998 value_get = function(self, force)
999 local v = eolian.eolian_typedecl_enum_field_value_get(self, force and 1 or 0) 999 local v = eolian.eolian_typedecl_enum_field_value_get(self, force and 1 or 0)
1000 if v == nil then return nil end 1000 if v == ffi.nullptr then return nil end
1001 return v 1001 return v
1002 end 1002 end
1003 } 1003 }
@@ -1016,7 +1016,7 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
1016 1016
1017 struct_field_get = function(self, name) 1017 struct_field_get = function(self, name)
1018 local v = eolian.eolian_typedecl_struct_field_get(self, name) 1018 local v = eolian.eolian_typedecl_struct_field_get(self, name)
1019 if v == nil then return nil end 1019 if v == ffi.nullptr then return nil end
1020 return v 1020 return v
1021 end, 1021 end,
1022 1022
@@ -1027,31 +1027,31 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
1027 1027
1028 enum_field_get = function(self, field) 1028 enum_field_get = function(self, field)
1029 local v = eolian.eolian_typedecl_enum_field_get(self, field) 1029 local v = eolian.eolian_typedecl_enum_field_get(self, field)
1030 if v == nil then return nil end 1030 if v == ffi.nullptr then return nil end
1031 return v 1031 return v
1032 end, 1032 end,
1033 1033
1034 enum_legacy_prefix_get = function(self) 1034 enum_legacy_prefix_get = function(self)
1035 local v = eolian.eolian_typedecl_enum_legacy_prefix_get(self) 1035 local v = eolian.eolian_typedecl_enum_legacy_prefix_get(self)
1036 if v == nil then return nil end 1036 if v == ffi.nullptr then return nil end
1037 return ffi.string(v) 1037 return ffi.string(v)
1038 end, 1038 end,
1039 1039
1040 documentation_get = function(self, name) 1040 documentation_get = function(self, name)
1041 local v = eolian.eolian_typedecl_documentation_get(self) 1041 local v = eolian.eolian_typedecl_documentation_get(self)
1042 if v == nil then return nil end 1042 if v == ffi.nullptr then return nil end
1043 return v 1043 return v
1044 end, 1044 end,
1045 1045
1046 base_type_get = function(self) 1046 base_type_get = function(self)
1047 local v = eolian.eolian_typedecl_base_type_get(self) 1047 local v = eolian.eolian_typedecl_base_type_get(self)
1048 if v == nil then return nil end 1048 if v == ffi.nullptr then return nil end
1049 return v 1049 return v
1050 end, 1050 end,
1051 1051
1052 aliased_base_get = function(self) 1052 aliased_base_get = function(self)
1053 local v = eolian.eolian_typedecl_aliased_byse_get(self) 1053 local v = eolian.eolian_typedecl_aliased_byse_get(self)
1054 if v == nil then return nil end 1054 if v == ffi.nullptr then return nil end
1055 return v 1055 return v
1056 end, 1056 end,
1057 1057
@@ -1061,19 +1061,19 @@ M.Typedecl = ffi.metatype("Eolian_Typedecl", {
1061 1061
1062 c_type_get = function(self) 1062 c_type_get = function(self)
1063 local v = eolian.eolian_typedecl_c_type_get(self) 1063 local v = eolian.eolian_typedecl_c_type_get(self)
1064 if v == nil then return nil end 1064 if v == ffi.nullptr then return nil end
1065 return ffi_stringshare(v) 1065 return ffi_stringshare(v)
1066 end, 1066 end,
1067 1067
1068 free_func_get = function(self) 1068 free_func_get = function(self)
1069 local v = eolian.eolian_typedecl_free_func_get(self) 1069 local v = eolian.eolian_typedecl_free_func_get(self)
1070 if v == nil then return nil end 1070 if v == ffi.nullptr then return nil end
1071 return ffi.string(v) 1071 return ffi.string(v)
1072 end, 1072 end,
1073 1073
1074 function_pointer_get = function(self) 1074 function_pointer_get = function(self)
1075 local v = eolian.eolian_typedecl_function_pointer_get(self) 1075 local v = eolian.eolian_typedecl_function_pointer_get(self)
1076 if v == nil then return nil end 1076 if v == ffi.nullptr then return nil end
1077 return v 1077 return v
1078 end 1078 end
1079 } 1079 }
@@ -1091,37 +1091,37 @@ M.Type = ffi.metatype("Eolian_Type", {
1091 1091
1092 base_type_get = function(self) 1092 base_type_get = function(self)
1093 local v = eolian.eolian_type_base_type_get(self) 1093 local v = eolian.eolian_type_base_type_get(self)
1094 if v == nil then return nil end 1094 if v == ffi.nullptr then return nil end
1095 return v 1095 return v
1096 end, 1096 end,
1097 1097
1098 next_type_get = function(self) 1098 next_type_get = function(self)
1099 local v = eolian.eolian_type_next_type_get(self) 1099 local v = eolian.eolian_type_next_type_get(self)
1100 if v == nil then return nil end 1100 if v == ffi.nullptr then return nil end
1101 return v 1101 return v
1102 end, 1102 end,
1103 1103
1104 typedecl_get = function(self) 1104 typedecl_get = function(self)
1105 local v = eolian.eolian_type_typedecl_get(self) 1105 local v = eolian.eolian_type_typedecl_get(self)
1106 if v == nil then return nil end 1106 if v == ffi.nullptr then return nil end
1107 return v 1107 return v
1108 end, 1108 end,
1109 1109
1110 aliased_base_get = function(self) 1110 aliased_base_get = function(self)
1111 local v = eolian.eolian_type_aliased_byse_get(self) 1111 local v = eolian.eolian_type_aliased_byse_get(self)
1112 if v == nil then return nil end 1112 if v == ffi.nullptr then return nil end
1113 return v 1113 return v
1114 end, 1114 end,
1115 1115
1116 class_get = function(self) 1116 class_get = function(self)
1117 local v = eolian.eolian_type_class_get(self) 1117 local v = eolian.eolian_type_class_get(self)
1118 if v == nil then return nil end 1118 if v == ffi.nullptr then return nil end
1119 return v 1119 return v
1120 end, 1120 end,
1121 1121
1122 error_get = function(self) 1122 error_get = function(self)
1123 local v = eolian.eolian_type_error_get(self) 1123 local v = eolian.eolian_type_error_get(self)
1124 if v == nil then return nil end 1124 if v == ffi.nullptr then return nil end
1125 return v 1125 return v
1126 end, 1126 end,
1127 1127
@@ -1139,7 +1139,7 @@ M.Type = ffi.metatype("Eolian_Type", {
1139 1139
1140 c_type_get = function(self) 1140 c_type_get = function(self)
1141 local v = eolian.eolian_type_c_type_get(self) 1141 local v = eolian.eolian_type_c_type_get(self)
1142 if v == nil then return nil end 1142 if v == ffi.nullptr then return nil end
1143 return ffi_stringshare(v) 1143 return ffi_stringshare(v)
1144 end 1144 end
1145 } 1145 }
@@ -1166,13 +1166,13 @@ M.Function = ffi.metatype("Eolian_Function", {
1166 1166
1167 full_c_name_get = function(self, ftype) 1167 full_c_name_get = function(self, ftype)
1168 local v = eolian.eolian_function_full_c_name_get(self, ftype) 1168 local v = eolian.eolian_function_full_c_name_get(self, ftype)
1169 if v == nil then return nil end 1169 if v == ffi.nullptr then return nil end
1170 return ffi_stringshare(v) 1170 return ffi_stringshare(v)
1171 end, 1171 end,
1172 1172
1173 implement_get = function(self) 1173 implement_get = function(self)
1174 local v = eolian.eolian_function_implement_get(self) 1174 local v = eolian.eolian_function_implement_get(self)
1175 if v == nil then return nil end 1175 if v == ffi.nullptr then return nil end
1176 return v 1176 return v
1177 end, 1177 end,
1178 1178
@@ -1205,19 +1205,19 @@ M.Function = ffi.metatype("Eolian_Function", {
1205 1205
1206 return_type_get = function(self, ftype) 1206 return_type_get = function(self, ftype)
1207 local v = eolian.eolian_function_return_type_get(self, ftype) 1207 local v = eolian.eolian_function_return_type_get(self, ftype)
1208 if v == nil then return nil end 1208 if v == ffi.nullptr then return nil end
1209 return v 1209 return v
1210 end, 1210 end,
1211 1211
1212 return_default_value_get = function(self, ftype) 1212 return_default_value_get = function(self, ftype)
1213 local v = eolian.eolian_function_return_default_value_get(self, ftype) 1213 local v = eolian.eolian_function_return_default_value_get(self, ftype)
1214 if v == nil then return nil end 1214 if v == ffi.nullptr then return nil end
1215 return v 1215 return v
1216 end, 1216 end,
1217 1217
1218 return_documentation_get = function(self, ftype) 1218 return_documentation_get = function(self, ftype)
1219 local v = eolian.eolian_function_return_documentation_get(self, ftype) 1219 local v = eolian.eolian_function_return_documentation_get(self, ftype)
1220 if v == nil then return nil end 1220 if v == ffi.nullptr then return nil end
1221 return v 1221 return v
1222 end, 1222 end,
1223 1223
@@ -1240,7 +1240,7 @@ M.Function = ffi.metatype("Eolian_Function", {
1240 1240
1241 class_get = function(self) 1241 class_get = function(self)
1242 local v = eolian.eolian_function_class_get(self) 1242 local v = eolian.eolian_function_class_get(self)
1243 if v == nil then return nil end 1243 if v == ffi.nullptr then return nil end
1244 return v 1244 return v
1245 end 1245 end
1246 } 1246 }
@@ -1261,19 +1261,19 @@ ffi.metatype("Eolian_Function_Parameter", {
1261 1261
1262 type_get = function(self) 1262 type_get = function(self)
1263 local v = eolian.eolian_parameter_type_get(self) 1263 local v = eolian.eolian_parameter_type_get(self)
1264 if v == nil then return nil end 1264 if v == ffi.nullptr then return nil end
1265 return v 1265 return v
1266 end, 1266 end,
1267 1267
1268 default_value_get = function(self) 1268 default_value_get = function(self)
1269 local v = eolian.eolian_parameter_default_value_get(self) 1269 local v = eolian.eolian_parameter_default_value_get(self)
1270 if v == nil then return nil end 1270 if v == ffi.nullptr then return nil end
1271 return v 1271 return v
1272 end, 1272 end,
1273 1273
1274 documentation_get = function(self) 1274 documentation_get = function(self)
1275 local v = eolian.eolian_parameter_documentation_get(self) 1275 local v = eolian.eolian_parameter_documentation_get(self)
1276 if v == nil then return nil end 1276 if v == ffi.nullptr then return nil end
1277 return v 1277 return v
1278 end, 1278 end,
1279 1279
@@ -1295,26 +1295,26 @@ ffi.metatype("Eolian_Implement", {
1295 __index = wrap_object { 1295 __index = wrap_object {
1296 class_get = function(self) 1296 class_get = function(self)
1297 local v = eolian.eolian_implement_class_get(self) 1297 local v = eolian.eolian_implement_class_get(self)
1298 if v == nil then return nil end 1298 if v == ffi.nullptr then return nil end
1299 return v 1299 return v
1300 end, 1300 end,
1301 1301
1302 implementing_class_get = function(self) 1302 implementing_class_get = function(self)
1303 local v = eolian.eolian_implement_implementing_class_get(self) 1303 local v = eolian.eolian_implement_implementing_class_get(self)
1304 if v == nil then return nil end 1304 if v == ffi.nullptr then return nil end
1305 return v 1305 return v
1306 end, 1306 end,
1307 1307
1308 function_get = function(self) 1308 function_get = function(self)
1309 local tp = ffi.new("Eolian_Function_Type[1]") 1309 local tp = ffi.new("Eolian_Function_Type[1]")
1310 local v = eolian.eolian_implement_function_get(self, tp) 1310 local v = eolian.eolian_implement_function_get(self, tp)
1311 if v == nil then return nil end 1311 if v == ffi.nullptr then return nil end
1312 return v, tp[0] 1312 return v, tp[0]
1313 end, 1313 end,
1314 1314
1315 documentation_get = function(self, ftype) 1315 documentation_get = function(self, ftype)
1316 local v = eolian.eolian_implement_documentation_get(self, ftype) 1316 local v = eolian.eolian_implement_documentation_get(self, ftype)
1317 if v == nil then return nil end 1317 if v == ffi.nullptr then return nil end
1318 return v 1318 return v
1319 end, 1319 end,
1320 1320
@@ -1344,13 +1344,13 @@ ffi.metatype("Eolian_Constructor", {
1344 __index = wrap_object { 1344 __index = wrap_object {
1345 class_get = function(self) 1345 class_get = function(self)
1346 local v = eolian.eolian_constructor_class_get(self) 1346 local v = eolian.eolian_constructor_class_get(self)
1347 if v == nil then return nil end 1347 if v == ffi.nullptr then return nil end
1348 return v 1348 return v
1349 end, 1349 end,
1350 1350
1351 function_get = function(self) 1351 function_get = function(self)
1352 local v = eolian.eolian_constructor_function_get(self) 1352 local v = eolian.eolian_constructor_function_get(self)
1353 if v == nil then return nil end 1353 if v == ffi.nullptr then return nil end
1354 return v 1354 return v
1355 end, 1355 end,
1356 1356
@@ -1364,19 +1364,19 @@ ffi.metatype("Eolian_Event", {
1364 __index = wrap_object { 1364 __index = wrap_object {
1365 type_get = function(self) 1365 type_get = function(self)
1366 local v = eolian.eolian_event_type_get(self) 1366 local v = eolian.eolian_event_type_get(self)
1367 if v == nil then return nil end 1367 if v == ffi.nullptr then return nil end
1368 return v 1368 return v
1369 end, 1369 end,
1370 1370
1371 class_get = function(self) 1371 class_get = function(self)
1372 local v = eolian.eolian_event_class_get(self) 1372 local v = eolian.eolian_event_class_get(self)
1373 if v == nil then return nil end 1373 if v == ffi.nullptr then return nil end
1374 return v 1374 return v
1375 end, 1375 end,
1376 1376
1377 documentation_get = function(self) 1377 documentation_get = function(self)
1378 local v = eolian.eolian_event_documentation_get(self) 1378 local v = eolian.eolian_event_documentation_get(self)
1379 if v == nil then return nil end 1379 if v == ffi.nullptr then return nil end
1380 return v 1380 return v
1381 end, 1381 end,
1382 1382
@@ -1386,7 +1386,7 @@ ffi.metatype("Eolian_Event", {
1386 1386
1387 c_macro_get = function(self) 1387 c_macro_get = function(self)
1388 local v = eolian.eolian_event_c_macro_get(self) 1388 local v = eolian.eolian_event_c_macro_get(self)
1389 if v == nil then return nil end 1389 if v == ffi.nullptr then return nil end
1390 return ffi_stringshare(v) 1390 return ffi_stringshare(v)
1391 end, 1391 end,
1392 1392
@@ -1404,13 +1404,13 @@ ffi.metatype("Eolian_Part", {
1404 __index = wrap_object { 1404 __index = wrap_object {
1405 class_get = function(self) 1405 class_get = function(self)
1406 local v = eolian.eolian_part_class_get(self) 1406 local v = eolian.eolian_part_class_get(self)
1407 if v == nil then return nil end 1407 if v == ffi.nullptr then return nil end
1408 return v 1408 return v
1409 end, 1409 end,
1410 1410
1411 documentation_get = function(self) 1411 documentation_get = function(self)
1412 local v = eolian.eolian_part_documentation_get(self) 1412 local v = eolian.eolian_part_documentation_get(self)
1413 if v == nil then return nil end 1413 if v == ffi.nullptr then return nil end
1414 return v 1414 return v
1415 end 1415 end
1416 } 1416 }
@@ -1432,13 +1432,13 @@ M.Class = ffi.metatype("Eolian_Class", {
1432 1432
1433 documentation_get = function(self) 1433 documentation_get = function(self)
1434 local v = eolian.eolian_class_documentation_get(self) 1434 local v = eolian.eolian_class_documentation_get(self)
1435 if v == nil then return nil end 1435 if v == ffi.nullptr then return nil end
1436 return v 1436 return v
1437 end, 1437 end,
1438 1438
1439 c_prefix_get = function(self) 1439 c_prefix_get = function(self)
1440 local v = eolian.eolian_class_c_prefix_get(self) 1440 local v = eolian.eolian_class_c_prefix_get(self)
1441 if v == nil then 1441 if v == ffi.nullptr then
1442 local buf = self:namespaces_get() 1442 local buf = self:namespaces_get()
1443 buf[#buf + 1] = self:short_name_get() 1443 buf[#buf + 1] = self:short_name_get()
1444 return table.concat(buf, "_"):lower() 1444 return table.concat(buf, "_"):lower()
@@ -1448,7 +1448,7 @@ M.Class = ffi.metatype("Eolian_Class", {
1448 1448
1449 event_c_prefix_get = function(self) 1449 event_c_prefix_get = function(self)
1450 local v = eolian.eolian_class_event_c_prefix_get(self) 1450 local v = eolian.eolian_class_event_c_prefix_get(self)
1451 if v == nil then 1451 if v == ffi.nullptr then
1452 return self:c_prefix_get() 1452 return self:c_prefix_get()
1453 end 1453 end
1454 return ffi.string(v) 1454 return ffi.string(v)
@@ -1456,13 +1456,13 @@ M.Class = ffi.metatype("Eolian_Class", {
1456 1456
1457 data_type_get = function(self) 1457 data_type_get = function(self)
1458 local v = eolian.eolian_class_data_type_get(self) 1458 local v = eolian.eolian_class_data_type_get(self)
1459 if v == nil then return nil end 1459 if v == ffi.nullptr then return nil end
1460 return ffi.string(v) 1460 return ffi.string(v)
1461 end, 1461 end,
1462 1462
1463 parent_get = function(self) 1463 parent_get = function(self)
1464 local v = eolian.eolian_class_parent_get(self) 1464 local v = eolian.eolian_class_parent_get(self)
1465 if v == nil then return nil end 1465 if v == ffi.nullptr then return nil end
1466 return v 1466 return v
1467 end, 1467 end,
1468 1468
@@ -1484,7 +1484,7 @@ M.Class = ffi.metatype("Eolian_Class", {
1484 function_by_name_get = function(self, fname, ftype) 1484 function_by_name_get = function(self, fname, ftype)
1485 local v = eolian.eolian_class_function_by_name_get(self, fname, 1485 local v = eolian.eolian_class_function_by_name_get(self, fname,
1486 ftype) 1486 ftype)
1487 if v == nil then return nil end 1487 if v == ffi.nullptr then return nil end
1488 return v 1488 return v
1489 end, 1489 end,
1490 1490
@@ -1505,7 +1505,7 @@ M.Class = ffi.metatype("Eolian_Class", {
1505 1505
1506 event_by_name_get = function(self, name) 1506 event_by_name_get = function(self, name)
1507 local v = eolian.eolian_class_event_by_name_get(self, name) 1507 local v = eolian.eolian_class_event_by_name_get(self, name)
1508 if v == nil then return nil end 1508 if v == ffi.nullptr then return nil end
1509 return v 1509 return v
1510 end, 1510 end,
1511 1511
@@ -1524,19 +1524,19 @@ M.Class = ffi.metatype("Eolian_Class", {
1524 1524
1525 c_get_function_name_get = function(self) 1525 c_get_function_name_get = function(self)
1526 local v = eolian.eolian_class_c_get_function_name_get(self) 1526 local v = eolian.eolian_class_c_get_function_name_get(self)
1527 if v == nil then return nil end 1527 if v == ffi.nullptr then return nil end
1528 return ffi_stringshare(v) 1528 return ffi_stringshare(v)
1529 end, 1529 end,
1530 1530
1531 c_macro_get = function(self) 1531 c_macro_get = function(self)
1532 local v = eolian.eolian_class_c_macro_get(self) 1532 local v = eolian.eolian_class_c_macro_get(self)
1533 if v == nil then return nil end 1533 if v == ffi.nullptr then return nil end
1534 return ffi_stringshare(v) 1534 return ffi_stringshare(v)
1535 end, 1535 end,
1536 1536
1537 c_data_type_get = function(self) 1537 c_data_type_get = function(self)
1538 local v = eolian.eolian_class_c_data_type_get(self) 1538 local v = eolian.eolian_class_c_data_type_get(self)
1539 if v == nil then return nil end 1539 if v == ffi.nullptr then return nil end
1540 return ffi_stringshare(v) 1540 return ffi_stringshare(v)
1541 end 1541 end
1542 } 1542 }
@@ -1611,7 +1611,7 @@ M.Value = ffi.metatype("Eolian_Value", {
1611 1611
1612 to_literal = function(self) 1612 to_literal = function(self)
1613 local v = eolian.eolian_expression_value_to_literal(self) 1613 local v = eolian.eolian_expression_value_to_literal(self)
1614 if v == nil then return nil end 1614 if v == ffi.nullptr then return nil end
1615 return ffi_stringshare(v) 1615 return ffi_stringshare(v)
1616 end 1616 end
1617 } 1617 }
@@ -1658,13 +1658,13 @@ M.Expression = ffi.metatype("Eolian_Expression", {
1658 eval = function(self, mask) 1658 eval = function(self, mask)
1659 mask = mask or emask.ALL 1659 mask = mask or emask.ALL
1660 local v = eolian.eolian_expression_eval(self, mask) 1660 local v = eolian.eolian_expression_eval(self, mask)
1661 if v == nil then return nil end 1661 if v == ffi.nullptr then return nil end
1662 return ffi.cast("Eolian_Value*", v) 1662 return ffi.cast("Eolian_Value*", v)
1663 end, 1663 end,
1664 1664
1665 serialize = function(self) 1665 serialize = function(self)
1666 local v = eolian.eolian_expression_serialize(self) 1666 local v = eolian.eolian_expression_serialize(self)
1667 if v == nil then return nil end 1667 if v == ffi.nullptr then return nil end
1668 return ffi_stringshare(v) 1668 return ffi_stringshare(v)
1669 end, 1669 end,
1670 1670
@@ -1678,13 +1678,13 @@ M.Expression = ffi.metatype("Eolian_Expression", {
1678 1678
1679 binary_lhs_get = function(self) 1679 binary_lhs_get = function(self)
1680 local v = eolian.eolian_expression_binary_lhs_get(self) 1680 local v = eolian.eolian_expression_binary_lhs_get(self)
1681 if v == nil then return nil end 1681 if v == ffi.nullptr then return nil end
1682 return v 1682 return v
1683 end, 1683 end,
1684 1684
1685 binary_rhs_get = function(self) 1685 binary_rhs_get = function(self)
1686 local v = eolian.eolian_expression_binary_rhs_get(self) 1686 local v = eolian.eolian_expression_binary_rhs_get(self)
1687 if v == nil then return nil end 1687 if v == ffi.nullptr then return nil end
1688 return v 1688 return v
1689 end, 1689 end,
1690 1690
@@ -1694,13 +1694,13 @@ M.Expression = ffi.metatype("Eolian_Expression", {
1694 1694
1695 unary_expression_get = function(self) 1695 unary_expression_get = function(self)
1696 local v = eolian.eolian_expression_unary_expression_get(self) 1696 local v = eolian.eolian_expression_unary_expression_get(self)
1697 if v == nil then return nil end 1697 if v == ffi.nullptr then return nil end
1698 return v 1698 return v
1699 end, 1699 end,
1700 1700
1701 value_get = function(self) 1701 value_get = function(self)
1702 local v = eolian.eolian_expression_value_get(self) 1702 local v = eolian.eolian_expression_value_get(self)
1703 if v == nil then return nil end 1703 if v == ffi.nullptr then return nil end
1704 return ffi.cast("Eolian_Value*", v) 1704 return ffi.cast("Eolian_Value*", v)
1705 end 1705 end
1706 } 1706 }
@@ -1710,19 +1710,19 @@ M.Constant = ffi.metatype("Eolian_Constant", {
1710 __index = wrap_object { 1710 __index = wrap_object {
1711 documentation_get = function(self) 1711 documentation_get = function(self)
1712 local v = eolian.eolian_constant_documentation_get(self) 1712 local v = eolian.eolian_constant_documentation_get(self)
1713 if v == nil then return nil end 1713 if v == ffi.nullptr then return nil end
1714 return v 1714 return v
1715 end, 1715 end,
1716 1716
1717 type_get = function(self) 1717 type_get = function(self)
1718 local v = eolian.eolian_constant_type_get(self) 1718 local v = eolian.eolian_constant_type_get(self)
1719 if v == nil then return nil end 1719 if v == ffi.nullptr then return nil end
1720 return v 1720 return v
1721 end, 1721 end,
1722 1722
1723 value_get = function(self) 1723 value_get = function(self)
1724 local v = eolian.eolian_constant_value_get(self) 1724 local v = eolian.eolian_constant_value_get(self)
1725 if v == nil then return nil end 1725 if v == ffi.nullptr then return nil end
1726 return v 1726 return v
1727 end, 1727 end,
1728 1728
@@ -1736,13 +1736,13 @@ M.Error = ffi.metatype("Eolian_Error", {
1736 __index = wrap_object { 1736 __index = wrap_object {
1737 documentation_get = function(self) 1737 documentation_get = function(self)
1738 local v = eolian.eolian_error_documentation_get(self) 1738 local v = eolian.eolian_error_documentation_get(self)
1739 if v == nil then return nil end 1739 if v == ffi.nullptr then return nil end
1740 return v 1740 return v
1741 end, 1741 end,
1742 1742
1743 message_get = function(self) 1743 message_get = function(self)
1744 local v = eolian.eolian_error_message_get(self) 1744 local v = eolian.eolian_error_message_get(self)
1745 if v == nil then return nil end 1745 if v == ffi.nullptr then return nil end
1746 return ffi.string(v) 1746 return ffi.string(v)
1747 end, 1747 end,
1748 1748
@@ -1756,19 +1756,19 @@ M.Documentation = ffi.metatype("Eolian_Documentation", {
1756 __index = wrap_object { 1756 __index = wrap_object {
1757 summary_get = function(self) 1757 summary_get = function(self)
1758 local v = eolian.eolian_documentation_summary_get(self) 1758 local v = eolian.eolian_documentation_summary_get(self)
1759 if v == nil then return nil end 1759 if v == ffi.nullptr then return nil end
1760 return ffi.string(v) 1760 return ffi.string(v)
1761 end, 1761 end,
1762 1762
1763 description_get = function(self) 1763 description_get = function(self)
1764 local v = eolian.eolian_documentation_description_get(self) 1764 local v = eolian.eolian_documentation_description_get(self)
1765 if v == nil then return nil end 1765 if v == ffi.nullptr then return nil end
1766 return ffi.string(v) 1766 return ffi.string(v)
1767 end, 1767 end,
1768 1768
1769 since_get = function(self) 1769 since_get = function(self)
1770 local v = eolian.eolian_documentation_since_get(self) 1770 local v = eolian.eolian_documentation_since_get(self)
1771 if v == nil then return nil end 1771 if v == ffi.nullptr then return nil end
1772 return ffi.string(v) 1772 return ffi.string(v)
1773 end 1773 end
1774 } 1774 }
@@ -1807,7 +1807,7 @@ end
1807 1807
1808M.documentation_tokenize = function(doc, ret) 1808M.documentation_tokenize = function(doc, ret)
1809 local ret = eolian.eolian_documentation_tokenize(doc, ret) 1809 local ret = eolian.eolian_documentation_tokenize(doc, ret)
1810 if ret == nil then 1810 if ret == ffi.nullptr then
1811 return nil 1811 return nil
1812 end 1812 end
1813 return ffi.string(ret) 1813 return ffi.string(ret)
@@ -1827,7 +1827,7 @@ M.Eolian_Doc_Token = ffi.metatype("Eolian_Doc_Token", {
1827 1827
1828 text_get = function(self) 1828 text_get = function(self)
1829 local str = eolian.eolian_doc_token_text_get(self) 1829 local str = eolian.eolian_doc_token_text_get(self)
1830 if str == nil then 1830 if str == ffi.nullptr then
1831 return nil 1831 return nil
1832 end 1832 end
1833 local ret = ffi.string(str) 1833 local ret = ffi.string(str)