This commit is contained in:
Roberto Ierusalimschy 2005-01-07 17:53:32 -02:00
parent e2498e079e
commit 071b2ae0e1
3 changed files with 9 additions and 15 deletions

9
lapi.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.23 2004/12/13 12:15:11 roberto Exp $
** $Id: lapi.c,v 2.24 2005/01/04 15:55:12 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@ -826,7 +826,7 @@ LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data) {
}
LUA_API int lua_threadstatus (lua_State *L) {
LUA_API int lua_status (lua_State *L) {
return L->status;
}
@ -890,11 +890,6 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
*/
LUA_API const char *lua_version (void) {
return LUA_VERSION;
}
LUA_API int lua_error (lua_State *L) {
lua_lock(L);
api_checknelems(L, 1);

View File

@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.162 2004/12/07 18:31:34 roberto Exp roberto $
** $Id: lbaselib.c,v 1.163 2004/12/13 12:15:11 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@ -469,7 +469,7 @@ static int auxresume (lua_State *L, lua_State *co, int narg) {
int status;
if (!lua_checkstack(co, narg))
luaL_error(L, "too many arguments to resume");
if (lua_threadstatus(co) == 0 && lua_gettop(co) == 0) {
if (lua_status(co) == 0 && lua_gettop(co) == 0) {
lua_pushliteral(L, "cannot resume dead coroutine");
return -1; /* error flag */
}
@ -549,7 +549,7 @@ static int luaB_costatus (lua_State *L) {
luaL_argcheck(L, co, 1, "coroutine expected");
if (L == co) lua_pushliteral(L, "running");
else {
switch (lua_threadstatus(co)) {
switch (lua_status(co)) {
case LUA_YIELD:
lua_pushliteral(L, "suspended");
break;

9
lua.h
View File

@ -1,5 +1,5 @@
/*
** $Id: lua.h,v 1.196 2004/12/06 17:53:42 roberto Exp roberto $
** $Id: lua.h,v 1.197 2004/12/13 12:15:11 roberto Exp roberto $
** Lua - An Extensible Extension Language
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
** http://www.lua.org mailto:info@lua.org
@ -18,6 +18,7 @@
#define LUA_VERSION "Lua 5.1 (work)"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2004 Tecgraf, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
@ -37,7 +38,7 @@
#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i))
/* return codes for `lua_pcall', `lua_resume', and `lua_threadstatus' */
/* return codes for `lua_pcall', `lua_resume', and `lua_status' */
#define LUA_YIELD 1
#define LUA_ERRRUN 2
#define LUA_ERRSYNTAX 3
@ -214,7 +215,7 @@ LUA_API int lua_dump (lua_State *L, lua_Chunkwriter writer, void *data);
*/
LUA_API int lua_yield (lua_State *L, int nresults);
LUA_API int lua_resume (lua_State *L, int narg);
LUA_API int lua_threadstatus (lua_State *L);
LUA_API int lua_status (lua_State *L);
/*
** garbage-collection function and options
@ -235,8 +236,6 @@ LUA_API int lua_gc (lua_State *L, int what, int data);
** miscellaneous functions
*/
LUA_API const char *lua_version (void);
LUA_API int lua_error (lua_State *L);
LUA_API int lua_next (lua_State *L, int idx);