ltm.h 828 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. ** $Id: ltm.h,v 1.32 2002/05/20 19:51:06 roberto Exp roberto $
  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_GETTABLE = 0,
  15. TM_SETTABLE,
  16. TM_INDEX,
  17. TM_NEWINDEX,
  18. TM_GC,
  19. TM_WEAKMODE,
  20. TM_ADD,
  21. TM_SUB,
  22. TM_MUL,
  23. TM_DIV,
  24. TM_POW,
  25. TM_UNM,
  26. TM_LT,
  27. TM_CONCAT,
  28. TM_CALL,
  29. TM_N /* number of elements in the enum */
  30. } TMS;
  31. #define fasttm(l,et,e) \
  32. (((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, G(l)->tmname[e]))
  33. const TObject *luaT_gettm (Table *events, TMS event, TString *ename);
  34. const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event);
  35. void luaT_init (lua_State *L);
  36. extern const char *const luaT_typenames[];
  37. #endif