aboutsummaryrefslogtreecommitdiff
path: root/ltm.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-09-16 16:25:59 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-09-16 16:25:59 -0300
commit4b91e9cde630573cb35bb20101eb74cf5cf79a27 (patch)
treea3f4021ffcff5856633dfac5f1f3faa38e4ab0bf /ltm.h
parent26c5f56ad1ac6f0409e638f44af75da09f2b0a0b (diff)
downloadlua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.tar.gz
lua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.tar.bz2
lua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.zip
Tag methods
Diffstat (limited to 'ltm.h')
-rw-r--r--ltm.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/ltm.h b/ltm.h
new file mode 100644
index 00000000..7227c243
--- /dev/null
+++ b/ltm.h
@@ -0,0 +1,61 @@
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* WARNING: if you change the order of this enumeration,
15* grep "ORDER IM"
16*/
17typedef enum {
18 IM_GETTABLE = 0,
19 IM_SETTABLE,
20 IM_INDEX,
21 IM_GETGLOBAL,
22 IM_SETGLOBAL,
23 IM_ADD,
24 IM_SUB,
25 IM_MUL,
26 IM_DIV,
27 IM_POW,
28 IM_UNM,
29 IM_LT,
30 IM_LE,
31 IM_GT,
32 IM_GE,
33 IM_CONCAT,
34 IM_GC,
35 IM_FUNCTION
36} IMS;
37
38#define IM_N 18
39
40
41extern struct IM {
42 TObject int_method[IM_N];
43} *luaT_IMtable;
44
45
46#define luaT_getim(tag,event) (&luaT_IMtable[-(tag)].int_method[event])
47#define luaT_getimbyObj(o,e) (luaT_getim(luaT_efectivetag(o),(e)))
48
49extern char *luaT_eventname[];
50
51
52void luaT_settag (int tag, TObject *o);
53void luaT_realtag (int tag);
54int luaT_efectivetag (TObject *o);
55void luaT_settagmethod (int t, char *event, TObject *func);
56TObject *luaT_gettagmethod (int t, char *event);
57char *luaT_travtagmethods (int (*fn)(TObject *));
58
59void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */
60
61#endif