ccp4_errno.h

Go to the documentation of this file.
00001 /*
00002      ccp4_errno.h: Header file for error handling routines
00003      Copyright (C) 2001  CCLRC, Charles Ballard and Martyn Winn
00004 
00005      This library is free software; you can redistribute it and/or
00006      modify it under the terms of the GNU Lesser General Public
00007      License as published by the Free Software Foundation; either
00008      version 2.1 of the License, or (at your option) any later
00009      version.
00010 
00011      This library is distributed in the hope that it will be useful,
00012      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014      Lesser General Public License for more details.
00015 
00016      You should have received a copy of the GNU Lesser General Public
00017      License along with this library; if not, write to the Free
00018      Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019      Boston, MA 02110-1301 USA
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   Local variables:
00166   mode: font-lock
00167   End:
00168 */

Generated on Wed Oct 29 21:14:24 2008 for gpp4 by  doxygen 1.4.7