aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-12 15:48:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-04-12 15:48:47 -0300
commit2ca518141350667e38941eac35b76980095d2fdc (patch)
tree82595f0dfd57df5782905621298c8aae68b46389 /ldo.h
parentf5ae26ec6c2eb69f03f316e59c1e1977c52c7c23 (diff)
downloadlua-2ca518141350667e38941eac35b76980095d2fdc.tar.gz
lua-2ca518141350667e38941eac35b76980095d2fdc.tar.bz2
lua-2ca518141350667e38941eac35b76980095d2fdc.zip
Branch 5.2 - new releases for 5.2 go from here, main trunk goes
for next version
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/ldo.h b/ldo.h
new file mode 100644
index 00000000..27b837d9
--- /dev/null
+++ b/ldo.h
@@ -0,0 +1,46 @@
1/*
2** $Id: ldo.h,v 2.20 2011/11/29 15:55:08 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#define luaD_checkstack(L,n) if (L->stack_last - L->top <= (n)) \
17 luaD_growstack(L, n); else condmovestack(L);
18
19
20#define incr_top(L) {L->top++; luaD_checkstack(L,0);}
21
22#define savestack(L,p) ((char *)(p) - (char *)L->stack)
23#define restorestack(L,n) ((TValue *)((char *)L->stack + (n)))
24
25
26/* type of protected functions, to be ran by `runprotected' */
27typedef void (*Pfunc) (lua_State *L, void *ud);
28
29LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
30 const char *mode);
31LUAI_FUNC void luaD_hook (lua_State *L, int event, int line);
32LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults);
33LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults,
34 int allowyield);
35LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u,
36 ptrdiff_t oldtop, ptrdiff_t ef);
37LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult);
38LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize);
39LUAI_FUNC void luaD_growstack (lua_State *L, int n);
40LUAI_FUNC void luaD_shrinkstack (lua_State *L);
41
42LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode);
43LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud);
44
45#endif
46