MCPcopy Create free account
hub / github.com/apache/kvrocks / LoadLibraries

Function LoadLibraries

src/storage/scripting.cc:938–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

936}
937
938void LoadLibraries(lua_State *lua) {
939 auto load_lib = [](lua_State *lua, const char *libname, lua_CFunction func) {
940 lua_pushcfunction(lua, func);
941 lua_pushstring(lua, libname);
942 lua_call(lua, 1, 0);
943 };
944
945 load_lib(lua, "", luaopen_base);
946 load_lib(lua, LUA_TABLIBNAME, luaopen_table);
947 load_lib(lua, LUA_STRLIBNAME, luaopen_string);
948 load_lib(lua, LUA_MATHLIBNAME, luaopen_math);
949 load_lib(lua, LUA_DBLIBNAME, luaopen_debug);
950 load_lib(lua, "cjson", luaopen_cjson);
951 load_lib(lua, "struct", luaopen_struct);
952 load_lib(lua, "cmsgpack", luaopen_cmsgpack);
953 load_lib(lua, "bit", luaopen_bit);
954}
955
956/* Returns a table with a single field 'field' set to the string value
957 * passed as argument. This helper function is handy when returning

Callers 1

CreateStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected