dynwind.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* classes: h_files */
  2. #ifndef SCM_DYNWIND_H
  3. #define SCM_DYNWIND_H
  4. /* Copyright (C) 1995,1996,1998,1999,2000,2003,2004, 2006 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
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but 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 02110-1301 USA
  19. */
  20. #include "libguile/__scm.h"
  21. typedef void (*scm_t_guard) (void *);
  22. typedef SCM (*scm_t_inner) (void *);
  23. SCM_API SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
  24. SCM_API SCM scm_internal_dynamic_wind (scm_t_guard before,
  25. scm_t_inner inner,
  26. scm_t_guard after,
  27. void *inner_data,
  28. void *guard_data);
  29. SCM_API void scm_dowinds (SCM to, long delta);
  30. SCM_API void scm_i_dowinds (SCM to, long delta,
  31. void (*turn_func) (void *), void *data);
  32. SCM_API void scm_init_dynwind (void);
  33. SCM_API void scm_swap_bindings (SCM vars, SCM vals);
  34. typedef enum {
  35. SCM_F_DYNWIND_REWINDABLE = (1 << 0)
  36. } scm_t_dynwind_flags;
  37. typedef enum {
  38. SCM_F_WIND_EXPLICITLY = (1 << 0)
  39. } scm_t_wind_flags;
  40. SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
  41. SCM_API void scm_dynwind_end (void);
  42. SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
  43. scm_t_wind_flags);
  44. SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
  45. scm_t_wind_flags);
  46. SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
  47. scm_t_wind_flags);
  48. SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
  49. scm_t_wind_flags);
  50. SCM_API void scm_dynwind_free (void *mem);
  51. #ifdef GUILE_DEBUG
  52. SCM_API SCM scm_wind_chain (void);
  53. #endif /*GUILE_DEBUG*/
  54. #endif /* SCM_DYNWIND_H */
  55. /*
  56. Local Variables:
  57. c-file-style: "gnu"
  58. End:
  59. */