annotate lib/lua/lua-5.2.2/ltm.h @ 2069:259df09dfb50

32bits almost there
author Nomad
date Tue, 03 Dec 2013 20:18:17 +0200
parents 41cc4dd3c122
children
rev   line source
1866
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
1 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
2 ** $Id: ltm.h,v 2.11 2011/02/28 17:32:10 roberto Exp $
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
3 ** Tag methods
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
4 ** See Copyright Notice in lua.h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
5 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
6
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
7 #ifndef ltm_h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
8 #define ltm_h
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
9
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
10
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
11 #include "lobject.h"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
12
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
13
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
14 /*
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
15 * WARNING: if you change the order of this enumeration,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
16 * grep "ORDER TM"
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
17 */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
18 typedef enum {
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
19 TM_INDEX,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
20 TM_NEWINDEX,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
21 TM_GC,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
22 TM_MODE,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
23 TM_LEN,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
24 TM_EQ, /* last tag method with `fast' access */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
25 TM_ADD,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
26 TM_SUB,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
27 TM_MUL,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
28 TM_DIV,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
29 TM_MOD,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
30 TM_POW,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
31 TM_UNM,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
32 TM_LT,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
33 TM_LE,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
34 TM_CONCAT,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
35 TM_CALL,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
36 TM_N /* number of elements in the enum */
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
37 } TMS;
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
38
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
39
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
40
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
41 #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
42 ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
43
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
44 #define fasttm(l,et,e) gfasttm(G(l), et, e)
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
45
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
46 #define ttypename(x) luaT_typenames_[(x) + 1]
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
47 #define objtypename(x) ttypename(ttypenv(x))
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
48
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
49 LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS];
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
50
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
51
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
52 LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
53 LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
54 TMS event);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
55 LUAI_FUNC void luaT_init (lua_State *L);
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
56
41cc4dd3c122 Lua 5.2.2 added.
Nomad
parents:
diff changeset
57 #endif