dynwind.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef SCM_DYNWIND_H
  2. #define SCM_DYNWIND_H
  3. /* Copyright 1995-1996,1998-2000,2003-2004,2006,2008,2011-2012,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include "libguile/dynstack.h"
  18. SCM_API SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
  19. SCM_INTERNAL void scm_init_dynwind (void);
  20. SCM_API void scm_swap_bindings (SCM vars, SCM vals);
  21. typedef enum {
  22. SCM_F_DYNWIND_REWINDABLE = SCM_F_DYNSTACK_FRAME_REWINDABLE
  23. } scm_t_dynwind_flags;
  24. typedef enum {
  25. SCM_F_WIND_EXPLICITLY = SCM_F_DYNSTACK_WINDER_EXPLICIT
  26. } scm_t_wind_flags;
  27. SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
  28. SCM_API void scm_dynwind_end (void);
  29. SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
  30. scm_t_wind_flags);
  31. SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
  32. scm_t_wind_flags);
  33. SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
  34. scm_t_wind_flags);
  35. SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
  36. scm_t_wind_flags);
  37. SCM_API void scm_dynwind_free (void *mem);
  38. #endif /* SCM_DYNWIND_H */