aboutsummaryrefslogtreecommitdiff
path: root/src/lua/ltm.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lua/ltm.h (renamed from src/lua-5.3/ltm.h)28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/lua-5.3/ltm.h b/src/lua/ltm.h
index 8170688..99b545e 100644
--- a/src/lua-5.3/ltm.h
+++ b/src/lua/ltm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltm.h,v 2.22.1.1 2017/04/19 17:20:42 roberto Exp $ 2** $Id: ltm.h $
3** Tag methods 3** Tag methods
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -40,10 +40,17 @@ typedef enum {
40 TM_LE, 40 TM_LE,
41 TM_CONCAT, 41 TM_CONCAT,
42 TM_CALL, 42 TM_CALL,
43 TM_CLOSE,
43 TM_N /* number of elements in the enum */ 44 TM_N /* number of elements in the enum */
44} TMS; 45} TMS;
45 46
46 47
48/*
49** Test whether there is no tagmethod.
50** (Because tagmethods use raw accesses, the result may be an "empty" nil.)
51*/
52#define notm(tm) ttisnil(tm)
53
47 54
48#define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 55#define gfasttm(g,et,e) ((et) == NULL ? NULL : \
49 ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 56 ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e]))
@@ -52,7 +59,7 @@ typedef enum {
52 59
53#define ttypename(x) luaT_typenames_[(x) + 1] 60#define ttypename(x) luaT_typenames_[(x) + 1]
54 61
55LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; 62LUAI_DDEC(const char *const luaT_typenames_[LUA_TOTALTYPES];)
56 63
57 64
58LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); 65LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o);
@@ -63,14 +70,25 @@ LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o,
63LUAI_FUNC void luaT_init (lua_State *L); 70LUAI_FUNC void luaT_init (lua_State *L);
64 71
65LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, 72LUAI_FUNC void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1,
66 const TValue *p2, TValue *p3, int hasres); 73 const TValue *p2, const TValue *p3);
67LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, 74LUAI_FUNC void luaT_callTMres (lua_State *L, const TValue *f,
68 StkId res, TMS event); 75 const TValue *p1, const TValue *p2, StkId p3);
69LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, 76LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
70 StkId res, TMS event); 77 StkId res, TMS event);
78LUAI_FUNC void luaT_tryconcatTM (lua_State *L);
79LUAI_FUNC void luaT_trybinassocTM (lua_State *L, const TValue *p1,
80 const TValue *p2, int inv, StkId res, TMS event);
81LUAI_FUNC void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2,
82 int inv, StkId res, TMS event);
71LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, 83LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1,
72 const TValue *p2, TMS event); 84 const TValue *p2, TMS event);
85LUAI_FUNC int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2,
86 int inv, int isfloat, TMS event);
73 87
88LUAI_FUNC void luaT_adjustvarargs (lua_State *L, int nfixparams,
89 struct CallInfo *ci, const Proto *p);
90LUAI_FUNC void luaT_getvarargs (lua_State *L, struct CallInfo *ci,
91 StkId where, int wanted);
74 92
75 93
76#endif 94#endif