summaryrefslogtreecommitdiff
path: root/lstate.h
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.h')
-rw-r--r--lstate.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/lstate.h b/lstate.h
index 21cbef59..6692e097 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 1.7 1998/01/09 14:57:43 roberto Exp $ 2** $Id: lstate.h,v 1.8 1998/05/27 13:03:40 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -8,6 +8,7 @@
8#define lstate_h 8#define lstate_h
9 9
10#include "lobject.h" 10#include "lobject.h"
11#include "lua.h"
11 12
12 13
13#define MAX_C_BLOCKS 10 14#define MAX_C_BLOCKS 10
@@ -44,10 +45,18 @@ struct ref {
44}; 45};
45 46
46 47
47typedef struct LState { 48struct lua_State {
49 /* trhead-specific state */
48 struct Stack stack; /* Lua stack */ 50 struct Stack stack; /* Lua stack */
49 struct C_Lua_Stack Cstack; /* C2lua struct */ 51 struct C_Lua_Stack Cstack; /* C2lua struct */
50 void *errorJmp; /* current error recover point */ 52 void *errorJmp; /* current error recover point */
53 char *Mbuffer; /* global buffer */
54 char *Mbuffbase; /* current first position of Mbuffer */
55 int Mbuffsize; /* size of Mbuffer */
56 int Mbuffnext; /* next position to fill in Mbuffer */
57 struct C_Lua_Stack Cblocks[MAX_C_BLOCKS];
58 int numCblocks; /* number of nested Cblocks */
59 /* global state */
51 TObject errorim; /* error tag method */ 60 TObject errorim; /* error tag method */
52 GCnode rootproto; /* list of all prototypes */ 61 GCnode rootproto; /* list of all prototypes */
53 GCnode rootcl; /* list of all closures */ 62 GCnode rootcl; /* list of all closures */
@@ -61,16 +70,10 @@ typedef struct LState {
61 int refSize; /* size of refArray */ 70 int refSize; /* size of refArray */
62 unsigned long GCthreshold; 71 unsigned long GCthreshold;
63 unsigned long nblocks; /* number of 'blocks' currently allocated */ 72 unsigned long nblocks; /* number of 'blocks' currently allocated */
64 char *Mbuffer; /* global buffer */ 73};
65 char *Mbuffbase; /* current first position of Mbuffer */
66 int Mbuffsize; /* size of Mbuffer */
67 int Mbuffnext; /* next position to fill in Mbuffer */
68 struct C_Lua_Stack Cblocks[MAX_C_BLOCKS];
69 int numCblocks; /* number of nested Cblocks */
70} LState;
71 74
72 75
73extern LState *lua_state; 76extern lua_State *lua_state;
74 77
75 78
76#define L lua_state 79#define L lua_state