From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 66A20446439 for ; Fri, 2 Oct 2020 19:14:31 +0300 (MSK) From: "Timur Safin" References: <96922008cb146eaa04cb727472eda3e71f2e7bc8.1600955781.git.tsafin@tarantool.org> <185c95b5-edc6-10d0-50c0-ba7c086fc97a@tarantool.org> <20200929050900.4xzupgi24zvddgfo@tkn_work_nb> In-Reply-To: <20200929050900.4xzupgi24zvddgfo@tkn_work_nb> Date: Fri, 2 Oct 2020 19:14:31 +0300 Message-ID: <0adc01d698d7$1cbac0c0$56304240$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH 2.X 4/7] module api: luaL_register_module & luaL_register_type List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Alexander Turenko' , 'Vladislav Shpilevoy' Cc: tarantool-patches@dev.tarantool.org : From: Alexander Turenko : Subject: Re: [Tarantool-patches] [PATCH 2.X 4/7] module api: : luaL_register_module & luaL_register_type : : > > diff --git a/src/lua/utils.h b/src/lua/utils.h : > > index 7639cd64a..9b1fe7e57 100644 : > > --- a/src/lua/utils.h : > > +++ b/src/lua/utils.h : > > @@ -78,6 +78,8 @@ luaL_pushuuid(struct lua_State *L); : > > : > > /** \cond public */ : > > : > > +struct luaL_Reg; : > : > 1. It does not seem to be public. How are users supposed to work with : that? : > Igor, could you please take a look at this? : > : > If you need it so badly, at least we need a wrapper around luaL_Reg : > or we need to expose it and document too. Probably Igor has better : ideas. : : It is exposed from lauxlib.h, no need to duplicate in the module API. Didn't know that - good point, thanks! : : > : > > + : > > /** : > > * @brief Checks whether a value on the Lua stack is a cdata. : > > * : > > @@ -442,6 +444,8 @@ luaL_checkfield(struct lua_State *L, struct : luaL_serializer *cfg, int idx, : > > luaL_convertfield(L, cfg, idx, field); : > > } : > > : > > +/** \cond public */ : > > + : > > void : > > luaL_register_type(struct lua_State *L, const char *type_name, : > > const struct luaL_Reg *methods); : > : > 2. These newly exported methods don't have a single comment. Why? : : luaL_register_*() are our helpers around luaL_register(), AFAIR. A : module should use the latter.