local List_Iterator = Iterator:clone {
__ctor = function(self, selfmt, list)
- if list == nil then return Iterator.__ctor(self, selfmt, nil) end
+ if not list or list == ffi.nullptr then
+ return Iterator.__ctor(self, selfmt, nil)
+ end
selfmt.__list = list
return Iterator.__ctor(self, selfmt,
eina.eina_list_iterator_new(dgetmt(list).__list))
local List_Reverse_Iterator = Iterator:clone {
__ctor = function(self, selfmt, list)
- if list == nil then return Iterator.__ctor(self, selfmt, nil) end
+ if not list or list == ffi.nullptr then
+ return Iterator.__ctor(self, selfmt, nil)
+ end
selfmt.__list = list
return Iterator.__ctor(self, selfmt,
eina.eina_list_iterator_reversed_new(dgetmt(list).__list))
local List_Accessor = Accessor:clone {
__ctor = function(self, selfmt, list)
- if list == nil then return Accessor.__ctor(self, selfmt, nil) end
+ if not list or list == ffi.nullptr then
+ return Accessor.__ctor(self, selfmt, nil)
+ end
selfmt.__list = list
return Accessor.__ctor(self, selfmt,
eina.eina_list_accessor_new(dgetmt(list).__list))
data_get = function(self, ptr)
if ptr ~= nil then return ptr end
local v = get_list_t(self).data
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
nth = function(self, n)
local v = eina.eina_list_nth(self, n - 1)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return self:data_get(v)
end,
nth_list = function(self, n)
local v = eina.eina_list_nth_list(self, n - 1)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
last = function(self)
local v = get_list_t(self).accounting.last
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
next = function(self)
local v = get_list_t(self).next
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
prev = function(self)
local v = get_list_t(self).prev
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end
}
list = ffi.gc(list, freefunc)
selfmt.__free = freefunc
end
- if list == nil then return end
+ if not list or list == ffi.nullptr then return end
selfmt.__eq = function(self, other)
return selfmt.__list == dgetmt(other).__list
end
free = function(self)
self = dgetmt(self)
local ffunc, l = self.__free, self.__list
- if not ffunc or l == nil then return end
+ if not ffunc or not l or l == ffi.nullptr then return end
ffunc(ffi.gc(self.__list, nil))
end,
count = function(self)
self = dgetmt(self)
local l = self.__list
- if l == nil then return 0 end
+ if not l or l == ffi.nullptr then return 0 end
return #l
end,
nth = function(self, n)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return l:nth()
end,
nth_list = function(self, n)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return self.__index(l:nth_list())
end,
last = function(self, n)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return self.__index(l:last())
end,
next = function(self, n)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return self.__index(l:next())
end,
prev = function(self, n)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return self.__index(l:prev())
end,
data_get = function(self, ptr)
self = dgetmt(self)
local l = self.__list
- if l == nil then return nil end
+ if not l or l == ffi.nullptr then return nil end
return l:data_get(ptr)
end,
to_array = function(self)
local l = dgetmt(self).__list
- if l == nil then return {}, 0 end
+ if not l or l == ffi.nullptr then return {}, 0 end
local n = 0
local r = {}
while l ~= nil do
M.String_List = List_Base:clone {
data_get = function(self, ptr)
ptr = List_Base.data_get(self, ptr)
- if ptr == nil then return nil end
+ if not ptr or ptr == ffi.nullptr then return nil end
return ffi.string(ptr)
end
}
unit_get = function(self)
local v = eolian.eolian_object_unit_get(cast_obj(self))
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return v
file_get = function(self)
local v = eolian.eolian_object_file_get(cast_obj(self))
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return ffi.string(v)
name_get = function(self)
local v = eolian.eolian_object_name_get(cast_obj(self))
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return ffi.string(v)
c_name_get = function(self)
local v = eolian.eolian_object_c_name_get(cast_obj(self))
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return ffi.string(v)
short_name_get = function(self)
local v = eolian.eolian_object_short_name_get(cast_obj(self))
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return ffi.string(v)
local unit_idx, wrap_unit = gen_wrap {
state_get = function(self)
local v = eolian.eolian_unit_state_get(cast_unit(self))
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
file_get = function(self)
local v = eolian.eolian_unit_file_get(cast_unit(self))
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
file_path_get = function(self)
local v = eolian.eolian_unit_file_path_get(cast_unit(self))
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
object_by_name_get = function(self, name)
local v = eolian.eolian_unit_object_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
class_by_name_get = function(self, cname)
local v = eolian.eolian_unit_class_by_name_get(cast_unit(self), cname)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
constant_by_name_get = function(self, name)
local v = eolian.eolian_unit_constant_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
error_by_name_get = function(self, name)
local v = eolian.eolian_unit_error_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
alias_by_name_get = function(self, name)
local v = eolian.eolian_unit_alias_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
struct_by_name_get = function(self, name)
local v = eolian.eolian_unit_struct_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
enum_by_name_get = function(self, name)
local v = eolian.eolian_unit_enum_by_name_get(cast_unit(self), name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
file_parse = function(self, fname)
local v = eolian.eolian_state_file_parse(self, fname)
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return v
file_path_parse = function(self, fpath)
local v = eolian.eolian_state_file_path_parse(self, fpath)
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return v
unit_by_file_get = function(self, fname)
local v = eolian.eolian_state_unit_by_file_get(state, fname)
- if v == nil then
+ if v == ffi.nullptr then
return nil
end
return v
class_by_file_get = function(self, fname)
local v = eolian.eolian_state_class_by_file_get(self, fname)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
documentation_get = function(self)
local v = eolian.eolian_typedecl_struct_field_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
type_get = function(self)
local v = eolian.eolian_typedecl_struct_field_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
c_name_get = function(self)
local v = eolian.eolian_typedecl_enum_field_c_constant_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
documentation_get = function(self)
local v = eolian.eolian_typedecl_enum_field_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
value_get = function(self, force)
local v = eolian.eolian_typedecl_enum_field_value_get(self, force and 1 or 0)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end
}
struct_field_get = function(self, name)
local v = eolian.eolian_typedecl_struct_field_get(self, name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
enum_field_get = function(self, field)
local v = eolian.eolian_typedecl_enum_field_get(self, field)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
enum_legacy_prefix_get = function(self)
local v = eolian.eolian_typedecl_enum_legacy_prefix_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
documentation_get = function(self, name)
local v = eolian.eolian_typedecl_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
base_type_get = function(self)
local v = eolian.eolian_typedecl_base_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
aliased_base_get = function(self)
local v = eolian.eolian_typedecl_aliased_byse_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
c_type_get = function(self)
local v = eolian.eolian_typedecl_c_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
free_func_get = function(self)
local v = eolian.eolian_typedecl_free_func_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
function_pointer_get = function(self)
local v = eolian.eolian_typedecl_function_pointer_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end
}
base_type_get = function(self)
local v = eolian.eolian_type_base_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
next_type_get = function(self)
local v = eolian.eolian_type_next_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
typedecl_get = function(self)
local v = eolian.eolian_type_typedecl_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
aliased_base_get = function(self)
local v = eolian.eolian_type_aliased_byse_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
class_get = function(self)
local v = eolian.eolian_type_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
error_get = function(self)
local v = eolian.eolian_type_error_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
c_type_get = function(self)
local v = eolian.eolian_type_c_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end
}
full_c_name_get = function(self, ftype)
local v = eolian.eolian_function_full_c_name_get(self, ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
implement_get = function(self)
local v = eolian.eolian_function_implement_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
return_type_get = function(self, ftype)
local v = eolian.eolian_function_return_type_get(self, ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
return_default_value_get = function(self, ftype)
local v = eolian.eolian_function_return_default_value_get(self, ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
return_documentation_get = function(self, ftype)
local v = eolian.eolian_function_return_documentation_get(self, ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
class_get = function(self)
local v = eolian.eolian_function_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end
}
type_get = function(self)
local v = eolian.eolian_parameter_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
default_value_get = function(self)
local v = eolian.eolian_parameter_default_value_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
documentation_get = function(self)
local v = eolian.eolian_parameter_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
class_get = function(self)
local v = eolian.eolian_implement_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
implementing_class_get = function(self)
local v = eolian.eolian_implement_implementing_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
function_get = function(self)
local tp = ffi.new("Eolian_Function_Type[1]")
local v = eolian.eolian_implement_function_get(self, tp)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v, tp[0]
end,
documentation_get = function(self, ftype)
local v = eolian.eolian_implement_documentation_get(self, ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
class_get = function(self)
local v = eolian.eolian_constructor_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
function_get = function(self)
local v = eolian.eolian_constructor_function_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
type_get = function(self)
local v = eolian.eolian_event_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
class_get = function(self)
local v = eolian.eolian_event_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
documentation_get = function(self)
local v = eolian.eolian_event_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
c_macro_get = function(self)
local v = eolian.eolian_event_c_macro_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
__index = wrap_object {
class_get = function(self)
local v = eolian.eolian_part_class_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
documentation_get = function(self)
local v = eolian.eolian_part_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end
}
documentation_get = function(self)
local v = eolian.eolian_class_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
c_prefix_get = function(self)
local v = eolian.eolian_class_c_prefix_get(self)
- if v == nil then
+ if v == ffi.nullptr then
local buf = self:namespaces_get()
buf[#buf + 1] = self:short_name_get()
return table.concat(buf, "_"):lower()
event_c_prefix_get = function(self)
local v = eolian.eolian_class_event_c_prefix_get(self)
- if v == nil then
+ if v == ffi.nullptr then
return self:c_prefix_get()
end
return ffi.string(v)
data_type_get = function(self)
local v = eolian.eolian_class_data_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
parent_get = function(self)
local v = eolian.eolian_class_parent_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
function_by_name_get = function(self, fname, ftype)
local v = eolian.eolian_class_function_by_name_get(self, fname,
ftype)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
event_by_name_get = function(self, name)
local v = eolian.eolian_class_event_by_name_get(self, name)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
c_get_function_name_get = function(self)
local v = eolian.eolian_class_c_get_function_name_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
c_macro_get = function(self)
local v = eolian.eolian_class_c_macro_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
c_data_type_get = function(self)
local v = eolian.eolian_class_c_data_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end
}
to_literal = function(self)
local v = eolian.eolian_expression_value_to_literal(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end
}
eval = function(self, mask)
mask = mask or emask.ALL
local v = eolian.eolian_expression_eval(self, mask)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.cast("Eolian_Value*", v)
end,
serialize = function(self)
local v = eolian.eolian_expression_serialize(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi_stringshare(v)
end,
binary_lhs_get = function(self)
local v = eolian.eolian_expression_binary_lhs_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
binary_rhs_get = function(self)
local v = eolian.eolian_expression_binary_rhs_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
unary_expression_get = function(self)
local v = eolian.eolian_expression_unary_expression_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
value_get = function(self)
local v = eolian.eolian_expression_value_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.cast("Eolian_Value*", v)
end
}
__index = wrap_object {
documentation_get = function(self)
local v = eolian.eolian_constant_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
type_get = function(self)
local v = eolian.eolian_constant_type_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
value_get = function(self)
local v = eolian.eolian_constant_value_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
__index = wrap_object {
documentation_get = function(self)
local v = eolian.eolian_error_documentation_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return v
end,
message_get = function(self)
local v = eolian.eolian_error_message_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
__index = wrap_object {
summary_get = function(self)
local v = eolian.eolian_documentation_summary_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
description_get = function(self)
local v = eolian.eolian_documentation_description_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end,
since_get = function(self)
local v = eolian.eolian_documentation_since_get(self)
- if v == nil then return nil end
+ if v == ffi.nullptr then return nil end
return ffi.string(v)
end
}
M.documentation_tokenize = function(doc, ret)
local ret = eolian.eolian_documentation_tokenize(doc, ret)
- if ret == nil then
+ if ret == ffi.nullptr then
return nil
end
return ffi.string(ret)
text_get = function(self)
local str = eolian.eolian_doc_token_text_get(self)
- if str == nil then
+ if str == ffi.nullptr then
return nil
end
local ret = ffi.string(str)