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 extern int ccp4_errno;
00095
00096 #ifdef __cplusplus
00097 namespace CCP4 {
00098 extern "C" {
00099 #endif
00100
00107 void ccp4_error( const char *);
00108
00116 const char *ccp4_strerror( int);
00117
00122 void ccp4_fatal(const char *);
00123
00137 int ccp4_liberr_verbosity(int iverb);
00138
00153 void ccp4_signal(const int, const char *const, void (*)());
00154
00155 int cfile_perror(const char *);
00156
00157 #ifdef __cplusplus
00158 }
00159 }
00160 #endif
00161
00162 #endif
00164
00165
00166
00167
00168