Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
lstate.h File Reference
#include "lua.h"
#include "lobject.h"
#include "ltm.h"
#include "lzio.h"

Go to the source code of this file.

Data Structures

struct  stringtable
 
struct  CallInfo
 
struct  global_State
 
struct  lua_State
 
struct  GCObject
 

Macros

#define gt(L)   (&L->l_gt)
 
#define registry(L)   (&G(L)->l_registry)
 
#define EXTRA_STACK   5
 
#define BASIC_CI_SIZE   8
 
#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)
 
#define curr_func(L)   (clvalue(L->ci->func))
 
#define ci_func(ci)   (clvalue((ci)->func))
 
#define f_isLua(ci)   (!ci_func(ci)->c.isC)
 
#define isLua(ci)   (ttisfunction((ci)->func) && f_isLua(ci))
 
#define G(L)   (L->l_G)
 
#define rawgco2ts(o)   check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))
 
#define gco2ts(o)   (&rawgco2ts(o)->tsv)
 
#define rawgco2u(o)   check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))
 
#define gco2u(o)   (&rawgco2u(o)->uv)
 
#define gco2cl(o)   check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))
 
#define gco2h(o)   check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))
 
#define gco2p(o)   check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p))
 
#define gco2uv(o)   check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))
 
#define ngcotouv(o)    check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))
 
#define gco2th(o)   check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th))
 
#define obj2gco(v)   (cast(GCObject *, (v)))
 

Typedefs

typedef struct stringtable stringtable
 
typedef struct CallInfo CallInfo
 
typedef struct global_State global_State
 

Functions

LUAI_FUNC lua_StateluaE_newthread (lua_State *L)
 
LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1)
 

Macro Definition Documentation

◆ BASIC_CI_SIZE

#define BASIC_CI_SIZE   8

Definition at line 32 of file lua-5.1.5/src/lstate.h.

Referenced by stack_init().

◆ BASIC_STACK_SIZE

#define BASIC_STACK_SIZE   (2*LUA_MINSTACK)

◆ ci_func

◆ curr_func

#define curr_func ( L)    (clvalue(L->ci->func))

◆ EXTRA_STACK

◆ f_isLua

#define f_isLua ( ci)    (!ci_func(ci)->c.isC)

Definition at line 61 of file lua-5.1.5/src/lstate.h.

Referenced by callrethooks(), lua_getstack(), and resume().

◆ G

#define G ( L)    (L->l_G)

Definition at line 130 of file lua-5.1.5/src/lstate.h.

Referenced by atomic(), atomic(), atomic(), atomic(), callallpendingfinalizers(), callallpendingfinalizers(), callallpendingfinalizers(), checkSizes(), checkSizes(), close_state(), close_state(), close_state(), close_state(), entersweep(), entersweep(), entersweep(), f_luaopen(), f_luaopen(), f_luaopen(), f_luaopen(), freeobj(), freeobj(), funcnamefromcode(), funcnamefromcode(), GCTM(), GCTM(), GCTM(), GCTM(), generationalcollection(), getfuncname(), incstep(), index2addr(), index2addr(), index2value(), internshrstr(), internshrstr(), internshrstr(), lua_atpanic(), lua_close(), lua_error(), lua_gc(), lua_gc(), lua_getallocf(), lua_getglobal(), lua_getglobal(), lua_getmetatable(), lua_load(), lua_newthread(), lua_pushthread(), lua_setallocf(), lua_setglobal(), lua_setglobal(), lua_setmetatable(), lua_setwarnf(), lua_version(), lua_xmove(), lua_yieldk(), lua_yieldk(), luaC_barrier_(), luaC_barrierback(), luaC_barrierback_(), luaC_barrierback_(), luaC_barrierf(), luaC_barrierproto_(), luaC_callGCTM(), luaC_changemode(), luaC_changemode(), luaC_checkfinalizer(), luaC_fix(), luaC_forcestep(), luaC_freeall(), luaC_freeallobjects(), luaC_fullgc(), luaC_fullgc(), luaC_link(), luaC_linkupval(), luaC_newobj(), luaC_newobj(), luaC_runtilstate(), luaC_separateudata(), luaC_step(), luaC_upvalbarrier_(), luaD_seterrorobj(), luaD_throw(), luaE_newthread(), luaE_warning(), luaF_close(), luaF_findupval(), luaM_free_(), luaM_malloc_(), luaM_realloc_(), luaS_createlngstrobj(), luaS_init(), luaS_new(), luaS_newlstr(), luaS_newudata(), luaS_remove(), luaS_resize(), luaS_resize(), luaT_gettmbyobj(), luaT_init(), luaV_concat(), luaV_concat(), markroot(), newlstr(), newshrstr(), newupval(), pmain(), preinit_state(), preinit_state(), preinit_thread(), preinit_thread(), prepcallclosemth(), runafewfinalizers(), runafewfinalizers(), separatetobefnz(), seterrorobj(), seterrorobj(), singlestep(), singlestep(), singlestep(), singlestep(), sweep2old(), sweeplist(), sweeplist(), sweeplist(), sweeplist(), sweepthread(), and tryagain().

◆ gco2cl

#define gco2cl ( o)    check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl))

Definition at line 153 of file lua-5.1.5/src/lstate.h.

Referenced by freeobj(), propagatemark(), and reallymarkobject().

◆ gco2h

#define gco2h ( o)    check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h))

Definition at line 154 of file lua-5.1.5/src/lstate.h.

Referenced by cleartable(), freeobj(), propagatemark(), and reallymarkobject().

◆ gco2p

◆ gco2th

◆ gco2ts

#define gco2ts ( o)    (&rawgco2ts(o)->tsv)

◆ gco2u

◆ gco2uv

#define gco2uv ( o)    check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv))

◆ gt

◆ isLua

◆ ngcotouv

#define ngcotouv ( o)     check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))

Definition at line 157 of file lua-5.1.5/src/lstate.h.

157#define ngcotouv(o) \
158 check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv))

Referenced by luaF_close(), and luaF_findupval().

◆ obj2gco

◆ rawgco2ts

#define rawgco2ts ( o)    check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts))

Definition at line 149 of file lua-5.1.5/src/lstate.h.

Referenced by internshrstr(), and luaS_newlstr().

◆ rawgco2u

#define rawgco2u ( o)    check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u))

Definition at line 151 of file lua-5.1.5/src/lstate.h.

Referenced by GCTM().

◆ registry

#define registry ( L)    (&G(L)->l_registry)

Typedef Documentation

◆ CallInfo

typedef struct CallInfo CallInfo

◆ global_State

typedef struct global_State global_State

◆ stringtable

typedef struct stringtable stringtable

Function Documentation

◆ luaE_freethread()

LUAI_FUNC void luaE_freethread ( lua_State * L,
lua_State * L1 )

Definition at line 134 of file lua-5.1.5/src/lstate.c.

134 {
135 luaF_close(L1, L1->stack); /* close all upvalues for this thread */
136 lua_assert(L1->openupval == NULL);
138 freestack(L, L1);
140}
#define NULL
Definition gmacros.h:924
void luaF_close(lua_State *L, StkId level)
#define lua_assert(c)
#define luaM_freemem(L, b, s)
#define state_size(x)
static void freestack(lua_State *L, lua_State *L1)
#define fromstate(l)
#define luai_userstatefree(L)
GCObject * openupval

◆ luaE_newthread()

LUAI_FUNC lua_State * luaE_newthread ( lua_State * L)

Definition at line 119 of file lua-5.1.5/src/lstate.c.

119 {
122 preinit_state(L1, G(L));
123 stack_init(L1, L); /* init stack */
124 setobj2n(L, gt(L1), gt(L)); /* share table of globals */
125 L1->hookmask = L->hookmask;
127 L1->hook = L->hook;
128 resethookcount(L1);
130 return L1;
131}
#define resethookcount(L)
void luaC_link(lua_State *L, GCObject *o, lu_byte tt)
#define iswhite(x)
#define luaM_malloc(L, t)
#define setobj2n
#define tostate(l)
static void stack_init(lua_State *L1, lua_State *L)
static void preinit_state(lua_State *L, global_State *g)
#define G(L)
#define gt(L)
#define obj2gco(v)
#define LUA_TTHREAD

References lua_State::basehookcount, G, gt, lua_State::hook, lua_State::hookmask, iswhite, lua_assert, LUA_TTHREAD, luaC_link(), luaM_malloc, obj2gco, preinit_state(), resethookcount, setobj2n, stack_init(), state_size, and tostate.

Referenced by lua_newthread().