changed the use of index argument for getting and pushing types
[lqt.git] / new / types.lua
blob82130e3c2d44e3a1f64900eee31267a137a1d71e
1 local base_types = (...)
3 local BaseType = function(s)
4 s = tostring(s)
5 return {
6 --label = "BaseType",
7 --xargs = { },
8 desc = s..';',
9 get = function(j)
10 return 'lua_to'..s..'(L, '..tostring(j)..');'
11 end,
12 push = function(j) -- must handle arguments (e.g. in virtual callbacks) and return values
13 return 'lua_push'..s..'(L, '..tostring(j)..');'
14 end,
15 test = function(j)
16 error'not implemented' -- TODO
17 return 'LqtTestBaseType_'..s..'(L, '..tostring(j)..')'
18 end,
19 num = 1,
21 end
23 base_types['char const*'] = BaseType'string'
24 base_types['int'] = BaseType'integer'
25 base_types['unsigned int'] = BaseType'integer'
26 base_types['short'] = BaseType'integer'
27 base_types['short int'] = BaseType'integer'
28 base_types['unsigned short'] = BaseType'integer'
29 base_types['unsigned short int'] = BaseType'integer'
30 base_types['short unsigned int'] = BaseType'integer'
31 base_types['long'] = BaseType'integer'
32 base_types['unsigned long'] = BaseType'integer'
33 base_types['long int'] = BaseType'integer'
34 base_types['unsigned long int'] = BaseType'integer'
35 base_types['long unsigned int'] = BaseType'integer'
36 base_types['long long'] = BaseType'integer'
37 base_types['unsigned long long'] = BaseType'integer'
38 base_types['long long int'] = BaseType'integer'
39 base_types['unsigned long long int'] = BaseType'integer'
40 base_types['float'] = BaseType'number'
41 base_types['double'] = BaseType'number'
42 base_types['bool'] = BaseType'boolean'