[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Ability to change C module by mere file renaming (Lua 5.1)
- From: Klaus Ripke <paul-lua@...>
- Date: Mon, 28 Nov 2005 00:39:50 +0100
On Sun, Nov 27, 2005 at 07:19:20PM -0300, Alex Queiroz wrote:
> On 27/11/05, Asko Kauppi <email@example.com> wrote:
> > Now, why make it so complicated? Why not just say, that in the
> > absence of "luaopen_myfilename()" function, a "luaopen_init()" (or
> > similar) will be called.
> You can't have several "luaopen_init()" functions linked
> together, even dinamically.
right, you can not really have them linked together,
yet you can dlopen several objects having such a function,
as dlopen does not try to "link" the exported symbols.
actually it's common for any object to export such special
symbols like _init and _fini, which are used e.g. to support
C++ global ctors/dtors. on such systems _init could do
most of the work of luaopen_init (but not return something).