mirror of https://github.com/lua/lua
old signature for lua_open
This commit is contained in:
parent
c5a23cf01a
commit
cb49b088b6
4
lstate.c
4
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
|
** Global State
|
||||||
** See Copyright Notice in lua.h
|
** 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;
|
struct Sopen so;
|
||||||
lua_State *L;
|
lua_State *L;
|
||||||
if (OL) lua_lock(OL);
|
if (OL) lua_lock(OL);
|
||||||
|
|
6
ltests.c
6
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
|
** Internal Module for Debugging of the Lua Implementation
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -422,7 +422,7 @@ static int newtag (lua_State *L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int doonnewstack (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;
|
if (L1 == NULL) return 0;
|
||||||
*((int **)L1) = &islocked; /* initialize the lock */
|
*((int **)L1) = &islocked; /* initialize the lock */
|
||||||
lua_dostring(L1, luaL_check_string(L, 2));
|
lua_dostring(L1, luaL_check_string(L, 2));
|
||||||
|
@ -445,7 +445,7 @@ static int d2s (lua_State *L) {
|
||||||
|
|
||||||
|
|
||||||
static int newstate (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) {
|
if (L1) {
|
||||||
*((int **)L1) = &islocked; /* initialize the lock */
|
*((int **)L1) = &islocked; /* initialize the lock */
|
||||||
lua_pushnumber(L, (unsigned long)L1);
|
lua_pushnumber(L, (unsigned long)L1);
|
||||||
|
|
4
lua.c
4
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
|
** Lua stand-alone interpreter
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -327,7 +327,7 @@ int main (int argc, l_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_open(NULL, opt.stacksize); /* create state */
|
L = lua_open(opt.stacksize); /* create state */
|
||||||
LUA_USERINIT(L); /* open libraries */
|
LUA_USERINIT(L); /* 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
6
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
|
** 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
|
||||||
|
@ -93,7 +93,7 @@ typedef char l_char;
|
||||||
/*
|
/*
|
||||||
** state manipulation
|
** 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);
|
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_pop(L,n) lua_settop(L, -(n)-1)
|
||||||
|
|
||||||
#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
|
#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
|
||||||
|
|
Loading…
Reference in New Issue