From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (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 2EBE7469710 for ; Fri, 8 May 2020 14:48:05 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id o14so286404ljp.4 for ; Fri, 08 May 2020 04:48:05 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 8 May 2020 14:47:11 +0300 Message-Id: <20200508114714.426908-5-gorcunov@gmail.com> In-Reply-To: <20200508114714.426908-1-gorcunov@gmail.com> References: <20200508114714.426908-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