Rewording for "make an intervention".
[bpt/guile.git] / libguile / dynwind.h
1 /* classes: h_files */
2
3 #ifndef SCM_DYNWIND_H
4 #define SCM_DYNWIND_H
5
6 /* Copyright (C) 1995,1996,1998,1999,2000,2003,2004, 2006, 2008 Free Software Foundation, Inc.
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24 \f
25
26 #include "libguile/__scm.h"
27
28 \f
29
30 typedef void (*scm_t_guard) (void *);
31 typedef SCM (*scm_t_inner) (void *);
32
33 SCM_API SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
34 SCM_API SCM scm_internal_dynamic_wind (scm_t_guard before,
35 scm_t_inner inner,
36 scm_t_guard after,
37 void *inner_data,
38 void *guard_data);
39 SCM_API void scm_dowinds (SCM to, long delta);
40 SCM_INTERNAL void scm_i_dowinds (SCM to, long delta,
41 void (*turn_func) (void *), void *data);
42 SCM_INTERNAL void scm_init_dynwind (void);
43
44 SCM_API void scm_swap_bindings (SCM vars, SCM vals);
45
46 typedef enum {
47 SCM_F_DYNWIND_REWINDABLE = (1 << 0)
48 } scm_t_dynwind_flags;
49
50 typedef enum {
51 SCM_F_WIND_EXPLICITLY = (1 << 0)
52 } scm_t_wind_flags;
53
54 SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
55 SCM_API void scm_dynwind_end (void);
56
57 SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
58 scm_t_wind_flags);
59 SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
60 scm_t_wind_flags);
61
62 SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
63 scm_t_wind_flags);
64 SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
65 scm_t_wind_flags);
66
67 SCM_API void scm_dynwind_free (void *mem);
68
69 #ifdef GUILE_DEBUG
70 SCM_API SCM scm_wind_chain (void);
71 #endif /*GUILE_DEBUG*/
72
73 #endif /* SCM_DYNWIND_H */
74
75 /*
76 Local Variables:
77 c-file-style: "gnu"
78 End:
79 */