2 ** $Id: lstate.h,v 1.11 1998/06/24 13:33:00 roberto Exp $
4 ** See Copyright Notice in lua.h
16 #define MAX_C_BLOCKS 10
18 #define GARBAGE_BLOCK 150
21 typedef int StkId
; /* index to stack elements */
30 StkId base
; /* when Lua calls C or C calls Lua, points to */
31 /* the first slot after the last parameter. */
32 StkId lua2C
; /* points to first element of "array" lua2C */
33 int num
; /* size of "array" lua2C */
39 int nuse
; /* number of elements (including EMPTYs) */
44 enum Status
{LOCK
, HOLD
, FREE
, COLLECTED
};
53 /* thread-specific state */
54 struct Stack stack
; /* Lua stack */
55 struct C_Lua_Stack Cstack
; /* C2lua struct */
56 jmp_buf *errorJmp
; /* current error recover point */
57 char *Mbuffer
; /* global buffer */
58 char *Mbuffbase
; /* current first position of Mbuffer */
59 int Mbuffsize
; /* size of Mbuffer */
60 int Mbuffnext
; /* next position to fill in Mbuffer */
61 struct C_Lua_Stack Cblocks
[MAX_C_BLOCKS
];
62 int numCblocks
; /* number of nested Cblocks */
64 TObject errorim
; /* error tag method */
65 GCnode rootproto
; /* list of all prototypes */
66 GCnode rootcl
; /* list of all closures */
67 GCnode roottable
; /* list of all tables */
68 GCnode rootglobal
; /* list of strings with global values */
69 stringtable
*string_root
; /* array of hash tables for strings and udata */
70 struct IM
*IMtable
; /* table for tag methods */
71 int IMtable_size
; /* size of IMtable */
72 int last_tag
; /* last used tag in IMtable */
73 struct ref
*refArray
; /* locked objects */
74 int refSize
; /* size of refArray */
75 unsigned long GCthreshold
;
76 unsigned long nblocks
; /* number of 'blocks' currently allocated */
80 extern lua_State
*lua_state
;