Expose lush global as a standard library (issue #26)
Register luaopen_lush() in stdlibs so the lush table is available as a global. Users can now extend the shell by adding functions to lush.builtins. The OP_LUSH VM access via integer keys is preserved.
This commit is contained in:
4
lualib.h
4
lualib.h
@@ -54,6 +54,10 @@ LUAMOD_API int (luaopen_table) (lua_State *L);
|
||||
#define LUA_UTF8LIBK (LUA_TABLIBK << 1)
|
||||
LUAMOD_API int (luaopen_utf8) (lua_State *L);
|
||||
|
||||
#define LUA_LUSHLIBNAME "lush"
|
||||
#define LUA_LUSHLIBK (LUA_UTF8LIBK << 1)
|
||||
LUAMOD_API int (luaopen_lush) (lua_State *L);
|
||||
|
||||
|
||||
/* open selected libraries */
|
||||
LUALIB_API void (luaL_openselectedlibs) (lua_State *L, int load, int preload);
|
||||
|
||||
Reference in New Issue
Block a user