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/>.
17 #include "../stdpch.h"
21 // #include "lua_loadlib.h"
24 #include "nel/misc/dynloadlib.h"
30 Tlua_newthread lua_newthread
;
31 Tlua_atpanic lua_atpanic
;
32 Tlua_gettop lua_gettop
;
33 Tlua_settop lua_settop
;
34 Tlua_pushvalue lua_pushvalue
;
35 Tlua_remove lua_remove
;
36 Tlua_insert lua_insert
;
37 Tlua_replace lua_replace
;
38 Tlua_checkstack lua_checkstack
;
40 Tlua_isnumber lua_isnumber
;
41 Tlua_isstring lua_isstring
;
42 Tlua_iscfunction lua_iscfunction
;
43 Tlua_isuserdata lua_isuserdata
;
45 Tlua_typename lua_typename
;
47 Tlua_rawequal lua_rawequal
;
48 Tlua_lessthan lua_lessthan
;
49 Tlua_tonumber lua_tonumber
;
50 Tlua_toboolean lua_toboolean
;
51 Tlua_tostring lua_tostring
;
52 Tlua_strlen lua_strlen
;
53 Tlua_tocfunction lua_tocfunction
;
54 Tlua_touserdata lua_touserdata
;
55 Tlua_tothread lua_tothread
;
56 Tlua_topointer lua_topointer
;
57 Tlua_pushnil lua_pushnil
;
58 Tlua_pushnumber lua_pushnumber
;
59 Tlua_pushlstring lua_pushlstring
;
60 Tlua_pushstring lua_pushstring
;
61 Tlua_pushvfstring lua_pushvfstring
;
62 Tlua_pushfstring lua_pushfstring
;
63 Tlua_pushcclosure lua_pushcclosure
;
64 Tlua_pushboolean lua_pushboolean
;
65 Tlua_pushlightuserdata lua_pushlightuserdata
;
66 Tlua_gettable lua_gettable
;
67 Tlua_rawget lua_rawget
;
68 Tlua_rawgeti lua_rawgeti
;
69 Tlua_newtable lua_newtable
;
70 Tlua_newuserdata lua_newuserdata
;
71 Tlua_getmetatable lua_getmetatable
;
72 Tlua_getfenv lua_getfenv
;
73 Tlua_settable lua_settable
;
74 Tlua_rawset lua_rawset
;
75 Tlua_rawseti lua_rawseti
;
76 Tlua_setmetatable lua_setmetatable
;
77 Tlua_setfenv lua_setfenv
;
80 Tlua_cpcall lua_cpcall
;
84 Tlua_resume lua_resume
;
85 Tlua_getgcthreshold lua_getgcthreshold
;
86 Tlua_getgccount lua_getgccount
;
87 Tlua_setgcthreshold lua_setgcthreshold
;
88 Tlua_version lua_version
;
91 Tlua_concat lua_concat
;
92 Tlua_pushupvalues lua_pushupvalues
;
93 Tlua_getstack lua_getstack
;
94 Tlua_getinfo lua_getinfo
;
95 Tlua_getlocal lua_getlocal
;
96 Tlua_setlocal lua_setlocal
;
97 Tlua_getupvalue lua_getupvalue
;
98 Tlua_setupvalue lua_setupvalue
;
99 Tlua_sethook lua_sethook
;
100 Tlua_gethook lua_gethook
;
101 Tlua_gethookmask lua_gethookmask
;
102 Tlua_gethookcount lua_gethookcount
;
104 TluaL_openlib luaL_openlib
;
105 TluaL_getmetafield luaL_getmetafield
;
106 TluaL_callmeta luaL_callmeta
;
107 TluaL_typerror luaL_typerror
;
108 TluaL_argerror luaL_argerror
;
109 TluaL_checklstring luaL_checklstring
;
110 TluaL_optlstring luaL_optlstring
;
111 TluaL_checknumber luaL_checknumber
;
112 TluaL_optnumber luaL_optnumber
;
113 TluaL_checkstack luaL_checkstack
;
114 TluaL_checktype luaL_checktype
;
115 TluaL_checkany luaL_checkany
;
116 TluaL_newmetatable luaL_newmetatable
;
117 TluaL_getmetatable luaL_getmetatable
;
118 TluaL_checkudata luaL_checkudata
;
119 TluaL_where luaL_where
;
120 TluaL_error luaL_error
;
121 TluaL_findstring luaL_findstring
;
123 TluaL_unref luaL_unref
;
124 TluaL_getn luaL_getn
;
125 TluaL_setn luaL_setn
;
126 TluaL_loadfile luaL_loadfile
;
127 TluaL_loadbuffer luaL_loadbuffer
;
128 TluaL_buffinit luaL_buffinit
;
129 TluaL_prepbuffer luaL_prepbuffer
;
130 TluaL_addlstring luaL_addlstring
;
131 TluaL_addstring luaL_addstring
;
132 TluaL_addvalue luaL_addvalue
;
133 TluaL_pushresult luaL_pushresult
;
134 Tlua_dofile lua_dofile
;
135 Tlua_dostring lua_dostring
;
136 Tlua_dobuffer lua_dobuffer
;
138 Tluaopen_base luaopen_base
;
139 Tluaopen_table luaopen_table
;
140 Tluaopen_io luaopen_io
;
141 Tluaopen_string luaopen_string
;
142 Tluaopen_math luaopen_math
;
143 Tluaopen_debug luaopen_debug
;
144 Tluaopen_loadlib luaopen_loadlib
;
149 HMODULE libHandle
= ::LoadLibrary("lua.dll");
150 if (!libHandle
) return false;
151 #define GET_LUA_PROC(name) name = (T##name) ::GetProcAddress(libHandle, #name); if (!name) return false;
153 GET_LUA_PROC(lua_open
)
154 GET_LUA_PROC(lua_close
)
155 GET_LUA_PROC(lua_newthread
)
156 GET_LUA_PROC(lua_atpanic
)
157 GET_LUA_PROC(lua_gettop
)
158 GET_LUA_PROC(lua_settop
)
159 GET_LUA_PROC(lua_pushvalue
)
160 GET_LUA_PROC(lua_remove
)
161 GET_LUA_PROC(lua_insert
)
162 GET_LUA_PROC(lua_replace
)
163 GET_LUA_PROC(lua_checkstack
)
164 GET_LUA_PROC(lua_xmove
)
165 GET_LUA_PROC(lua_isnumber
)
166 GET_LUA_PROC(lua_isstring
)
167 GET_LUA_PROC(lua_iscfunction
)
168 GET_LUA_PROC(lua_isuserdata
)
169 GET_LUA_PROC(lua_type
)
170 GET_LUA_PROC(lua_typename
)
171 GET_LUA_PROC(lua_equal
)
172 GET_LUA_PROC(lua_rawequal
)
173 GET_LUA_PROC(lua_lessthan
)
174 GET_LUA_PROC(lua_tonumber
)
175 GET_LUA_PROC(lua_toboolean
)
176 GET_LUA_PROC(lua_tostring
)
177 GET_LUA_PROC(lua_strlen
)
178 GET_LUA_PROC(lua_tocfunction
)
179 GET_LUA_PROC(lua_touserdata
)
180 GET_LUA_PROC(lua_tothread
)
181 GET_LUA_PROC(lua_topointer
)
182 GET_LUA_PROC(lua_pushnil
)
183 GET_LUA_PROC(lua_pushnumber
)
184 GET_LUA_PROC(lua_pushlstring
)
185 GET_LUA_PROC(lua_pushstring
)
186 GET_LUA_PROC(lua_pushcclosure
)
187 GET_LUA_PROC(lua_pushboolean
)
188 GET_LUA_PROC(lua_pushlightuserdata
)
189 GET_LUA_PROC(lua_gettable
)
190 GET_LUA_PROC(lua_rawget
)
191 GET_LUA_PROC(lua_rawgeti
)
192 GET_LUA_PROC(lua_newtable
)
193 GET_LUA_PROC(lua_newuserdata
)
194 GET_LUA_PROC(lua_getmetatable
)
195 GET_LUA_PROC(lua_getfenv
)
196 GET_LUA_PROC(lua_settable
)
197 GET_LUA_PROC(lua_rawset
)
198 GET_LUA_PROC(lua_rawseti
)
199 GET_LUA_PROC(lua_setmetatable
)
200 GET_LUA_PROC(lua_setfenv
)
201 GET_LUA_PROC(lua_call
)
202 GET_LUA_PROC(lua_pcall
)
203 GET_LUA_PROC(lua_cpcall
)
204 GET_LUA_PROC(lua_load
)
205 GET_LUA_PROC(lua_dump
)
206 GET_LUA_PROC(lua_yield
)
207 GET_LUA_PROC(lua_resume
)
208 GET_LUA_PROC(lua_getgcthreshold
)
209 GET_LUA_PROC(lua_getgccount
)
210 GET_LUA_PROC(lua_setgcthreshold
)
211 GET_LUA_PROC(lua_version
)
212 GET_LUA_PROC(lua_error
)
213 GET_LUA_PROC(lua_next
)
214 GET_LUA_PROC(lua_concat
)
215 GET_LUA_PROC(lua_pushupvalues
)
216 GET_LUA_PROC(lua_getstack
)
217 GET_LUA_PROC(lua_getinfo
)
218 GET_LUA_PROC(lua_getlocal
)
219 GET_LUA_PROC(lua_setlocal
)
220 GET_LUA_PROC(lua_getupvalue
)
221 GET_LUA_PROC(lua_setupvalue
)
222 GET_LUA_PROC(lua_sethook
)
223 GET_LUA_PROC(lua_gethook
)
224 GET_LUA_PROC(lua_gethookmask
)
225 GET_LUA_PROC(lua_gethookcount
)
227 GET_LUA_PROC(luaL_openlib
)
228 GET_LUA_PROC(luaL_getmetafield
)
229 GET_LUA_PROC(luaL_callmeta
)
230 GET_LUA_PROC(luaL_typerror
)
231 GET_LUA_PROC(luaL_argerror
)
232 GET_LUA_PROC(luaL_checklstring
)
233 GET_LUA_PROC(luaL_optlstring
)
234 GET_LUA_PROC(luaL_checknumber
)
235 GET_LUA_PROC(luaL_optnumber
)
236 GET_LUA_PROC(luaL_checkstack
)
237 GET_LUA_PROC(luaL_checktype
)
238 GET_LUA_PROC(luaL_checkany
)
239 GET_LUA_PROC(luaL_newmetatable
)
240 GET_LUA_PROC(luaL_getmetatable
)
241 GET_LUA_PROC(luaL_checkudata
)
242 GET_LUA_PROC(luaL_where
)
243 GET_LUA_PROC(luaL_error
)
244 GET_LUA_PROC(luaL_findstring
)
245 GET_LUA_PROC(luaL_ref
)
246 GET_LUA_PROC(luaL_unref
)
247 GET_LUA_PROC(luaL_getn
)
248 GET_LUA_PROC(luaL_setn
)
249 GET_LUA_PROC(luaL_loadfile
)
250 GET_LUA_PROC(luaL_loadbuffer
)
251 GET_LUA_PROC(luaL_buffinit
)
252 GET_LUA_PROC(luaL_prepbuffer
)
253 GET_LUA_PROC(luaL_addlstring
)
254 GET_LUA_PROC(luaL_addstring
)
255 GET_LUA_PROC(luaL_addvalue
)
256 GET_LUA_PROC(luaL_pushresult
)
257 GET_LUA_PROC(lua_dofile
)
258 GET_LUA_PROC(lua_dostring
)
259 GET_LUA_PROC(lua_dobuffer
)
261 GET_LUA_PROC(luaopen_base
)
262 GET_LUA_PROC(luaopen_table
)
263 GET_LUA_PROC(luaopen_io
)
264 GET_LUA_PROC(luaopen_string
)
265 GET_LUA_PROC(luaopen_math
)
266 GET_LUA_PROC(luaopen_debug
)
267 GET_LUA_PROC(luaopen_loadlib
)