ltm.h 870 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. ** $Id: ltm.h,v 1.38 2002/07/01 17:06:58 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_INDEX,
  15. TM_NEWINDEX,
  16. TM_GC,
  17. TM_EQ, /* last tag method with `fast' access */
  18. TM_GETTABLE,
  19. TM_SETTABLE,
  20. TM_ADD,
  21. TM_SUB,
  22. TM_MUL,
  23. TM_DIV,
  24. TM_POW,
  25. TM_UNM,
  26. TM_LT,
  27. TM_LE,
  28. TM_CONCAT,
  29. TM_CALL,
  30. TM_N /* number of elements in the enum */
  31. } TMS;
  32. #define fasttm(l,et,e) \
  33. (((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, G(l)->tmname[e]))
  34. const TObject *luaT_gettm (Table *events, TMS event, TString *ename);
  35. const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event);
  36. void luaT_init (lua_State *L);
  37. extern const char *const luaT_typenames[];
  38. #endif