You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

58 lines
1.1 KiB

  1. /*
  2. ** $Id: ltm.h,v 2.11 2011/02/28 17:32:10 roberto Exp $
  3. ** Tag methods
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef ltm_h
  7. #define ltm_h
  8. #include "lobject.h"
  9. /*
  10. * WARNING: if you change the order of this enumeration,
  11. * grep "ORDER TM"
  12. */
  13. typedef enum {
  14. TM_INDEX,
  15. TM_NEWINDEX,
  16. TM_GC,
  17. TM_MODE,
  18. TM_LEN,
  19. TM_EQ, /* last tag method with `fast' access */
  20. TM_ADD,
  21. TM_SUB,
  22. TM_MUL,
  23. TM_DIV,
  24. TM_MOD,
  25. TM_POW,
  26. TM_UNM,
  27. TM_LT,
  28. TM_LE,
  29. TM_CONCAT,
  30. TM_CALL,
  31. TM_N /* number of elements in the enum */
  32. } TMS;
  33. #define gfasttm(g,et,e) ((et) == NULL ? NULL : \
  34. ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
  35. #define fasttm(l,et,e) gfasttm(G(l), et, e)
  36. #define ttypename(x) luaT_typenames_[(x) + 1]
  37. #define objtypename(x) ttypename(ttypenv(x))
  38. LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS];
  39. LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename);
  40. LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
  41. TMS event);
  42. LUAI_FUNC void luaT_init (lua_State *L);
  43. #endif