`lua_newstate' renamed to `lua_open'

This commit is contained in:
Roberto Ierusalimschy 2000-09-11 16:42:57 -03:00
parent 787a78f83e
commit 30f6e658d2
4 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lstate.c,v 1.36 2000/09/05 19:33:32 roberto Exp roberto $ ** $Id: lstate.c,v 1.37 2000/09/11 17:38:42 roberto Exp roberto $
** Global State ** Global State
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -25,7 +25,7 @@ void luaB_opentests (lua_State *L);
#endif #endif
lua_State *lua_newstate (int stacksize) { lua_State *lua_open (int stacksize) {
struct lua_longjmp myErrorJmp; struct lua_longjmp myErrorJmp;
lua_State *L = luaM_new(NULL, lua_State); lua_State *L = luaM_new(NULL, lua_State);
if (L == NULL) return NULL; /* memory allocation error */ if (L == NULL) return NULL; /* memory allocation error */

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltests.c,v 1.39 2000/08/31 20:23:40 roberto Exp roberto $ ** $Id: ltests.c,v 1.40 2000/09/05 19:33:32 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation ** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -267,7 +267,7 @@ static int udataval (lua_State *L) {
} }
static int newstate (lua_State *L) { static int newstate (lua_State *L) {
lua_State *L1 = lua_newstate(luaL_check_int(L, 1)); lua_State *L1 = lua_open(luaL_check_int(L, 1));
if (L1) if (L1)
lua_pushuserdata(L, L1); lua_pushuserdata(L, L1);
else else

4
lua.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.c,v 1.49 2000/08/31 20:23:40 roberto Exp roberto $ ** $Id: lua.c,v 1.50 2000/09/05 19:33:32 roberto Exp roberto $
** Lua stand-alone interpreter ** Lua stand-alone interpreter
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -314,7 +314,7 @@ int main (int argc, char *argv[]) {
int status; int status;
opt.toclose = 0; opt.toclose = 0;
getstacksize(argc, argv, &opt); /* handle option `-s' */ getstacksize(argc, argv, &opt); /* handle option `-s' */
L = lua_newstate(opt.stacksize); /* create state */ L = lua_open(opt.stacksize); /* create state */
USERINIT(); /* open libraries */ USERINIT(); /* open libraries */
register_getargs(argv); /* create `getargs' function */ register_getargs(argv); /* create `getargs' function */
status = handle_argv(argv+1, &opt); status = handle_argv(argv+1, &opt);

6
lua.h
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.h,v 1.65 2000/08/31 21:01:43 roberto Exp roberto $ ** $Id: lua.h,v 1.66 2000/09/05 19:33:32 roberto Exp roberto $
** Lua - An Extensible Extension Language ** Lua - An Extensible Extension Language
** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
** e-mail: lua@tecgraf.puc-rio.br ** e-mail: lua@tecgraf.puc-rio.br
@ -34,7 +34,7 @@
#define LUA_MULTRET (-1) #define LUA_MULTRET (-1)
#define LUA_MINSTACK 16 #define LUA_MINSTACK 20
/* error codes for lua_do* */ /* error codes for lua_do* */
@ -52,7 +52,7 @@ typedef int (*lua_CFunction) (lua_State *L);
/* /*
** state manipulation ** state manipulation
*/ */
lua_State *lua_newstate (int stacksize); lua_State *lua_open (int stacksize);
void lua_close (lua_State *L); void lua_close (lua_State *L);