summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/ltm.h
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-21 19:01:41 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-21 19:01:41 +0000
commitcf87597226f5d6b269f1f2c4d6f402aa1eccb852 (patch)
tree4ba1f3ae53b3bd9cae0e2c6c4dd57836b43a5ece /apps/plugins/lua/ltm.h
parentc483efadc63eaed35b5fb5e4e02c2282daf32470 (diff)
downloadrockbox-cf87597226f5d6b269f1f2c4d6f402aa1eccb852.tar.gz
rockbox-cf87597226f5d6b269f1f2c4d6f402aa1eccb852.zip
Commit FS#9174: Lua scripting language by Dan Everton
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21020 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lua/ltm.h')
-rw-r--r--apps/plugins/lua/ltm.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/apps/plugins/lua/ltm.h b/apps/plugins/lua/ltm.h
new file mode 100644
index 0000000000..1b89683ef3
--- /dev/null
+++ b/apps/plugins/lua/ltm.h
@@ -0,0 +1,54 @@
1/*
2** $Id$
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"
17*/
18typedef enum {
19 TM_INDEX,
20 TM_NEWINDEX,
21 TM_GC,
22 TM_MODE,
23 TM_EQ, /* last tag method with `fast' access */
24 TM_ADD,
25 TM_SUB,
26 TM_MUL,
27 TM_DIV,
28 TM_MOD,
29 TM_POW,
30 TM_UNM,
31 TM_LEN,
32 TM_LT,
33 TM_LE,
34 TM_CONCAT,
35 TM_CALL,
36 TM_N /* number of elements in the enum */
37} TMS;
38
39
40
41#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
42 ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
43
44#define fasttm(l,et,e) gfasttm(G(l), et, e)
45
46LUAI_DATA const char *const luaT_typenames[];
47
48
49LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
50LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
51 TMS event);
52LUAI_FUNC void luaT_init (lua_State *L);
53
54#endif