File: ltm.h

package info (click to toggle)
scummvm 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 450,580 kB
  • sloc: cpp: 4,299,825; asm: 28,322; python: 12,901; sh: 11,302; java: 9,289; xml: 7,895; perl: 2,639; ansic: 2,465; yacc: 1,670; javascript: 1,020; makefile: 933; lex: 578; awk: 275; objc: 82; sed: 11; php: 1
file content (62 lines) | stat: -rw-r--r-- 1,094 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
** Tag methods
** See Copyright Notice in lua.h
*/

#ifndef GRIM_LTM_H
#define GRIM_LTM_H

#include "engines/grim/lua/lobject.h"
#include "engines/grim/lua/lstate.h"

namespace Grim {

/*
* 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
} eIMS;
typedef int32 IMS;

#define IM_N 18

struct IM {
	TObject int_method[IM_N];
};

#define luaT_getim(tag, event)  (&IMtable[-(tag)].int_method[event])
#define luaT_getimbyObj(o, e)   (luaT_getim(luaT_efectivetag(o), (e)))

extern const char *luaT_eventname[];

void luaT_init();
void luaT_realtag(int32 tag);
int32 luaT_efectivetag(TObject *o);
void luaT_settagmethod(int32 t, const char *event, TObject *func);
TObject *luaT_gettagmethod(int32 t, const char *event);
const char *luaT_travtagmethods(int32 (*fn)(TObject *));

void luaT_setfallback();  // only if LUA_COMPAT2_5

} // end of namespace Grim

#endif