diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-09-16 16:25:59 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1997-09-16 16:25:59 -0300 |
commit | 4b91e9cde630573cb35bb20101eb74cf5cf79a27 (patch) | |
tree | a3f4021ffcff5856633dfac5f1f3faa38e4ab0bf /ltm.h | |
parent | 26c5f56ad1ac6f0409e638f44af75da09f2b0a0b (diff) | |
download | lua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.tar.gz lua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.tar.bz2 lua-4b91e9cde630573cb35bb20101eb74cf5cf79a27.zip |
Tag methods
Diffstat (limited to 'ltm.h')
-rw-r--r-- | ltm.h | 61 |
1 files changed, 61 insertions, 0 deletions
@@ -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 | */ | ||
17 | typedef 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 | |||
41 | extern 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 | |||
49 | extern char *luaT_eventname[]; | ||
50 | |||
51 | |||
52 | void luaT_settag (int tag, TObject *o); | ||
53 | void luaT_realtag (int tag); | ||
54 | int luaT_efectivetag (TObject *o); | ||
55 | void luaT_settagmethod (int t, char *event, TObject *func); | ||
56 | TObject *luaT_gettagmethod (int t, char *event); | ||
57 | char *luaT_travtagmethods (int (*fn)(TObject *)); | ||
58 | |||
59 | void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */ | ||
60 | |||
61 | #endif | ||