Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/ceguilua/src/lua-5.0.3/lua/ldo.h @ 1803

Last change on this file since 1803 was 1803, checked in by rgrieder, 16 years ago

added files for lua 5.1.3, lua 5.0.3, CEGUILua-0.6.1 and CEGUILua-0.5.0b

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/*
2** $Id: ldo.h,v 1.56 2002/12/04 17:29:32 roberto Exp $
3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h
5*/
6
7#ifndef ldo_h
8#define ldo_h
9
10
11#include "lobject.h"
12#include "lstate.h"
13#include "lzio.h"
14
15
16/*
17** macro to control inclusion of some hard tests on stack reallocation
18*/ 
19#ifndef HARDSTACKTESTS
20#define condhardstacktests(x)   { /* empty */ }
21#else
22#define condhardstacktests(x)   x
23#endif
24
25
26#define luaD_checkstack(L,n)    \
27  if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \
28    luaD_growstack(L, n); \
29  else condhardstacktests(luaD_reallocstack(L, L->stacksize));
30
31
32#define incr_top(L) {luaD_checkstack(L,1); L->top++;}
33
34#define savestack(L,p)          ((char *)(p) - (char *)L->stack)
35#define restorestack(L,n)       ((TObject *)((char *)L->stack + (n)))
36
37#define saveci(L,p)             ((char *)(p) - (char *)L->base_ci)
38#define restoreci(L,n)          ((CallInfo *)((char *)L->base_ci + (n)))
39
40
41/* type of protected functions, to be ran by `runprotected' */
42typedef void (*Pfunc) (lua_State *L, void *ud);
43
44void luaD_resetprotection (lua_State *L);
45int luaD_protectedparser (lua_State *L, ZIO *z, int bin);
46void luaD_callhook (lua_State *L, int event, int line);
47StkId luaD_precall (lua_State *L, StkId func);
48void luaD_call (lua_State *L, StkId func, int nResults);
49int luaD_pcall (lua_State *L, Pfunc func, void *u,
50                ptrdiff_t oldtop, ptrdiff_t ef);
51void luaD_poscall (lua_State *L, int wanted, StkId firstResult);
52void luaD_reallocCI (lua_State *L, int newsize);
53void luaD_reallocstack (lua_State *L, int newsize);
54void luaD_growstack (lua_State *L, int n);
55
56void luaD_throw (lua_State *L, int errcode);
57int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
58
59
60#endif
Note: See TracBrowser for help on using the repository browser.