xref: /freebsd/sys/contrib/openzfs/module/lua/ldebug.h (revision 9e5787d2284e187abb5b654d924394a65772e004)
1 /* BEGIN CSTYLED */
2 /*
3 ** $Id: ldebug.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $
4 ** Auxiliary functions from Debug Interface module
5 ** See Copyright Notice in lua.h
6 */
7 
8 #ifndef ldebug_h
9 #define ldebug_h
10 
11 
12 #include "lstate.h"
13 
14 
15 #define pcRel(pc, p)	(cast(int, (pc) - (p)->code) - 1)
16 
17 #define getfuncline(f,pc)	(((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
18 
19 #define resethookcount(L)	(L->hookcount = L->basehookcount)
20 
21 /* Active Lua function (given call info) */
22 #define ci_func(ci)		(clLvalue((ci)->func))
23 
24 
25 LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
26                                                 const char *opname);
27 LUAI_FUNC l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2);
28 LUAI_FUNC l_noret luaG_aritherror (lua_State *L, const TValue *p1,
29                                                  const TValue *p2);
30 LUAI_FUNC l_noret luaG_ordererror (lua_State *L, const TValue *p1,
31                                                  const TValue *p2);
32 LUAI_FUNC l_noret luaG_runerror (lua_State *L, const char *fmt, ...);
33 LUAI_FUNC l_noret luaG_errormsg (lua_State *L);
34 
35 #endif
36 /* END CSTYLED */
37