The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
lapi.h
Go to the documentation of this file.
1 /*
2 ** Auxiliary functions from Lua API
3 ** See Copyright Notice in lua.h
4 */
5 
6 #ifndef lapi_h
7 #define lapi_h
8 
9 
10 #include "llimits.h"
11 #include "lstate.h"
12 
13 #define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
14  "stack overflow");}
15 
16 #define adjustresults(L,nres) \
17  { if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
18 
19 #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
20  "not enough elements in the stack")
21 
22 
23 #endif