Convert emit-linear-dispatch to use match
[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, 2011, 2012 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 #include "libguile/dynstack.h"
28
29 \f
30
31 SCM_API SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
32
33 SCM_INTERNAL void scm_init_dynwind (void);
34
35 SCM_API void scm_swap_bindings (SCM vars, SCM vals);
36
37 typedef enum {
38 SCM_F_DYNWIND_REWINDABLE = SCM_F_DYNSTACK_FRAME_REWINDABLE
39 } scm_t_dynwind_flags;
40
41 typedef enum {
42 SCM_F_WIND_EXPLICITLY = SCM_F_DYNSTACK_WINDER_EXPLICIT
43 } scm_t_wind_flags;
44
45 SCM_API void scm_dynwind_begin (scm_t_dynwind_flags);
46 SCM_API void scm_dynwind_end (void);
47
48 SCM_API void scm_dynwind_unwind_handler (void (*func) (void *), void *data,
49 scm_t_wind_flags);
50 SCM_API void scm_dynwind_rewind_handler (void (*func) (void *), void *data,
51 scm_t_wind_flags);
52
53 SCM_API void scm_dynwind_unwind_handler_with_scm (void (*func) (SCM), SCM data,
54 scm_t_wind_flags);
55 SCM_API void scm_dynwind_rewind_handler_with_scm (void (*func) (SCM), SCM data,
56 scm_t_wind_flags);
57
58 SCM_API void scm_dynwind_free (void *mem);
59
60
61 #endif /* SCM_DYNWIND_H */
62
63 /*
64 Local Variables:
65 c-file-style: "gnu"
66 End:
67 */