ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ldo.h
1 /*
2 ** Stack and Call structure of Lua
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef GRIM_LDO_H
7 #define GRIM_LDO_H
8 
9 
10 #include "engines/grim/lua/lobject.h"
11 #include "engines/grim/lua/lstate.h"
12 
13 namespace Grim {
14 
15 #define MULT_RET 255
16 
17 
18 /*
19 ** macro to increment stack top.
20 ** There must be always an empty slot at the lua_state->stack.top
21 */
22 #define incr_top { if (lua_state->stack.top >= lua_state->stack.last) luaD_checkstack(1); lua_state->stack.top++; }
23 
24 // macros to convert from lua_Object to (TObject *) and back
25 
26 #define Address(lo) ((lo) + lua_state->stack.stack - 1)
27 #define Ref(st) ((st) - lua_state->stack.stack + 1)
28 
29 void luaD_init();
30 void luaD_initthr();
31 void luaD_adjusttop(StkId newtop);
32 void luaD_openstack(int32 nelems);
33 void luaD_lineHook(int32 line);
34 void luaD_callHook(StkId base, TProtoFunc *tf, int32 isreturn);
35 void luaD_postret(StkId firstResult);
36 int32 luaD_call(StkId base, int32 nResults);
37 void luaD_callTM(TObject *f, int32 nParams, int32 nResults);
38 int32 luaD_protectedrun(int32 nResults);
39 void luaD_gcIM(TObject *o);
40 void luaD_travstack(int32 (*fn)(TObject *));
41 void luaD_checkstack(int32 n);
42 
43 } // end of namespace Grim
44 
45 #endif
Definition: lobject.h:73
Definition: actor.h:33