ldo.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. ** $Id: ldo.h,v 1.4 1997/12/15 16:17:20 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_call (StkId base, int nResults);
  26. void luaD_calln (int nArgs, int nResults);
  27. void luaD_callTM (TObject *f, int nParams, int nResults);
  28. int luaD_protectedrun (int nResults);
  29. void luaD_gcIM (TObject *o);
  30. void luaD_travstack (int (*fn)(TObject *));
  31. void luaD_checkstack (int n);
  32. #endif