[Tarantool-patches] [PATCH 1.10 6/9] module api: luaL_checkibuf & luaL_checkconstchar

Timur Safin tsafin at tarantool.org
Fri Sep 25 00:00:38 MSK 2020


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



More information about the Tarantool-patches mailing list