You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
714 B
Lua
24 lines
714 B
Lua
local base = string.match(..., "(.-)[^%.]+%.[^%.]+$")
|
|
local ffi = require("ffi")
|
|
local fh = require(base.."helper.ffi_struct")
|
|
|
|
local format = string.format
|
|
|
|
local mt, index = {}, {}
|
|
|
|
fh.gen_raw_accessor(index, "value")
|
|
fh.gen_raw_accessor(index, "minimum")
|
|
fh.gen_raw_accessor(index, "maximum")
|
|
fh.gen_raw_accessor(index, "fuzz")
|
|
fh.gen_raw_accessor(index, "flat")
|
|
fh.gen_raw_accessor(index, "resolution")
|
|
|
|
function index:tostring()
|
|
return format(
|
|
"absinfo{value=%d, minimum=%d, maximum=%d, fuzz=%d, flat=%d, resolution=%d}",
|
|
self.value, self.minimum, self.maximum, self.fuzz, self.flat, self.resolution)
|
|
end
|
|
mt.__tostring = index.tostring
|
|
|
|
return fh.base(mt, index, ffi.typeof("struct input_absinfo"))
|