[Tarantool-patches] [PATCH 03/14] WIP: module api/lua: add luaL_iscdata() function

Alexander Turenko alexander.turenko at tarantool.org
Fri Oct 9 00:46:28 MSK 2020


> > diff --git a/src/exports.h b/src/exports.h
> > index 7861bb529..08ca03507 100644
> > --- a/src/exports.h
> > +++ b/src/exports.h
> > @@ -355,6 +355,7 @@ EXPORT(luaL_fileresult)
> >  EXPORT(luaL_findtable)
> >  EXPORT(luaL_getmetafield)
> >  EXPORT(luaL_gsub)
> > +EXPORT(luaL_iscdata)
> >  EXPORT(luaL_iscallable)
> 
> 1. 'd' > 'a', so luaL_isc*d*ata should come after luaL_isc*a*llable.

You're machine!

Sure, will fix in the next patchset version.

> 
> >  EXPORT(luaL_loadbuffer)
> >  EXPORT(luaL_loadbufferx)
> > diff --git a/src/lua/utils.h b/src/lua/utils.h
> > index 7e02a05f2..e9dd27d08 100644
> > --- a/src/lua/utils.h
> > +++ b/src/lua/utils.h
> > @@ -78,6 +78,26 @@ luaL_pushuuid(struct lua_State *L);
> >  
> >  /** \cond public */
> >  
> > +/**
> > + * @brief Checks whether a value on the Lua stack is a cdata.
> > + *
> > + * Unlike <luaL_checkcdata>() this function does not raise an
> > + * error. It is useful to raise a domain specific error.
> > + *
> > + * Lua API and module API don't expose LUA_TCDATA constant.
> > + * We have no guarantee that this constant will remain the same in
> > + * future LuaJIT versions. So this function should be used in
> > + * modules instead of `lua_type(L, idx) == LUA_TCDATA`.
> > + *
> > + * @param L Lua State
> > + * @param idx stack index
> 
> 2. I am going to go OCD here, but lets start sentences from a capital
> letter and end with a dot. Here and in all the other commits in
> their places.

Okay.


More information about the Tarantool-patches mailing list