dynwind.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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, 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. typedef void (*scm_t_guard) (void *);
  23. typedef SCM (*scm_t_inner) (void *);
  24. SCM_API SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
  25. SCM_API SCM scm_internal_dynamic_wind (scm_t_guard before,
  26. scm_t_inner inner,
  27. scm_t_guard after,
  28. void *inner_data,
  29. void *guard_data);
  30. SCM_API void scm_dowinds (SCM to, long delta);
  31. SCM_INTERNAL void scm_i_dowinds (SCM to, long delta,
  32. void (*turn_func) (void *), void *data);
  33. SCM_INTERNAL void scm_init_dynwind (void);
  34. SCM_API void scm_swap_bindings (SCM vars, SCM vals);
  35. typedef enum {
  36. SCM_F_DYNWIND_REWINDABLE = (1 << 0)
  37. } scm_t_dynwind_flags;
  38. typedef enum {
  39. SCM_F_WIND_EXPLICITLY = (1 << 0)
  40. } scm_t_wind_flags;
  41. SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
  42. SCM_API void scm_dynwind_end (void);
  43. SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
  44. scm_t_wind_flags);
  45. SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
  46. scm_t_wind_flags);
  47. SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
  48. scm_t_wind_flags);
  49. SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
  50. scm_t_wind_flags);
  51. SCM_API void scm_dynwind_free (void *mem);
  52. #ifdef GUILE_DEBUG
  53. SCM_API SCM scm_wind_chain (void);
  54. #endif /*GUILE_DEBUG*/
  55. #endif /* SCM_DYNWIND_H */
  56. /*
  57. Local Variables:
  58. c-file-style: "gnu"
  59. End:
  60. */