etc/protocols - sync with NetBSD-8
[minix.git] / external / mit / lua / dist / src / ldo.h
blobf0823bd632598ed922284e7ba7511017947e1cc4
1 /* $NetBSD: ldo.h,v 1.4 2015/10/08 13:21:00 mbalmer Exp $ */
3 /*
4 ** Id: ldo.h,v 2.22 2015/05/22 17:48:19 roberto Exp
5 ** Stack and Call structure of Lua
6 ** See Copyright Notice in lua.h
7 */
9 #ifndef ldo_h
10 #define ldo_h
13 #include "lobject.h"
14 #include "lstate.h"
15 #include "lzio.h"
18 #define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \
19 luaD_growstack(L, n); else condmovestack(L);
22 #define incr_top(L) {L->top++; luaD_checkstack(L,0);}
24 #define savestack(L,p) ((char *)(p) - (char *)L->stack)
25 #define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
28 /* type of protected functions, to be ran by 'runprotected' */
29 typedef void (*Pfunc) (lua_State *L, void *ud);
31 LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
32 const char *mode);
33 LUAI_FUNC void luaD_hook (lua_State *L, int event, int line);
34 LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
35 LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults,
36 int allowyield);
37 LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
38 ptrdiff_t oldtop, ptrdiff_t ef);
39 LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult, int nres);
40 LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
41 LUAI_FUNC void luaD_growstack (lua_State *L, int n);
42 LUAI_FUNC void luaD_shrinkstack (lua_State *L);
44 LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode);
45 LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
47 #endif