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
00020
00021
00028 #ifndef __CCP4_ERROR_GUARD
00029 #define __CCP4_ERROR_GUARD
00030
00031 #include <errno.h>
00032
00033
00034 #ifndef CCP4_ERRSYSTEM
00035 #define CCP4_ERRSYSTEM(x) (((x)&0xfff)<<24)
00036 #endif
00037 #ifndef CCP4_ERRLEVEL
00038 #define CCP4_ERRLEVEL(x) (((x)&0xf)<<16)
00039 #endif
00040 #ifndef CCP4_ERRSETLEVEL
00041 #define CCP4_ERRSETLEVEL(y,x) ((y) & (~CCP4_ERRLEVEL(0xf)) | CCP4_ERRLEVEL(x)))
00042 #endif
00043 #ifndef CCP4_ERRGETSYS
00044 #define CCP4_ERRGETSYS(x) (((x)>>24)&0xfff)
00045 #endif
00046 #ifndef CCP4_ERRGETLEVEL
00047 #define CCP4_ERRGETLEVEL(x) (((x)>>16)&0xf)
00048 #endif
00049 #ifndef CCP4_ERRGETCODE
00050 #define CCP4_ERRGETCODE(x) ((x)&0xffff)
00051 #endif
00052
00053 #define CCP4_ERR_SYS CCP4_ERRSYSTEM(0x0)
00054 #define CCP4_ERR_FILE CCP4_ERRSYSTEM(0x1)
00055 #define CCP4_ERR_COORD CCP4_ERRSYSTEM(0x2)
00056 #define CCP4_ERR_MTZ CCP4_ERRSYSTEM(0x3)
00057 #define CCP4_ERR_MAP CCP4_ERRSYSTEM(0x4)
00058 #define CCP4_ERR_UTILS CCP4_ERRSYSTEM(0x5)
00059 #define CCP4_ERR_PARS CCP4_ERRSYSTEM(0x6)
00060 #define CCP4_ERR_SYM CCP4_ERRSYSTEM(0x7)
00061 #define CCP4_ERR_GEN CCP4_ERRSYSTEM(0x8)
00062
00063 #define CCP4_COUNT(x) sizeof(x)/sizeof(x[0])
00064
00094 #ifdef __cplusplus
00095 extern "C" {
00096 #endif
00097 extern int ccp4_errno;
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101
00102 #ifdef __cplusplus
00103 namespace CCP4 {
00104 extern "C" {
00105 #endif
00106
00113 void ccp4_error( const char *);
00114
00122 const char *ccp4_strerror( int);
00123
00128 void ccp4_fatal(const char *);
00129
00143 int ccp4_liberr_verbosity(int iverb);
00144
00159 void ccp4_signal(const int, const char *const, void (*)());
00160
00161 int cfile_perror(const char *);
00162
00163 #ifdef __cplusplus
00164 }
00165 }
00166 #endif
00167
00168 #endif
00170
00171
00172
00173
00174