[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: On Lua and C Modules (was Re: [ANN] luafaq.org source on GitHub)
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Sun, 30 Jun 2013 09:21:30 +0100
2013/6/28 Sean Conner <sean@conman.org>:
> I'm surprised that Lua doesn't look for just
>
> luaopen()
>
> as part of the search mechanism.
Putting aside name conflict issues in dynamic libraries (that may not
apply to your platforms), it's very easy to extend the module system
to implement the behaviour you describe. I wrote an example binary
loaded on the Lua wiki a while ago (for 5.1):
http://lua-users.org/wiki/BinaryModulesLoader
Simply replace the package.loadlib second argument with a constant
string, and voilà, you can move your DLLs around (provided you name
the entry point with that constant string).