From cb49b088b61b75b905663a58a2c545de1ffea13a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 9 Mar 2001 15:05:05 -0300 Subject: old signature for lua_open --- lstate.c | 4 ++-- ltests.c | 6 +++--- lua.c | 4 ++-- lua.h | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lstate.c b/lstate.c index f48f59e3..059390fb 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 1.58 2001/03/02 17:27:50 roberto Exp roberto $ +** $Id: lstate.c,v 1.59 2001/03/07 18:09:25 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -90,7 +90,7 @@ static void f_luaopen (lua_State *L, void *ud) { } -LUA_API lua_State *lua_open (lua_State *OL, int stacksize) { +LUA_API lua_State *lua_newthread (lua_State *OL, int stacksize) { struct Sopen so; lua_State *L; if (OL) lua_lock(OL); diff --git a/ltests.c b/ltests.c index 574e60f6..8f20c67b 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 1.74 2001/03/06 20:09:38 roberto Exp roberto $ +** $Id: ltests.c,v 1.75 2001/03/07 13:22:55 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -422,7 +422,7 @@ static int newtag (lua_State *L) { } static int doonnewstack (lua_State *L) { - lua_State *L1 = lua_open(L, luaL_check_int(L, 1)); + lua_State *L1 = lua_newthread(L, luaL_check_int(L, 1)); if (L1 == NULL) return 0; *((int **)L1) = &islocked; /* initialize the lock */ lua_dostring(L1, luaL_check_string(L, 2)); @@ -445,7 +445,7 @@ static int d2s (lua_State *L) { static int newstate (lua_State *L) { - lua_State *L1 = lua_open(NULL, luaL_check_int(L, 1)); + lua_State *L1 = lua_open(luaL_check_int(L, 1)); if (L1) { *((int **)L1) = &islocked; /* initialize the lock */ lua_pushnumber(L, (unsigned long)L1); diff --git a/lua.c b/lua.c index 6a5c5d52..e964518b 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.63 2001/02/23 17:28:12 roberto Exp roberto $ +** $Id: lua.c,v 1.64 2001/02/23 20:28:26 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -327,7 +327,7 @@ int main (int argc, l_char *argv[]) { int status; opt.toclose = 0; getstacksize(argc, argv, &opt); /* handle option `-s' */ - L = lua_open(NULL, opt.stacksize); /* create state */ + L = lua_open(opt.stacksize); /* create state */ LUA_USERINIT(L); /* open libraries */ register_getargs(argv); /* create `getargs' function */ status = handle_argv(argv+1, &opt); diff --git a/lua.h b/lua.h index 4ab3a3cf..bf04e14f 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.89 2001/02/23 17:17:25 roberto Exp roberto $ +** $Id: lua.h,v 1.90 2001/02/23 17:28:12 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: lua@tecgraf.puc-rio.br @@ -93,7 +93,7 @@ typedef char l_char; /* ** state manipulation */ -LUA_API lua_State *lua_open (lua_State *L, int stacksize); +LUA_API lua_State *lua_newthread (lua_State *L, int stacksize); LUA_API void lua_close (lua_State *L); @@ -210,6 +210,8 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size); ** =============================================================== */ +#define lua_open(n) lua_newthread(NULL, (n)) + #define lua_pop(L,n) lua_settop(L, -(n)-1) #define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) -- cgit v1.2.3-55-g6feb