/* ** $Id: ltm.h,v 1.27 2001/08/27 15:13:59 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 TM" */ typedef enum { TM_GETTABLE = 0, TM_SETTABLE, TM_INDEX, TM_GETGLOBAL, TM_SETGLOBAL, TM_ADD, TM_SUB, TM_MUL, TM_DIV, TM_POW, TM_UNM, TM_LT, TM_CONCAT, TM_GC, TM_FUNCTION, TM_N /* number of elements in the enum */ } TMS; /* ** masks for allowable tag methods ** (see `luaT_validevents') */ #define HAS_TM_GETGLOBAL(L,t) ((1<<(t)) & ((1<TMtable[tag].method[event]) #define luaT_gettmbyObj(G,o,e) (luaT_gettm((G),luaT_tag(o),(e))) #define typenamebytag(G, t) getstr(G->TMtable[t].name) #define validtag(G,t) (NUM_TAGS <= (t) && (t) < G->ntag) extern const l_char *const luaT_eventname[]; void luaT_init (lua_State *L); int luaT_newtag (lua_State *L, const l_char *name, int basictype); const l_char *luaT_typename (global_State *G, const TObject *o); int luaT_tag (const TObject *o); #endif