ltm.h 1019 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. ** $Id: $
  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 IM"
  12. */
  13. typedef enum {
  14. IM_GETTABLE = 0,
  15. IM_SETTABLE,
  16. IM_INDEX,
  17. IM_GETGLOBAL,
  18. IM_SETGLOBAL,
  19. IM_ADD,
  20. IM_SUB,
  21. IM_MUL,
  22. IM_DIV,
  23. IM_POW,
  24. IM_UNM,
  25. IM_LT,
  26. IM_LE,
  27. IM_GT,
  28. IM_GE,
  29. IM_CONCAT,
  30. IM_GC,
  31. IM_FUNCTION
  32. } IMS;
  33. #define IM_N 18
  34. extern struct IM {
  35. TObject int_method[IM_N];
  36. } *luaT_IMtable;
  37. #define luaT_getim(tag,event) (&luaT_IMtable[-(tag)].int_method[event])
  38. #define luaT_getimbyObj(o,e) (luaT_getim(luaT_efectivetag(o),(e)))
  39. extern char *luaT_eventname[];
  40. void luaT_settag (int tag, TObject *o);
  41. void luaT_realtag (int tag);
  42. int luaT_efectivetag (TObject *o);
  43. void luaT_settagmethod (int t, char *event, TObject *func);
  44. TObject *luaT_gettagmethod (int t, char *event);
  45. char *luaT_travtagmethods (int (*fn)(TObject *));
  46. void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */
  47. #endif