gpp4  1.3.1
ccp4_errno.h
Go to the documentation of this file.
1 /*
2  ccp4_errno.h: Header file for error handling routines
3  Copyright (C) 2001 CCLRC, Charles Ballard and Martyn Winn
4 
5  This library is free software: you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation, either
8  version 3 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with This library. If not, see
17  <http://www.gnu.org/licenses/>.
18 
19 */
26 #ifndef __CCP4_ERROR_GUARD
27 #define __CCP4_ERROR_GUARD
28 
29 #include <errno.h>
30 
31 
32 #ifndef CCP4_ERRSYSTEM
33 #define CCP4_ERRSYSTEM(x) (((x)&0xfff)<<24)
34 #endif
35 #ifndef CCP4_ERRLEVEL
36 #define CCP4_ERRLEVEL(x) (((x)&0xf)<<16)
37 #endif
38 #ifndef CCP4_ERRSETLEVEL
39 #define CCP4_ERRSETLEVEL(y,x) ((y) & (~CCP4_ERRLEVEL(0xf)) | CCP4_ERRLEVEL(x)))
40 #endif
41 #ifndef CCP4_ERRGETSYS
42 #define CCP4_ERRGETSYS(x) (((x)>>24)&0xfff)
43 #endif
44 #ifndef CCP4_ERRGETLEVEL
45 #define CCP4_ERRGETLEVEL(x) (((x)>>16)&0xf)
46 #endif
47 #ifndef CCP4_ERRGETCODE
48 #define CCP4_ERRGETCODE(x) ((x)&0xffff)
49 #endif
50 
51 #define CCP4_ERR_SYS CCP4_ERRSYSTEM(0x0)
52 #define CCP4_ERR_FILE CCP4_ERRSYSTEM(0x1)
53 #define CCP4_ERR_COORD CCP4_ERRSYSTEM(0x2)
54 #define CCP4_ERR_MTZ CCP4_ERRSYSTEM(0x3)
55 #define CCP4_ERR_MAP CCP4_ERRSYSTEM(0x4)
56 #define CCP4_ERR_UTILS CCP4_ERRSYSTEM(0x5)
57 #define CCP4_ERR_PARS CCP4_ERRSYSTEM(0x6)
58 #define CCP4_ERR_SYM CCP4_ERRSYSTEM(0x7)
59 #define CCP4_ERR_GEN CCP4_ERRSYSTEM(0x8)
60 
61 #define CCP4_COUNT(x) sizeof(x)/sizeof(x[0])
62 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 extern int ccp4_errno;
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #ifdef __cplusplus
101 namespace CCP4 {
102 extern "C" {
103 #endif
104 
111 void ccp4_error( const char *);
112 
120 const char *ccp4_strerror( int);
121 
126 void ccp4_fatal(const char *);
127 
141 int ccp4_liberr_verbosity(int iverb);
142 
157 void ccp4_signal(const int, const char *const, void (*)());
158 
159 int cfile_perror(const char *);
160 
161 #ifdef __cplusplus
162 }
163 }
164 #endif
165 
166 #endif
168 /*
169  Local variables:
170  mode: font-lock
171  End:
172 */
ccp4_signal
void ccp4_signal(const int, const char *const, void(*)())
Definition: library_err.c:278
ccp4_fatal
void ccp4_fatal(const char *)
Definition: library_err.c:235
ccp4_error
void ccp4_error(const char *)
Definition: library_err.c:212
ccp4_strerror
const char * ccp4_strerror(int)
Definition: library_err.c:190
ccp4_liberr_verbosity
int ccp4_liberr_verbosity(int iverb)
Definition: library_err.c:258
ccp4_errno
int ccp4_errno
Definition: library_err.c:33