aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-07-12 13:14:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1998-07-12 13:14:34 -0300
commitee912e5a7f090314915be7b354be5bfa1002ed79 (patch)
treef7492fd78812f605d6d8a863319cdf982aeae1de
parentad446a0eb06f570f826fd313f5ed225b04e3719a (diff)
downloadlua-ee912e5a7f090314915be7b354be5bfa1002ed79.tar.gz
lua-ee912e5a7f090314915be7b354be5bfa1002ed79.tar.bz2
lua-ee912e5a7f090314915be7b354be5bfa1002ed79.zip
auxiliar function "luaD_calln".
-rw-r--r--ldo.c11
-rw-r--r--ldo.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/ldo.c b/ldo.c
index 116d6eb0..20b769d8 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.26 1998/06/15 21:34:14 roberto Exp roberto $ 2** $Id: ldo.c,v 1.27 1998/06/19 18:47:06 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -172,11 +172,10 @@ static StkId callCclosure (struct Closure *cl, lua_CFunction f, StkId base)
172} 172}
173 173
174 174
175void luaD_callTM (TObject *f, int nParams, int nResults) 175void luaD_callTM (TObject *f, int nParams, int nResults) {
176{
177 luaD_openstack(nParams); 176 luaD_openstack(nParams);
178 *(L->stack.top-nParams-1) = *f; 177 *(L->stack.top-nParams-1) = *f;
179 luaD_call((L->stack.top-L->stack.stack)-nParams, nResults); 178 luaD_calln(nParams, nResults);
180} 179}
181 180
182 181
@@ -230,6 +229,10 @@ void luaD_call (StkId base, int nResults)
230} 229}
231 230
232 231
232void luaD_calln (int nArgs, int nResults) {
233 luaD_call((L->stack.top-L->stack.stack)-nArgs, nResults);
234}
235
233 236
234/* 237/*
235** Traverse all objects on L->stack.stack 238** Traverse all objects on L->stack.stack
diff --git a/ldo.h b/ldo.h
index 61b24d92..b39e737d 100644
--- a/ldo.h
+++ b/ldo.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.h,v 1.3 1997/11/19 17:29:23 roberto Exp roberto $ 2** $Id: ldo.h,v 1.4 1997/12/15 16:17:20 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -36,6 +36,7 @@ void luaD_openstack (int nelems);
36void luaD_lineHook (int line); 36void luaD_lineHook (int line);
37void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn); 37void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn);
38void luaD_call (StkId base, int nResults); 38void luaD_call (StkId base, int nResults);
39void luaD_calln (int nArgs, int nResults);
39void luaD_callTM (TObject *f, int nParams, int nResults); 40void luaD_callTM (TObject *f, int nParams, int nResults);
40int luaD_protectedrun (int nResults); 41int luaD_protectedrun (int nResults);
41void luaD_gcIM (TObject *o); 42void luaD_gcIM (TObject *o);