lua/lapi.h

26 lines
574 B
C
Raw Normal View History

1997-09-16 12:25:59 -07:00
/*
2017-11-03 05:12:30 -07:00
** $Id: lapi.h,v 2.10 2017/11/01 18:20:48 roberto Exp roberto $
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
#include "llimits.h"
#include "lstate.h"
1997-09-16 12:25:59 -07:00
2017-11-03 05:12:30 -07:00
#define api_incr_top(L) {L->top++; api_check(L, L->top <= functop(L->func), \
"stack overflow");}
1997-09-16 12:25:59 -07:00
#define adjustresults(L,nres) \
2017-11-03 05:12:30 -07:00
{ if ((nres) == LUA_MULTRET && functop(L->func) < L->top) \
setfunctop(L->func, L->top); }
2017-11-01 11:20:48 -07:00
#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->func), \
"not enough elements in the stack")
1997-09-16 12:25:59 -07:00
#endif