Re: Accessing ctype of FFI cdata from the Lua C API

  • From: Mike Pall <mike-1301@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 27 Jan 2013 12:30:32 +0100

Simon Cooke wrote:
> Now to make this type-safe I can check the corresponding ctype number
> for the cdata [2] by essentially invoking 'tonumber(ffi.typeof(c))'
> via the C API, but is there an easier/quicker/undocumented way to get
> this information directly?

Nope. The FFI and the classic Lua/C API don't mix.

But I wonder why you're worrying about type-safety when this is
only for the purpose of migration, anyway?

--Mike

Other related posts: