lua-users home
lua-l archive

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


Irayo wrote:
Martin wrote:
As I try to learn how to embed and extend lua into/with my program
I found some lack of information in reference manual (or I see
them as such).

[...]
I found that argument LUA_XXXLIBNAME for luaopen_xxx is not
in 1:1 relation with name of library. Here is copy from linit.c
that shows which library needs which argument:
Lua 5.1 Reference Manual, chapter 5:

"To have access to these libraries, the C host program should call the luaL_openlibs function, which opens all standard libraries. Alternatively, it can open them individually by calling luaopen_base (for the basic library), luaopen_package (for the package library), luaopen_string (for the string library), luaopen_table (for the table library), luaopen_math (for the mathematical library), luaopen_io (for the I/O library), luaopen_os (for the Operating System library), and luaopen_debug (for the debug library). These functions are declared in lualib.h and should not be called directly: you must call them like any other Lua C function, e.g., by using lua_call."
Excuse me, I misunderstood your meaning at first. The XXXLIBNAME macros are indeed not included in the manual.

Sorry.

--
Irayo