mirror of
https://github.com/fluencelabs/redis
synced 2025-06-16 10:41:22 +00:00
JSON support for Lua scripting, based on work from @lp, thanks!. We are using the good and fast cjson by Mark Pulford.
This commit is contained in:
@ -271,12 +271,15 @@ void luaLoadLib(lua_State *lua, const char *libname, lua_CFunction luafunc) {
|
||||
lua_call(lua, 1, 0);
|
||||
}
|
||||
|
||||
LUALIB_API int (luaopen_cjson) (lua_State *L);
|
||||
|
||||
void luaLoadLibraries(lua_State *lua) {
|
||||
luaLoadLib(lua, "", luaopen_base);
|
||||
luaLoadLib(lua, LUA_TABLIBNAME, luaopen_table);
|
||||
luaLoadLib(lua, LUA_STRLIBNAME, luaopen_string);
|
||||
luaLoadLib(lua, LUA_MATHLIBNAME, luaopen_math);
|
||||
luaLoadLib(lua, LUA_DBLIBNAME, luaopen_debug);
|
||||
luaLoadLib(lua, "cjson", luaopen_cjson);
|
||||
|
||||
#if 0 /* Stuff that we don't load currently, for sandboxing concerns. */
|
||||
luaLoadLib(lua, LUA_LOADLIBNAME, luaopen_package);
|
||||
|
Reference in New Issue
Block a user