From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E0152469710 for ; Tue, 12 May 2020 16:51:46 +0300 (MSK) Received: by mail-lf1-f65.google.com with SMTP id z22so10660286lfd.0 for ; Tue, 12 May 2020 06:51:46 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 12 May 2020 16:50:49 +0300 Message-Id: <20200512135052.221379-5-gorcunov@gmail.com> In-Reply-To: <20200512135052.221379-1-gorcunov@gmail.com> References: <20200512135052.221379-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 4/7] box/console: rename luaL_yaml_default to serializer_yaml List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml As we gonna implement lua output serializer lets rename luaL_yaml_default to serializer_yaml which will be more general name, for other serializers we will use same serializer_ prefix. Part-of #4682 Signed-off-by: Cyrill Gorcunov --- src/box/lua/console.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/box/lua/console.c b/src/box/lua/console.c index 734c0ee47..c8e0dea58 100644 --- a/src/box/lua/console.c +++ b/src/box/lua/console.c @@ -49,7 +49,7 @@ extern char serpent_lua[]; -static struct luaL_serializer *luaL_yaml_default = NULL; +static struct luaL_serializer *serializer_yaml; /* * Completion engine (Mike Paul's). @@ -369,7 +369,7 @@ lbox_console_format_yaml(struct lua_State *L) } lua_replace(L, 1); lua_settop(L, 1); - return lua_yaml_encode(L, luaL_yaml_default, NULL, NULL); + return lua_yaml_encode(L, serializer_yaml, NULL, NULL); } int @@ -404,7 +404,7 @@ console_dump_plain(struct lua_State *L, uint32_t *size) { enum output_format fmt = console_get_output_format(); if (fmt == OUTPUT_FORMAT_YAML) { - int rc = lua_yaml_encode(L, luaL_yaml_default, "!push!", + int rc = lua_yaml_encode(L, serializer_yaml, "!push!", "tag:tarantool.io/push,2018"); if (rc == 2) { /* @@ -566,11 +566,11 @@ tarantool_lua_console_init(struct lua_State *L) lua_pushcclosure(L, lbox_console_readline, 1); lua_setfield(L, -2, "readline"); - luaL_yaml_default = lua_yaml_new_serializer(L); - luaL_yaml_default->encode_invalid_numbers = 1; - luaL_yaml_default->encode_load_metatables = 1; - luaL_yaml_default->encode_use_tostring = 1; - luaL_yaml_default->encode_invalid_as_nil = 1; + serializer_yaml = lua_yaml_new_serializer(L); + serializer_yaml->encode_invalid_numbers = 1; + serializer_yaml->encode_load_metatables = 1; + serializer_yaml->encode_use_tostring = 1; + serializer_yaml->encode_invalid_as_nil = 1; /* * Hold reference to the formatter in module local * variable. -- 2.26.2