dynwind.h 2.1 KB

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