lapi.h 574 B

12345678910111213141516171819202122232425
  1. /*
  2. ** $Id: lapi.h,v 2.10 2017/11/01 18:20:48 roberto Exp roberto $
  3. ** Auxiliary functions from Lua API
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef lapi_h
  7. #define lapi_h
  8. #include "llimits.h"
  9. #include "lstate.h"
  10. #define api_incr_top(L) {L->top++; api_check(L, L->top <= functop(L->func), \
  11. "stack overflow");}
  12. #define adjustresults(L,nres) \
  13. { if ((nres) == LUA_MULTRET && functop(L->func) < L->top) \
  14. setfunctop(L->func, L->top); }
  15. #define api_checknelems(L,n) api_check(L, (n) < (L->top - L->func), \
  16. "not enough elements in the stack")
  17. #endif