mirror of
https://github.com/lua/lua
synced 2024-11-22 12:51:30 +03:00
lua_upcall' ->
lua_call'
This commit is contained in:
parent
69906cb56f
commit
78c507b7b8
4
ldblib.c
4
ldblib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ldblib.c,v 1.59 2002/06/18 17:10:43 roberto Exp roberto $
|
||||
** $Id: ldblib.c,v 1.60 2002/06/18 17:42:52 roberto Exp roberto $
|
||||
** Interface from Lua to its debug API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -117,7 +117,7 @@ static void hookf (lua_State *L, void *key) {
|
||||
lua_rawget(L, LUA_REGISTRYINDEX);
|
||||
if (lua_isfunction(L, -1)) {
|
||||
lua_pushvalue(L, -2); /* original argument (below function) */
|
||||
lua_upcall(L, 1, 0);
|
||||
lua_call(L, 1, 0);
|
||||
}
|
||||
else
|
||||
lua_pop(L, 1); /* pop result from gettable */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lstrlib.c,v 1.84 2002/06/13 13:44:50 roberto Exp roberto $
|
||||
** $Id: lstrlib.c,v 1.85 2002/06/18 15:16:18 roberto Exp roberto $
|
||||
** Standard library for string operations and pattern-matching
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -548,7 +548,7 @@ static void add_s (MatchState *ms, luaL_Buffer *b,
|
||||
int n;
|
||||
lua_pushvalue(L, 3);
|
||||
n = push_captures(ms, s, e);
|
||||
lua_upcall(L, n, 1);
|
||||
lua_call(L, n, 1);
|
||||
if (lua_isstring(L, -1))
|
||||
luaL_addvalue(b); /* add return to accumulated result */
|
||||
else
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltablib.c,v 1.6 2002/06/13 13:44:50 roberto Exp roberto $
|
||||
** $Id: ltablib.c,v 1.7 2002/06/18 15:16:18 roberto Exp roberto $
|
||||
** Library for Table Manipulation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -25,7 +25,7 @@ static int luaB_foreachi (lua_State *L) {
|
||||
lua_pushvalue(L, 2); /* function */
|
||||
lua_pushnumber(L, i); /* 1st argument */
|
||||
lua_rawgeti(L, 1, i); /* 2nd argument */
|
||||
lua_upcall(L, 2, 1);
|
||||
lua_call(L, 2, 1);
|
||||
if (!lua_isnil(L, -1))
|
||||
return 1;
|
||||
lua_pop(L, 1); /* remove nil result */
|
||||
@ -44,7 +44,7 @@ static int luaB_foreach (lua_State *L) {
|
||||
lua_pushvalue(L, 2); /* function */
|
||||
lua_pushvalue(L, -3); /* key */
|
||||
lua_pushvalue(L, -3); /* value */
|
||||
lua_upcall(L, 2, 1);
|
||||
lua_call(L, 2, 1);
|
||||
if (!lua_isnil(L, -1))
|
||||
return 1;
|
||||
lua_pop(L, 2); /* remove value and result */
|
||||
@ -128,7 +128,7 @@ static int sort_comp (lua_State *L, int a, int b) {
|
||||
lua_pushvalue(L, 2);
|
||||
lua_pushvalue(L, a-1); /* -1 to compensate function */
|
||||
lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */
|
||||
lua_upcall(L, 2, 1);
|
||||
lua_call(L, 2, 1);
|
||||
res = lua_toboolean(L, -1);
|
||||
lua_pop(L, 1);
|
||||
return res;
|
||||
|
4
ltests.c
4
ltests.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltests.c,v 1.126 2002/06/18 15:19:27 roberto Exp roberto $
|
||||
** $Id: ltests.c,v 1.127 2002/06/20 20:40:38 roberto Exp roberto $
|
||||
** Internal Module for Debugging of the Lua Implementation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -665,7 +665,7 @@ static int testC (lua_State *L) {
|
||||
else if EQ("rawcall") {
|
||||
int narg = getnum;
|
||||
int nres = getnum;
|
||||
lua_upcall(L, narg, nres);
|
||||
lua_call(L, narg, nres);
|
||||
}
|
||||
else if EQ("call") {
|
||||
int narg = getnum;
|
||||
|
6
lua.h
6
lua.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lua.h,v 1.141 2002/06/18 15:19:27 roberto Exp roberto $
|
||||
** $Id: lua.h,v 1.142 2002/06/20 20:41:46 roberto Exp roberto $
|
||||
** Lua - An Extensible Extension Language
|
||||
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
|
||||
** http://www.lua.org mailto:info@lua.org
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
|
||||
/* option for multiple returns in `lua_pcall' and `lua_upcall' */
|
||||
/* option for multiple returns in `lua_pcall' and `lua_call' */
|
||||
#define LUA_MULTRET (-1)
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ LUA_API int lua_setglobals (lua_State *L, int level);
|
||||
/*
|
||||
** `load' and `call' functions (load and run Lua code)
|
||||
*/
|
||||
LUA_API void lua_upcall (lua_State *L, int nargs, int nresults);
|
||||
LUA_API void lua_call (lua_State *L, int nargs, int nresults);
|
||||
LUA_API int lua_pcall (lua_State *L, int nargs, int nresults);
|
||||
LUA_API int lua_load (lua_State *L, lua_Chunkreader reader, void *data,
|
||||
const char *chunkname);
|
||||
|
Loading…
Reference in New Issue
Block a user