Imported from ../lua-3.2.tar.gz.
[lua.git] / src / ltm.h
blob845ea15317d7e869c76980063e20997003b55963
1 /*
2 ** $Id: ltm.h,v 1.5 1999/01/15 13:11:57 roberto Exp $
3 ** Tag methods
4 ** See Copyright Notice in lua.h
5 */
7 #ifndef ltm_h
8 #define ltm_h
11 #include "lobject.h"
12 #include "lstate.h"
15 * WARNING: if you change the order of this enumeration,
16 * grep "ORDER IM"
18 typedef enum {
19 IM_GETTABLE = 0,
20 IM_SETTABLE,
21 IM_INDEX,
22 IM_GETGLOBAL,
23 IM_SETGLOBAL,
24 IM_ADD,
25 IM_SUB,
26 IM_MUL,
27 IM_DIV,
28 IM_POW,
29 IM_UNM,
30 IM_LT,
31 IM_LE,
32 IM_GT,
33 IM_GE,
34 IM_CONCAT,
35 IM_GC,
36 IM_FUNCTION
37 } IMS;
39 #define IM_N 18
42 struct IM {
43 TObject int_method[IM_N];
47 #define luaT_getim(tag,event) (&L->IMtable[-(tag)].int_method[event])
48 #define luaT_getimbyObj(o,e) (luaT_getim(luaT_effectivetag(o),(e)))
50 extern char *luaT_eventname[];
53 void luaT_init (void);
54 void luaT_realtag (int tag);
55 int luaT_effectivetag (TObject *o);
56 void luaT_settagmethod (int t, char *event, TObject *func);
57 TObject *luaT_gettagmethod (int t, char *event);
58 char *luaT_travtagmethods (int (*fn)(TObject *));
60 void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */
62 #endif