2 ** $Id: ldo.h,v 2.20 2011/11/29 15:55:08 roberto Exp $
3 ** Stack and Call structure of Lua
4 ** See Copyright Notice in lua.h
16 #define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \
17 luaD_growstack(L, n); else condmovestack(L);
20 #define incr_top(L) {L->top++; luaD_checkstack(L,0);}
22 #define savestack(L,p) ((char *)(p) - (char *)L->stack)
23 #define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
26 /* type of protected functions, to be ran by `runprotected' */
27 typedef void (*Pfunc
) (lua_State
*L
, void *ud
);
29 LUAI_FUNC
int luaD_protectedparser (lua_State
*L
, ZIO
*z
, const char *name
,
31 LUAI_FUNC
void luaD_hook (lua_State
*L
, int event
, int line
);
32 LUAI_FUNC
int luaD_precall (lua_State
*L
, StkId func
, int nresults
);
33 LUAI_FUNC
void luaD_call (lua_State
*L
, StkId func
, int nResults
,
35 LUAI_FUNC
int luaD_pcall (lua_State
*L
, Pfunc func
, void *u
,
36 ptrdiff_t oldtop
, ptrdiff_t ef
);
37 LUAI_FUNC
int luaD_poscall (lua_State
*L
, StkId firstResult
);
38 LUAI_FUNC
void luaD_reallocstack (lua_State
*L
, int newsize
);
39 LUAI_FUNC
void luaD_growstack (lua_State
*L
, int n
);
40 LUAI_FUNC
void luaD_shrinkstack (lua_State
*L
);
42 LUAI_FUNC l_noret
luaD_throw (lua_State
*L
, int errcode
);
43 LUAI_FUNC
int luaD_rawrunprotected (lua_State
*L
, Pfunc f
, void *ud
);