binana/profile/3.3.5a-windows-386/include/lua/state.h

118 lines
2.3 KiB
C
Raw Normal View History

2026-04-01 17:37:40 -04:00
#ifndef LUA_STATE_H
#define LUA_STATE_H
DECLARE_STRUCT(stringtable);
DECLARE_STRUCT(CallInfo);
DECLARE_STRUCT(global_State);
DECLARE_STRUCT(lua_State);
2026-04-08 09:08:33 -04:00
DECLARE_STRUCT(LG);
2026-04-01 17:37:40 -04:00
#include "lua/object.h"
#include "lua/types.h"
2026-04-15 13:55:03 -04:00
#include "lua/zio.h"
2026-04-01 17:37:40 -04:00
struct stringtable {
GCObject** hash;
lu_int32 nuse;
int32_t size;
};
struct CallInfo {
StkId base;
StkId func;
StkId top;
Instruction* savedpc;
int32_t nresults;
int32_t tailcalls;
};
struct global_State {
stringtable strt;
lua_Alloc frealloc;
void* ud;
2026-04-08 09:08:33 -04:00
lu_byte profile;
2026-04-01 17:37:40 -04:00
lu_byte currentwhite;
lu_byte gcstate;
int32_t 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;
int32_t gcpause;
int32_t gcstepmul;
lua_CFunction panic;
TValue l_registry;
lua_State* mainthread;
UpVal uvhead;
Table* mt[9];
2026-04-08 09:08:33 -04:00
uint32_t unkBC;
uint32_t unkC0;
TString* tmname[17];
2026-04-01 17:37:40 -04:00
};
struct lua_State {
2026-04-08 09:08:33 -04:00
GCObject* next;
// Added by Blizzard
// Set to:
// - lua_tainted
// - lua_gctag
int32_t unk04;
2026-04-01 17:37:40 -04:00
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;
int32_t stacksize;
int32_t size_ci;
uint16_t nCcalls;
lu_byte hookmask;
lu_byte allowhook;
int32_t basehookcount;
int32_t hookcount;
lua_Hook hook;
TValue l_gt;
TValue env;
GCObject* openupval;
GCObject* gclist;
lua_longjmp* errorJmp;
ptrdiff_t errfunc;
2026-04-08 09:08:33 -04:00
uint32_t unk78;
uint32_t unk7C;
2026-04-01 17:37:40 -04:00
};
union GCObject {
GCheader gch;
TString ts;
Udata u;
Closure cl;
Table h;
Proto p;
UpVal uv;
lua_State th;
};
2026-04-08 09:08:33 -04:00
struct LG {
lua_State l;
global_State g;
};
2026-04-01 17:37:40 -04:00
#endif