# lua_State Struct Reference

`#include <lua/lstate.h>`

Collaboration diagram for lua_State:
[legend]

## Data Fields
GCObject * | next
lu_byte | tt
lu_byte | marked
lu_byte | status
StkId | top
StkId | base
global_State * | l_G
CallInfo * | ci
const 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

## Detailed Description

Definition at line 100 of file lstate.h.

## Field Documentation

GCObject* lua_State::next

Definition at line 101 of file lstate.h.

Referenced by GCTM(), lua_newstate(), and luaC_separateudata().

lu_byte lua_State::tt

Definition at line 101 of file lstate.h.

Referenced by lua_newstate().

lu_byte lua_State::marked

Definition at line 101 of file lstate.h.

Referenced by lua_newstate().

lu_byte lua_State::status

Definition at line 102 of file lstate.h.

Referenced by lua_resume(), lua_status(), lua_yield(), luaD_throw(), luaV_execute(), preinit_state(), and resume().

StkId lua_State::top

Definition at line 103 of file lstate.h.

Referenced by adjust_varargs(), call_orderTM(), callTM(), callTMres(), close_func(), collectvalidlines(), correctstack(), f_Ccall(), f_parser(), findlocal(), GCTM(), index2adr(), LoadFunction(), lua_call(), lua_checkstack(), lua_close(), lua_concat(), lua_cpcall(), lua_createtable(), lua_dump(), lua_getfenv(), lua_getfield(), lua_getinfo(), lua_getmetatable(), lua_gettable(), lua_gettop(), lua_getupvalue(), lua_insert(), lua_newthread(), lua_newuserdata(), lua_next(), lua_pcall(), lua_pushboolean(), lua_pushcclosure(), lua_pushinteger(), lua_pushlightuserdata(), lua_pushlstring(), lua_pushnil(), lua_pushnumber(), lua_pushthread(), lua_pushvalue(), lua_rawget(), lua_rawgeti(), lua_rawset(), lua_rawseti(), lua_remove(), lua_replace(), lua_resume(), lua_setfenv(), lua_setfield(), lua_setlocal(), lua_setmetatable(), lua_settable(), lua_settop(), lua_setupvalue(), lua_xmove(), lua_yield(), luaA_pushobject(), luaD_callhook(), luaD_poscall(), luaD_precall(), luaD_protectedparser(), luaD_seterrorobj(), luaG_errormsg(), luaO_pushvfstring(), luaV_equalval(), luaV_execute(), open_func(), pushstr(), resume(), resume_error(), stack_init(), traversestack(), and tryfuncTM().

StkId lua_State::base

Definition at line 104 of file lstate.h.

Referenced by correctstack(), index2adr(), lua_checkstack(), lua_close(), lua_concat(), lua_gettop(), lua_settop(), lua_yield(), luaD_pcall(), luaD_poscall(), luaD_precall(), luaG_typeerror(), luaO_pushvfstring(), luaV_concat(), luaV_execute(), resetstack(), resume(), and stack_init().

global_State* lua_State::l_G

Definition at line 105 of file lstate.h.

CallInfo* lua_State::ci

Definition at line 106 of file lstate.h.

Referenced by addinfo(), callrethooks(), checkstacksizes(), currentpc(), findlocal(), getcurrenv(), growCI(), lua_checkstack(), lua_close(), lua_getstack(), lua_replace(), lua_resume(), lua_xmove(), luaD_callhook(), luaD_pcall(), luaD_poscall(), luaD_precall(), luaD_reallocCI(), luaG_typeerror(), luaV_execute(), preinit_state(), resetstack(), restore_stack_limit(), resume(), resume_error(), stack_init(), and traceexec().

const Instruction* lua_State::savedpc

Definition at line 107 of file lstate.h.

Referenced by currentpc(), luaD_pcall(), luaD_poscall(), luaD_precall(), luaV_execute(), preinit_state(), and traceexec().

StkId lua_State::stack_last

Definition at line 108 of file lstate.h.

Referenced by luaD_callhook(), luaD_precall(), luaD_reallocstack(), restore_stack_limit(), stack_init(), and traversestack().

StkId lua_State::stack

Definition at line 109 of file lstate.h.

Referenced by checkstacksizes(), close_state(), correctstack(), freestack(), lua_close(), luaD_reallocstack(), luaE_freethread(), luaV_execute(), preinit_state(), restore_stack_limit(), stack_init(), and traversestack().

CallInfo* lua_State::end_ci

Definition at line 110 of file lstate.h.

Referenced by luaD_reallocCI(), and stack_init().

CallInfo* lua_State::base_ci

Definition at line 111 of file lstate.h.

Referenced by checkstacksizes(), correctstack(), freestack(), getcurrenv(), lua_close(), lua_getinfo(), lua_getlocal(), lua_getstack(), lua_replace(), lua_resume(), lua_setlocal(), luaD_callhook(), luaD_reallocCI(), preinit_state(), resetstack(), restore_stack_limit(), resume(), stack_init(), and traversestack().

int lua_State::stacksize

Definition at line 112 of file lstate.h.

Referenced by checkstacksizes(), freestack(), luaD_growstack(), luaD_reallocstack(), luaV_execute(), preinit_state(), propagatemark(), restore_stack_limit(), and stack_init().

int lua_State::size_ci

Definition at line 113 of file lstate.h.

Referenced by checkstacksizes(), freestack(), growCI(), luaD_reallocCI(), preinit_state(), propagatemark(), restore_stack_limit(), and stack_init().

unsigned short lua_State::nCcalls

Definition at line 114 of file lstate.h.

Referenced by assignment(), enterlevel(), lua_close(), lua_resume(), lua_yield(), luaD_call(), luaD_pcall(), preinit_state(), and resetstack().

lu_byte lua_State::hookmask

Definition at line 115 of file lstate.h.

Referenced by lua_gethookmask(), lua_sethook(), luaD_poscall(), luaD_precall(), luaE_newthread(), luaV_execute(), preinit_state(), and traceexec().

lu_byte lua_State::allowhook

Definition at line 116 of file lstate.h.

Referenced by GCTM(), luaD_callhook(), luaD_pcall(), preinit_state(), and resetstack().

int lua_State::basehookcount

Definition at line 117 of file lstate.h.

Referenced by lua_gethookcount(), lua_sethook(), luaE_newthread(), and preinit_state().

int lua_State::hookcount

Definition at line 118 of file lstate.h.

Referenced by luaV_execute(), and traceexec().

lua_Hook lua_State::hook

Definition at line 119 of file lstate.h.

Referenced by lua_gethook(), lua_sethook(), luaD_callhook(), luaE_newthread(), and preinit_state().

TValue lua_State::l_gt

Definition at line 120 of file lstate.h.

TValue lua_State::env

Definition at line 121 of file lstate.h.

Referenced by index2adr().

GCObject* lua_State::openupval

Definition at line 122 of file lstate.h.

Referenced by correctstack(), luaE_freethread(), luaF_close(), luaF_findupval(), luaV_execute(), and preinit_state().

GCObject* lua_State::gclist

Definition at line 123 of file lstate.h.

Referenced by propagatemark().

struct lua_longjmp* lua_State::errorJmp`[read]`

Definition at line 124 of file lstate.h.

Referenced by luaD_rawrunprotected(), luaD_throw(), preinit_state(), and resetstack().

ptrdiff_t lua_State::errfunc

Definition at line 125 of file lstate.h.

Referenced by lua_close(), lua_resume(), luaD_pcall(), luaD_protectedparser(), luaG_errormsg(), preinit_state(), and resetstack().

The documentation for this struct was generated from the following file:

- lua/lstate.h