[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: FILE* on LuaJIT
- From: William Ahern <william@...>
- Date: Sat, 7 Sep 2013 19:59:52 -0700
I've got some code which wraps some internal objects with a FILE* handle
using fopencookie (Linux) and funopen (BSD, including OS X). These routines
allow specifying user callbacks (read, write, seek, and close) for FILE
operations.
Generating a LUA_FILEHANDLE userdata is relatively easy for Lua 5.1 and 5.2.
However, LuaJIT seems to tag it's LUA_FILEHANDLE with an internal type that
can't be faked.
Has anybody gotten around this? The only idea I can think of is to create a
LUA_FILEHANDLE to /dev/null, then swapping out the FILE* member. Any others?