# peek-luadecls-2.txt # This is part of peek.lua, that is part of the DaVinci project. # See: # # Author: Eduardo Ochs # Version: 2007aug05 # This is the output of # (find-lua51sh "cd src/; gcc -E -x c lstate.h") # (find-lua51sh "cd src/; gcc -E -x c lstate.h | grep -v '^#'") # after some more hand-tuning... # Compare: # (find-tkdiff "peek-luadecls-1.txt" "peek-luadecls-2.txt") typedef int ptrdiff_t; typedef unsignedint size_t; typedef int wchar_t; union:luai_Cast { double l_d; long l_l; }; typedef struct:lua_State lua_State; typedef int (lua_State* L)* lua_CFunction; typedef char* (lua_State* L, void* ud, size_t* sz)* lua_Reader; typedef int (lua_State* L, void* p, size_t sz, void* ud)* lua_Writer; typedef void* (void* ud, void* ptr, size_t osize, size_t nsize)* lua_Alloc; typedef double lua_Number; typedef ptrdiff_t lua_Integer; typedef struct:lua_Debug lua_Debug; typedef void (lua_State* L, lua_Debug* ar)* lua_Hook; struct:lua_Debug { int event; char* name; char* namewhat; char* what; char* source; int currentline; int nups; int linedefined; int lastlinedefined; char[60] short_src; int i_ci; }; typedef unsignedint lu_int32; typedef size_t lu_mem; typedef ptrdiff_t l_mem; typedef unsignedchar lu_byte; typedef union:L_Umaxalign { double u; void* s; long l; } L_Umaxalign; typedef double l_uacNumber; typedef lu_int32 Instruction; typedef union:GCObject GCObject; typedef struct:GCheader { GCObject* next; lu_byte tt; lu_byte marked; } GCheader; typedef union:Value { GCObject* gc; void* p; lua_Number n; int b; } Value; typedef struct:lua_TValue { Value value; int tt; } TValue; typedef TValue* StkId; struct:TString__tsv { GCObject* next; lu_byte tt; lu_byte marked; lu_byte reserved; unsigned int hash; size_t len; }; typedef union:TString { L_Umaxalign dummy; struct:TString__tsv tsv; } TString; struct:Udata__uv { GCObject* next; lu_byte tt; lu_byte marked; struct:Table* metatable; struct:Table* env; size_t len; }; typedef union:Udata { L_Umaxalign dummy; struct:Udata__uv uv; } Udata; typedef struct:Proto { GCObject* next; lu_byte tt; lu_byte marked; TValue* k; Instruction* code; struct:Proto** p; int* lineinfo; struct:LocVar* locvars; TString** upvalues; TString* source; int sizeupvalues; int sizek; int sizecode; int sizelineinfo; int sizep; int sizelocvars; int linedefined; int lastlinedefined; GCObject* gclist; lu_byte nups; lu_byte numparams; lu_byte is_vararg; lu_byte maxstacksize; } Proto; typedef struct:LocVar { TString* varname; int startpc; int endpc; } LocVar; struct:UpVal__u__l { struct:UpVal* prev; struct:UpVal* next; }; union:UpVal__u { TValue value; struct:UpVal__u__l l; }; typedef struct:UpVal { GCObject* next; lu_byte tt; lu_byte marked; TValue* v; union:UpVal__u u; } UpVal; typedef struct:CClosure { GCObject* next; lu_byte tt; lu_byte marked; lu_byte isC; lu_byte nupvalues; GCObject* gclist; struct:Table* env; lua_CFunction f; TValue[1] upvalue; } CClosure; typedef struct:LClosure { GCObject* next; lu_byte tt; lu_byte marked; lu_byte isC; lu_byte nupvalues; GCObject* gclist; struct:Table* env; struct:Proto* p; UpVal*[1] upvals; } LClosure; typedef union:Closure { CClosure c; LClosure l; } Closure; struct:TKey__nk { Value value; int tt; struct:Node* next; }; typedef union:TKey { struct:TKey__nk nk; TValue tvk; } TKey; typedef struct:Node { TValue i_val; TKey i_key; } Node; typedef struct:Table { GCObject* next; lu_byte tt; lu_byte marked; lu_byte flags; lu_byte lsizenode; struct:Table* metatable; TValue* array; Node* node; Node* lastfree; GCObject* gclist; int sizearray; } Table; typedef struct:Zio ZIO; typedef struct:Mbuffer { char* buffer; size_t n; size_t buffsize; } Mbuffer; struct:Zio { size_t n; char* p; lua_Reader reader; void* data; lua_State* L; }; struct:lua_longjmp; typedef struct:stringtable { GCObject** hash; lu_int32 nuse; int size; } stringtable; typedef struct:CallInfo { StkId base; StkId func; StkId top; Instruction* savedpc; int nresults; int tailcalls; } CallInfo; typedef struct:global_State { stringtable strt; lua_Alloc frealloc; void* ud; lu_byte currentwhite; lu_byte gcstate; int sweepstrgc; GCObject* rootgc; GCObject** sweepgc; GCObject* gray; GCObject* grayagain; GCObject* weak; GCObject* tmudata; Mbuffer buff; lu_mem GCthreshold; lu_mem totalbytes; lu_mem estimate; lu_mem gcdept; int gcpause; int gcstepmul; lua_CFunction panic; TValue l_registry; struct:lua_State* mainthread; UpVal uvhead; struct:Table*[9] mt; TString*[17] tmname; } global_State; struct:lua_State { GCObject* next; lu_byte tt; lu_byte marked; lu_byte status; StkId top; StkId base; global_State* l_G; CallInfo* ci; Instruction* savedpc; StkId stack_last; StkId stack; CallInfo* end_ci; CallInfo* base_ci; int stacksize; int size_ci; unsigned short nCcalls; lu_byte hookmask; lu_byte allowhook; int basehookcount; int hookcount; lua_Hook hook; TValue l_gt; TValue env; GCObject* openupval; GCObject* gclist; struct:lua_longjmp* errorJmp; ptrdiff_t errfunc; }; union:GCObject { GCheader gch; union:TString ts; union:Udata u; union:Closure cl; struct:Table h; struct:Proto p; struct:UpVal uv; struct:lua_State th; };