1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "lua_loadlib.h"
22 typedef lua_State
* (*Tlua_open
) (void);
23 typedef void (*Tlua_close
) (lua_State
*L
);
24 typedef lua_State
*(*Tlua_newthread
) (lua_State
*L
);
25 typedef lua_CFunction (*Tlua_atpanic
) (lua_State
*L
, lua_CFunction panicf
);
26 typedef int (*Tlua_gettop
) (lua_State
*L
);
27 typedef void (*Tlua_settop
) (lua_State
*L
, int idx
);
28 typedef void (*Tlua_pushvalue
) (lua_State
*L
, int idx
);
29 typedef void (*Tlua_remove
) (lua_State
*L
, int idx
);
30 typedef void (*Tlua_insert
)(lua_State
*L
, int idx
);
31 typedef void (*Tlua_replace
) (lua_State
*L
, int idx
);
32 typedef int (*Tlua_checkstack
) (lua_State
*L
, int sz
);
33 typedef void (*Tlua_xmove
) (lua_State
*from
, lua_State
*to
, int n
);
34 typedef int (*Tlua_isnumber
) (lua_State
*L
, int idx
);
35 typedef int (*Tlua_isstring
) (lua_State
*L
, int idx
);
36 typedef int (*Tlua_iscfunction
) (lua_State
*L
, int idx
);
37 typedef int (*Tlua_isuserdata
) (lua_State
*L
, int idx
);
38 typedef int (*Tlua_type
) (lua_State
*L
, int idx
);
39 typedef const char *(*Tlua_typename
) (lua_State
*L
, int tp
);
40 typedef int (*Tlua_equal
) (lua_State
*L
, int idx1
, int idx2
);
41 typedef int (*Tlua_rawequal
) (lua_State
*L
, int idx1
, int idx2
);
42 typedef int (*Tlua_lessthan
) (lua_State
*L
, int idx1
, int idx2
);
43 typedef lua_Number (*Tlua_tonumber
) (lua_State
*L
, int idx
);
44 typedef int (*Tlua_toboolean
) (lua_State
*L
, int idx
);
45 typedef const char *(*Tlua_tostring
) (lua_State
*L
, int idx
);
46 typedef size_t (*Tlua_strlen
) (lua_State
*L
, int idx
);
47 typedef lua_CFunction (*Tlua_tocfunction
) (lua_State
*L
, int idx
);
48 typedef void *(*Tlua_touserdata
) (lua_State
*L
, int idx
);
49 typedef lua_State
*(*Tlua_tothread
) (lua_State
*L
, int idx
);
50 typedef const void *(*Tlua_topointer
) (lua_State
*L
, int idx
);
51 typedef void (*Tlua_pushnil
) (lua_State
*L
);
52 typedef void (*Tlua_pushnumber
) (lua_State
*L
, lua_Number n
);
53 typedef void (*Tlua_pushlstring
) (lua_State
*L
, const char *s
, size_t l
);
54 typedef void (*Tlua_pushstring
) (lua_State
*L
, const char *s
);
55 typedef const char *(*Tlua_pushvfstring
) (lua_State
*L
, const char *fmt
, va_list argp
);
56 typedef const char *(*Tlua_pushfstring
) (lua_State
*L
, const char *fmt
, ...);
57 typedef void (*Tlua_pushcclosure
) (lua_State
*L
, lua_CFunction fn
, int n
);
58 typedef void (*Tlua_pushboolean
) (lua_State
*L
, int b
);
59 typedef void (*Tlua_pushlightuserdata
) (lua_State
*L
, void *p
);
60 typedef void (*Tlua_gettable
) (lua_State
*L
, int idx
);
61 typedef void (*Tlua_rawget
) (lua_State
*L
, int idx
);
62 typedef void (*Tlua_rawgeti
) (lua_State
*L
, int idx
, int n
);
63 typedef void (*Tlua_newtable
) (lua_State
*L
);
64 typedef void *(*Tlua_newuserdata
) (lua_State
*L
, size_t sz
);
65 typedef int (*Tlua_getmetatable
) (lua_State
*L
, int objindex
);
66 typedef void (*Tlua_getfenv
) (lua_State
*L
, int idx
);
67 typedef void (*Tlua_settable
) (lua_State
*L
, int idx
);
68 typedef void (*Tlua_rawset
) (lua_State
*L
, int idx
);
69 typedef void (*Tlua_rawseti
) (lua_State
*L
, int idx
, int n
);
70 typedef int (*Tlua_setmetatable
) (lua_State
*L
, int objindex
);
71 typedef int (*Tlua_setfenv
) (lua_State
*L
, int idx
);
72 typedef void (*Tlua_call
) (lua_State
*L
, int nargs
, int nresults
);
73 typedef int (*Tlua_pcall
) (lua_State
*L
, int nargs
, int nresults
, int errfunc
);
74 typedef int (*Tlua_cpcall
) (lua_State
*L
, lua_CFunction func
, void *ud
);
75 typedef int (*Tlua_load
) (lua_State
*L
, lua_Chunkreader reader
, void *dt
,
76 const char *chunkname
);
77 typedef int (*Tlua_dump
) (lua_State
*L
, lua_Chunkwriter writer
, void *data
);
78 typedef int (*Tlua_yield
) (lua_State
*L
, int nresults
);
79 typedef int (*Tlua_resume
) (lua_State
*L
, int narg
);
80 typedef int (*Tlua_getgcthreshold
) (lua_State
*L
);
81 typedef int (*Tlua_getgccount
) (lua_State
*L
);
82 typedef void (*Tlua_setgcthreshold
) (lua_State
*L
, int newthreshold
);
83 typedef const char *(*Tlua_version
) (void);
84 typedef int (*Tlua_error
) (lua_State
*L
);
85 typedef int (*Tlua_next
) (lua_State
*L
, int idx
);
86 typedef void (*Tlua_concat
) (lua_State
*L
, int n
);
87 typedef int (*Tlua_pushupvalues
) (lua_State
*L
);
88 typedef void (*Tlua_Hook
) (lua_State
*L
, lua_Debug
*ar
);
89 typedef int (*Tlua_getstack
) (lua_State
*L
, int level
, lua_Debug
*ar
);
90 typedef int (*Tlua_getinfo
) (lua_State
*L
, const char *what
, lua_Debug
*ar
);
91 typedef const char *(*Tlua_getlocal
) (lua_State
*L
, const lua_Debug
*ar
, int n
);
92 typedef const char *(*Tlua_setlocal
) (lua_State
*L
, const lua_Debug
*ar
, int n
);
93 typedef const char *(*Tlua_getupvalue
) (lua_State
*L
, int funcindex
, int n
);
94 typedef const char *(*Tlua_setupvalue
) (lua_State
*L
, int funcindex
, int n
);
95 typedef int (*Tlua_sethook
) (lua_State
*L
, lua_Hook func
, int mask
, int count
);
96 typedef lua_Hook (*Tlua_gethook
) (lua_State
*L
);
97 typedef int (*Tlua_gethookmask
) (lua_State
*L
);
98 typedef int (*Tlua_gethookcount
) (lua_State
*L
);
101 typedef void (*TluaL_openlib
) (lua_State
*L
, const char *libname
,
102 const luaL_reg
*l
, int nup
);
103 typedef int (*TluaL_getmetafield
) (lua_State
*L
, int obj
, const char *e
);
104 typedef int (*TluaL_callmeta
) (lua_State
*L
, int obj
, const char *e
);
105 typedef int (*TluaL_typerror
) (lua_State
*L
, int narg
, const char *tname
);
106 typedef int (*TluaL_argerror
) (lua_State
*L
, int numarg
, const char *extramsg
);
107 typedef const char *(*TluaL_checklstring
) (lua_State
*L
, int numArg
, size_t *l
);
108 typedef const char *(*TluaL_optlstring
) (lua_State
*L
, int numArg
,
109 const char *def
, size_t *l
);
110 typedef lua_Number (*TluaL_checknumber
) (lua_State
*L
, int numArg
);
111 typedef lua_Number (*TluaL_optnumber
) (lua_State
*L
, int nArg
, lua_Number def
);
113 typedef void (*TluaL_checkstack
) (lua_State
*L
, int sz
, const char *msg
);
114 typedef void (*TluaL_checktype
) (lua_State
*L
, int narg
, int t
);
115 typedef void (*TluaL_checkany
) (lua_State
*L
, int narg
);
117 typedef int (*TluaL_newmetatable
) (lua_State
*L
, const char *tname
);
118 typedef void (*TluaL_getmetatable
) (lua_State
*L
, const char *tname
);
119 typedef void *(*TluaL_checkudata
) (lua_State
*L
, int ud
, const char *tname
);
121 typedef void (*TluaL_where
) (lua_State
*L
, int lvl
);
122 typedef int (*TluaL_error
) (lua_State
*L
, const char *fmt
, ...);
124 typedef int (*TluaL_findstring
) (const char *st
, const char *const lst
[]);
126 typedef int (*TluaL_ref
) (lua_State
*L
, int t
);
127 typedef void (*TluaL_unref
) (lua_State
*L
, int t
, int ref
);
129 typedef int (*TluaL_getn
) (lua_State
*L
, int t
);
130 typedef void (*TluaL_setn
) (lua_State
*L
, int t
, int n
);
132 typedef int (*TluaL_loadfile
) (lua_State
*L
, const char *filename
);
133 typedef int (*TluaL_loadbuffer
) (lua_State
*L
, const char *buff
, size_t sz
,
136 typedef void (*TluaL_buffinit
) (lua_State
*L
, luaL_Buffer
*B
);
137 typedef char *(*TluaL_prepbuffer
) (luaL_Buffer
*B
);
138 typedef void (*TluaL_addlstring
) (luaL_Buffer
*B
, const char *s
, size_t l
);
139 typedef void (*TluaL_addstring
) (luaL_Buffer
*B
, const char *s
);
140 typedef void (*TluaL_addvalue
) (luaL_Buffer
*B
);
141 typedef void (*TluaL_pushresult
) (luaL_Buffer
*B
);
142 typedef int (*Tlua_dofile
) (lua_State
*L
, const char *filename
);
143 typedef int (*Tlua_dostring
) (lua_State
*L
, const char *str
);
144 typedef int (*Tlua_dobuffer
) (lua_State
*L
, const char *buff
, size_t sz
,
148 typedef int (*Tluaopen_base
) (lua_State
*L
);
149 typedef int (*Tluaopen_table
) (lua_State
*L
);
150 typedef int (*Tluaopen_io
) (lua_State
*L
);
151 typedef int (*Tluaopen_string
) (lua_State
*L
);
152 typedef int (*Tluaopen_math
) (lua_State
*L
);
153 typedef int (*Tluaopen_debug
) (lua_State
*L
);
154 typedef int (*Tluaopen_loadlib
) (lua_State
*L
);
157 Tlua_open dlllua_open
;
158 Tlua_close dlllua_close
;
159 Tlua_newthread dlllua_newthread
;
160 Tlua_atpanic dlllua_atpanic
;
161 Tlua_gettop dlllua_gettop
;
162 Tlua_settop dlllua_settop
;
163 Tlua_pushvalue dlllua_pushvalue
;
164 Tlua_remove dlllua_remove
;
165 Tlua_insert dlllua_insert
;
166 Tlua_replace dlllua_replace
;
167 Tlua_checkstack dlllua_checkstack
;
168 Tlua_xmove dlllua_xmove
;
169 Tlua_isnumber dlllua_isnumber
;
170 Tlua_isstring dlllua_isstring
;
171 Tlua_iscfunction dlllua_iscfunction
;
172 Tlua_isuserdata dlllua_isuserdata
;
173 Tlua_type dlllua_type
;
174 Tlua_typename dlllua_typename
;
175 Tlua_equal dlllua_equal
;
176 Tlua_rawequal dlllua_rawequal
;
177 Tlua_lessthan dlllua_lessthan
;
178 Tlua_tonumber dlllua_tonumber
;
179 Tlua_toboolean dlllua_toboolean
;
180 Tlua_tostring dlllua_tostring
;
181 Tlua_strlen dlllua_strlen
;
182 Tlua_tocfunction dlllua_tocfunction
;
183 Tlua_touserdata dlllua_touserdata
;
184 Tlua_tothread dlllua_tothread
;
185 Tlua_topointer dlllua_topointer
;
186 Tlua_pushnil dlllua_pushnil
;
187 Tlua_pushnumber dlllua_pushnumber
;
188 Tlua_pushlstring dlllua_pushlstring
;
189 Tlua_pushstring dlllua_pushstring
;
190 Tlua_pushvfstring dlllua_pushvfstring
;
191 Tlua_pushfstring dlllua_pushfstring
;
192 Tlua_pushcclosure dlllua_pushcclosure
;
193 Tlua_pushboolean dlllua_pushboolean
;
194 Tlua_pushlightuserdata dlllua_pushlightuserdata
;
195 Tlua_gettable dlllua_gettable
;
196 Tlua_rawget dlllua_rawget
;
197 Tlua_rawgeti dlllua_rawgeti
;
198 Tlua_newtable dlllua_newtable
;
199 Tlua_newuserdata dlllua_newuserdata
;
200 Tlua_getmetatable dlllua_getmetatable
;
201 Tlua_getfenv dlllua_getfenv
;
202 Tlua_settable dlllua_settable
;
203 Tlua_rawset dlllua_rawset
;
204 Tlua_rawseti dlllua_rawseti
;
205 Tlua_setmetatable dlllua_setmetatable
;
206 Tlua_setfenv dlllua_setfenv
;
207 Tlua_call dlllua_call
;
208 Tlua_pcall dlllua_pcall
;
209 Tlua_cpcall dlllua_cpcall
;
210 Tlua_load dlllua_load
;
211 Tlua_dump dlllua_dump
;
212 Tlua_yield dlllua_yield
;
213 Tlua_resume dlllua_resume
;
214 Tlua_getgcthreshold dlllua_getgcthreshold
;
215 Tlua_getgccount dlllua_getgccount
;
216 Tlua_setgcthreshold dlllua_setgcthreshold
;
217 Tlua_version dlllua_version
;
218 Tlua_error dlllua_error
;
219 Tlua_next dlllua_next
;
220 Tlua_concat dlllua_concat
;
221 Tlua_pushupvalues dlllua_pushupvalues
;
222 Tlua_getstack dlllua_getstack
;
223 Tlua_getinfo dlllua_getinfo
;
224 Tlua_getlocal dlllua_getlocal
;
225 Tlua_setlocal dlllua_setlocal
;
226 Tlua_getupvalue dlllua_getupvalue
;
227 Tlua_setupvalue dlllua_setupvalue
;
228 Tlua_sethook dlllua_sethook
;
229 Tlua_gethook dlllua_gethook
;
230 Tlua_gethookmask dlllua_gethookmask
;
231 Tlua_gethookcount dlllua_gethookcount
;
233 TluaL_openlib dllluaL_openlib
;
234 TluaL_getmetafield dllluaL_getmetafield
;
235 TluaL_callmeta dllluaL_callmeta
;
236 TluaL_typerror dllluaL_typerror
;
237 TluaL_argerror dllluaL_argerror
;
238 TluaL_checklstring dllluaL_checklstring
;
239 TluaL_optlstring dllluaL_optlstring
;
240 TluaL_checknumber dllluaL_checknumber
;
241 TluaL_optnumber dllluaL_optnumber
;
242 TluaL_checkstack dllluaL_checkstack
;
243 TluaL_checktype dllluaL_checktype
;
244 TluaL_checkany dllluaL_checkany
;
245 TluaL_newmetatable dllluaL_newmetatable
;
246 TluaL_getmetatable dllluaL_getmetatable
;
247 TluaL_checkudata dllluaL_checkudata
;
248 TluaL_where dllluaL_where
;
249 TluaL_error dllluaL_error
;
250 TluaL_findstring dllluaL_findstring
;
251 TluaL_ref dllluaL_ref
;
252 TluaL_unref dllluaL_unref
;
253 TluaL_getn dllluaL_getn
;
254 TluaL_setn dllluaL_setn
;
255 TluaL_loadfile dllluaL_loadfile
;
256 TluaL_loadbuffer dllluaL_loadbuffer
;
257 TluaL_buffinit dllluaL_buffinit
;
258 TluaL_prepbuffer dllluaL_prepbuffer
;
259 TluaL_addlstring dllluaL_addlstring
;
260 TluaL_addstring dllluaL_addstring
;
261 TluaL_addvalue dllluaL_addvalue
;
262 TluaL_pushresult dllluaL_pushresult
;
263 Tlua_dofile dlllua_dofile
;
264 Tlua_dostring dlllua_dostring
;
265 Tlua_dobuffer dlllua_dobuffer
;
267 Tluaopen_base dllluaopen_base
;
268 Tluaopen_table dllluaopen_table
;
269 Tluaopen_io dllluaopen_io
;
270 Tluaopen_string dllluaopen_string
;
271 Tluaopen_math dllluaopen_math
;
272 Tluaopen_debug dllluaopen_debug
;
273 Tluaopen_loadlib dllluaopen_loadlib
;
275 // call to actual dll function
276 lua_State
*lua_open (void) { return dlllua_open(); }
277 void lua_close (lua_State
*L
) { dlllua_close(L
); }
278 lua_State
*lua_newthread (lua_State
*L
) { return dlllua_newthread(L
); }
279 lua_CFunction
lua_atpanic (lua_State
*L
, lua_CFunction panicf
) { return dlllua_atpanic(L
, panicf
); }
280 int lua_gettop (lua_State
*L
) { return dlllua_gettop(L
); }
281 void lua_settop (lua_State
*L
, int idx
) { dlllua_settop(L
, idx
); }
282 void lua_pushvalue (lua_State
*L
, int idx
) { dlllua_pushvalue(L
, idx
); }
283 void lua_remove (lua_State
*L
, int idx
) { dlllua_remove(L
, idx
); }
284 void lua_insert (lua_State
*L
, int idx
) { dlllua_insert (L
, idx
); }
285 void lua_replace (lua_State
*L
, int idx
) { dlllua_replace(L
, idx
); }
286 int lua_checkstack (lua_State
*L
, int sz
) { return dlllua_checkstack(L
, sz
); }
287 void lua_xmove (lua_State
*from
, lua_State
*to
, int n
) { dlllua_xmove(from
, to
, n
); }
288 int lua_isnumber (lua_State
*L
, int idx
) { return dlllua_isnumber(L
, idx
); }
289 int lua_isstring (lua_State
*L
, int idx
) { return dlllua_isstring(L
, idx
); }
290 int lua_iscfunction (lua_State
*L
, int idx
) { return dlllua_iscfunction(L
, idx
); }
291 int lua_isuserdata (lua_State
*L
, int idx
) { return dlllua_isuserdata(L
, idx
); }
292 int lua_type (lua_State
*L
, int idx
) { return dlllua_type(L
, idx
); }
293 const char *lua_typename (lua_State
*L
, int tp
) { return dlllua_typename(L
, tp
); }
294 int lua_equal (lua_State
*L
, int idx1
, int idx2
) { return dlllua_equal(L
, idx1
, idx2
); }
295 int lua_rawequal (lua_State
*L
, int idx1
, int idx2
) { return dlllua_rawequal(L
, idx1
, idx2
); }
296 int lua_lessthan (lua_State
*L
, int idx1
, int idx2
) { return dlllua_lessthan(L
, idx1
, idx2
); }
297 lua_Number
lua_tonumber (lua_State
*L
, int idx
) { return dlllua_tonumber(L
, idx
); }
298 int lua_toboolean (lua_State
*L
, int idx
) { return dlllua_toboolean(L
, idx
); }
299 const char *lua_tostring (lua_State
*L
, int idx
) { return dlllua_tostring(L
, idx
); }
300 size_t lua_strlen (lua_State
*L
, int idx
) { return dlllua_strlen(L
, idx
); }
301 lua_CFunction
lua_tocfunction (lua_State
*L
, int idx
) { return dlllua_tocfunction(L
, idx
); }
302 void *lua_touserdata (lua_State
*L
, int idx
) { return dlllua_touserdata(L
, idx
); }
303 lua_State
*lua_tothread (lua_State
*L
, int idx
) { return dlllua_tothread(L
, idx
); }
304 const void *lua_topointer (lua_State
*L
, int idx
) { return dlllua_topointer(L
, idx
); }
305 void lua_pushnil (lua_State
*L
) { dlllua_pushnil(L
); }
306 void lua_pushnumber (lua_State
*L
, lua_Number n
) { dlllua_pushnumber(L
, n
); }
307 void lua_pushlstring (lua_State
*L
, const char *s
, size_t l
) { dlllua_pushlstring(L
, s
, l
); }
308 void lua_pushstring (lua_State
*L
, const char *s
) { dlllua_pushstring(L
, s
); }
310 const char *lua_pushvfstring (lua_State
*L
, const char *fmt
, va_list argp
)
314 va_start (_args
, fmt
);
315 result
= dlllua_pushvfstring(L
, fmt
, _args
);
320 const char *lua_pushfstring (lua_State
*L
, const char *fmt
, ...)
324 va_start (_args
, fmt
);
325 result
= dlllua_pushfstring(L
, fmt
, _args
);
330 void lua_pushcclosure (lua_State
*L
, lua_CFunction fn
, int n
) { dlllua_pushcclosure(L
, fn
, n
); }
331 void lua_pushboolean (lua_State
*L
, int b
) { dlllua_pushboolean(L
, b
); }
332 void lua_pushlightuserdata (lua_State
*L
, void *p
) { dlllua_pushlightuserdata(L
, p
); }
333 void lua_gettable (lua_State
*L
, int idx
) { dlllua_gettable(L
, idx
); }
334 void lua_rawget (lua_State
*L
, int idx
) { dlllua_rawget(L
, idx
); }
335 void lua_rawgeti (lua_State
*L
, int idx
, int n
) { dlllua_rawgeti(L
, idx
, n
); }
336 void lua_newtable (lua_State
*L
) { dlllua_newtable(L
); }
337 void *lua_newuserdata (lua_State
*L
, size_t sz
) { return dlllua_newuserdata(L
, sz
); }
338 int lua_getmetatable (lua_State
*L
, int objindex
) { return dlllua_getmetatable(L
, objindex
); }
339 void lua_getfenv (lua_State
*L
, int idx
) { dlllua_getfenv(L
, idx
); }
340 void lua_settable (lua_State
*L
, int idx
) { dlllua_settable(L
, idx
); }
341 void lua_rawset (lua_State
*L
, int idx
) { dlllua_rawset(L
, idx
); }
342 void lua_rawseti (lua_State
*L
, int idx
, int n
) { dlllua_rawseti(L
, idx
, n
); }
343 int lua_setmetatable (lua_State
*L
, int objindex
) { return dlllua_setmetatable(L
, objindex
); }
344 int lua_setfenv (lua_State
*L
, int idx
) { return dlllua_setfenv(L
, idx
); }
345 void lua_call (lua_State
*L
, int nargs
, int nresults
) { dlllua_call(L
, nargs
, nresults
); }
346 int lua_pcall (lua_State
*L
, int nargs
, int nresults
, int errfunc
) { return dlllua_pcall(L
, nargs
, nresults
, errfunc
); }
347 int lua_cpcall (lua_State
*L
, lua_CFunction func
, void *ud
) { return dlllua_cpcall(L
, func
, ud
); }
348 int lua_load (lua_State
*L
, lua_Chunkreader reader
, void *dt
, const char *chunkname
)
350 return dlllua_load(L
, reader
, dt
, chunkname
);
352 int lua_dump (lua_State
*L
, lua_Chunkwriter writer
, void *data
) { return dlllua_dump(L
, writer
, data
); }
353 int lua_yield (lua_State
*L
, int nresults
) { return dlllua_yield(L
, nresults
); }
354 int lua_resume (lua_State
*L
, int narg
) { return dlllua_resume(L
, narg
); }
355 int lua_getgcthreshold (lua_State
*L
) { return dlllua_getgcthreshold(L
); }
356 int lua_getgccount (lua_State
*L
) { return dlllua_getgccount(L
); }
357 void lua_setgcthreshold (lua_State
*L
, int newthreshold
) { dlllua_setgcthreshold(L
, newthreshold
); }
358 const char *lua_version (void) { return dlllua_version(); }
359 int lua_error (lua_State
*L
) { return dlllua_error(L
); }
360 int lua_next (lua_State
*L
, int idx
) { return dlllua_next(L
, idx
); }
361 void lua_concat (lua_State
*L
, int n
) { dlllua_concat(L
, n
); }
362 int lua_pushupvalues (lua_State
*L
) { return dlllua_pushupvalues(L
); }
363 int lua_getstack (lua_State
*L
, int level
, lua_Debug
*ar
) { return dlllua_getstack(L
, level
, ar
); }
364 int lua_getinfo (lua_State
*L
, const char *what
, lua_Debug
*ar
) { return dlllua_getinfo(L
, what
, ar
); }
365 const char *lua_getlocal (lua_State
*L
, const lua_Debug
*ar
, int n
) { return dlllua_getlocal(L
, ar
, n
); }
366 const char *lua_setlocal (lua_State
*L
, const lua_Debug
*ar
, int n
) { return dlllua_setlocal(L
, ar
, n
); }
367 const char *lua_getupvalue (lua_State
*L
, int funcindex
, int n
) { return dlllua_getupvalue(L
, funcindex
, n
); }
368 const char *lua_setupvalue (lua_State
*L
, int funcindex
, int n
) { return dlllua_setupvalue(L
, funcindex
, n
); }
369 int lua_sethook (lua_State
*L
, lua_Hook func
, int mask
, int count
) { return dlllua_sethook(L
, func
, mask
, count
); }
370 lua_Hook
lua_gethook (lua_State
*L
) { return dlllua_gethook(L
); }
371 int lua_gethookmask (lua_State
*L
) { return dlllua_gethookmask(L
); }
372 int lua_gethookcount (lua_State
*L
) { return dlllua_gethookcount(L
); }
375 void luaL_openlib (lua_State
*L
, const char *libname
, const luaL_reg
*l
, int nup
) { dllluaL_openlib(L
, libname
, l
, nup
); }
376 int luaL_getmetafield (lua_State
*L
, int obj
, const char *e
) { return dllluaL_getmetafield(L
, obj
, e
); }
377 int luaL_callmeta (lua_State
*L
, int obj
, const char *e
) { return dllluaL_callmeta(L
, obj
, e
); }
378 int luaL_typerror (lua_State
*L
, int narg
, const char *tname
) { return dllluaL_typerror(L
, narg
, tname
); }
379 int luaL_argerror (lua_State
*L
, int numarg
, const char *extramsg
) { return dllluaL_argerror(L
, numarg
, extramsg
); }
380 const char *luaL_checklstring (lua_State
*L
, int numArg
, size_t *l
) { return dllluaL_checklstring(L
, numArg
, l
); }
381 const char *luaL_optlstring (lua_State
*L
, int numArg
, const char *def
, size_t *l
) { return dllluaL_optlstring(L
, numArg
, def
, l
); }
382 lua_Number
luaL_checknumber (lua_State
*L
, int numArg
) { return dllluaL_checknumber(L
, numArg
); }
383 lua_Number
luaL_optnumber (lua_State
*L
, int nArg
, lua_Number def
) { return dllluaL_optnumber(L
, nArg
, def
); }
384 void luaL_checkstack (lua_State
*L
, int sz
, const char *msg
) { dllluaL_checkstack(L
, sz
, msg
); }
385 void luaL_checktype (lua_State
*L
, int narg
, int t
) { dllluaL_checktype(L
, narg
, t
); }
386 void luaL_checkany (lua_State
*L
, int narg
) { dllluaL_checkany(L
, narg
); }
387 int luaL_newmetatable (lua_State
*L
, const char *tname
) { return dllluaL_newmetatable(L
, tname
); }
388 void luaL_getmetatable (lua_State
*L
, const char *tname
) { dllluaL_getmetatable(L
, tname
); }
389 void *luaL_checkudata (lua_State
*L
, int ud
, const char *tname
) { return dllluaL_checkudata(L
, ud
, tname
); }
390 void luaL_where (lua_State
*L
, int lvl
) { dllluaL_where(L
, lvl
); }
392 int luaL_error (lua_State
*L
, const char *fmt
, ...)
396 va_start (_args
, fmt
);
397 result
= dllluaL_error(L
, fmt
, _args
);
401 int luaL_findstring (const char *st
, const char *const lst
[]) { return dllluaL_findstring(st
, lst
); }
402 int luaL_ref (lua_State
*L
, int t
) { return dllluaL_ref(L
, t
); }
403 void luaL_unref (lua_State
*L
, int t
, int ref
) { dllluaL_unref(L
, t
, ref
); }
404 int luaL_getn (lua_State
*L
, int t
) { return dllluaL_getn(L
, t
); }
405 void luaL_setn (lua_State
*L
, int t
, int n
) { dllluaL_setn(L
, t
, n
); }
406 int luaL_loadfile (lua_State
*L
, const char *filename
) { return dllluaL_loadfile(L
, filename
); }
407 int luaL_loadbuffer (lua_State
*L
, const char *buff
, size_t sz
, const char *name
) { return dllluaL_loadbuffer(L
, buff
, sz
, name
); }
409 void luaL_buffinit (lua_State
*L
, luaL_Buffer
*B
) { dllluaL_buffinit(L
, B
); }
410 char *luaL_prepbuffer (luaL_Buffer
*B
) { return dllluaL_prepbuffer(B
); }
412 void luaL_addlstring (luaL_Buffer
*B
, const char *s
, size_t l
) { dllluaL_addlstring(B
, s
, l
); }
413 void luaL_addstring (luaL_Buffer
*B
, const char *s
) { dllluaL_addstring(B
, s
); }
414 void luaL_addvalue (luaL_Buffer
*B
) { dllluaL_addvalue(B
); }
415 void luaL_pushresult (luaL_Buffer
*B
) { dllluaL_pushresult(B
); }
416 int lua_dofile (lua_State
*L
, const char *filename
) { return dlllua_dofile(L
, filename
); }
417 int lua_dostring (lua_State
*L
, const char *str
) { return dlllua_dostring(L
, str
); }
418 int lua_dobuffer (lua_State
*L
, const char *buff
, size_t sz
, const char *n
) { return dlllua_dobuffer(L
, buff
, sz
, n
); }
421 int luaopen_base (lua_State
*L
) { return dllluaopen_base(L
); }
422 int luaopen_table (lua_State
*L
) { return dllluaopen_table(L
); }
423 int luaopen_io (lua_State
*L
) { return dllluaopen_io(L
); }
424 int luaopen_string (lua_State
*L
) { return dllluaopen_string(L
); }
425 int luaopen_math (lua_State
*L
) { return dllluaopen_math(L
); }
426 int luaopen_debug (lua_State
*L
) { return dllluaopen_debug(L
); }
427 int luaopen_loadlib (lua_State
*L
) { return dllluaopen_loadlib(L
); }
432 HMODULE libHandle
= LoadLibrary("lua.dll");
433 if (!libHandle
) return 0;
434 #define GET_LUA_PROC(name) dll##name = (T##name) GetProcAddress(libHandle, #name); if (!dll##name) return 0;
436 GET_LUA_PROC(lua_close
)
437 GET_LUA_PROC(lua_newthread
)
438 GET_LUA_PROC(lua_atpanic
)
439 GET_LUA_PROC(lua_gettop
)
440 GET_LUA_PROC(lua_settop
)
441 GET_LUA_PROC(lua_pushvalue
)
442 GET_LUA_PROC(lua_remove
)
443 GET_LUA_PROC(lua_insert
)
444 GET_LUA_PROC(lua_replace
)
445 GET_LUA_PROC(lua_checkstack
)
446 GET_LUA_PROC(lua_xmove
)
447 GET_LUA_PROC(lua_isnumber
)
448 GET_LUA_PROC(lua_isstring
)
449 GET_LUA_PROC(lua_iscfunction
)
450 GET_LUA_PROC(lua_isuserdata
)
451 GET_LUA_PROC(lua_type
)
452 GET_LUA_PROC(lua_typename
)
453 GET_LUA_PROC(lua_equal
)
454 GET_LUA_PROC(lua_rawequal
)
455 GET_LUA_PROC(lua_lessthan
)
456 GET_LUA_PROC(lua_tonumber
)
457 GET_LUA_PROC(lua_toboolean
)
458 GET_LUA_PROC(lua_tostring
)
459 GET_LUA_PROC(lua_strlen
)
460 GET_LUA_PROC(lua_tocfunction
)
461 GET_LUA_PROC(lua_touserdata
)
462 GET_LUA_PROC(lua_tothread
)
463 GET_LUA_PROC(lua_topointer
)
464 GET_LUA_PROC(lua_pushnil
)
465 GET_LUA_PROC(lua_pushnumber
)
466 GET_LUA_PROC(lua_pushlstring
)
467 GET_LUA_PROC(lua_pushstring
)
468 GET_LUA_PROC(lua_pushcclosure
)
469 GET_LUA_PROC(lua_pushboolean
)
470 GET_LUA_PROC(lua_pushlightuserdata
)
471 GET_LUA_PROC(lua_gettable
)
472 GET_LUA_PROC(lua_rawget
)
473 GET_LUA_PROC(lua_rawgeti
)
474 GET_LUA_PROC(lua_newtable
)
475 GET_LUA_PROC(lua_newuserdata
)
476 GET_LUA_PROC(lua_getmetatable
)
477 GET_LUA_PROC(lua_getfenv
)
478 GET_LUA_PROC(lua_settable
)
479 GET_LUA_PROC(lua_rawset
)
480 GET_LUA_PROC(lua_rawseti
)
481 GET_LUA_PROC(lua_setmetatable
)
482 GET_LUA_PROC(lua_setfenv
)
483 GET_LUA_PROC(lua_call
)
484 GET_LUA_PROC(lua_pcall
)
485 GET_LUA_PROC(lua_cpcall
)
486 GET_LUA_PROC(lua_load
)
487 GET_LUA_PROC(lua_dump
)
488 GET_LUA_PROC(lua_yield
)
489 GET_LUA_PROC(lua_resume
)
490 GET_LUA_PROC(lua_getgcthreshold
)
491 GET_LUA_PROC(lua_getgccount
)
492 GET_LUA_PROC(lua_setgcthreshold
)
493 GET_LUA_PROC(lua_version
)
494 GET_LUA_PROC(lua_error
)
495 GET_LUA_PROC(lua_next
)
496 GET_LUA_PROC(lua_concat
)
497 GET_LUA_PROC(lua_pushupvalues
)
498 GET_LUA_PROC(lua_getstack
)
499 GET_LUA_PROC(lua_getinfo
)
500 GET_LUA_PROC(lua_getlocal
)
501 GET_LUA_PROC(lua_setlocal
)
502 GET_LUA_PROC(lua_getupvalue
)
503 GET_LUA_PROC(lua_setupvalue
)
504 GET_LUA_PROC(lua_sethook
)
505 GET_LUA_PROC(lua_gethook
)
506 GET_LUA_PROC(lua_gethookmask
)
507 GET_LUA_PROC(lua_gethookcount
)
509 GET_LUA_PROC(luaL_openlib
)
510 GET_LUA_PROC(luaL_getmetafield
)
511 GET_LUA_PROC(luaL_callmeta
)
512 GET_LUA_PROC(luaL_typerror
)
513 GET_LUA_PROC(luaL_argerror
)
514 GET_LUA_PROC(luaL_checklstring
)
515 GET_LUA_PROC(luaL_optlstring
)
516 GET_LUA_PROC(luaL_checknumber
)
517 GET_LUA_PROC(luaL_optnumber
)
518 GET_LUA_PROC(luaL_checkstack
)
519 GET_LUA_PROC(luaL_checktype
)
520 GET_LUA_PROC(luaL_checkany
)
521 GET_LUA_PROC(luaL_newmetatable
)
522 GET_LUA_PROC(luaL_getmetatable
)
523 GET_LUA_PROC(luaL_checkudata
)
524 GET_LUA_PROC(luaL_where
)
525 GET_LUA_PROC(luaL_error
)
526 GET_LUA_PROC(luaL_findstring
)
527 GET_LUA_PROC(luaL_ref
)
528 GET_LUA_PROC(luaL_unref
)
529 GET_LUA_PROC(luaL_getn
)
530 GET_LUA_PROC(luaL_setn
)
531 GET_LUA_PROC(luaL_loadfile
)
532 GET_LUA_PROC(luaL_loadbuffer
)
533 GET_LUA_PROC(luaL_buffinit
)
534 GET_LUA_PROC(luaL_prepbuffer
)
535 GET_LUA_PROC(luaL_addlstring
)
536 GET_LUA_PROC(luaL_addstring
)
537 GET_LUA_PROC(luaL_addvalue
)
538 GET_LUA_PROC(luaL_pushresult
)
539 GET_LUA_PROC(lua_dofile
)
540 GET_LUA_PROC(lua_dostring
)
541 GET_LUA_PROC(lua_dobuffer
)
543 GET_LUA_PROC(luaopen_base
)
544 GET_LUA_PROC(luaopen_table
)
545 GET_LUA_PROC(luaopen_io
)
546 GET_LUA_PROC(luaopen_string
)
547 GET_LUA_PROC(luaopen_math
)
548 GET_LUA_PROC(luaopen_debug
)
549 GET_LUA_PROC(luaopen_loadlib
)