Re: C data reflection in LuaJIT

  • From: Mike Pall <mike-1410@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 5 Oct 2014 13:32:37 +0200

Peter Colberg wrote:
> Could you take a quick look at the attached patch and test? It adds
> three minimal functions ffi.elemtypeof(), ffi.fieldtypeof(), and
> ffi.fieldsof().

I think that API is not minimal enough and incomplete, too. I'd go
for a single low-level function that only does a ctype_get() with
bounds-checked CTypeID, returning a CType* cdata object or nil.
Adding the definition of CType* to the predefined types is
probably the trickiest part of that.

--Mike

Other related posts: