1997-09-16 23:25:59 +04:00
|
|
|
/*
|
2015-03-06 22:49:50 +03:00
|
|
|
** $Id: lapi.h,v 2.8 2014/07/15 21:26:50 roberto Exp roberto $
|
1998-06-19 20:14:09 +04:00
|
|
|
** Auxiliary functions from Lua API
|
1997-09-16 23:25:59 +04:00
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lapi_h
|
|
|
|
#define lapi_h
|
|
|
|
|
|
|
|
|
2006-07-11 19:53:29 +04:00
|
|
|
#include "llimits.h"
|
|
|
|
#include "lstate.h"
|
1997-09-16 23:25:59 +04:00
|
|
|
|
2015-03-06 22:49:50 +03:00
|
|
|
#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \
|
2009-08-31 18:26:28 +04:00
|
|
|
"stack overflow");}
|
1997-09-16 23:25:59 +04:00
|
|
|
|
2009-03-10 20:14:37 +03:00
|
|
|
#define adjustresults(L,nres) \
|
2009-04-03 19:58:03 +04:00
|
|
|
{ if ((nres) == LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; }
|
2009-03-10 20:14:37 +03:00
|
|
|
|
2015-03-06 22:49:50 +03:00
|
|
|
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \
|
2009-11-27 18:37:59 +03:00
|
|
|
"not enough elements in the stack")
|
|
|
|
|
2009-03-10 20:14:37 +03:00
|
|
|
|
1997-09-16 23:25:59 +04:00
|
|
|
#endif
|