1 /* $NetBSD: lapi.h,v 1.4 2015/10/08 13:21:00 mbalmer Exp $ */ 2 3 /* 4 ** Id: lapi.h,v 2.9 2015/03/06 19:49:50 roberto Exp 5 ** Auxiliary functions from Lua API 6 ** See Copyright Notice in lua.h 7 */ 8 9 #ifndef lapi_h 10 #define lapi_h 11 12 13 #include "llimits.h" 14 #include "lstate.h" 15 16 #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ 17 "stack overflow");} 18 19 #define adjustresults(L,nres) \ 20 { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } 21 22 #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ 23 "not enough elements in the stack") 24 25 26 #endif 27