diff -urN luasocket-1.4/luasocket.c luasocket-1.4-loadmodule/luasocket.c --- luasocket-1.4/luasocket.c 2001-09-27 16:21:34.000000000 -0400 +++ luasocket-1.4-loadmodule/luasocket.c 2002-12-07 00:49:22.000000000 -0500 @@ -1652,6 +1652,22 @@ /*=========================================================================*\ * Module exported functions \*=========================================================================*/ + + +/*-------------------------------------------------------------------------*\ +* Hooks for loadmodule. +* Under Linux, compile with: +* gcc -shared -o libluasocket.so luasocket.c -O2 -I../lua-4.0.1-loadmodule/include -L../lua-4.0.1-loadmodule/lib -llua-4.0 -llualib-4.0 -DDLL_EXPORT="" +* Under MinGW, compile with: +* gcc -c luasocket.c -O2 -I../lua-4.0.1-loadmodule/include/ -DDLL_EXPORT='__declspec(dllexport)' -DWIN32 +* dllwrap luasocket.o -o luasocket.dll -L../lua-4.0.1-loadmodule/bin -llua-4.0 -llualib-4.0 -lws2_32 --add-stdcall-alias +\*-------------------------------------------------------------------------*/ +DLL_EXPORT const char* luaLM_version() +{ + return LUA_VERSION; +} +DLL_EXPORT int luaLM_import(lua_State *L) +{ + return lua_socketlibopen(L); +} + /*-------------------------------------------------------------------------*\ * Initializes the library interface with Lua and the socket library. * Defines the symbols exported to Lua.