rlm@1: /* rlm@1: ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ rlm@1: ** Tag methods rlm@1: ** See Copyright Notice in lua.h rlm@1: */ rlm@1: rlm@1: #ifndef ltm_h rlm@1: #define ltm_h rlm@1: rlm@1: rlm@1: #include "lobject.h" rlm@1: rlm@1: rlm@1: /* rlm@1: * WARNING: if you change the order of this enumeration, rlm@1: * grep "ORDER TM" rlm@1: */ rlm@1: typedef enum { rlm@1: TM_INDEX, rlm@1: TM_NEWINDEX, rlm@1: TM_GC, rlm@1: TM_MODE, rlm@1: TM_EQ, /* last tag method with `fast' access */ rlm@1: TM_ADD, rlm@1: TM_SUB, rlm@1: TM_MUL, rlm@1: TM_DIV, rlm@1: TM_MOD, rlm@1: TM_POW, rlm@1: TM_UNM, rlm@1: TM_LEN, rlm@1: TM_LT, rlm@1: TM_LE, rlm@1: TM_CONCAT, rlm@1: TM_CALL, rlm@1: TM_N /* number of elements in the enum */ rlm@1: } TMS; rlm@1: rlm@1: rlm@1: rlm@1: #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ rlm@1: ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) rlm@1: rlm@1: #define fasttm(l,et,e) gfasttm(G(l), et, e) rlm@1: rlm@1: LUAI_DATA const char *const luaT_typenames[]; rlm@1: rlm@1: rlm@1: LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); rlm@1: LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, rlm@1: TMS event); rlm@1: LUAI_FUNC void luaT_init (lua_State *L); rlm@1: rlm@1: #endif