Remove unused macros in goops.c
[bpt/guile.git] / libguile / throw.h
CommitLineData
0f2d19dd
JB
1/* classes: h_files */
2
0527e687
DH
3#ifndef SCM_THROW_H
4#define SCM_THROW_H
5
7e2fd4e7 6/* Copyright (C) 1995,1996,1998,2000, 2006, 2008, 2010, 2014 Free Software Foundation, Inc.
0527e687 7 *
73be1d9e 8 * This library is free software; you can redistribute it and/or
53befeb7
NJ
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.
0527e687 12 *
53befeb7
NJ
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
73be1d9e
MV
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
0527e687 17 *
73be1d9e
MV
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
53befeb7
NJ
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * 02110-1301 USA
73be1d9e 22 */
0527e687 23
0f2d19dd
JB
24\f
25
b4309c3c 26#include "libguile/__scm.h"
0f2d19dd
JB
27
28\f
fec45334 29
92c2555f
MV
30typedef SCM (*scm_t_catch_body) (void *data);
31typedef SCM (*scm_t_catch_handler) (void *data,
7866a09b 32 SCM tag, SCM throw_args);
650fa1ab 33
43e01b1e
NJ
34SCM_API SCM scm_c_catch (SCM tag,
35 scm_t_catch_body body,
36 void *body_data,
37 scm_t_catch_handler handler,
38 void *handler_data,
39 scm_t_catch_handler pre_unwind_handler,
40 void *pre_unwind_handler_data);
41
42SCM_API SCM scm_c_with_throw_handler (SCM tag,
43 scm_t_catch_body body,
44 void *body_data,
45 scm_t_catch_handler handler,
46 void *handler_data,
47 int lazy_catch_p);
48
33b001fd
MV
49SCM_API SCM scm_internal_catch (SCM tag,
50 scm_t_catch_body body,
51 void *body_data,
52 scm_t_catch_handler handler,
53 void *handler_data);
54
816a6f06
JB
55/* The first argument to scm_body_thunk should be a pointer to one of
56 these. See the implementation of catch in throw.c. */
57struct scm_body_thunk_data
58{
59 /* The tag being caught. We only use it to figure out what
60 arguments to pass to the body procedure; see scm_catch_thunk_body for
61 details. */
62 SCM tag;
63
64 /* The Scheme procedure object constituting the catch body.
65 scm_body_by_proc invokes this. */
66 SCM body_proc;
67};
68
33b001fd 69SCM_API SCM scm_body_thunk (void *);
816a6f06
JB
70
71
33b001fd
MV
72SCM_API SCM scm_handle_by_proc (void *, SCM, SCM);
73SCM_API SCM scm_handle_by_proc_catching_all (void *, SCM, SCM);
74SCM_API SCM scm_handle_by_message (void *, SCM, SCM);
75SCM_API SCM scm_handle_by_message_noexit (void *, SCM, SCM);
76SCM_API SCM scm_handle_by_throw (void *, SCM, SCM);
77SCM_API int scm_exit_status (SCM args);
650fa1ab 78
43e01b1e 79SCM_API SCM scm_catch_with_pre_unwind_handler (SCM tag, SCM thunk, SCM handler, SCM lazy_handler);
33b001fd 80SCM_API SCM scm_catch (SCM tag, SCM thunk, SCM handler);
43e01b1e 81SCM_API SCM scm_with_throw_handler (SCM tag, SCM thunk, SCM handler);
36c40440 82SCM_API SCM scm_ithrow (SCM key, SCM args, int no_return);
1a36eef2 83
7e2fd4e7
AW
84/* This throws to the `stack-overflow' key, without running pre-unwind
85 handlers. */
86SCM_API void scm_report_stack_overflow (void);
87
c2247b78
AW
88/* This throws to the `out-of-memory' key, without running pre-unwind
89 handlers. */
90SCM_API void scm_report_out_of_memory (void);
91
33b001fd 92SCM_API SCM scm_throw (SCM key, SCM args);
102dbb6f 93SCM_INTERNAL void scm_init_throw (void);
0527e687
DH
94
95#endif /* SCM_THROW_H */
89e00824
ML
96
97/*
98 Local Variables:
99 c-file-style: "gnu"
100 End:
101*/