commit - cfac40fbb247b1bbbb8cfa6e88c102784562fe8f
commit + 1b0cc057f3b06138e61a47be4309200186691200
blob - e447fb627f0fc75c156441138e0d70f932d86bdc
blob + 443bd9025a086285fc3c0c0f912fc2ce0629b338
--- src/box/lua/console.c
+++ src/box/lua/console.c
*/
lua_setfield(L, -2, "formatter_lua");
- /* Output formatter in Lua mode */
- lua_serializer_init(L);
-
struct session_vtab console_session_vtab = {
.push = console_session_push,
.fd = console_session_fd,
blob - 3869f6e1da76fdd06dd2e32f86632a8448fc5b42
blob + e4f20c792b93f5c72433c2755660ddf4b54af04d
--- src/box/lua/serialize_lua.c
+++ src/box/lua/serialize_lua.c
"Buffer is too small");
static_assert(DT_IVAL_TO_STRING_BUFSIZE > DT_TO_STRING_BUFSIZE,
"Buffer is too small");
-
-/* Serializer for Lua output mode */
-static struct luaL_serializer *serializer_lua;
enum {
NODE_NONE_BIT = 0,
if (lua_isnumber(L, -1))
opts->indent_lvl = (int)lua_tonumber(L, -1);
lua_pop(L, 1);
-}
-
-/**
- * Initialize Lua serializer.
- */
-void
-lua_serializer_init(struct lua_State *L)
-{
- /*
- * We don't export it as a module
- * for a while, so the library
- * is kept empty.
- */
- static const luaL_Reg lualib[] = {
- {
- .name = NULL,
- },
- };
-
- serializer_lua = luaL_newserializer(L, NULL, lualib);
- serializer_lua->has_compact = 1;
- serializer_lua->encode_invalid_numbers = 1;
- serializer_lua->encode_load_metatables = 1;
- serializer_lua->encode_use_tostring = 1;
- serializer_lua->encode_invalid_as_nil = 1;
-
- /*
- * Keep a reference to this module so it
- * won't be unloaded.
- */
- lua_setfield(L, -2, "formatter_lua");
}
blob - 923e13be9267c6f5f3180e52edff1ef9d0ceb8b2
blob + 24bc79a01f161821966c8330e6d9cf3df9ba8534
--- src/box/lua/serialize_lua.h
+++ src/box/lua/serialize_lua.h
bool block_mode;
} lua_dumper_opts_t;
-void
-lua_serializer_init(struct lua_State *L);
-
int
lua_encode(lua_State *L, struct luaL_serializer *serializer,
lua_dumper_opts_t *opts);