From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp15.mail.ru (smtp15.mail.ru [94.100.176.133]) (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 E406744643F for ; Fri, 25 Sep 2020 00:01:17 +0300 (MSK) From: Timur Safin Date: Fri, 25 Sep 2020 00:00:38 +0300 Message-Id: <825fc22c4606b0f4d708b46d2b0c40057f575237.1600955796.git.tsafin@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1.10 6/9] module api: luaL_checkibuf & luaL_checkconstchar List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: v.shpilevoy@tarantool.org, alexander.turenko@tarantool.org Cc: tarantool-patches@dev.tarantool.org Moved `luaL_checkibuf` & `luaL_checkconstchar` to the public part of module api. Part of #5273 --- src/lua/utils.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/lua/utils.h b/src/lua/utils.h index 4eb5ce566..ac6682d80 100644 --- a/src/lua/utils.h +++ b/src/lua/utils.h @@ -565,6 +565,23 @@ luaT_temp_luastate(int *coro_ref, int *top); void luaT_release_temp_luastate(struct lua_State *L, int coro_ref, int top); +/** + * 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 * +luaL_checkibuf(struct lua_State *L, int idx); + +/** + * Check if a value on @a L stack by index @a idx is pointer at + * char or const char. '(char *)NULL' is also considered a valid + * char pointer. + */ +int +luaL_checkconstchar(struct lua_State *L, int idx, const char **res, + uint32_t *cdata_type_p); + /** \endcond public */ void -- 2.20.1