stacks.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* classes: h_files */
  2. #ifndef SCM_STACKS_H
  3. #define SCM_STACKS_H
  4. /* Copyright (C) 1995,1996,2000,2001, 2004, 2006, 2008 Free Software Foundation, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either version 3 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #include "libguile/__scm.h"
  22. #include "libguile/frames.h"
  23. /* {Frames and stacks}
  24. */
  25. SCM_API SCM scm_stack_type;
  26. #define SCM_STACK_LAYOUT \
  27. "pw" /* len */ \
  28. "pw" /* id */ \
  29. "pw" /* frame */
  30. #define SCM_STACKP(obj) (SCM_STRUCTP (obj) && scm_is_eq (SCM_STRUCT_VTABLE (obj), scm_stack_type))
  31. #define SCM_STACK_LENGTH(obj) (scm_to_long (SCM_STRUCT_SLOT_REF (obj,0)))
  32. #define SCM_SET_STACK_LENGTH(obj,f) (SCM_STRUCT_SLOT_SET (obj,0,scm_from_long (f)))
  33. #define SCM_STACK_ID(obj) (SCM_STRUCT_SLOT_REF (obj,1))
  34. #define SCM_SET_STACK_ID(obj,f) (SCM_STRUCT_SLOT_SET (obj,1,f))
  35. #define SCM_STACK_FRAME(obj) (SCM_STRUCT_SLOT_REF (obj,2))
  36. #define SCM_SET_STACK_FRAME(obj,f) (SCM_STRUCT_SLOT_SET (obj,2,f))
  37. #define SCM_FRAMEP(obj) (SCM_VM_FRAME_P (obj))
  38. SCM_API SCM scm_stack_p (SCM obj);
  39. SCM_API SCM scm_make_stack (SCM obj, SCM args);
  40. SCM_API SCM scm_stack_id (SCM stack);
  41. SCM_API SCM scm_stack_ref (SCM stack, SCM i);
  42. SCM_API SCM scm_stack_length (SCM stack);
  43. SCM_INTERNAL void scm_init_stacks (void);
  44. #endif /* SCM_STACKS_H */
  45. /*
  46. Local Variables:
  47. c-file-style: "gnu"
  48. End:
  49. */