summaryrefslogtreecommitdiff
path: root/src/ltm.h
diff options
context:
space:
mode:
authorLua Team <team@lua.org>1998-07-11 12:00:00 +0000
committerrepogen <>1998-07-11 12:00:00 +0000
commit377347776f1f3d820f92151f70bec667f96d5e6b (patch)
treecdb3ba26158df33547dfe765547177afcee119d1 /src/ltm.h
parent4f8c5d0f284e1f4da717aea5008915f185cd2e05 (diff)
downloadlua-github-3.1.tar.gz
Lua 3.13.1
Diffstat (limited to 'src/ltm.h')
-rw-r--r--src/ltm.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/ltm.h b/src/ltm.h
new file mode 100644
index 00000000..b688d1e1
--- /dev/null
+++ b/src/ltm.h
@@ -0,0 +1,62 @@
+/*
+** $Id: ltm.h,v 1.4 1997/11/26 18:53:45 roberto Exp $
+** Tag methods
+** See Copyright Notice in lua.h
+*/
+
+#ifndef ltm_h
+#define ltm_h
+
+
+#include "lobject.h"
+#include "lstate.h"
+
+/*
+* WARNING: if you change the order of this enumeration,
+* grep "ORDER IM"
+*/
+typedef enum {
+ IM_GETTABLE = 0,
+ IM_SETTABLE,
+ IM_INDEX,
+ IM_GETGLOBAL,
+ IM_SETGLOBAL,
+ IM_ADD,
+ IM_SUB,
+ IM_MUL,
+ IM_DIV,
+ IM_POW,
+ IM_UNM,
+ IM_LT,
+ IM_LE,
+ IM_GT,
+ IM_GE,
+ IM_CONCAT,
+ IM_GC,
+ IM_FUNCTION
+} IMS;
+
+#define IM_N 18
+
+
+struct IM {
+ TObject int_method[IM_N];
+};
+
+
+#define luaT_getim(tag,event) (&L->IMtable[-(tag)].int_method[event])
+#define luaT_getimbyObj(o,e) (luaT_getim(luaT_efectivetag(o),(e)))
+
+extern char *luaT_eventname[];
+
+
+void luaT_init (void);
+void luaT_realtag (int tag);
+int luaT_efectivetag (TObject *o);
+void luaT_settagmethod (int t, char *event, TObject *func);
+TObject *luaT_gettagmethod (int t, char *event);
+char *luaT_travtagmethods (int (*fn)(TObject *));
+
+void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */
+
+#endif