diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-12-01 17:50:08 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-12-01 17:50:08 -0200 |
| commit | fe237ad8085f34e89fcd3610a9771215af63f03f (patch) | |
| tree | f7ee5d8f7d1ffb74e94f049aa6f31eb03606cdf6 /ldo.h | |
| parent | 3181dfefee40b9a424b80aa779c671f5f458904c (diff) | |
| download | lua-fe237ad8085f34e89fcd3610a9771215af63f03f.tar.gz lua-fe237ad8085f34e89fcd3610a9771215af63f03f.tar.bz2 lua-fe237ad8085f34e89fcd3610a9771215af63f03f.zip | |
fixed stack; first version.
Diffstat (limited to 'ldo.h')
| -rw-r--r-- | ldo.h | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.h,v 1.10 1999/11/22 13:12:07 roberto Exp roberto $ | 2 | ** $Id: ldo.h,v 1.11 1999/11/25 18:58:51 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 | */ |
| @@ -20,22 +20,22 @@ | |||
| 20 | ** macro to increment stack top. | 20 | ** macro to increment stack top. |
| 21 | ** There must be always an empty slot at the L->stack.top | 21 | ** There must be always an empty slot at the L->stack.top |
| 22 | */ | 22 | */ |
| 23 | #define incr_top { if (L->stack.top >= L->stack.last) luaD_checkstack(L, 1); \ | 23 | #define incr_top {if (L->top == L->stack_last) luaD_checkstack(L, 1); L->top++;} |
| 24 | L->stack.top++; } | ||
| 25 | 24 | ||
| 26 | 25 | ||
| 27 | /* macros to convert from lua_Object to (TObject *) and back */ | 26 | /* macros to convert from lua_Object to (TObject *) and back */ |
| 28 | 27 | ||
| 29 | #define Address(L, lo) ((lo)+L->stack.stack-1) | 28 | #define Address(L, lo) ((lo)+L->stack-1) |
| 30 | #define Ref(L, st) ((st)-L->stack.stack+1) | 29 | #define Ref(L, st) ((st)-L->stack+1) |
| 31 | 30 | ||
| 32 | 31 | ||
| 33 | void luaD_init (lua_State *L); | 32 | void luaD_init (lua_State *L); |
| 34 | void luaD_adjusttop (lua_State *L, StkId newtop); | 33 | void luaD_adjusttop (lua_State *L, StkId base, int extra); |
| 35 | void luaD_openstack (lua_State *L, int nelems); | 34 | void luaD_openstack (lua_State *L, StkId pos); |
| 36 | void luaD_lineHook (lua_State *L, int line); | 35 | void luaD_lineHook (lua_State *L, int line); |
| 37 | void luaD_callHook (lua_State *L, StkId base, const TProtoFunc *tf, int isreturn); | 36 | void luaD_callHook (lua_State *L, StkId base, const TProtoFunc *tf, |
| 38 | void luaD_call (lua_State *L, TObject *func, int nResults); | 37 | int isreturn); |
| 38 | void luaD_call (lua_State *L, StkId func, int nResults); | ||
| 39 | void luaD_callTM (lua_State *L, const TObject *f, int nParams, int nResults); | 39 | void luaD_callTM (lua_State *L, const TObject *f, int nParams, int nResults); |
| 40 | int luaD_protectedrun (lua_State *L); | 40 | int luaD_protectedrun (lua_State *L); |
| 41 | void luaD_gcIM (lua_State *L, const TObject *o); | 41 | void luaD_gcIM (lua_State *L, const TObject *o); |
