lua/ltm.h

63 lines
1.1 KiB
C
Raw Normal View History

1997-09-16 12:25:59 -07:00
/*
1999-08-16 13:52:00 -07:00
** $Id: ltm.h,v 1.5 1999/01/15 13:11:57 roberto Exp roberto $
1997-09-16 12:25:59 -07:00
** Tag methods
** See Copyright Notice in lua.h
*/
#ifndef ltm_h
#define ltm_h
#include "lobject.h"
#include "lstate.h"
1997-09-16 12:25:59 -07:00
/*
* WARNING: if you change the order of this enumeration,
* grep "ORDER IM"
*/
typedef enum {
IM_GETTABLE = 0,
IM_SETTABLE,
IM_INDEX,
IM_GETGLOBAL,
IM_SETGLOBAL,
IM_ADD,
IM_SUB,
IM_MUL,
IM_DIV,
IM_POW,
IM_UNM,
IM_LT,
IM_LE,
IM_GT,
IM_GE,
IM_CONCAT,
IM_GC,
IM_FUNCTION
} IMS;
#define IM_N 18
struct IM {
1997-09-16 12:25:59 -07:00
TObject int_method[IM_N];
};
1997-09-16 12:25:59 -07:00
#define luaT_getim(tag,event) (&L->IMtable[-(tag)].int_method[event])
1999-01-15 05:11:57 -08:00
#define luaT_getimbyObj(o,e) (luaT_getim(luaT_effectivetag(o),(e)))
1997-09-16 12:25:59 -07:00
1999-08-16 13:52:00 -07:00
extern const char *const luaT_eventname[];
1997-09-16 12:25:59 -07:00
void luaT_init (void);
1997-09-16 12:25:59 -07:00
void luaT_realtag (int tag);
1999-08-16 13:52:00 -07:00
int luaT_effectivetag (const TObject *o);
void luaT_settagmethod (int t, const char *event, TObject *func);
const TObject *luaT_gettagmethod (int t, const char *event);
const char *luaT_travtagmethods (int (*fn)(TObject *));
1997-09-16 12:25:59 -07:00
void luaT_setfallback (void); /* only if LUA_COMPAT2_5 */
#endif