Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #ifndef __CCP4_ERROR_GUARD
00027 #define __CCP4_ERROR_GUARD
00028
00029 #include <errno.h>
00030
00031
00032 #ifndef CCP4_ERRSYSTEM
00033 #define CCP4_ERRSYSTEM(x) (((x)&0xfff)<<24)
00034 #endif
00035 #ifndef CCP4_ERRLEVEL
00036 #define CCP4_ERRLEVEL(x) (((x)&0xf)<<16)
00037 #endif
00038 #ifndef CCP4_ERRSETLEVEL
00039 #define CCP4_ERRSETLEVEL(y,x) ((y) & (~CCP4_ERRLEVEL(0xf)) | CCP4_ERRLEVEL(x)))
00040 #endif
00041 #ifndef CCP4_ERRGETSYS
00042 #define CCP4_ERRGETSYS(x) (((x)>>24)&0xfff)
00043 #endif
00044 #ifndef CCP4_ERRGETLEVEL
00045 #define CCP4_ERRGETLEVEL(x) (((x)>>16)&0xf)
00046 #endif
00047 #ifndef CCP4_ERRGETCODE
00048 #define CCP4_ERRGETCODE(x) ((x)&0xffff)
00049 #endif
00050
00051 #define CCP4_ERR_SYS CCP4_ERRSYSTEM(0x0)
00052 #define CCP4_ERR_FILE CCP4_ERRSYSTEM(0x1)
00053 #define CCP4_ERR_COORD CCP4_ERRSYSTEM(0x2)
00054 #define CCP4_ERR_MTZ CCP4_ERRSYSTEM(0x3)
00055 #define CCP4_ERR_MAP CCP4_ERRSYSTEM(0x4)
00056 #define CCP4_ERR_UTILS CCP4_ERRSYSTEM(0x5)
00057 #define CCP4_ERR_PARS CCP4_ERRSYSTEM(0x6)
00058 #define CCP4_ERR_SYM CCP4_ERRSYSTEM(0x7)
00059 #define CCP4_ERR_GEN CCP4_ERRSYSTEM(0x8)
00060
00061 #define CCP4_COUNT(x) sizeof(x)/sizeof(x[0])
00062
00092 #ifdef __cplusplus
00093 extern "C" {
00094 #endif
00095 extern int ccp4_errno;
00096 #ifdef __cplusplus
00097 }
00098 #endif
00099
00100 #ifdef __cplusplus
00101 namespace CCP4 {
00102 extern "C" {
00103 #endif
00104
00111 void ccp4_error( const char *);
00112
00120 const char *ccp4_strerror( int);
00121
00126 void ccp4_fatal(const char *);
00127
00141 int ccp4_liberr_verbosity(int iverb);
00142
00157 void ccp4_signal(const int, const char *const, void (*)());
00158
00159 int cfile_perror(const char *);
00160
00161 #ifdef __cplusplus
00162 }
00163 }
00164 #endif
00165
00166 #endif
00168
00169
00170
00171
00172