ldo.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. ** $Id: ldo.h,v 1.5 1998/07/12 16:14:34 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. #define MULT_RET 255
  11. /*
  12. ** macro to increment stack top.
  13. ** There must be always an empty slot at the L->stack.top
  14. */
  15. #define incr_top { if (L->stack.top >= L->stack.last) luaD_checkstack(1); \
  16. L->stack.top++; }
  17. /* macros to convert from lua_Object to (TObject *) and back */
  18. #define Address(lo) ((lo)+L->stack.stack-1)
  19. #define Ref(st) ((st)-L->stack.stack+1)
  20. void luaD_init (void);
  21. void luaD_adjusttop (StkId newtop);
  22. void luaD_openstack (int nelems);
  23. void luaD_lineHook (int line);
  24. void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn);
  25. void luaD_calln (int nArgs, int nResults);
  26. void luaD_callTM (TObject *f, int nParams, int nResults);
  27. int luaD_protectedrun (void);
  28. void luaD_gcIM (TObject *o);
  29. void luaD_travstack (int (*fn)(TObject *));
  30. void luaD_checkstack (int n);
  31. #endif