sweet-moon 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rspec +1 -0
  4. data/.rubocop.yml +40 -0
  5. data/Gemfile +12 -0
  6. data/Gemfile.lock +61 -0
  7. data/README.md +1149 -0
  8. data/components/api.rb +83 -0
  9. data/components/injections/injections_503.rb +21 -0
  10. data/components/injections/injections_514.rb +29 -0
  11. data/components/injections/injections_542.rb +49 -0
  12. data/components/injections.rb +11 -0
  13. data/components/interpreters/50/function.rb +52 -0
  14. data/components/interpreters/50/interpreter.rb +105 -0
  15. data/components/interpreters/50/reader.rb +65 -0
  16. data/components/interpreters/50/table.rb +99 -0
  17. data/components/interpreters/50/writer.rb +45 -0
  18. data/components/interpreters/51/function.rb +52 -0
  19. data/components/interpreters/51/interpreter.rb +104 -0
  20. data/components/interpreters/51/reader.rb +65 -0
  21. data/components/interpreters/51/table.rb +60 -0
  22. data/components/interpreters/51/writer.rb +45 -0
  23. data/components/interpreters/54/function.rb +52 -0
  24. data/components/interpreters/54/interpreter.rb +100 -0
  25. data/components/interpreters/54/reader.rb +65 -0
  26. data/components/interpreters/54/table.rb +60 -0
  27. data/components/interpreters/54/writer.rb +45 -0
  28. data/components/interpreters.rb +11 -0
  29. data/components/io.rb +11 -0
  30. data/config/tests.sample.yml +15 -0
  31. data/controllers/api.rb +143 -0
  32. data/controllers/cli/cli.rb +32 -0
  33. data/controllers/cli/help.rb +24 -0
  34. data/controllers/cli/signatures.rb +179 -0
  35. data/controllers/cli/version.rb +14 -0
  36. data/controllers/interpreter.rb +68 -0
  37. data/controllers/state.rb +74 -0
  38. data/dsl/api.rb +31 -0
  39. data/dsl/cache.rb +118 -0
  40. data/dsl/concerns/fennel.rb +13 -0
  41. data/dsl/concerns/packages.rb +37 -0
  42. data/dsl/errors.rb +28 -0
  43. data/dsl/fennel.rb +47 -0
  44. data/dsl/global.rb +42 -0
  45. data/dsl/state.rb +104 -0
  46. data/dsl/sweet_moon.rb +53 -0
  47. data/logic/api.rb +17 -0
  48. data/logic/interpreter.rb +84 -0
  49. data/logic/interpreters/interpreter_50.rb +34 -0
  50. data/logic/interpreters/interpreter_51.rb +37 -0
  51. data/logic/interpreters/interpreter_54.rb +41 -0
  52. data/logic/io.rb +6 -0
  53. data/logic/options.rb +14 -0
  54. data/logic/shared_object.rb +52 -0
  55. data/logic/signature.rb +258 -0
  56. data/logic/signatures/ffi_types.rb +27 -0
  57. data/logic/signatures/signatures_322.rb +418 -0
  58. data/logic/signatures/signatures_401.rb +243 -0
  59. data/logic/signatures/signatures_503.rb +575 -0
  60. data/logic/signatures/signatures_514.rb +460 -0
  61. data/logic/signatures/signatures_542.rb +591 -0
  62. data/logic/spec.rb +13 -0
  63. data/logic/tables.rb +32 -0
  64. data/ports/in/dsl/sweet-moon/errors.rb +3 -0
  65. data/ports/in/dsl/sweet-moon.rb +1 -0
  66. data/ports/in/shell/sweet-moon +5 -0
  67. data/ports/in/shell.rb +21 -0
  68. data/ports/out/shell.rb +9 -0
  69. data/sweet-moon.gemspec +35 -0
  70. metadata +137 -0
@@ -0,0 +1,418 @@
1
+ module Logic
2
+ module V322
3
+ Signatures = {
4
+ functions: [{ source: 'Closure *luaF_newclosure (int nelems);',
5
+ ffi: [:luaF_newclosure, [:int], :pointer] },
6
+ { source: 'Hash *luaH_new (int nhash);',
7
+ ffi: [:luaH_new, [:int], :pointer] },
8
+ { source: 'Node *luaH_present (Hash *t, TObject *key);',
9
+ ffi: [:luaH_present, %i[pointer pointer], :pointer] },
10
+ { source: 'StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base);',
11
+ ffi: [:luaV_execute, %i[pointer pointer int], :int] },
12
+ { source: 'TObject *luaA_Address (lua_Object o);',
13
+ ffi: [:luaA_Address, [:int], :pointer] },
14
+ { source: 'TObject *luaH_getint (Hash *t, int ref);',
15
+ ffi: [:luaH_getint, %i[pointer int], :pointer] },
16
+ { source: 'TObject *luaT_gettagmethod (int t, char *event);',
17
+ ffi: [:luaT_gettagmethod, %i[int pointer], :pointer] },
18
+ { source: 'TObject* luaC_getref (int ref);',
19
+ ffi: [:luaC_getref, [:int], :pointer] },
20
+ { source: 'TProtoFunc *luaF_newproto (void);',
21
+ ffi: [:luaF_newproto, [], :pointer] },
22
+ { source: 'TProtoFunc *luaY_parser (ZIO *z);',
23
+ ffi: [:luaY_parser, [:pointer], :pointer] },
24
+ { source: 'TProtoFunc* luaU_undump1 (ZIO* Z);',
25
+ ffi: [:luaU_undump1, [:pointer], :pointer] },
26
+ { source: 'TaggedString *luaA_nextvar (TaggedString *g);',
27
+ ffi: [:luaA_nextvar, [:pointer], :pointer] },
28
+ { source: 'TaggedString *luaS_collector (void);',
29
+ ffi: [:luaS_collector, [], :pointer] },
30
+ { source: 'TaggedString *luaS_collectudata (void);',
31
+ ffi: [:luaS_collectudata, [], :pointer] },
32
+ { source: 'TaggedString *luaS_createudata (void *udata, int tag);',
33
+ ffi: [:luaS_createudata, %i[pointer int], :pointer] },
34
+ { source: 'TaggedString *luaS_new (char *str);',
35
+ ffi: [:luaS_new, [:pointer], :pointer] },
36
+ { source: 'TaggedString *luaS_newfixedstring (char *str);',
37
+ ffi: [:luaS_newfixedstring, [:pointer], :pointer] },
38
+ { source: 'TaggedString *luaS_newlstr (char *str, long l);',
39
+ ffi: [:luaS_newlstr, %i[pointer long], :pointer] },
40
+ { source: 'char *luaF_getlocalname (TProtoFunc *func, int local_number, int line);',
41
+ ffi: [:luaF_getlocalname, %i[pointer int int], :pointer] },
42
+ { source: 'char *luaI_classend (char *p);',
43
+ ffi: [:luaI_classend, [:pointer], :pointer] },
44
+ { source: 'char *luaL_buffer (void);', ffi: [:luaL_buffer, [], :pointer] },
45
+ { source: 'char *luaL_check_lstr (int numArg, long *len);',
46
+ ffi: [:luaL_check_lstr, %i[int pointer], :pointer] },
47
+ { source: 'char *luaL_openspace (int size);',
48
+ ffi: [:luaL_openspace, [:int], :pointer] },
49
+ { source: 'char *luaL_opt_lstr (int numArg, char *def, long *len);',
50
+ ffi: [:luaL_opt_lstr, %i[int pointer pointer], :pointer] },
51
+ { source: 'char *lua_getobjname (lua_Object o, char **name);',
52
+ ffi: [:lua_getobjname, %i[int pointer], :pointer] },
53
+ { source: 'char *lua_getstring (lua_Object object);',
54
+ ffi: [:lua_getstring, [:int], :pointer] },
55
+ { source: 'char *lua_nextvar (char *varname);',
56
+ ffi: [:lua_nextvar, [:pointer], :pointer] },
57
+ { source: 'double luaL_check_number (int numArg);',
58
+ ffi: [:luaL_check_number, [:int], :double] },
59
+ { source: 'double luaL_opt_number (int numArg, double def);',
60
+ ffi: [:luaL_opt_number, %i[int double], :double] },
61
+ { source: 'double luaO_str2d (char *s);',
62
+ ffi: [:luaO_str2d, [:pointer], :double] },
63
+ { source: 'double luaU_str2d (char* b, char* where);',
64
+ ffi: [:luaU_str2d, %i[pointer pointer], :double] },
65
+ { source: 'double lua_getnumber (lua_Object object);',
66
+ ffi: [:lua_getnumber, [:int], :double] },
67
+ { source: 'int luaA_next (Hash *t, int i);',
68
+ ffi: [:luaA_next, %i[pointer int], :int] },
69
+ { source: 'int luaA_passresults (void);',
70
+ ffi: [:luaA_passresults, [], :int] },
71
+ { source: 'int luaC_ref (TObject *o, int lock);',
72
+ ffi: [:luaC_ref, %i[pointer int], :int] },
73
+ { source: 'int luaD_protectedrun (void);',
74
+ ffi: [:luaD_protectedrun, [], :int] },
75
+ { source: 'int luaH_pos (Hash *t, TObject *r);',
76
+ ffi: [:luaH_pos, %i[pointer pointer], :int] },
77
+ { source: 'int luaI_singlematch (int c, char *p, char *ep);',
78
+ ffi: [:luaI_singlematch, %i[int pointer pointer], :int] },
79
+ { source: 'int luaL_findstring (char *name, char *list[]);',
80
+ ffi: [:luaL_findstring, %i[pointer pointer], :int] },
81
+ { source: 'int luaL_getsize (void);', ffi: [:luaL_getsize, [], :int] },
82
+ { source: 'int luaL_newbuffer (int size);',
83
+ ffi: [:luaL_newbuffer, [:int], :int] },
84
+ { source: 'int luaO_equalval (TObject *t1, TObject *t2);',
85
+ ffi: [:luaO_equalval, %i[pointer pointer], :int] },
86
+ { source: 'int luaO_redimension (int oldsize);',
87
+ ffi: [:luaO_redimension, [:int], :int] },
88
+ { source: 'int luaS_globaldefined (char *name);',
89
+ ffi: [:luaS_globaldefined, [:pointer], :int] },
90
+ { source: 'int luaT_effectivetag (TObject *o);',
91
+ ffi: [:luaT_effectivetag, [:pointer], :int] },
92
+ { source: 'int luaV_tonumber (TObject *obj);',
93
+ ffi: [:luaV_tonumber, [:pointer], :int] },
94
+ { source: 'int luaV_tostring (TObject *obj);',
95
+ ffi: [:luaV_tostring, [:pointer], :int] },
96
+ { source: 'int luaX_lex (LexState *LS);',
97
+ ffi: [:luaX_lex, [:pointer], :int] },
98
+ { source: 'int lua_callfunction (lua_Object f);',
99
+ ffi: [:lua_callfunction, [:int], :int] },
100
+ { source: 'int lua_copytagmethods (int tagto, int tagfrom);',
101
+ ffi: [:lua_copytagmethods, %i[int int], :int] },
102
+ { source: 'int lua_currentline (lua_Function func);',
103
+ ffi: [:lua_currentline, [:int], :int] },
104
+ { source: 'int lua_dobuffer (char *buff, int size, char *name);',
105
+ ffi: [:lua_dobuffer, %i[pointer int pointer], :int] },
106
+ { source: 'int lua_dofile (char *filename);',
107
+ ffi: [:lua_dofile, [:pointer], :int] },
108
+ { source: 'int lua_dostring (char *string);',
109
+ ffi: [:lua_dostring, [:pointer], :int] },
110
+ { source: 'int lua_iscfunction (lua_Object object);',
111
+ ffi: [:lua_iscfunction, [:int], :int] },
112
+ { source: 'int lua_isfunction (lua_Object object);',
113
+ ffi: [:lua_isfunction, [:int], :int] },
114
+ { source: 'int lua_isnil (lua_Object object);',
115
+ ffi: [:lua_isnil, [:int], :int] },
116
+ { source: 'int lua_isnumber (lua_Object object);',
117
+ ffi: [:lua_isnumber, [:int], :int] },
118
+ { source: 'int lua_isstring (lua_Object object);',
119
+ ffi: [:lua_isstring, [:int], :int] },
120
+ { source: 'int lua_istable (lua_Object object);',
121
+ ffi: [:lua_istable, [:int], :int] },
122
+ { source: 'int lua_isuserdata (lua_Object object);',
123
+ ffi: [:lua_isuserdata, [:int], :int] },
124
+ { source: 'int lua_newtag (void);', ffi: [:lua_newtag, [], :int] },
125
+ { source: 'int lua_next (lua_Object o, int i);',
126
+ ffi: [:lua_next, %i[int int], :int] },
127
+ { source: 'int lua_nups (lua_Function func);',
128
+ ffi: [:lua_nups, [:int], :int] },
129
+ { source: 'int lua_ref (int lock);', ffi: [:lua_ref, [:int], :int] },
130
+ { source: 'int lua_setdebug (int debug);',
131
+ ffi: [:lua_setdebug, [:int], :int] },
132
+ { source: 'int lua_setlocal (lua_Function func, int local_number);',
133
+ ffi: [:lua_setlocal, %i[int int], :int] },
134
+ { source: 'int lua_tag (lua_Object object);',
135
+ ffi: [:lua_tag, [:int], :int] },
136
+ { source: 'long lua_collectgarbage (long limit);',
137
+ ffi: [:lua_collectgarbage, [:long], :long] },
138
+ { source: 'long lua_strlen (lua_Object object);',
139
+ ffi: [:lua_strlen, [:int], :long] },
140
+ { source: 'lua_CFunction lua_getcfunction (lua_Object object);',
141
+ ffi: [:lua_getcfunction, [:int], :void] },
142
+ { source: 'lua_CHFunction lua_setcallhook (lua_CHFunction func);',
143
+ ffi: [:lua_setcallhook, [], :void] },
144
+ { source: 'lua_Function lua_stackedfunction (int level);',
145
+ ffi: [:lua_stackedfunction, [:int], :int] },
146
+ { source: 'lua_LHFunction lua_setlinehook (lua_LHFunction func);',
147
+ ffi: [:lua_setlinehook, [], :void] },
148
+ { source: 'lua_Object luaL_functionarg (int arg);',
149
+ ffi: [:luaL_functionarg, [:int], :int] },
150
+ { source: 'lua_Object luaL_nonnullarg (int numArg);',
151
+ ffi: [:luaL_nonnullarg, [:int], :int] },
152
+ { source: 'lua_Object luaL_tablearg (int arg);',
153
+ ffi: [:luaL_tablearg, [:int], :int] },
154
+ { source: 'lua_Object lua_createtable (void);',
155
+ ffi: [:lua_createtable, [], :int] },
156
+ { source: 'lua_Object lua_getglobal (char *name);',
157
+ ffi: [:lua_getglobal, [:pointer], :int] },
158
+ { source: 'lua_Object lua_getlocal (lua_Function func, int local_number, char **name);',
159
+ ffi: [:lua_getlocal, %i[int int pointer], :int] },
160
+ { source: 'lua_Object lua_getref (int ref);',
161
+ ffi: [:lua_getref, [:int], :int] },
162
+ { source: 'lua_Object lua_gettable (void);',
163
+ ffi: [:lua_gettable, [], :int] },
164
+ { source: 'lua_Object lua_gettagmethod (int tag, char *event);',
165
+ ffi: [:lua_gettagmethod, %i[int pointer], :int] },
166
+ { source: 'lua_Object lua_lua2C (int number);',
167
+ ffi: [:lua_lua2C, [:int], :int] },
168
+ { source: 'lua_Object lua_pop (void);', ffi: [:lua_pop, [], :int] },
169
+ { source: 'lua_Object lua_rawgetglobal (char *name);',
170
+ ffi: [:lua_rawgetglobal, [:pointer], :int] },
171
+ { source: 'lua_Object lua_rawgettable (void);',
172
+ ffi: [:lua_rawgettable, [], :int] },
173
+ { source: 'lua_Object lua_seterrormethod (void);',
174
+ ffi: [:lua_seterrormethod, [], :int] },
175
+ { source: 'lua_Object lua_settagmethod (int tag, char *event);',
176
+ ffi: [:lua_settagmethod, %i[int pointer], :int] },
177
+ { source: 'lua_State *lua_setstate (lua_State *st);',
178
+ ffi: [:lua_setstate, [:pointer], :pointer] },
179
+ { source: 'void *luaM_growaux (void *block, unsigned long nelems, int inc, int size, char *errormsg, unsigned long limit);',
180
+ ffi: [:luaM_growaux,
181
+ %i[pointer long int int pointer long],
182
+ :pointer] },
183
+ { source: 'void *luaM_realloc (void *oldblock, unsigned long size);',
184
+ ffi: [:luaM_realloc, %i[pointer long], :pointer] },
185
+ { source: 'void *lua_getuserdata (lua_Object object);',
186
+ ffi: [:lua_getuserdata, [:int], :pointer] },
187
+ { source: 'void luaA_packresults (void);',
188
+ ffi: [:luaA_packresults, [], :void] },
189
+ { source: 'void luaA_pushobject (TObject *o);',
190
+ ffi: [:luaA_pushobject, [:pointer], :void] },
191
+ { source: 'void luaB_predefine (void);',
192
+ ffi: [:luaB_predefine, [], :void] },
193
+ { source: 'void luaC_checkGC (void);', ffi: [:luaC_checkGC, [], :void] },
194
+ { source: 'void luaC_hashcallIM (Hash *l);',
195
+ ffi: [:luaC_hashcallIM, [:pointer], :void] },
196
+ { source: 'void luaC_strcallIM (TaggedString *l);',
197
+ ffi: [:luaC_strcallIM, [:pointer], :void] },
198
+ { source: 'void luaD_adjusttop (StkId newtop);',
199
+ ffi: [:luaD_adjusttop, [:int], :void] },
200
+ { source: 'void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn);',
201
+ ffi: [:luaD_callHook, %i[int pointer int], :void] },
202
+ { source: 'void luaD_callTM (TObject *f, int nParams, int nResults);',
203
+ ffi: [:luaD_callTM, %i[pointer int int], :void] },
204
+ { source: 'void luaD_calln (int nArgs, int nResults);',
205
+ ffi: [:luaD_calln, %i[int int], :void] },
206
+ { source: 'void luaD_checkstack (int n);',
207
+ ffi: [:luaD_checkstack, [:int], :void] },
208
+ { source: 'void luaD_gcIM (TObject *o);',
209
+ ffi: [:luaD_gcIM, [:pointer], :void] },
210
+ { source: 'void luaD_init (void);', ffi: [:luaD_init, [], :void] },
211
+ { source: 'void luaD_lineHook (int line);',
212
+ ffi: [:luaD_lineHook, [:int], :void] },
213
+ { source: 'void luaD_openstack (int nelems);',
214
+ ffi: [:luaD_openstack, [:int], :void] },
215
+ { source: 'void luaF_freeclosure (Closure *l);',
216
+ ffi: [:luaF_freeclosure, [:pointer], :void] },
217
+ { source: 'void luaF_freeproto (TProtoFunc *l);',
218
+ ffi: [:luaF_freeproto, [:pointer], :void] },
219
+ { source: 'void luaH_free (Hash *frees);',
220
+ ffi: [:luaH_free, [:pointer], :void] },
221
+ { source: 'void luaH_set (Hash *t, TObject *ref, TObject *val);',
222
+ ffi: [:luaH_set, %i[pointer pointer pointer], :void] },
223
+ { source: 'void luaH_setint (Hash *t, int ref, TObject *val);',
224
+ ffi: [:luaH_setint, %i[pointer int pointer], :void] },
225
+ { source: 'void luaL_addchar (int c);',
226
+ ffi: [:luaL_addchar, [:int], :void] },
227
+ { source: 'void luaL_addsize (int n);',
228
+ ffi: [:luaL_addsize, [:int], :void] },
229
+ { source: 'void luaL_argerror (int numarg, char *extramsg);',
230
+ ffi: [:luaL_argerror, %i[int pointer], :void] },
231
+ { source: 'void luaL_chunkid (char *out, char *source, int len);',
232
+ ffi: [:luaL_chunkid, %i[pointer pointer int], :void] },
233
+ { source: 'void luaL_filesource (char *out, char *filename, int len);',
234
+ ffi: [:luaL_filesource, %i[pointer pointer int], :void] },
235
+ { source: 'void luaL_oldbuffer (int old);',
236
+ ffi: [:luaL_oldbuffer, [:int], :void] },
237
+ { source: 'void luaL_openlib (struct luaL_reg *l, int n);',
238
+ ffi: [:luaL_openlib, %i[pointer int], :void] },
239
+ { source: 'void luaL_resetbuffer (void);',
240
+ ffi: [:luaL_resetbuffer, [], :void] },
241
+ { source: 'void luaL_verror (char *fmt, ...);',
242
+ ffi: [:luaL_verror, %i[pointer varargs], :void] },
243
+ { source: 'void luaO_insertlist (GCnode *root, GCnode *node);',
244
+ ffi: [:luaO_insertlist, %i[pointer pointer], :void] },
245
+ { source: 'void luaS_free (TaggedString *l);',
246
+ ffi: [:luaS_free, [:pointer], :void] },
247
+ { source: 'void luaS_freeall (void);', ffi: [:luaS_freeall, [], :void] },
248
+ { source: 'void luaS_init (void);', ffi: [:luaS_init, [], :void] },
249
+ { source: 'void luaS_rawsetglobal (TaggedString *ts, TObject *newval);',
250
+ ffi: [:luaS_rawsetglobal, %i[pointer pointer], :void] },
251
+ { source: 'void luaT_init (void);', ffi: [:luaT_init, [], :void] },
252
+ { source: 'void luaT_realtag (int tag);',
253
+ ffi: [:luaT_realtag, [:int], :void] },
254
+ { source: 'void luaT_settagmethod (int t, char *event, TObject *func);',
255
+ ffi: [:luaT_settagmethod, %i[int pointer pointer], :void] },
256
+ { source: 'void luaU_badconstant (char* s, int i, TObject* o, TProtoFunc* tf);',
257
+ ffi: [:luaU_badconstant, %i[pointer int pointer pointer], :void] },
258
+ { source: 'void luaV_closure (int nelems);',
259
+ ffi: [:luaV_closure, [:int], :void] },
260
+ { source: 'void luaV_comparison (lua_Type ttype_less, lua_Type ttype_equal, lua_Type ttype_great, IMS op);',
261
+ ffi: [:luaV_comparison, %i[int int int int], :void] },
262
+ { source: 'void luaV_getglobal (TaggedString *ts);',
263
+ ffi: [:luaV_getglobal, [:pointer], :void] },
264
+ { source: 'void luaV_gettable (void);', ffi: [:luaV_gettable, [], :void] },
265
+ { source: 'void luaV_pack (StkId firstel, int nvararg, TObject *tab);',
266
+ ffi: [:luaV_pack, %i[int int pointer], :void] },
267
+ { source: 'void luaV_rawsettable (TObject *t);',
268
+ ffi: [:luaV_rawsettable, [:pointer], :void] },
269
+ { source: 'void luaV_setglobal (TaggedString *ts);',
270
+ ffi: [:luaV_setglobal, [:pointer], :void] },
271
+ { source: 'void luaV_setn (Hash *t, int val);',
272
+ ffi: [:luaV_setn, %i[pointer int], :void] },
273
+ { source: 'void luaV_settable (TObject *t);',
274
+ ffi: [:luaV_settable, [:pointer], :void] },
275
+ { source: 'void luaX_error (LexState *ls, char *s);',
276
+ ffi: [:luaX_error, %i[pointer pointer], :void] },
277
+ { source: 'void luaX_init (void);', ffi: [:luaX_init, [], :void] },
278
+ { source: 'void luaX_setinput (LexState *LS, ZIO *z);',
279
+ ffi: [:luaX_setinput, %i[pointer pointer], :void] },
280
+ { source: 'void luaX_syntaxerror (LexState *ls, char *s, char *token);',
281
+ ffi: [:luaX_syntaxerror, %i[pointer pointer pointer], :void] },
282
+ { source: 'void luaX_token2str (int token, char *s);',
283
+ ffi: [:luaX_token2str, %i[int pointer], :void] },
284
+ { source: 'void lua_beginblock (void);',
285
+ ffi: [:lua_beginblock, [], :void] },
286
+ { source: 'void lua_close (void);', ffi: [:lua_close, [], :void] },
287
+ { source: 'void lua_dblibopen (void);', ffi: [:lua_dblibopen, [], :void] },
288
+ { source: 'void lua_endblock (void);', ffi: [:lua_endblock, [], :void] },
289
+ { source: 'void lua_error (char *s);',
290
+ ffi: [:lua_error, [:pointer], :void] },
291
+ { source: 'void lua_funcinfo (lua_Object func, char **source, int *linedefined);',
292
+ ffi: [:lua_funcinfo, %i[int pointer pointer], :void] },
293
+ { source: 'void lua_iolibopen (void);', ffi: [:lua_iolibopen, [], :void] },
294
+ { source: 'void lua_mathlibopen (void);',
295
+ ffi: [:lua_mathlibopen, [], :void] },
296
+ { source: 'void lua_open (void);', ffi: [:lua_open, [], :void] },
297
+ { source: 'void lua_pushcclosure (lua_CFunction fn, int n);',
298
+ ffi: [:lua_pushcclosure, %i[void int], :void] },
299
+ { source: 'void lua_pushlstring (char *s, long len);',
300
+ ffi: [:lua_pushlstring, %i[pointer long], :void] },
301
+ { source: 'void lua_pushnil (void);', ffi: [:lua_pushnil, [], :void] },
302
+ { source: 'void lua_pushnumber (double n);',
303
+ ffi: [:lua_pushnumber, [:double], :void] },
304
+ { source: 'void lua_pushobject (lua_Object object);',
305
+ ffi: [:lua_pushobject, [:int], :void] },
306
+ { source: 'void lua_pushstring (char *s);',
307
+ ffi: [:lua_pushstring, [:pointer], :void] },
308
+ { source: 'void lua_pushusertag (void *u, int tag);',
309
+ ffi: [:lua_pushusertag, %i[pointer int], :void] },
310
+ { source: 'void lua_rawsetglobal (char *name);',
311
+ ffi: [:lua_rawsetglobal, [:pointer], :void] },
312
+ { source: 'void lua_rawsettable (void);',
313
+ ffi: [:lua_rawsettable, [], :void] },
314
+ { source: 'void lua_setglobal (char *name);',
315
+ ffi: [:lua_setglobal, [:pointer], :void] },
316
+ { source: 'void lua_settable (void);', ffi: [:lua_settable, [], :void] },
317
+ { source: 'void lua_settag (int tag);', ffi: [:lua_settag, [:int], :void] },
318
+ { source: 'void lua_strlibopen (void);',
319
+ ffi: [:lua_strlibopen, [], :void] },
320
+ { source: 'void lua_unref (int ref);', ffi: [:lua_unref, [:int], :void] },
321
+ { source: 'void lua_userinit (void);', ffi: [:lua_userinit, [], :void] }],
322
+ macros: [{ source: '#define LUA_ASSERT(c,s) { if (!(c)) LUA_INTERNALERROR(s); }',
323
+ name: 'LUA_ASSERT',
324
+ input: %w[c s] },
325
+ { source: '#define luaH_get(t,ref) (val(luaH_present((t), (ref))))',
326
+ name: 'luaH_get',
327
+ input: %w[t ref] },
328
+ { source: '#define luaH_move(t,from,to) (luaH_setint(t, to, luaH_getint(t, from)))',
329
+ name: 'luaH_move',
330
+ input: %w[t from to] },
331
+ { source: '#define luaL_check_int(n) ((int)luaL_check_number(n))',
332
+ name: 'luaL_check_intn',
333
+ input: ['int'] },
334
+ { source: '#define luaL_check_long(n) ((long)luaL_check_number(n))',
335
+ name: 'luaL_check_longn',
336
+ input: ['long'] },
337
+ { source: '#define luaL_opt_int(n,d) ((int)luaL_opt_number(n,d))',
338
+ name: 'luaL_opt_int',
339
+ input: %w[n d] },
340
+ { source: '#define luaL_opt_long(n,d) ((long)luaL_opt_number(n,d))',
341
+ name: 'luaL_opt_long',
342
+ input: %w[n d] },
343
+ { source: '#define luaL_opt_string(n, d) (luaL_opt_lstr((n), (d), NULL))',
344
+ name: 'luaL_opt_string',
345
+ input: %w[n d] },
346
+ { source: '#define luaM_free(b) luaM_realloc((b), 0)',
347
+ name: 'luaM_free',
348
+ input: ['b'] },
349
+ { source: '#define luaM_malloc(t) luaM_realloc(NULL, (t))',
350
+ name: 'luaM_malloc',
351
+ input: ['t'] },
352
+ { source: '#define luaM_new(t) ((t *)luaM_malloc(sizeof(t)))',
353
+ name: 'luaM_newt',
354
+ input: ['t'] },
355
+ { source: '#define luaM_newvector(n,t) ((t *)luaM_malloc((n)*sizeof(t)))',
356
+ name: 'luaM_newvector',
357
+ input: %w[n t] },
358
+ { source: '#define luaM_reallocvector(v,n,t) ((v)=(t *)luaM_realloc(v,(n)*sizeof(t)))',
359
+ name: 'luaM_reallocvector',
360
+ input: %w[v n t] },
361
+ { source: '#define luaO_equalObj(t1,t2) ((ttype(t1) != ttype(t2)) ? 0 \\ : luaO_equalval(t1,t2))',
362
+ name: 'luaO_equalObj',
363
+ input: %w[t1 t2] },
364
+ { source: '#define luaO_memdown(d,s,n) memmove(d,s,n)',
365
+ name: 'luaO_memdown',
366
+ input: %w[d s n] },
367
+ { source: '#define luaO_memup(d,s,n) memmove(d,s,n)',
368
+ name: 'luaO_memup',
369
+ input: %w[d s n] },
370
+ { source: '#define luaT_getim(tag,event) (&L->IMtable[-(tag)].int_method[event])',
371
+ name: 'luaT_getim',
372
+ input: %w[tag event] },
373
+ { source: '#define luaT_getimbyObj(o,e) (luaT_getim(luaT_effectivetag(o),(e)))',
374
+ name: 'luaT_getimbyObj',
375
+ input: %w[o e] },
376
+ { source: '#define lua_call(name) lua_callfunction(lua_getglobal(name))',
377
+ name: 'lua_call',
378
+ input: ['name'] },
379
+ { source: '#define lua_clonetag(t) lua_copytagmethods(lua_newtag(), (t))',
380
+ name: 'lua_clonetag',
381
+ input: ['t'] },
382
+ { source: '#define lua_getfield(o,f) (lua_pushobject(o), lua_pushstring(f), lua_gettable())',
383
+ name: 'lua_getfield',
384
+ input: %w[o f] },
385
+ { source: '#define lua_getindexed(o,n) (lua_pushobject(o), lua_pushnumber(n), lua_gettable())',
386
+ name: 'lua_getindexed',
387
+ input: %w[o n] },
388
+ { source: '#define lua_getparam(_) lua_lua2C(_)',
389
+ name: 'lua_getparam',
390
+ input: ['_'] },
391
+ { source: '#define lua_getresult(_) lua_lua2C(_)',
392
+ name: 'lua_getresult',
393
+ input: ['_'] },
394
+ { source: '#define lua_lock() lua_ref(1)', name: 'lua_lock', input: [] },
395
+ { source: '#define lua_lockobject(o) lua_refobject(o,1)',
396
+ name: 'lua_lockobject',
397
+ input: ['o'] },
398
+ { source: '#define lua_pushcfunction(f) lua_pushcclosure(f, 0)',
399
+ name: 'lua_pushcfunction',
400
+ input: ['f'] },
401
+ { source: '#define lua_pushliteral(o) lua_pushstring(o)',
402
+ name: 'lua_pushliteral',
403
+ input: ['o'] },
404
+ { source: '#define lua_pushref(ref) lua_pushobject(lua_getref(ref))',
405
+ name: 'lua_pushref',
406
+ input: ['ref'] },
407
+ { source: '#define lua_pushuserdata(u) lua_pushusertag(u, 0)',
408
+ name: 'lua_pushuserdata',
409
+ input: ['u'] },
410
+ { source: '#define lua_refobject(o,l) (lua_pushobject(o), lua_ref(l))',
411
+ name: 'lua_refobject',
412
+ input: %w[o l] },
413
+ { source: '#define lua_register(n,f) (lua_pushcfunction(f), lua_setglobal(n))',
414
+ name: 'lua_register',
415
+ input: %w[n f] }]
416
+ }
417
+ end
418
+ end