[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Checking whether a shared library has been loaded
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 9 Feb 2015 13:19:11 -0200
> > No record is kept of anything loaded with "package.loadlib".
>
> The following session strongly seems to suggest that an
> undocumented feature of Lua 5.3, not present in Lua 5.2,
> is a table in the registry keyed by the filenames of libraries
> loaded with "package.loadlib".
Ah, Lua 5.3 replaced _CLIBS by an anonymous table whose key is a userdata.
_CLIBS is used for cleanup. It is an implementation detail and so is not
documented in the manual. So, yes, "package.loadlib" does record which
shared libraries have been loaded. See the first lines of luaopen_package:
http://www.lua.org/source/5.3/loadlib.c.html#luaopen_package
http://www.lua.org/source/5.2/loadlib.c.html#luaopen_package