Lua 5.1.4: ldo.h


L0001    /*
L0002    ** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
L0003    ** Stack and Call structure of Lua
L0004    ** See Copyright Notice in lua.h
L0005    */
L0006    
L0007    #ifndef ldo_h
L0008    #define ldo_h
L0009    
L0010    
L0011    #include "lobject.h"
L0012    #include "lstate.h"
L0013    #include "lzio.h"
L0014    
L0015    
L0016    #define luaD_checkstack(L,n)	\
L0017      if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \
L0018        luaD_growstack(L, n); \
L0019      else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1));
L0020    
L0021    
L0022    #define incr_top(L) {luaD_checkstack(L,1); L->top++;}
L0023    
L0024    #define savestack(L,p)		((char *)(p) - (char *)L->stack)
L0025    #define restorestack(L,n)	((TValue *)((char *)L->stack + (n)))
L0026    
L0027    #define saveci(L,p)		((char *)(p) - (char *)L->base_ci)
L0028    #define restoreci(L,n)		((CallInfo *)((char *)L->base_ci + (n)))
L0029    
L0030    
L0031    /* results from luaD_precall */
L0032    #define PCRLUA		0	/* initiated a call to a Lua function */
L0033    #define PCRC		1	/* did a call to a C function */
L0034    #define PCRYIELD	2	/* C funtion yielded */
L0035    
L0036    
L0037    /* type of protected functions, to be ran by `runprotected' */
L0038    typedef void (*Pfunc) (lua_State *L, void *ud);
L0039    
L0040    LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name);
L0041    LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line);
L0042    LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
L0043    LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
L0044    LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
L0045                                            ptrdiff_t oldtop, ptrdiff_t ef);
L0046    LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
L0047    LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize);
L0048    LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
L0049    LUAI_FUNC void luaD_growstack (lua_State *L, int n);
L0050    
L0051    LUAI_FUNC void luaD_throw (lua_State *L, int errcode);
L0052    LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
L0053    
L0054    LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop);
L0055    
L0056    #endif
L0057    

Generated by pretty.lua