lua-users home
lua-l archive

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


> Could the authors (or other knowledgable sources) tell, what exactly would
> be in 5.0 regarding dynamic extensions.
> 
> I've drafted one such extension module (dll/so that knows how to link
itself
> with Lua) but noticed that the lua_... functions need (of course!) to be
> provided to the module by function pointers or otherwise (since they live
on
> the engine side of the dll/so barrier). I'll want to sleep over this
before
> using "brute force". If there's a more clever technique already on the
way,
> I'd like to know.

I cannot speak in behalf of Lua's authors, but I understood there is only
base support for loading extensions, the gory (and not portable) details being
left to the implementers. I believe the main reason to support this is to
provide an uniform interface to this much asked functionality.

The method I know, working at least for Windows' DLLs (implemented in an
unrelated project), is to call at initialization time a DLL function, giving it
a structure (or table) holding all the needed function pointers. Thus, the
DLL can have access to the Lua library.
Another method is to force Lua code to be in a DLL (or .so), so the library
can load it too. Since I prefer standalone applications (to avoid DLL hell),
this is less appealing.

Regards.

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--

GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net