diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-07-12 13:14:34 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-07-12 13:14:34 -0300 |
commit | ee912e5a7f090314915be7b354be5bfa1002ed79 (patch) | |
tree | f7492fd78812f605d6d8a863319cdf982aeae1de | |
parent | ad446a0eb06f570f826fd313f5ed225b04e3719a (diff) | |
download | lua-ee912e5a7f090314915be7b354be5bfa1002ed79.tar.gz lua-ee912e5a7f090314915be7b354be5bfa1002ed79.tar.bz2 lua-ee912e5a7f090314915be7b354be5bfa1002ed79.zip |
auxiliar function "luaD_calln".
-rw-r--r-- | ldo.c | 11 | ||||
-rw-r--r-- | ldo.h | 3 |
2 files changed, 9 insertions, 5 deletions
@@ -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 | ||
175 | void luaD_callTM (TObject *f, int nParams, int nResults) | 175 | void 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 | ||
232 | void 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 |
@@ -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); | |||
36 | void luaD_lineHook (int line); | 36 | void luaD_lineHook (int line); |
37 | void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn); | 37 | void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn); |
38 | void luaD_call (StkId base, int nResults); | 38 | void luaD_call (StkId base, int nResults); |
39 | void luaD_calln (int nArgs, int nResults); | ||
39 | void luaD_callTM (TObject *f, int nParams, int nResults); | 40 | void luaD_callTM (TObject *f, int nParams, int nResults); |
40 | int luaD_protectedrun (int nResults); | 41 | int luaD_protectedrun (int nResults); |
41 | void luaD_gcIM (TObject *o); | 42 | void luaD_gcIM (TObject *o); |