diff options
author | Li Jin <dragon-fly@qq.com> | 2022-10-31 11:32:33 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-11-09 11:29:32 +0800 |
commit | 417ec1a37922c6178900adfec70628cad46731ff (patch) | |
tree | a5a2d74927ad2c41b5a16264a78409e1c0334b72 /win-build/Lua53/ltm.h | |
parent | 3dd607c8887d2fe0186668aabca31bb84a41e2da (diff) | |
download | yuescript-417ec1a37922c6178900adfec70628cad46731ff.tar.gz yuescript-417ec1a37922c6178900adfec70628cad46731ff.tar.bz2 yuescript-417ec1a37922c6178900adfec70628cad46731ff.zip |
fix issue #112 and issue #113.
Diffstat (limited to 'win-build/Lua53/ltm.h')
-rw-r--r-- | win-build/Lua53/ltm.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/win-build/Lua53/ltm.h b/win-build/Lua53/ltm.h new file mode 100644 index 0000000..8170688 --- /dev/null +++ b/win-build/Lua53/ltm.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | ** $Id: ltm.h,v 2.22.1.1 2017/04/19 17:20:42 roberto Exp $ | ||
3 | ** Tag methods | ||
4 | ** See Copyright Notice in lua.h | ||
5 | */ | ||
6 | |||
7 | #ifndef ltm_h | ||
8 | #define ltm_h | ||
9 | |||
10 | |||
11 | #include "lobject.h" | ||
12 | |||
13 | |||
14 | /* | ||
15 | * WARNING: if you change the order of this enumeration, | ||
16 | * grep "ORDER TM" and "ORDER OP" | ||
17 | */ | ||
18 | typedef enum { | ||
19 | TM_INDEX, | ||
20 | TM_NEWINDEX, | ||
21 | TM_GC, | ||
22 | TM_MODE, | ||
23 | TM_LEN, | ||
24 | TM_EQ, /* last tag method with fast access */ | ||
25 | TM_ADD, | ||
26 | TM_SUB, | ||
27 | TM_MUL, | ||
28 | TM_MOD, | ||
29 | TM_POW, | ||
30 | TM_DIV, | ||
31 | TM_IDIV, | ||
32 | TM_BAND, | ||
33 | TM_BOR, | ||
34 | TM_BXOR, | ||
35 | TM_SHL, | ||
36 | TM_SHR, | ||
37 | TM_UNM, | ||
38 | TM_BNOT, | ||
39 | TM_LT, | ||
40 | TM_LE, | ||
41 | TM_CONCAT, | ||
42 | TM_CALL, | ||
43 | TM_N /* number of elements in the enum */ | ||
44 | } TMS; | ||
45 | |||
46 | |||
47 | |||
48 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ | ||
49 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) | ||
50 | |||
51 | #define fasttm(l,et,e) gfasttm(G(l), et, e) | ||
52 | |||
53 | #define ttypename(x) luaT_typenames_[(x) + 1] | ||
54 | |||
55 | LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; | ||
56 | |||
57 | |||
58 | LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); | ||
59 | |||
60 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); | ||
61 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, | ||
62 | TMS event); | ||
63 | LUAI_FUNC void luaT_init (lua_State *L); | ||
64 | |||
65 | LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, | ||
66 | const TValue *p2, TValue *p3, int hasres); | ||
67 | LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, | ||
68 | StkId res, TMS event); | ||
69 | LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, | ||
70 | StkId res, TMS event); | ||
71 | LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, | ||
72 | const TValue *p2, TMS event); | ||
73 | |||
74 | |||
75 | |||
76 | #endif | ||