From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 9E447469719 for ; Fri, 16 Oct 2020 01:04:08 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <74b0e544-76c1-9641-0883-4f468c6cfd5b@tarantool.org> Date: Fri, 16 Oct 2020 00:04:07 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2.X v4 3/4] module api: introduced luaT_toibuf instead of luaL_checkibuf List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Timur Safin , alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Hi! Thanks for the patch! Firstly, I agree with Alexander's comments. Secondly, see my comment below. > diff --git a/src/lua/utils.h b/src/lua/utils.h > index e80e2b1a2..5e902b94e 100644 > --- a/src/lua/utils.h > +++ b/src/lua/utils.h > @@ -539,6 +539,14 @@ luaT_tolstring(lua_State *L, int idx, size_t *ssize); > LUA_API int > luaL_iscallable(lua_State *L, int idx); > > +/** > + * Check if a value on @a L stack by index @a idx is an ibuf > + * object. Both 'struct ibuf' and 'struct ibuf *' are accepted. > + * Returns NULL, if can't convert - not an ibuf object. > + */ > +struct ibuf * > +luaT_toibuf(struct lua_State *L, int idx); AFAIR, we have decided to use box_ibuf_t, and not export struct ibuf in module.h.