ltm.h 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. ** $Id: ltm.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $
  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_GC,
  18. TM_WEAKMODE,
  19. TM_ADD,
  20. TM_SUB,
  21. TM_MUL,
  22. TM_DIV,
  23. TM_POW,
  24. TM_UNM,
  25. TM_LT,
  26. TM_CONCAT,
  27. TM_CALL,
  28. TM_N /* number of elements in the enum */
  29. } TMS;
  30. #define fasttm(l,et,e) \
  31. (((et)->flags & (1<<(e))) ? NULL : luaT_gettm(et, e, G(l)->tmname[e]))
  32. const TObject *luaT_gettm (Table *events, TMS event, TString *ename);
  33. const TObject *luaT_gettmbyobj (lua_State *L, const TObject *o, TMS event);
  34. void luaT_init (lua_State *L);
  35. extern const char *const luaT_typenames[];
  36. #endif