summaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-06-02 17:37:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-06-02 17:37:04 -0300
commit02a6891939895129bc968364a5beda73331005e7 (patch)
tree61417ec2d6e1eb38542e04fba31c482c6284280b /lstate.c
parent741c6f50067bfb0f351967c321da56805191f302 (diff)
downloadlua-github-02a6891939895129bc968364a5beda73331005e7.tar.gz
API for functions to manipulate global state.
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lstate.c b/lstate.c
index c1a1b43d..434bd0bd 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstate.c,v 1.4 1997/12/11 14:48:46 roberto Exp roberto $
+** $Id: lstate.c,v 1.5 1997/12/17 20:48:58 roberto Exp roberto $
** Global State
** See Copyright Notice in lua.h
*/
@@ -17,13 +17,13 @@
#include "ltm.h"
-LState *lua_state = NULL;
+lua_State *lua_state = NULL;
void lua_open (void)
{
if (lua_state) return;
- lua_state = luaM_new(LState);
+ lua_state = luaM_new(lua_State);
L->numCblocks = 0;
L->Cstack.base = 0;
L->Cstack.lua2C = 0;
@@ -76,3 +76,11 @@ void lua_close (void)
printf("total de memoria: %ld\n", totalmem);
#endif
}
+
+
+lua_State *lua_setstate (lua_State *st) {
+ lua_State *old = lua_state;
+ lua_state = st;
+ return old;
+}
+