ITK Function Reference
(V10000.1.0.60_20160308.00)
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
error_datatypes.h
Go to the documentation of this file.
1
/*HEAD ERROR_DATATYPES HHH SYSS */
2
/*===============================================================================
3
4
Copyright (c) 2003-2004 Unigraphics Solutions Inc.
5
Unpublished - All rights reserved
6
7
=================================================================================
8
File description:
9
10
Header file to define data types for the ERROR module.
11
12
=================================================================================
13
Date Name Description of Change
14
NX3
15
17-Jul-2003 Lavarini Split from error.h
16
17-Oct-2003 Lavarini Add ERROR_FINALLY_TYPE so support error_finally.h
17
12-Jan-2004 Lavarini Replace ERROR_raise_handler_t with
18
ERROR_raise_handler_fn_p_t and change signature
19
Implement ERROR_raise_handler_id_t
20
23-Jan-2004 Lavarini Rename ERROR_handler_t to ERROR_debug_handler_fn_p_t
21
Implement ERROR_debug_handler_t
22
27-Feb-2004 Alasdair Mackintosh Add ERROR_THIRD_PARTY_ERROR
23
24-Mar-2005 Jack Marr Include stdarg.h to get the va_list typedef
24
27-Sep-2005 Lavarini Add ERROR_QUIT_TYPE
25
$HISTORY$
26
===============================================================================*/
27
28
#ifndef ERROR_DATATYPES_H_INCLUDED
29
#define ERROR_DATATYPES_H_INCLUDED
30
31
#include <stdarg.h>
/* define va_list */
32
33
/* Define the special code number for internal errors.
34
(give unix twice the space for sigs => 65!)
35
<BJS> 18-Nov-94
36
Unfortunately Windows (NT) has a symbol ERROR_INTERNAL_ERROR too
37
so I've renamed ours to ERROR_INTERNAL_ERROR_CODE.
38
Added ERROR_USER_ABORT for user aborts
39
<AJM> 27-Feb-04
40
Added ERROR_THIRD_PARTY_ERROR for C++ exceptions thrown in external libraries.
41
*/
42
43
#define ERROR_INTERNAL_ERROR_CODE 65
44
#define ERROR_USER_ABORT 66
45
#define ERROR_THIRD_PARTY_ERROR 67
46
47
/* <BJS> 18-Nov-94
48
This is the maximum error code generated by the ERROR module itself
49
*/
50
51
#define ERROR_MAX_INTERNAL_CODE 67
52
53
/* <BJS> 11-Mar-93
54
default value for ERROR_this_file_name.
55
*/
56
57
#ifndef ERROR__STATIC_FILE_NAME
58
#define ERROR_this_file_name __FILE__
59
#endif
60
61
62
/* The ERROR_line macro saves having to type in two arguments to every
63
call of an error reporting routine.
64
*/
65
66
#define ERROR_line ERROR_this_file_name, __LINE__
67
68
#define ERROR_system_log_name_len 256
69
70
/* <BJS> 16-Apr-93
71
Enum for exception types
72
*/
73
74
typedef
enum
75
{
ERROR_NO_EXCEPTION
,
/* no exception has ever been thrown */
76
ERROR_ESCAPE
,
/* last exception caused by ERROR_escape */
77
ERROR_ERROR
/* last exception caused by ERROR_raise/ERROR_internal */
78
}
ERROR_exception_type_t
;
79
80
/* <DJL> 17-Jul-2003
81
* Enum to specify in the Error_Exception class just what macro is
82
* being used.
83
*/
84
typedef
enum
ERROR_recover_type_e
85
{
86
ERROR_PROTECT_TYPE
,
87
ERROR_ESCAPE_TYPE
,
88
ERROR_TOP_TYPE
,
89
ERROR_UF_TYPE
,
90
ERROR_USERABORT_TYPE
,
91
ERROR_CALLBACK_PROTECT_TYPE
,
92
ERROR_CALLBACK_WATCH_TYPE
,
93
ERROR_FRUSTRUM_PROTECT_TYPE
,
94
ERROR_FINALLY_TYPE
,
95
ERROR_QUIT_TYPE
96
}
ERROR_recover_type_t
;
97
98
/* ERROR_log_file_status_t
99
100
<BJS> 14-May-93
101
This enum gives possible values for the log file status
102
and dictates the behaviour on exitting this program run
103
*/
104
105
typedef
enum
106
{
ERROR_LOG_FILE_NOT_OPEN
,
107
ERROR_KEEP_LOG_FILE
,
108
ERROR_KEEP_LOG_FILE_ON_NOTE
,
/* implies keep on error too */
109
ERROR_KEEP_LOG_FILE_ON_ERROR
110
}
ERROR_log_file_status_t
;
111
112
/*
113
<BJS> name of argument commented out to get through AGA
114
<ARMB> finally got it acceptable, with argument name, to cc, AGA and g++. (Based on Stroustrup p.208)
115
<AJF> Can now pass in a pointer to some data, which gets passed to the error handler when it is called.
116
*/
117
typedef
void (*
ERROR_debug_handler_fn_p_t
)(
int
failure_code,
void
*data);
118
typedef
struct
ERROR_debug_handler_s
119
{
120
ERROR_debug_handler_fn_p_t
pHandler
;
121
void
*
pData
;
122
}
ERROR_debug_handler_t
, *
ERROR_debug_handler_p_t
;
123
124
125
typedef
void (*
ERROR_note_handler_t
)(
const
char
*file_name,
int
line_number,
const
char
*control_string, va_list ap);
126
127
/* <BJS> 19-Oct-01
128
Raise handlers take no args (you can use ERROR_ask routines to find out
129
what is happening).
130
<DJL> 12-Jan-04
131
Rename typedef, and pass in error code because ERROR_ask routines are now
132
limited to being called from RECOVER blocks
133
*/
134
135
typedef
void (*
ERROR_raise_handler_fn_p_t
)(
int
error_code );
136
137
/*
138
Data type that defines a particular raise handler. This id is returned
139
by the set routine to specify the handler just set, and subsequently used
140
by the cancel routine when that particular handler is no longer needed.
141
*/
142
typedef
ERROR_raise_handler_fn_p_t
ERROR_raise_handler_id_t
;
143
144
/* <BJS> 26-Mar-93
145
Data types for routines to manipulate user suppliable signal routine.
146
Is simply called with the signal number and may return to
147
faulting code (e.g. for ^C) or continue fault handling
148
*/
149
150
typedef
enum
151
{
ERROR_return_to_faulting_code
,
152
ERROR_continue_fault_handling
153
}
ERROR_signal_action_t
;
154
155
typedef
ERROR_signal_action_t
(*
ERROR_signal_fn_t
) (
int
/* signal_number */
);
156
157
typedef
generic_routine_t
ERROR_generic_routine_t
;
158
159
/* <TAS> 19-Aug-96
160
This is a registered function that determines if the
161
error reporting mechinism should be suppressed.
162
*/
163
typedef
logical
(*
ERROR_suppression_fn_p_t
) (
int
error );
164
165
#endif
/* ERROR_DATATYPES_H_INCLUDED */