commit 071b2ae0e1aba719cb3f909d2b02c79f5873ff36
parent e2498e079e4636217e89f0b28844c4b5df4f8793
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Fri, 7 Jan 2005 17:53:10 -0200
details
Diffstat:
3 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/lapi.c b/lapi.c
@@ -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);
diff --git a/lbaselib.c b/lbaselib.c
@@ -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;
diff --git a/lua.h b/lua.h
@@ -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);