1997-09-16 16:25:59 -03:00
|
|
|
/*
|
2011-10-07 17:45:19 -03:00
|
|
|
** $Id: ldo.h,v 2.18 2009/12/17 12:28:57 roberto Exp roberto $
|
1997-09-16 16:25:59 -03:00
|
|
|
** Stack and Call structure of Lua
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ldo_h
|
|
|
|
#define ldo_h
|
|
|
|
|
|
|
|
|
|
|
|
#include "lobject.h"
|
1997-11-19 15:29:23 -02:00
|
|
|
#include "lstate.h"
|
2002-04-22 11:40:50 -03:00
|
|
|
#include "lzio.h"
|
1997-09-16 16:25:59 -03:00
|
|
|
|
|
|
|
|
2009-07-08 13:06:51 -03:00
|
|
|
#define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \
|
|
|
|
luaD_growstack(L, n); else condmovestack(L);
|
2002-11-21 15:19:11 -02:00
|
|
|
|
2002-03-20 09:52:32 -03:00
|
|
|
|
2006-07-11 12:53:29 -03:00
|
|
|
#define incr_top(L) {L->top++; luaD_checkstack(L,0);}
|
2002-11-21 14:46:16 -02:00
|
|
|
|
2002-03-20 09:52:32 -03:00
|
|
|
#define savestack(L,p) ((char *)(p) - (char *)L->stack)
|
2003-12-10 10:13:36 -02:00
|
|
|
#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
|
2001-06-05 16:41:24 -03:00
|
|
|
|
|
|
|
|
2002-04-22 11:40:50 -03:00
|
|
|
/* type of protected functions, to be ran by `runprotected' */
|
2002-08-05 14:36:24 -03:00
|
|
|
typedef void (*Pfunc) (lua_State *L, void *ud);
|
2002-04-22 11:40:50 -03:00
|
|
|
|
2005-04-25 16:24:10 -03:00
|
|
|
LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
|
2009-11-25 13:27:51 -02:00
|
|
|
LUAI_FUNC void luaD_hook (lua_State *L, int event, int line);
|
2005-04-25 16:24:10 -03:00
|
|
|
LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
|
2009-03-10 14:14:37 -03:00
|
|
|
LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults,
|
|
|
|
int allowyield);
|
2005-04-25 16:24:10 -03:00
|
|
|
LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
|
|
|
|
ptrdiff_t oldtop, ptrdiff_t ef);
|
2005-08-22 15:54:49 -03:00
|
|
|
LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
|
2005-04-25 16:24:10 -03:00
|
|
|
LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
|
|
|
|
LUAI_FUNC void luaD_growstack (lua_State *L, int n);
|
2009-07-15 14:26:14 -03:00
|
|
|
LUAI_FUNC void luaD_shrinkstack (lua_State *L);
|
1997-09-16 16:25:59 -03:00
|
|
|
|
2011-10-07 17:45:19 -03:00
|
|
|
LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode);
|
2005-04-25 16:24:10 -03:00
|
|
|
LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
|
2000-09-25 13:22:42 -03:00
|
|
|
|
1997-09-16 16:25:59 -03:00
|
|
|
#endif
|
2005-04-25 16:24:10 -03:00
|
|
|
|