Re: lua_CFunctions taking a cdata

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 1 Jun 2012 22:30:39 +1000

On 1 June 2012 00:57, Mike Pall <mike-1205@xxxxxxxxxx> wrote:
> I'm not sure that's a good idea to mix classic API functions with
> FFI data types. I really don't want to extend the classic API with
> support for handling cdata objects.
>
> That said, lua_type() returns 10 for cdata. And lua_topointer()
> returns a pointer to the data area of a cdata object. That's about
> it for cdata support in the classic API.
Could you please expose this in lua.h? (ie. #define LUA_TCDATA 10)
Good to know about topointer :)

The other thing I'd be interested in having exposed is a type getting
function....
imagine printf implemented as a lua_Cfunction: you'd want cdata types
such as int to be cast to the corresponding C type....

Other related posts: