ldo.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. ** $Id: ldo.h,v 1.41 2002/03/20 12:52:32 roberto Exp roberto $
  3. ** Stack and Call structure of Lua
  4. ** See Copyright Notice in lua.h
  5. */
  6. #ifndef ldo_h
  7. #define ldo_h
  8. #include "lobject.h"
  9. #include "lstate.h"
  10. /*
  11. ** macro to increment stack top.
  12. ** There must be always an empty slot at the L->stack.top
  13. */
  14. #define incr_top(L) \
  15. {if (L->top >= L->stack_last) luaD_growstack(L, 1); L->top++;}
  16. #define luaD_checkstack(L,n) \
  17. if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TObject)) \
  18. luaD_growstack(L, n)
  19. #define savestack(L,p) ((char *)(p) - (char *)L->stack)
  20. #define restorestack(L,n) ((TObject *)((char *)L->stack + (n)))
  21. void luaD_lineHook (lua_State *L, int line);
  22. StkId luaD_precall (lua_State *L, StkId func);
  23. void luaD_call (lua_State *L, StkId func, int nResults);
  24. void luaD_poscall (lua_State *L, int wanted, StkId firstResult);
  25. void luaD_reallocCI (lua_State *L, int newsize);
  26. void luaD_reallocstack (lua_State *L, int newsize);
  27. void luaD_growstack (lua_State *L, int n);
  28. void luaD_error (lua_State *L, const char *s);
  29. void luaD_breakrun (lua_State *L, int errcode);
  30. int luaD_runprotected (lua_State *L, void (*f)(lua_State *, void *), void *ud);
  31. #endif