1994-11-07 18:20:56 +03:00
|
|
|
/*
|
1997-04-25 02:59:57 +04:00
|
|
|
** $Id: fallback.h,v 1.22 1997/04/04 22:24:51 roberto Exp roberto $
|
1994-11-07 18:20:56 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef fallback_h
|
|
|
|
#define fallback_h
|
|
|
|
|
1996-04-22 22:00:37 +04:00
|
|
|
#include "lua.h"
|
1994-11-08 22:56:39 +03:00
|
|
|
#include "opcode.h"
|
|
|
|
|
1997-03-20 22:20:43 +03:00
|
|
|
/*
|
|
|
|
* WARNING: if you change the order of this enumeration,
|
|
|
|
* grep "ORDER IM"
|
|
|
|
*/
|
|
|
|
typedef enum {
|
|
|
|
IM_GETTABLE = 0,
|
|
|
|
IM_SETTABLE,
|
|
|
|
IM_INDEX,
|
1997-04-01 00:59:09 +04:00
|
|
|
IM_GETGLOBAL,
|
|
|
|
IM_SETGLOBAL,
|
1997-03-20 22:20:43 +03:00
|
|
|
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;
|
|
|
|
|
1997-04-01 00:59:09 +04:00
|
|
|
#define IM_N 18
|
1997-03-20 22:20:43 +03:00
|
|
|
|
1997-04-25 02:59:57 +04:00
|
|
|
|
|
|
|
extern struct IM {
|
|
|
|
TObject int_method[IM_N];
|
|
|
|
} *luaI_IMtable;
|
|
|
|
|
1997-03-20 22:20:43 +03:00
|
|
|
extern char *luaI_eventname[];
|
|
|
|
|
1997-04-25 02:59:57 +04:00
|
|
|
#define luaI_getim(tag,event) (&luaI_IMtable[-(tag)].int_method[event])
|
|
|
|
#define luaI_getimbyObj(o,e) (luaI_getim(luaI_efectivetag(o),(e)))
|
1997-03-20 22:20:43 +03:00
|
|
|
|
1994-11-10 20:11:52 +03:00
|
|
|
void luaI_setfallback (void);
|
1997-03-31 18:02:58 +04:00
|
|
|
int luaI_ref (TObject *object, int lock);
|
|
|
|
TObject *luaI_getref (int ref);
|
|
|
|
void luaI_travlock (int (*fn)(TObject *));
|
1996-04-22 22:00:37 +04:00
|
|
|
void luaI_invalidaterefs (void);
|
1997-03-31 18:02:58 +04:00
|
|
|
char *luaI_travfallbacks (int (*fn)(TObject *));
|
1994-11-07 18:20:56 +03:00
|
|
|
|
1997-03-31 18:02:58 +04:00
|
|
|
void luaI_settag (int tag, TObject *o);
|
1997-04-05 02:24:51 +04:00
|
|
|
void luaI_realtag (int tag);
|
1997-04-01 00:59:09 +04:00
|
|
|
TObject *luaI_geterrorim (void);
|
1997-04-25 02:59:57 +04:00
|
|
|
int luaI_efectivetag (TObject *o);
|
1997-04-05 02:24:51 +04:00
|
|
|
void luaI_settagmethod (void);
|
|
|
|
void luaI_gettagmethod (void);
|
1997-04-01 00:59:09 +04:00
|
|
|
void luaI_seterrormethod (void);
|
1997-03-19 22:41:10 +03:00
|
|
|
void luaI_initfallbacks (void);
|
1997-02-26 20:38:41 +03:00
|
|
|
|
1994-11-07 18:20:56 +03:00
|
|
|
#endif
|
|
|
|
|