ldo.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. ** $Id: ldo.h,v 1.10 1999/11/22 13:12:07 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(L, 1); \
  16. L->stack.top++; }
  17. /* macros to convert from lua_Object to (TObject *) and back */
  18. #define Address(L, lo) ((lo)+L->stack.stack-1)
  19. #define Ref(L, st) ((st)-L->stack.stack+1)
  20. void luaD_init (lua_State *L);
  21. void luaD_adjusttop (lua_State *L, StkId newtop);
  22. void luaD_openstack (lua_State *L, int nelems);
  23. void luaD_lineHook (lua_State *L, int line);
  24. void luaD_callHook (lua_State *L, StkId base, const TProtoFunc *tf, int isreturn);
  25. void luaD_call (lua_State *L, TObject *func, int nResults);
  26. void luaD_callTM (lua_State *L, const TObject *f, int nParams, int nResults);
  27. int luaD_protectedrun (lua_State *L);
  28. void luaD_gcIM (lua_State *L, const TObject *o);
  29. void luaD_checkstack (lua_State *L, int n);
  30. #endif