xref: /freebsd/sys/contrib/openzfs/module/lua/lapi.h (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1 /* BEGIN CSTYLED */
2 /*
3 ** $Id: lapi.h,v 2.7.1.1 2013/04/12 18:48:47 roberto Exp $
4 ** Auxiliary functions from Lua API
5 ** See Copyright Notice in lua.h
6 */
7 
8 #ifndef lapi_h
9 #define lapi_h
10 
11 
12 #include "llimits.h"
13 #include "lstate.h"
14 
15 #define api_incr_top(L)   {L->top++; api_check(L, L->top <= L->ci->top, \
16 				"stack overflow");}
17 
18 #define adjustresults(L,nres) \
19     { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
20 
21 #define api_checknelems(L,n)	api_check(L, (n) < (L->top - L->ci->func), \
22 				  "not enough elements in the stack")
23 
24 
25 #endif
26 /* END CSTYLED */
27