25 #define luaD_checkstackaux(L,n,pre,pos) \ 26 if (L->stack_last - L->top <= (n)) \ 27 { pre; luaD_growstack(L, n, 1); pos; } \ 28 else { condmovestack(L,pre,pos); } 31 #define luaD_checkstack(L,n) luaD_checkstackaux(L,n,(void)0,(void)0) 35 #define savestack(L,p) ((char *)(p) - (char *)L->stack) 36 #define restorestack(L,n) ((StkId)((char *)L->stack + (n))) 40 #define checkstackGCp(L,n,p) \ 41 luaD_checkstackaux(L, n, \ 42 ptrdiff_t t__ = savestack(L, p); \ 44 p = restorestack(L, t__)) 48 #define checkstackGC(L,fsize) \ 49 luaD_checkstackaux(L, (fsize), luaC_checkGC(L), (void)0) 53 typedef void (*Pfunc) (lua_State *L,
void *ud);
55 LUAI_FUNC
void luaD_seterrorobj (lua_State *L,
int errcode, StkId oldtop);
56 LUAI_FUNC
int luaD_protectedparser (lua_State *L, ZIO *z,
const char *name,
58 LUAI_FUNC
void luaD_hook (lua_State *L,
int event,
int line,
59 int fTransfer,
int nTransfer);
60 LUAI_FUNC
void luaD_hookcall (lua_State *L, CallInfo *ci);
61 LUAI_FUNC
void luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func,
int n);
62 LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func,
int nResults);
63 LUAI_FUNC
void luaD_call (lua_State *L, StkId func,
int nResults);
64 LUAI_FUNC
void luaD_callnoyield (lua_State *L, StkId func,
int nResults);
65 LUAI_FUNC
void luaD_tryfuncTM (lua_State *L, StkId func);
66 LUAI_FUNC
int luaD_pcall (lua_State *L, Pfunc func,
void *u,
67 ptrdiff_t oldtop, ptrdiff_t ef);
68 LUAI_FUNC
void luaD_poscall (lua_State *L, CallInfo *ci,
int nres);
69 LUAI_FUNC
int luaD_reallocstack (lua_State *L,
int newsize,
int raiseerror);
70 LUAI_FUNC
int luaD_growstack (lua_State *L,
int n,
int raiseerror);
71 LUAI_FUNC
void luaD_shrinkstack (lua_State *L);
72 LUAI_FUNC
void luaD_inctop (lua_State *L);
74 LUAI_FUNC l_noret luaD_throw (lua_State *L,
int errcode);
75 LUAI_FUNC
int luaD_rawrunprotected (lua_State *L, Pfunc f,
void *ud);