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