[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Load .so library dynamically from C
- From: Viacheslav Usov <via.usov@...>
- Date: Mon, 14 Sep 2020 16:20:29 +0200
On Mon, Sep 14, 2020 at 9:10 AM Александр Машин <traditio.ru@gmail.com> wrote:
> is there a C in Lua distribution function that does this?
I think your code is equivalent to the following Lua code:
_ENV[global] = package.loadlib(path, 'luaopen_' .. global)()
Then again, it is not clear why this should not just be:
_ENV[global] = require(global)
There are several ways to execute Lua code from a C host, for example,
luaL_dostring().
Cheers,
V.