The Battle for Wesnoth  1.15.2+dev
ltm.h
Go to the documentation of this file.
1 /*
2 ** $Id: ltm.h,v 2.22.1.1 2017/04/19 17:20:42 roberto Exp $
3 ** Tag methods
4 ** See Copyright Notice in lua.h
5 */
6 
7 #ifndef ltm_h
8 #define ltm_h
9 
10 
11 #include "lobject.h"
12 
13 
14 /*
15 * WARNING: if you change the order of this enumeration,
16 * grep "ORDER TM" and "ORDER OP"
17 */
18 typedef enum {
24  TM_EQ, /* last tag method with fast access */
43  TM_N /* number of elements in the enum */
44 } TMS;
45 
46 
47 
48 #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
49  ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
50 
51 #define fasttm(l,et,e) gfasttm(G(l), et, e)
52 
53 #define ttypename(x) luaT_typenames_[(x) + 1]
54 
56 
57 
58 LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o);
59 
60 LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
61 LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
62  TMS event);
63 LUAI_FUNC void luaT_init (lua_State *L);
64 
65 LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
66  const TValue *p2, TValue *p3, int hasres);
67 LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2,
68  StkId res, TMS event);
69 LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
70  StkId res, TMS event);
71 LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1,
72  const TValue *p2, TMS event);
73 
74 
75 
76 #endif
Definition: ltm.h:41
Definition: ltm.h:28
Definition: ltm.h:19
Definition: ltm.h:34
Definition: lobject.h:497
Definition: ltm.h:37
Definition: ltm.h:21
LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]
Definition: ltm.h:55
#define LUAI_FUNC
Definition: luaconf.h:282
Definition: ltm.h:33
Definition: ltm.h:35
Definition: ltm.h:42
LUAI_FUNC const TValue * luaT_gettm(Table *events, TMS event, TString *ename)
Definition: ltm.cpp:59
Definition: ltm.h:29
Definition: ltm.h:38
LUAI_FUNC const char * luaT_objtypename(lua_State *L, const TValue *o)
Definition: ltm.cpp:90
LUAI_FUNC void luaT_callTM(lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, TValue *p3, int hasres)
Definition: ltm.cpp:102
#define LUAI_DDEC
Definition: luaconf.h:285
LUAI_FUNC int luaT_callorderTM(lua_State *L, const TValue *p1, const TValue *p2, TMS event)
Definition: ltm.cpp:158
LUAI_FUNC const TValue * luaT_gettmbyobj(lua_State *L, const TValue *o, TMS event)
Definition: ltm.cpp:70
Definition: ltm.h:25
LUAI_FUNC void luaT_init(lua_State *L)
Definition: ltm.cpp:37
Definition: ltm.h:43
Definition: ltm.h:39
#define LUA_TOTALTAGS
Definition: lobject.h:28
Definition: ltm.h:22
Definition: ltm.h:31
Definition: ltm.h:23
Definition: ltm.h:36
Definition: ltm.h:32
Definition: ltm.h:26
LUAI_FUNC int luaT_callbinTM(lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event)
Definition: ltm.cpp:124
Definition: ltm.h:27
Definition: ltm.h:24
Handling of system events.
Definition: manager.hpp:41
TMS
Definition: ltm.h:18
#define f
Definition: ltm.h:40
LUAI_FUNC void luaT_trybinTM(lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event)
Definition: ltm.cpp:135
Definition: ltm.h:30