xref: /freebsd/sys/contrib/openzfs/module/lua/lvm.h (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1*61145dc2SMartin Matuska // SPDX-License-Identifier: MIT
2eda14cbcSMatt Macy /*
3eda14cbcSMatt Macy ** $Id: lvm.h,v 2.18.1.1 2013/04/12 18:48:47 roberto Exp $
4eda14cbcSMatt Macy ** Lua virtual machine
5eda14cbcSMatt Macy ** See Copyright Notice in lua.h
6eda14cbcSMatt Macy */
7eda14cbcSMatt Macy 
8eda14cbcSMatt Macy #ifndef lvm_h
9eda14cbcSMatt Macy #define lvm_h
10eda14cbcSMatt Macy 
11eda14cbcSMatt Macy 
12eda14cbcSMatt Macy #include "ldo.h"
13eda14cbcSMatt Macy #include "lobject.h"
14eda14cbcSMatt Macy #include "ltm.h"
15eda14cbcSMatt Macy 
16eda14cbcSMatt Macy 
17eda14cbcSMatt Macy #define tostring(L,o) (ttisstring(o) || (luaV_tostring(L, o)))
18eda14cbcSMatt Macy 
19eda14cbcSMatt Macy #define tonumber(o,n)	(ttisnumber(o) || (((o) = luaV_tonumber(o,n)) != NULL))
20eda14cbcSMatt Macy 
21eda14cbcSMatt Macy #define equalobj(L,o1,o2)  (ttisequal(o1, o2) && luaV_equalobj_(L, o1, o2))
22eda14cbcSMatt Macy 
23eda14cbcSMatt Macy #define luaV_rawequalobj(o1,o2)		equalobj(NULL,o1,o2)
24eda14cbcSMatt Macy 
25eda14cbcSMatt Macy 
26eda14cbcSMatt Macy /* not to called directly */
27eda14cbcSMatt Macy LUAI_FUNC int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2);
28eda14cbcSMatt Macy 
29eda14cbcSMatt Macy 
30eda14cbcSMatt Macy LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
31eda14cbcSMatt Macy LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r);
32eda14cbcSMatt Macy LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n);
33eda14cbcSMatt Macy LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj);
34eda14cbcSMatt Macy LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key,
35eda14cbcSMatt Macy                                             StkId val);
36eda14cbcSMatt Macy LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key,
37eda14cbcSMatt Macy                                             StkId val);
38eda14cbcSMatt Macy LUAI_FUNC void luaV_finishOp (lua_State *L);
39eda14cbcSMatt Macy LUAI_FUNC void luaV_execute (lua_State *L);
40eda14cbcSMatt Macy LUAI_FUNC void luaV_concat (lua_State *L, int total);
41eda14cbcSMatt Macy LUAI_FUNC void luaV_arith (lua_State *L, StkId ra, const TValue *rb,
42eda14cbcSMatt Macy                            const TValue *rc, TMS op);
43eda14cbcSMatt Macy LUAI_FUNC void luaV_objlen (lua_State *L, StkId ra, const TValue *rb);
44eda14cbcSMatt Macy 
45eda14cbcSMatt Macy #endif
46