summaryrefslogtreecommitdiff
path: root/src/ltm.h
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2003-04-11 12:00:00 +0000
committerrepogen <>2003-04-11 12:00:00 +0000
commitf0e4e22f5c119865eb5a8d3844a40df2d5980b3b (patch)
treec4df063a747e9c99f8aba1678588a030993780a9 /src/ltm.h
parent1981b7c90eb09e956e969cda5c473be4560af573 (diff)
downloadlua-github-5.0.tar.gz
Lua 5.05.0
Diffstat (limited to 'src/ltm.h')
-rw-r--r--src/ltm.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/ltm.h b/src/ltm.h
index 3bd8e827..8eebfd3d 100644
--- a/src/ltm.h
+++ b/src/ltm.h
@@ -1,5 +1,5 @@
/*
-** $Id: ltm.h,v 1.18 2000/10/05 13:00:17 roberto Exp $
+** $Id: ltm.h,v 1.41 2002/11/14 11:51:50 roberto Exp $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ -9,18 +9,18 @@
#include "lobject.h"
-#include "lstate.h"
+
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER TM"
*/
typedef enum {
- TM_GETTABLE = 0,
- TM_SETTABLE,
TM_INDEX,
- TM_GETGLOBAL,
- TM_SETGLOBAL,
+ TM_NEWINDEX,
+ TM_GC,
+ TM_MODE,
+ TM_EQ, /* last tag method with `fast' access */
TM_ADD,
TM_SUB,
TM_MUL,
@@ -28,32 +28,24 @@ typedef enum {
TM_POW,
TM_UNM,
TM_LT,
+ TM_LE,
TM_CONCAT,
- TM_GC,
- TM_FUNCTION,
+ TM_CALL,
TM_N /* number of elements in the enum */
} TMS;
-struct TM {
- Closure *method[TM_N];
- TString *collected; /* list of garbage-collected udata with this tag */
-};
-
-
-#define luaT_gettm(L,tag,event) (L->TMtable[tag].method[event])
-#define luaT_gettmbyObj(L,o,e) (luaT_gettm((L),luaT_tag(o),(e)))
-
-#define validtag(t) (NUM_TAGS <= (t) && (t) <= L->last_tag)
+#define gfasttm(g,et,e) \
+ (((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
-extern const char *const luaT_eventname[];
+#define fasttm(l,et,e) gfasttm(G(l), et, e)
+const TObject *luaT_gettm (Table *events, TMS event, TString *ename);
+const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event);
void luaT_init (lua_State *L);
-void luaT_realtag (lua_State *L, int tag);
-int luaT_tag (const TObject *o);
-int luaT_validevent (int t, int e); /* used by compatibility module */
+extern const char *const luaT_typenames[];
#endif