lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I just updated and re-uploaded the changed version to reflect the
name-change from lua_version() and lua_impport() to luaLM_version() and
luaLM_import()
new binaries in the zip also.

From: "Ignacio Castaño" <castanyo@yahoo.es>
> Some comments about the code:
>
> 1. I think you can remove the "extern int tolua_SDL_open(lua_State *L);"
:-)

OOOPS ;) out it goes, missed it while cleaning up

> 2. On win32 you can also export the functions by adding them to a .def
file,
> instead of using __declspec(dllexport). I think it'll look much cleaner.
hmmm, that might actually be cleaner, but I'll stick with the one-file
approach for this. That way it's clearer, wht need's to be there in one
single file.

> In fact, if you have an existing lua extension, turning it into a lua
> 'module' is something as simple as adding the following:
>
> int lua_import(lua_State* L) {
>   return your_module_init_function(L);
> }
> const char* lua_version(void) {
>   return LUA_VERSION;
> }

That's the absolute beauty of it. It doesn't take more.
A big thanks to Ignacio & Thatcher for making this possible.

-Martin