sweet-moon 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rspec +1 -0
- data/.rubocop.yml +40 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +61 -0
- data/README.md +1149 -0
- data/components/api.rb +83 -0
- data/components/injections/injections_503.rb +21 -0
- data/components/injections/injections_514.rb +29 -0
- data/components/injections/injections_542.rb +49 -0
- data/components/injections.rb +11 -0
- data/components/interpreters/50/function.rb +52 -0
- data/components/interpreters/50/interpreter.rb +105 -0
- data/components/interpreters/50/reader.rb +65 -0
- data/components/interpreters/50/table.rb +99 -0
- data/components/interpreters/50/writer.rb +45 -0
- data/components/interpreters/51/function.rb +52 -0
- data/components/interpreters/51/interpreter.rb +104 -0
- data/components/interpreters/51/reader.rb +65 -0
- data/components/interpreters/51/table.rb +60 -0
- data/components/interpreters/51/writer.rb +45 -0
- data/components/interpreters/54/function.rb +52 -0
- data/components/interpreters/54/interpreter.rb +100 -0
- data/components/interpreters/54/reader.rb +65 -0
- data/components/interpreters/54/table.rb +60 -0
- data/components/interpreters/54/writer.rb +45 -0
- data/components/interpreters.rb +11 -0
- data/components/io.rb +11 -0
- data/config/tests.sample.yml +15 -0
- data/controllers/api.rb +143 -0
- data/controllers/cli/cli.rb +32 -0
- data/controllers/cli/help.rb +24 -0
- data/controllers/cli/signatures.rb +179 -0
- data/controllers/cli/version.rb +14 -0
- data/controllers/interpreter.rb +68 -0
- data/controllers/state.rb +74 -0
- data/dsl/api.rb +31 -0
- data/dsl/cache.rb +118 -0
- data/dsl/concerns/fennel.rb +13 -0
- data/dsl/concerns/packages.rb +37 -0
- data/dsl/errors.rb +28 -0
- data/dsl/fennel.rb +47 -0
- data/dsl/global.rb +42 -0
- data/dsl/state.rb +104 -0
- data/dsl/sweet_moon.rb +53 -0
- data/logic/api.rb +17 -0
- data/logic/interpreter.rb +84 -0
- data/logic/interpreters/interpreter_50.rb +34 -0
- data/logic/interpreters/interpreter_51.rb +37 -0
- data/logic/interpreters/interpreter_54.rb +41 -0
- data/logic/io.rb +6 -0
- data/logic/options.rb +14 -0
- data/logic/shared_object.rb +52 -0
- data/logic/signature.rb +258 -0
- data/logic/signatures/ffi_types.rb +27 -0
- data/logic/signatures/signatures_322.rb +418 -0
- data/logic/signatures/signatures_401.rb +243 -0
- data/logic/signatures/signatures_503.rb +575 -0
- data/logic/signatures/signatures_514.rb +460 -0
- data/logic/signatures/signatures_542.rb +591 -0
- data/logic/spec.rb +13 -0
- data/logic/tables.rb +32 -0
- data/ports/in/dsl/sweet-moon/errors.rb +3 -0
- data/ports/in/dsl/sweet-moon.rb +1 -0
- data/ports/in/shell/sweet-moon +5 -0
- data/ports/in/shell.rb +21 -0
- data/ports/out/shell.rb +9 -0
- data/sweet-moon.gemspec +35 -0
- metadata +137 -0
@@ -0,0 +1,575 @@
|
|
1
|
+
module Logic
|
2
|
+
module V503
|
3
|
+
Signatures = {
|
4
|
+
functions: [{ source: 'Closure *luaF_newCclosure (lua_State *L, int nelems);',
|
5
|
+
ffi: [:luaF_newCclosure, %i[pointer int], :pointer] },
|
6
|
+
{ source: 'Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *e);',
|
7
|
+
ffi: [:luaF_newLclosure, %i[pointer int pointer], :pointer] },
|
8
|
+
{ source: 'LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B);',
|
9
|
+
ffi: [:luaL_prepbuffer, [:pointer], :pointer] },
|
10
|
+
{ source: 'LUALIB_API const char *luaL_checklstring (lua_State *L, int numArg, size_t *l);',
|
11
|
+
ffi: [:luaL_checklstring, %i[pointer int pointer], :pointer] },
|
12
|
+
{ source: 'LUALIB_API const char *luaL_optlstring (lua_State *L, int numArg, const char *def, size_t *l);',
|
13
|
+
ffi: [:luaL_optlstring, %i[pointer int pointer pointer], :pointer] },
|
14
|
+
{ source: 'LUALIB_API int luaL_argerror (lua_State *L, int numarg, const char *extramsg);',
|
15
|
+
ffi: [:luaL_argerror, %i[pointer int pointer], :int] },
|
16
|
+
{ source: 'LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *e);',
|
17
|
+
ffi: [:luaL_callmeta, %i[pointer int pointer], :int] },
|
18
|
+
{ source: 'LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...);',
|
19
|
+
ffi: [:luaL_error, %i[pointer pointer varargs], :int] },
|
20
|
+
{ source: 'LUALIB_API int luaL_findstring (const char *st, const char *const lst[]);',
|
21
|
+
ffi: [:luaL_findstring, %i[pointer pointer], :int] },
|
22
|
+
{ source: 'LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *e);',
|
23
|
+
ffi: [:luaL_getmetafield, %i[pointer int pointer], :int] },
|
24
|
+
{ source: 'LUALIB_API int luaL_getn (lua_State *L, int t);',
|
25
|
+
ffi: [:luaL_getn, %i[pointer int], :int] },
|
26
|
+
{ source: 'LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t sz, const char *name);',
|
27
|
+
ffi: [:luaL_loadbuffer, %i[pointer pointer ulong pointer], :int] },
|
28
|
+
{ source: 'LUALIB_API int luaL_loadfile (lua_State *L, const char *filename);',
|
29
|
+
ffi: [:luaL_loadfile, %i[pointer pointer], :int] },
|
30
|
+
{ source: 'LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname);',
|
31
|
+
ffi: [:luaL_newmetatable, %i[pointer pointer], :int] },
|
32
|
+
{ source: 'LUALIB_API int luaL_ref (lua_State *L, int t);',
|
33
|
+
ffi: [:luaL_ref, %i[pointer int], :int] },
|
34
|
+
{ source: 'LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname);',
|
35
|
+
ffi: [:luaL_typerror, %i[pointer int pointer], :int] },
|
36
|
+
{ source: 'LUALIB_API int lua_dobuffer (lua_State *L, const char *buff, size_t sz, const char *n);',
|
37
|
+
ffi: [:lua_dobuffer, %i[pointer pointer ulong pointer], :int] },
|
38
|
+
{ source: 'LUALIB_API int lua_dofile (lua_State *L, const char *filename);',
|
39
|
+
ffi: [:lua_dofile, %i[pointer pointer], :int] },
|
40
|
+
{ source: 'LUALIB_API int lua_dostring (lua_State *L, const char *str);',
|
41
|
+
ffi: [:lua_dostring, %i[pointer pointer], :int] },
|
42
|
+
{ source: 'LUALIB_API int luaopen_base (lua_State *L);',
|
43
|
+
ffi: [:luaopen_base, [:pointer], :int] },
|
44
|
+
{ source: 'LUALIB_API int luaopen_debug (lua_State *L);',
|
45
|
+
ffi: [:luaopen_debug, [:pointer], :int] },
|
46
|
+
{ source: 'LUALIB_API int luaopen_io (lua_State *L);',
|
47
|
+
ffi: [:luaopen_io, [:pointer], :int] },
|
48
|
+
{ source: 'LUALIB_API int luaopen_loadlib (lua_State *L);',
|
49
|
+
ffi: [:luaopen_loadlib, [:pointer], :int] },
|
50
|
+
{ source: 'LUALIB_API int luaopen_math (lua_State *L);',
|
51
|
+
ffi: [:luaopen_math, [:pointer], :int] },
|
52
|
+
{ source: 'LUALIB_API int luaopen_string (lua_State *L);',
|
53
|
+
ffi: [:luaopen_string, [:pointer], :int] },
|
54
|
+
{ source: 'LUALIB_API int luaopen_table (lua_State *L);',
|
55
|
+
ffi: [:luaopen_table, [:pointer], :int] },
|
56
|
+
{ source: 'LUALIB_API lua_Number luaL_checknumber (lua_State *L, int numArg);',
|
57
|
+
ffi: [:luaL_checknumber, %i[pointer int], :double] },
|
58
|
+
{ source: 'LUALIB_API lua_Number luaL_optnumber (lua_State *L, int nArg, lua_Number def);',
|
59
|
+
ffi: [:luaL_optnumber, %i[pointer int double], :double] },
|
60
|
+
{ source: 'LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname);',
|
61
|
+
ffi: [:luaL_checkudata, %i[pointer int pointer], :pointer] },
|
62
|
+
{ source: 'LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);',
|
63
|
+
ffi: [:luaL_addlstring, %i[pointer pointer ulong], :void] },
|
64
|
+
{ source: 'LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s);',
|
65
|
+
ffi: [:luaL_addstring, %i[pointer pointer], :void] },
|
66
|
+
{ source: 'LUALIB_API void luaL_addvalue (luaL_Buffer *B);',
|
67
|
+
ffi: [:luaL_addvalue, [:pointer], :void] },
|
68
|
+
{ source: 'LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B);',
|
69
|
+
ffi: [:luaL_buffinit, %i[pointer pointer], :void] },
|
70
|
+
{ source: 'LUALIB_API void luaL_checkany (lua_State *L, int narg);',
|
71
|
+
ffi: [:luaL_checkany, %i[pointer int], :void] },
|
72
|
+
{ source: 'LUALIB_API void luaL_checkstack (lua_State *L, int sz, const char *msg);',
|
73
|
+
ffi: [:luaL_checkstack, %i[pointer int pointer], :void] },
|
74
|
+
{ source: 'LUALIB_API void luaL_checktype (lua_State *L, int narg, int t);',
|
75
|
+
ffi: [:luaL_checktype, %i[pointer int int], :void] },
|
76
|
+
{ source: 'LUALIB_API void luaL_getmetatable (lua_State *L, const char *tname);',
|
77
|
+
ffi: [:luaL_getmetatable, %i[pointer pointer], :void] },
|
78
|
+
{ source: 'LUALIB_API void luaL_openlib (lua_State *L, const char *libname, const luaL_reg *l, int nup);',
|
79
|
+
ffi: [:luaL_openlib, %i[pointer pointer pointer int], :void] },
|
80
|
+
{ source: 'LUALIB_API void luaL_pushresult (luaL_Buffer *B);',
|
81
|
+
ffi: [:luaL_pushresult, [:pointer], :void] },
|
82
|
+
{ source: 'LUALIB_API void luaL_setn (lua_State *L, int t, int n);',
|
83
|
+
ffi: [:luaL_setn, %i[pointer int int], :void] },
|
84
|
+
{ source: 'LUALIB_API void luaL_unref (lua_State *L, int t, int ref);',
|
85
|
+
ffi: [:luaL_unref, %i[pointer int int], :void] },
|
86
|
+
{ source: 'LUALIB_API void luaL_where (lua_State *L, int lvl);',
|
87
|
+
ffi: [:luaL_where, %i[pointer int], :void] },
|
88
|
+
{ source: 'LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n);',
|
89
|
+
ffi: [:lua_getlocal, %i[pointer pointer int], :pointer] },
|
90
|
+
{ source: 'LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n);',
|
91
|
+
ffi: [:lua_getupvalue, %i[pointer int int], :pointer] },
|
92
|
+
{ source: 'LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...);',
|
93
|
+
ffi: [:lua_pushfstring, %i[pointer pointer varargs], :pointer] },
|
94
|
+
{ source: 'LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, va_list argp);',
|
95
|
+
ffi: [:lua_pushvfstring, %i[pointer pointer varargs], :pointer] },
|
96
|
+
{ source: 'LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n);',
|
97
|
+
ffi: [:lua_setlocal, %i[pointer pointer int], :pointer] },
|
98
|
+
{ source: 'LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n);',
|
99
|
+
ffi: [:lua_setupvalue, %i[pointer int int], :pointer] },
|
100
|
+
{ source: 'LUA_API const char *lua_tostring (lua_State *L, int idx);',
|
101
|
+
ffi: [:lua_tostring, %i[pointer int], :pointer] },
|
102
|
+
{ source: 'LUA_API const char *lua_typename (lua_State *L, int tp);',
|
103
|
+
ffi: [:lua_typename, %i[pointer int], :pointer] },
|
104
|
+
{ source: 'LUA_API const char *lua_version (void);',
|
105
|
+
ffi: [:lua_version, [], :pointer] },
|
106
|
+
{ source: 'LUA_API const void *lua_topointer (lua_State *L, int idx);',
|
107
|
+
ffi: [:lua_topointer, %i[pointer int], :pointer] },
|
108
|
+
{ source: 'LUA_API int lua_checkstack (lua_State *L, int sz);',
|
109
|
+
ffi: [:lua_checkstack, %i[pointer int], :int] },
|
110
|
+
{ source: 'LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud);',
|
111
|
+
ffi: [:lua_cpcall, %i[pointer int pointer], :int] },
|
112
|
+
{ source: 'LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data);',
|
113
|
+
ffi: [:lua_dump, %i[pointer int pointer], :int] },
|
114
|
+
{ source: 'LUA_API int lua_equal (lua_State *L, int idx1, int idx2);',
|
115
|
+
ffi: [:lua_equal, %i[pointer int int], :int] },
|
116
|
+
{ source: 'LUA_API int lua_error (lua_State *L);',
|
117
|
+
ffi: [:lua_error, [:pointer], :int] },
|
118
|
+
{ source: 'LUA_API int lua_getgccount (lua_State *L);',
|
119
|
+
ffi: [:lua_getgccount, [:pointer], :int] },
|
120
|
+
{ source: 'LUA_API int lua_getgcthreshold (lua_State *L);',
|
121
|
+
ffi: [:lua_getgcthreshold, [:pointer], :int] },
|
122
|
+
{ source: 'LUA_API int lua_gethookcount (lua_State *L);',
|
123
|
+
ffi: [:lua_gethookcount, [:pointer], :int] },
|
124
|
+
{ source: 'LUA_API int lua_gethookmask (lua_State *L);',
|
125
|
+
ffi: [:lua_gethookmask, [:pointer], :int] },
|
126
|
+
{ source: 'LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);',
|
127
|
+
ffi: [:lua_getinfo, %i[pointer pointer pointer], :int] },
|
128
|
+
{ source: 'LUA_API int lua_getmetatable (lua_State *L, int objindex);',
|
129
|
+
ffi: [:lua_getmetatable, %i[pointer int], :int] },
|
130
|
+
{ source: 'LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar);',
|
131
|
+
ffi: [:lua_getstack, %i[pointer int pointer], :int] },
|
132
|
+
{ source: 'LUA_API int lua_gettop (lua_State *L);',
|
133
|
+
ffi: [:lua_gettop, [:pointer], :int] },
|
134
|
+
{ source: 'LUA_API int lua_iscfunction (lua_State *L, int idx);',
|
135
|
+
ffi: [:lua_iscfunction, %i[pointer int], :int] },
|
136
|
+
{ source: 'LUA_API int lua_isnumber (lua_State *L, int idx);',
|
137
|
+
ffi: [:lua_isnumber, %i[pointer int], :int] },
|
138
|
+
{ source: 'LUA_API int lua_isstring (lua_State *L, int idx);',
|
139
|
+
ffi: [:lua_isstring, %i[pointer int], :int] },
|
140
|
+
{ source: 'LUA_API int lua_isuserdata (lua_State *L, int idx);',
|
141
|
+
ffi: [:lua_isuserdata, %i[pointer int], :int] },
|
142
|
+
{ source: 'LUA_API int lua_lessthan (lua_State *L, int idx1, int idx2);',
|
143
|
+
ffi: [:lua_lessthan, %i[pointer int int], :int] },
|
144
|
+
{ source: 'LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *dt, const char *chunkname);',
|
145
|
+
ffi: [:lua_load, %i[pointer char pointer pointer], :int] },
|
146
|
+
{ source: 'LUA_API int lua_next (lua_State *L, int idx);',
|
147
|
+
ffi: [:lua_next, %i[pointer int], :int] },
|
148
|
+
{ source: 'LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc);',
|
149
|
+
ffi: [:lua_pcall, %i[pointer int int int], :int] },
|
150
|
+
{ source: 'LUA_API int lua_pushupvalues (lua_State *L);',
|
151
|
+
ffi: [:lua_pushupvalues, [:pointer], :int] },
|
152
|
+
{ source: 'LUA_API int lua_rawequal (lua_State *L, int idx1, int idx2);',
|
153
|
+
ffi: [:lua_rawequal, %i[pointer int int], :int] },
|
154
|
+
{ source: 'LUA_API int lua_resume (lua_State *L, int narg);',
|
155
|
+
ffi: [:lua_resume, %i[pointer int], :int] },
|
156
|
+
{ source: 'LUA_API int lua_setfenv (lua_State *L, int idx);',
|
157
|
+
ffi: [:lua_setfenv, %i[pointer int], :int] },
|
158
|
+
{ source: 'LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count);',
|
159
|
+
ffi: [:lua_sethook, %i[pointer void int int], :int] },
|
160
|
+
{ source: 'LUA_API int lua_setmetatable (lua_State *L, int objindex);',
|
161
|
+
ffi: [:lua_setmetatable, %i[pointer int], :int] },
|
162
|
+
{ source: 'LUA_API int lua_toboolean (lua_State *L, int idx);',
|
163
|
+
ffi: [:lua_toboolean, %i[pointer int], :int] },
|
164
|
+
{ source: 'LUA_API int lua_type (lua_State *L, int idx);',
|
165
|
+
ffi: [:lua_type, %i[pointer int], :int] },
|
166
|
+
{ source: 'LUA_API int lua_yield (lua_State *L, int nresults);',
|
167
|
+
ffi: [:lua_yield, %i[pointer int], :int] },
|
168
|
+
{ source: 'LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf);',
|
169
|
+
ffi: [:lua_atpanic, %i[pointer int], :int] },
|
170
|
+
{ source: 'LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx);',
|
171
|
+
ffi: [:lua_tocfunction, %i[pointer int], :int] },
|
172
|
+
{ source: 'LUA_API lua_Hook lua_gethook (lua_State *L);',
|
173
|
+
ffi: [:lua_gethook, [:pointer], :void] },
|
174
|
+
{ source: 'LUA_API lua_Number lua_tonumber (lua_State *L, int idx);',
|
175
|
+
ffi: [:lua_tonumber, %i[pointer int], :double] },
|
176
|
+
{ source: 'LUA_API lua_State *lua_newthread (lua_State *L);',
|
177
|
+
ffi: [:lua_newthread, [:pointer], :pointer] },
|
178
|
+
{ source: 'LUA_API lua_State *lua_open (void);',
|
179
|
+
ffi: [:lua_open, [], :pointer] },
|
180
|
+
{ source: 'LUA_API lua_State *lua_tothread (lua_State *L, int idx);',
|
181
|
+
ffi: [:lua_tothread, %i[pointer int], :pointer] },
|
182
|
+
{ source: 'LUA_API size_t lua_strlen (lua_State *L, int idx);',
|
183
|
+
ffi: [:lua_strlen, %i[pointer int], :ulong] },
|
184
|
+
{ source: 'LUA_API void *lua_newuserdata (lua_State *L, size_t sz);',
|
185
|
+
ffi: [:lua_newuserdata, %i[pointer ulong], :pointer] },
|
186
|
+
{ source: 'LUA_API void *lua_touserdata (lua_State *L, int idx);',
|
187
|
+
ffi: [:lua_touserdata, %i[pointer int], :pointer] },
|
188
|
+
{ source: 'LUA_API void lua_call (lua_State *L, int nargs, int nresults);',
|
189
|
+
ffi: [:lua_call, %i[pointer int int], :void] },
|
190
|
+
{ source: 'LUA_API void lua_close (lua_State *L);',
|
191
|
+
ffi: [:lua_close, [:pointer], :void] },
|
192
|
+
{ source: 'LUA_API void lua_concat (lua_State *L, int n);',
|
193
|
+
ffi: [:lua_concat, %i[pointer int], :void] },
|
194
|
+
{ source: 'LUA_API void lua_getfenv (lua_State *L, int idx);',
|
195
|
+
ffi: [:lua_getfenv, %i[pointer int], :void] },
|
196
|
+
{ source: 'LUA_API void lua_gettable (lua_State *L, int idx);',
|
197
|
+
ffi: [:lua_gettable, %i[pointer int], :void] },
|
198
|
+
{ source: 'LUA_API void lua_insert (lua_State *L, int idx);',
|
199
|
+
ffi: [:lua_insert, %i[pointer int], :void] },
|
200
|
+
{ source: 'LUA_API void lua_newtable (lua_State *L);',
|
201
|
+
ffi: [:lua_newtable, [:pointer], :void] },
|
202
|
+
{ source: 'LUA_API void lua_pushboolean (lua_State *L, int b);',
|
203
|
+
ffi: [:lua_pushboolean, %i[pointer int], :void] },
|
204
|
+
{ source: 'LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n);',
|
205
|
+
ffi: [:lua_pushcclosure, %i[pointer int int], :void] },
|
206
|
+
{ source: 'LUA_API void lua_pushlightuserdata (lua_State *L, void *p);',
|
207
|
+
ffi: [:lua_pushlightuserdata, %i[pointer pointer], :void] },
|
208
|
+
{ source: 'LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t l);',
|
209
|
+
ffi: [:lua_pushlstring, %i[pointer pointer ulong], :void] },
|
210
|
+
{ source: 'LUA_API void lua_pushnil (lua_State *L);',
|
211
|
+
ffi: [:lua_pushnil, [:pointer], :void] },
|
212
|
+
{ source: 'LUA_API void lua_pushnumber (lua_State *L, lua_Number n);',
|
213
|
+
ffi: [:lua_pushnumber, %i[pointer double], :void] },
|
214
|
+
{ source: 'LUA_API void lua_pushstring (lua_State *L, const char *s);',
|
215
|
+
ffi: [:lua_pushstring, %i[pointer pointer], :void] },
|
216
|
+
{ source: 'LUA_API void lua_pushvalue (lua_State *L, int idx);',
|
217
|
+
ffi: [:lua_pushvalue, %i[pointer int], :void] },
|
218
|
+
{ source: 'LUA_API void lua_rawget (lua_State *L, int idx);',
|
219
|
+
ffi: [:lua_rawget, %i[pointer int], :void] },
|
220
|
+
{ source: 'LUA_API void lua_rawgeti (lua_State *L, int idx, int n);',
|
221
|
+
ffi: [:lua_rawgeti, %i[pointer int int], :void] },
|
222
|
+
{ source: 'LUA_API void lua_rawset (lua_State *L, int idx);',
|
223
|
+
ffi: [:lua_rawset, %i[pointer int], :void] },
|
224
|
+
{ source: 'LUA_API void lua_rawseti (lua_State *L, int idx, int n);',
|
225
|
+
ffi: [:lua_rawseti, %i[pointer int int], :void] },
|
226
|
+
{ source: 'LUA_API void lua_remove (lua_State *L, int idx);',
|
227
|
+
ffi: [:lua_remove, %i[pointer int], :void] },
|
228
|
+
{ source: 'LUA_API void lua_replace (lua_State *L, int idx);',
|
229
|
+
ffi: [:lua_replace, %i[pointer int], :void] },
|
230
|
+
{ source: 'LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);',
|
231
|
+
ffi: [:lua_setgcthreshold, %i[pointer int], :void] },
|
232
|
+
{ source: 'LUA_API void lua_settable (lua_State *L, int idx);',
|
233
|
+
ffi: [:lua_settable, %i[pointer int], :void] },
|
234
|
+
{ source: 'LUA_API void lua_settop (lua_State *L, int idx);',
|
235
|
+
ffi: [:lua_settop, %i[pointer int], :void] },
|
236
|
+
{ source: 'LUA_API void lua_xmove (lua_State *from, lua_State *to, int n);',
|
237
|
+
ffi: [:lua_xmove, %i[pointer pointer int], :void] },
|
238
|
+
{ source: 'Node *luaH_mainposition (const Table *t, const TObject *key);',
|
239
|
+
ffi: [:luaH_mainposition, %i[pointer pointer], :pointer] },
|
240
|
+
{ source: 'Proto *luaF_newproto (lua_State *L);',
|
241
|
+
ffi: [:luaF_newproto, [:pointer], :pointer] },
|
242
|
+
{ source: 'Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff);',
|
243
|
+
ffi: [:luaY_parser, %i[pointer pointer pointer], :pointer] },
|
244
|
+
{ source: 'Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff);',
|
245
|
+
ffi: [:luaU_undump, %i[pointer pointer pointer], :pointer] },
|
246
|
+
{ source: 'StkId luaD_precall (lua_State *L, StkId func);',
|
247
|
+
ffi: [:luaD_precall, %i[pointer int], :int] },
|
248
|
+
{ source: 'StkId luaV_execute (lua_State *L);',
|
249
|
+
ffi: [:luaV_execute, [:pointer], :int] },
|
250
|
+
{ source: 'TObject *luaH_set (lua_State *L, Table *t, const TObject *key);',
|
251
|
+
ffi: [:luaH_set, %i[pointer pointer pointer], :pointer] },
|
252
|
+
{ source: 'TObject *luaH_setnum (lua_State *L, Table *t, int key);',
|
253
|
+
ffi: [:luaH_setnum, %i[pointer pointer int], :pointer] },
|
254
|
+
{ source: 'TString *luaS_newlstr (lua_State *L, const char *str, size_t l);',
|
255
|
+
ffi: [:luaS_newlstr, %i[pointer pointer ulong], :pointer] },
|
256
|
+
{ source: 'Table *luaH_new (lua_State *L, int narray, int lnhash);',
|
257
|
+
ffi: [:luaH_new, %i[pointer int int], :pointer] },
|
258
|
+
{ source: 'Udata *luaS_newudata (lua_State *L, size_t s);',
|
259
|
+
ffi: [:luaS_newudata, %i[pointer ulong], :pointer] },
|
260
|
+
{ source: 'UpVal *luaF_findupval (lua_State *L, StkId level);',
|
261
|
+
ffi: [:luaF_findupval, %i[pointer int], :pointer] },
|
262
|
+
{ source: 'char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);',
|
263
|
+
ffi: [:luaZ_openspace, %i[pointer pointer ulong], :pointer] },
|
264
|
+
{ source: 'const TObject *luaH_get (Table *t, const TObject *key);',
|
265
|
+
ffi: [:luaH_get, %i[pointer pointer], :pointer] },
|
266
|
+
{ source: 'const TObject *luaH_getnum (Table *t, int key);',
|
267
|
+
ffi: [:luaH_getnum, %i[pointer int], :pointer] },
|
268
|
+
{ source: 'const TObject *luaH_getstr (Table *t, TString *key);',
|
269
|
+
ffi: [:luaH_getstr, %i[pointer pointer], :pointer] },
|
270
|
+
{ source: 'const TObject *luaT_gettm (Table *events, TMS event, TString *ename);',
|
271
|
+
ffi: [:luaT_gettm, %i[pointer int pointer], :pointer] },
|
272
|
+
{ source: 'const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event);',
|
273
|
+
ffi: [:luaT_gettmbyobj, %i[pointer pointer int], :pointer] },
|
274
|
+
{ source: 'const TObject *luaV_gettable (lua_State *L, const TObject *t, TObject *key, int loop);',
|
275
|
+
ffi: [:luaV_gettable, %i[pointer pointer pointer int], :pointer] },
|
276
|
+
{ source: 'const TObject *luaV_tonumber (const TObject *obj, TObject *n);',
|
277
|
+
ffi: [:luaV_tonumber, %i[pointer pointer], :pointer] },
|
278
|
+
{ source: 'const char *luaF_getlocalname (const Proto *func, int local_number, int pc);',
|
279
|
+
ffi: [:luaF_getlocalname, %i[pointer int int], :pointer] },
|
280
|
+
{ source: 'const char *luaO_pushfstring (lua_State *L, const char *fmt, ...);',
|
281
|
+
ffi: [:luaO_pushfstring, %i[pointer pointer varargs], :pointer] },
|
282
|
+
{ source: 'const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp);',
|
283
|
+
ffi: [:luaO_pushvfstring, %i[pointer pointer varargs], :pointer] },
|
284
|
+
{ source: 'const char *luaX_token2str (LexState *ls, int token);',
|
285
|
+
ffi: [:luaX_token2str, %i[pointer int], :pointer] },
|
286
|
+
{ source: 'int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef);',
|
287
|
+
ffi: [:luaD_pcall, %i[pointer void pointer int int], :int] },
|
288
|
+
{ source: 'int luaD_protectedparser (lua_State *L, ZIO *z, int bin);',
|
289
|
+
ffi: [:luaD_protectedparser, %i[pointer pointer int], :int] },
|
290
|
+
{ source: 'int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);',
|
291
|
+
ffi: [:luaD_rawrunprotected, %i[pointer void pointer], :int] },
|
292
|
+
{ source: 'int luaG_checkcode (const Proto *pt);',
|
293
|
+
ffi: [:luaG_checkcode, [:pointer], :int] },
|
294
|
+
{ source: 'int luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2);',
|
295
|
+
ffi: [:luaG_ordererror, %i[pointer pointer pointer], :int] },
|
296
|
+
{ source: 'int luaH_next (lua_State *L, Table *t, StkId key);',
|
297
|
+
ffi: [:luaH_next, %i[pointer pointer int], :int] },
|
298
|
+
{ source: 'int luaK_code (FuncState *fs, Instruction i, int line);',
|
299
|
+
ffi: [:luaK_code, %i[pointer long int], :int] },
|
300
|
+
{ source: 'int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C);',
|
301
|
+
ffi: [:luaK_codeABC, %i[pointer int int int int], :int] },
|
302
|
+
{ source: 'int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx);',
|
303
|
+
ffi: [:luaK_codeABx, %i[pointer int int int], :int] },
|
304
|
+
{ source: 'int luaK_exp2RK (FuncState *fs, expdesc *e);',
|
305
|
+
ffi: [:luaK_exp2RK, %i[pointer pointer], :int] },
|
306
|
+
{ source: 'int luaK_exp2anyreg (FuncState *fs, expdesc *e);',
|
307
|
+
ffi: [:luaK_exp2anyreg, %i[pointer pointer], :int] },
|
308
|
+
{ source: 'int luaK_getlabel (FuncState *fs);',
|
309
|
+
ffi: [:luaK_getlabel, [:pointer], :int] },
|
310
|
+
{ source: 'int luaK_jump (FuncState *fs);',
|
311
|
+
ffi: [:luaK_jump, [:pointer], :int] },
|
312
|
+
{ source: 'int luaK_numberK (FuncState *fs, lua_Number r);',
|
313
|
+
ffi: [:luaK_numberK, %i[pointer double], :int] },
|
314
|
+
{ source: 'int luaK_stringK (FuncState *fs, TString *s);',
|
315
|
+
ffi: [:luaK_stringK, %i[pointer pointer], :int] },
|
316
|
+
{ source: 'int luaO_int2fb (unsigned int x);',
|
317
|
+
ffi: [:luaO_int2fb, [:int], :int] },
|
318
|
+
{ source: 'int luaO_log2 (unsigned int x);',
|
319
|
+
ffi: [:luaO_log2, [:int], :int] },
|
320
|
+
{ source: 'int luaO_rawequalObj (const TObject *t1, const TObject *t2);',
|
321
|
+
ffi: [:luaO_rawequalObj, %i[pointer pointer], :int] },
|
322
|
+
{ source: 'int luaO_str2d (const char *s, lua_Number *result);',
|
323
|
+
ffi: [:luaO_str2d, %i[pointer pointer], :int] },
|
324
|
+
{ source: 'int luaU_endianness (void);',
|
325
|
+
ffi: [:luaU_endianness, [], :int] },
|
326
|
+
{ source: 'int luaV_equalval (lua_State *L, const TObject *t1, const TObject *t2);',
|
327
|
+
ffi: [:luaV_equalval, %i[pointer pointer pointer], :int] },
|
328
|
+
{ source: 'int luaV_lessthan (lua_State *L, const TObject *l, const TObject *r);',
|
329
|
+
ffi: [:luaV_lessthan, %i[pointer pointer pointer], :int] },
|
330
|
+
{ source: 'int luaV_tostring (lua_State *L, StkId obj);',
|
331
|
+
ffi: [:luaV_tostring, %i[pointer int], :int] },
|
332
|
+
{ source: 'int luaX_lex (LexState *LS, SemInfo *seminfo);',
|
333
|
+
ffi: [:luaX_lex, %i[pointer pointer], :int] },
|
334
|
+
{ source: 'int luaZ_fill (ZIO *z);', ffi: [:luaZ_fill, [:pointer], :int] },
|
335
|
+
{ source: 'int luaZ_lookahead (ZIO *z);',
|
336
|
+
ffi: [:luaZ_lookahead, [:pointer], :int] },
|
337
|
+
{ source: 'lua_State *luaE_newthread (lua_State *L);',
|
338
|
+
ffi: [:luaE_newthread, [:pointer], :pointer] },
|
339
|
+
{ source: 'size_t luaC_separateudata (lua_State *L);',
|
340
|
+
ffi: [:luaC_separateudata, [:pointer], :ulong] },
|
341
|
+
{ source: 'size_t luaZ_read (ZIO* z, void* b, size_t n);',
|
342
|
+
ffi: [:luaZ_read, %i[pointer pointer ulong], :ulong] },
|
343
|
+
{ source: 'void *luaM_growaux (lua_State *L, void *block, int *size, int size_elem, int limit, const char *errormsg);',
|
344
|
+
ffi: [:luaM_growaux,
|
345
|
+
%i[pointer pointer pointer int int pointer],
|
346
|
+
:pointer] },
|
347
|
+
{ source: 'void *luaM_realloc (lua_State *L, void *oldblock, lu_mem oldsize, lu_mem size);',
|
348
|
+
ffi: [:luaM_realloc, %i[pointer pointer long long], :pointer] },
|
349
|
+
{ source: 'void luaA_pushobject (lua_State *L, const TObject *o);',
|
350
|
+
ffi: [:luaA_pushobject, %i[pointer pointer], :void] },
|
351
|
+
{ source: 'void luaC_callGCTM (lua_State *L);',
|
352
|
+
ffi: [:luaC_callGCTM, [:pointer], :void] },
|
353
|
+
{ source: 'void luaC_collectgarbage (lua_State *L);',
|
354
|
+
ffi: [:luaC_collectgarbage, [:pointer], :void] },
|
355
|
+
{ source: 'void luaC_link (lua_State *L, GCObject *o, lu_byte tt);',
|
356
|
+
ffi: [:luaC_link, %i[pointer pointer char], :void] },
|
357
|
+
{ source: 'void luaC_sweep (lua_State *L, int all);',
|
358
|
+
ffi: [:luaC_sweep, %i[pointer int], :void] },
|
359
|
+
{ source: 'void luaD_call (lua_State *L, StkId func, int nResults);',
|
360
|
+
ffi: [:luaD_call, %i[pointer int int], :void] },
|
361
|
+
{ source: 'void luaD_callhook (lua_State *L, int event, int line);',
|
362
|
+
ffi: [:luaD_callhook, %i[pointer int int], :void] },
|
363
|
+
{ source: 'void luaD_growstack (lua_State *L, int n);',
|
364
|
+
ffi: [:luaD_growstack, %i[pointer int], :void] },
|
365
|
+
{ source: 'void luaD_poscall (lua_State *L, int wanted, StkId firstResult);',
|
366
|
+
ffi: [:luaD_poscall, %i[pointer int int], :void] },
|
367
|
+
{ source: 'void luaD_reallocCI (lua_State *L, int newsize);',
|
368
|
+
ffi: [:luaD_reallocCI, %i[pointer int], :void] },
|
369
|
+
{ source: 'void luaD_reallocstack (lua_State *L, int newsize);',
|
370
|
+
ffi: [:luaD_reallocstack, %i[pointer int], :void] },
|
371
|
+
{ source: 'void luaD_throw (lua_State *L, int errcode);',
|
372
|
+
ffi: [:luaD_throw, %i[pointer int], :void] },
|
373
|
+
{ source: 'void luaE_freethread (lua_State *L, lua_State *L1);',
|
374
|
+
ffi: [:luaE_freethread, %i[pointer pointer], :void] },
|
375
|
+
{ source: 'void luaF_close (lua_State *L, StkId level);',
|
376
|
+
ffi: [:luaF_close, %i[pointer int], :void] },
|
377
|
+
{ source: 'void luaF_freeclosure (lua_State *L, Closure *c);',
|
378
|
+
ffi: [:luaF_freeclosure, %i[pointer pointer], :void] },
|
379
|
+
{ source: 'void luaF_freeproto (lua_State *L, Proto *f);',
|
380
|
+
ffi: [:luaF_freeproto, %i[pointer pointer], :void] },
|
381
|
+
{ source: 'void luaG_aritherror (lua_State *L, const TObject *p1, const TObject *p2);',
|
382
|
+
ffi: [:luaG_aritherror, %i[pointer pointer pointer], :void] },
|
383
|
+
{ source: 'void luaG_concaterror (lua_State *L, StkId p1, StkId p2);',
|
384
|
+
ffi: [:luaG_concaterror, %i[pointer int int], :void] },
|
385
|
+
{ source: 'void luaG_errormsg (lua_State *L);',
|
386
|
+
ffi: [:luaG_errormsg, [:pointer], :void] },
|
387
|
+
{ source: 'void luaG_inithooks (lua_State *L);',
|
388
|
+
ffi: [:luaG_inithooks, [:pointer], :void] },
|
389
|
+
{ source: 'void luaG_runerror (lua_State *L, const char *fmt, ...);',
|
390
|
+
ffi: [:luaG_runerror, %i[pointer pointer varargs], :void] },
|
391
|
+
{ source: 'void luaG_typeerror (lua_State *L, const TObject *o, const char *opname);',
|
392
|
+
ffi: [:luaG_typeerror, %i[pointer pointer pointer], :void] },
|
393
|
+
{ source: 'void luaH_free (lua_State *L, Table *t);',
|
394
|
+
ffi: [:luaH_free, %i[pointer pointer], :void] },
|
395
|
+
{ source: 'void luaK_checkstack (FuncState *fs, int n);',
|
396
|
+
ffi: [:luaK_checkstack, %i[pointer int], :void] },
|
397
|
+
{ source: 'void luaK_concat (FuncState *fs, int *l1, int l2);',
|
398
|
+
ffi: [:luaK_concat, %i[pointer pointer int], :void] },
|
399
|
+
{ source: 'void luaK_dischargevars (FuncState *fs, expdesc *e);',
|
400
|
+
ffi: [:luaK_dischargevars, %i[pointer pointer], :void] },
|
401
|
+
{ source: 'void luaK_exp2nextreg (FuncState *fs, expdesc *e);',
|
402
|
+
ffi: [:luaK_exp2nextreg, %i[pointer pointer], :void] },
|
403
|
+
{ source: 'void luaK_exp2val (FuncState *fs, expdesc *e);',
|
404
|
+
ffi: [:luaK_exp2val, %i[pointer pointer], :void] },
|
405
|
+
{ source: 'void luaK_fixline (FuncState *fs, int line);',
|
406
|
+
ffi: [:luaK_fixline, %i[pointer int], :void] },
|
407
|
+
{ source: 'void luaK_goiffalse (FuncState *fs, expdesc *e);',
|
408
|
+
ffi: [:luaK_goiffalse, %i[pointer pointer], :void] },
|
409
|
+
{ source: 'void luaK_goiftrue (FuncState *fs, expdesc *e);',
|
410
|
+
ffi: [:luaK_goiftrue, %i[pointer pointer], :void] },
|
411
|
+
{ source: 'void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);',
|
412
|
+
ffi: [:luaK_indexed, %i[pointer pointer pointer], :void] },
|
413
|
+
{ source: 'void luaK_infix (FuncState *fs, BinOpr op, expdesc *v);',
|
414
|
+
ffi: [:luaK_infix, %i[pointer int pointer], :void] },
|
415
|
+
{ source: 'void luaK_nil (FuncState *fs, int from, int n);',
|
416
|
+
ffi: [:luaK_nil, %i[pointer int int], :void] },
|
417
|
+
{ source: 'void luaK_patchlist (FuncState *fs, int list, int target);',
|
418
|
+
ffi: [:luaK_patchlist, %i[pointer int int], :void] },
|
419
|
+
{ source: 'void luaK_patchtohere (FuncState *fs, int list);',
|
420
|
+
ffi: [:luaK_patchtohere, %i[pointer int], :void] },
|
421
|
+
{ source: 'void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2);',
|
422
|
+
ffi: [:luaK_posfix, %i[pointer int pointer pointer], :void] },
|
423
|
+
{ source: 'void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v);',
|
424
|
+
ffi: [:luaK_prefix, %i[pointer int pointer], :void] },
|
425
|
+
{ source: 'void luaK_reserveregs (FuncState *fs, int n);',
|
426
|
+
ffi: [:luaK_reserveregs, %i[pointer int], :void] },
|
427
|
+
{ source: 'void luaK_self (FuncState *fs, expdesc *e, expdesc *key);',
|
428
|
+
ffi: [:luaK_self, %i[pointer pointer pointer], :void] },
|
429
|
+
{ source: 'void luaK_setcallreturns (FuncState *fs, expdesc *var, int nresults);',
|
430
|
+
ffi: [:luaK_setcallreturns, %i[pointer pointer int], :void] },
|
431
|
+
{ source: 'void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);',
|
432
|
+
ffi: [:luaK_storevar, %i[pointer pointer pointer], :void] },
|
433
|
+
{ source: 'void luaO_chunkid (char *out, const char *source, int len);',
|
434
|
+
ffi: [:luaO_chunkid, %i[pointer pointer int], :void] },
|
435
|
+
{ source: 'void luaS_freeall (lua_State *L);',
|
436
|
+
ffi: [:luaS_freeall, [:pointer], :void] },
|
437
|
+
{ source: 'void luaS_resize (lua_State *L, int newsize);',
|
438
|
+
ffi: [:luaS_resize, %i[pointer int], :void] },
|
439
|
+
{ source: 'void luaT_init (lua_State *L);',
|
440
|
+
ffi: [:luaT_init, [:pointer], :void] },
|
441
|
+
{ source: 'void luaU_dump (lua_State* L, const Proto* Main, lua_Chunkwriter w, void* data);',
|
442
|
+
ffi: [:luaU_dump, %i[pointer pointer int pointer], :void] },
|
443
|
+
{ source: 'void luaV_concat (lua_State *L, int total, int last);',
|
444
|
+
ffi: [:luaV_concat, %i[pointer int int], :void] },
|
445
|
+
{ source: 'void luaV_settable (lua_State *L, const TObject *t, TObject *key, StkId val);',
|
446
|
+
ffi: [:luaV_settable, %i[pointer pointer pointer int], :void] },
|
447
|
+
{ source: 'void luaX_checklimit (LexState *ls, int val, int limit, const char *msg);',
|
448
|
+
ffi: [:luaX_checklimit, %i[pointer int int pointer], :void] },
|
449
|
+
{ source: 'void luaX_errorline (LexState *ls, const char *s, const char *token, int line);',
|
450
|
+
ffi: [:luaX_errorline, %i[pointer pointer pointer int], :void] },
|
451
|
+
{ source: 'void luaX_init (lua_State *L);',
|
452
|
+
ffi: [:luaX_init, [:pointer], :void] },
|
453
|
+
{ source: 'void luaX_setinput (lua_State *L, LexState *LS, ZIO *z, TString *source);',
|
454
|
+
ffi: [:luaX_setinput, %i[pointer pointer pointer pointer], :void] },
|
455
|
+
{ source: 'void luaX_syntaxerror (LexState *ls, const char *s);',
|
456
|
+
ffi: [:luaX_syntaxerror, %i[pointer pointer], :void] },
|
457
|
+
{ source: 'void luaZ_init (ZIO *z, lua_Chunkreader reader, void *data, const char *name);',
|
458
|
+
ffi: [:luaZ_init, %i[pointer char pointer pointer], :void] }],
|
459
|
+
macros: [{ source: '#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx)',
|
460
|
+
name: 'luaK_codeAsBx',
|
461
|
+
input: %w[fs o A sBx] },
|
462
|
+
{ source: '#define luaL_addsize(B,n) ((B)->p += (n))',
|
463
|
+
name: 'luaL_addsize',
|
464
|
+
input: %w[B n] },
|
465
|
+
{ source: '#define luaL_checkint(L,n) ((int)luaL_checknumber(L, n))',
|
466
|
+
name: 'luaL_checkint',
|
467
|
+
input: %w[L n] },
|
468
|
+
{ source: '#define luaL_checklong(L,n) ((long)luaL_checknumber(L, n))',
|
469
|
+
name: 'luaL_checklong',
|
470
|
+
input: %w[L n] },
|
471
|
+
{ source: '#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL))',
|
472
|
+
name: 'luaL_checkstring',
|
473
|
+
input: %w[L n] },
|
474
|
+
{ source: '#define luaL_optint(L,n,d) ((int)luaL_optnumber(L, n,(lua_Number)(d)))',
|
475
|
+
name: 'luaL_optint',
|
476
|
+
input: %w[L n d] },
|
477
|
+
{ source: '#define luaL_optlong(L,n,d) ((long)luaL_optnumber(L, n,(lua_Number)(d)))',
|
478
|
+
name: 'luaL_optlong',
|
479
|
+
input: %w[L n d] },
|
480
|
+
{ source: '#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL))',
|
481
|
+
name: 'luaL_optstring',
|
482
|
+
input: %w[L n d] },
|
483
|
+
{ source: '#define luaM_free(L, b, s) luaM_realloc(L, (b), (s), 0)',
|
484
|
+
name: 'luaM_free',
|
485
|
+
input: %w[L b s] },
|
486
|
+
{ source: '#define luaM_freearray(L, b, n, t) luaM_realloc(L, (b), \\ cast(lu_mem, n)*cast(lu_mem, sizeof(t)), 0)',
|
487
|
+
name: 'luaM_freearray',
|
488
|
+
input: %w[L b n t] },
|
489
|
+
{ source: '#define luaM_freelem(L, b) luaM_realloc(L, (b), sizeof(*(b)), 0)',
|
490
|
+
name: 'luaM_freelem',
|
491
|
+
input: %w[L b] },
|
492
|
+
{ source: '#define luaM_malloc(L, t) luaM_realloc(L, NULL, 0, (t))',
|
493
|
+
name: 'luaM_malloc',
|
494
|
+
input: %w[L t] },
|
495
|
+
{ source: '#define luaM_new(L, t) cast(t *, luaM_malloc(L, sizeof(t)))',
|
496
|
+
name: 'luaM_new',
|
497
|
+
input: %w[L t] },
|
498
|
+
{ source: '#define luaM_newvector(L, n,t) cast(t *, luaM_malloc(L, \\ cast(lu_mem, n)*cast(lu_mem, sizeof(t))))',
|
499
|
+
name: 'luaM_newvector',
|
500
|
+
input: %w[L n t] },
|
501
|
+
{ source: '#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s)))',
|
502
|
+
name: 'luaS_new',
|
503
|
+
input: %w[L s] },
|
504
|
+
{ source: '#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \\ (sizeof(s)/sizeof(char))-1))',
|
505
|
+
name: 'luaS_newliteral',
|
506
|
+
input: %w[L s] },
|
507
|
+
{ source: '#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0)',
|
508
|
+
name: 'luaZ_freebuffer',
|
509
|
+
input: %w[L buff] },
|
510
|
+
{ source: '#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0)',
|
511
|
+
name: 'luaZ_initbuffer',
|
512
|
+
input: %w[L buff] },
|
513
|
+
{ source: '#define lua_assert(c) assert(c)',
|
514
|
+
name: 'lua_assert',
|
515
|
+
input: ['c'] },
|
516
|
+
{ source: '#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, ref)',
|
517
|
+
name: 'lua_getref',
|
518
|
+
input: %w[L ref] },
|
519
|
+
{ source: '#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)',
|
520
|
+
name: 'lua_getregistry',
|
521
|
+
input: ['L'] },
|
522
|
+
{ source: '#define lua_isboolean(L,n) (lua_type(L,n) == LUA_TBOOLEAN)',
|
523
|
+
name: 'lua_isboolean',
|
524
|
+
input: %w[L n] },
|
525
|
+
{ source: '#define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION)',
|
526
|
+
name: 'lua_isfunction',
|
527
|
+
input: %w[L n] },
|
528
|
+
{ source: '#define lua_islightuserdata(L,n) (lua_type(L,n) == LUA_TLIGHTUSERDATA)',
|
529
|
+
name: 'lua_islightuserdata',
|
530
|
+
input: %w[L n] },
|
531
|
+
{ source: '#define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL)',
|
532
|
+
name: 'lua_isnil',
|
533
|
+
input: %w[L n] },
|
534
|
+
{ source: '#define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE)',
|
535
|
+
name: 'lua_isnone',
|
536
|
+
input: %w[L n] },
|
537
|
+
{ source: '#define lua_isnoneornil(L, n) (lua_type(L,n) <= 0)',
|
538
|
+
name: 'lua_isnoneornil',
|
539
|
+
input: %w[L n] },
|
540
|
+
{ source: '#define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE)',
|
541
|
+
name: 'lua_istable',
|
542
|
+
input: %w[L n] },
|
543
|
+
{ source: '#define lua_lock(l) lua_assert((*getlock(l))++ == 0)',
|
544
|
+
name: 'lua_lock',
|
545
|
+
input: ['l'] },
|
546
|
+
{ source: '#define lua_number2int(i,d) __asm__("fldl %1\\nfistpl %0":"=m"(i):"m"(d))',
|
547
|
+
name: 'lua_number2int',
|
548
|
+
input: %w[i d] },
|
549
|
+
{ source: '#define lua_pop(L,n) lua_settop(L, -(n)-1)',
|
550
|
+
name: 'lua_pop',
|
551
|
+
input: %w[L n] },
|
552
|
+
{ source: '#define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0)',
|
553
|
+
name: 'lua_pushcfunction',
|
554
|
+
input: %w[L f] },
|
555
|
+
{ source: '#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \\ (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0))',
|
556
|
+
name: 'lua_ref',
|
557
|
+
input: %w[L lock] },
|
558
|
+
{ source: '#define lua_str2number(s,p) strtol((s), (p), 10)',
|
559
|
+
name: 'lua_str2number',
|
560
|
+
input: %w[s p] },
|
561
|
+
{ source: '#define lua_unboxpointer(L,i) (*(void **)(lua_touserdata(L, i)))',
|
562
|
+
name: 'lua_unboxpointer',
|
563
|
+
input: %w[L i] },
|
564
|
+
{ source: '#define lua_unlock(l) lua_assert(--(*getlock(l)) == 0)',
|
565
|
+
name: 'lua_unlock',
|
566
|
+
input: ['l'] },
|
567
|
+
{ source: '#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))',
|
568
|
+
name: 'lua_unref',
|
569
|
+
input: %w[L ref] },
|
570
|
+
{ source: '#define lua_userstateopen(l) if (l != NULL) getlock(l) = &islocked;',
|
571
|
+
name: 'lua_userstateopen',
|
572
|
+
input: ['l'] }]
|
573
|
+
}
|
574
|
+
end
|
575
|
+
end
|