Re: lua_CFunctions taking a cdata

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 11 Jul 2012 23:43:29 +1000

On 1 June 2012 22:30, Daurnimator <quae@xxxxxxxxxxxxxxx> wrote:
> The other thing I'd be interested in having exposed is a type getting
> function....

I've got in a similar situation again now;
I've got a luajit being controlled by another; and I'd like to
marshall CDATA objects across.

I essentially need a pointer to it, and the type...
The former is provided by lua_topointer; the latter I can get by doing
`tostring`, but of course that isn't very stable (eg, if there was a
metatype) or efficient.
Could you please add a function to the luajit api that returns the cdata type?

const char* luajit_cdatatype ( lua_State *L , int index )
    returns NULL if the object is not of cdata type

Other related posts: