#include <errno.h>
Go to the source code of this file.
Defines | |
| #define | CCP4_ERRSYSTEM(x) (((x)&0xfff)<<24) |
| #define | CCP4_ERRLEVEL(x) (((x)&0xf)<<16) |
| #define | CCP4_ERRSETLEVEL(y, x) ((y) & (~CCP4_ERRLEVEL(0xf)) | CCP4_ERRLEVEL(x))) |
| #define | CCP4_ERRGETSYS(x) (((x)>>24)&0xfff) |
| #define | CCP4_ERRGETLEVEL(x) (((x)>>16)&0xf) |
| #define | CCP4_ERRGETCODE(x) ((x)&0xffff) |
| #define | CCP4_ERR_SYS CCP4_ERRSYSTEM(0x0) |
| #define | CCP4_ERR_FILE CCP4_ERRSYSTEM(0x1) |
| #define | CCP4_ERR_COORD CCP4_ERRSYSTEM(0x2) |
| #define | CCP4_ERR_MTZ CCP4_ERRSYSTEM(0x3) |
| #define | CCP4_ERR_MAP CCP4_ERRSYSTEM(0x4) |
| #define | CCP4_ERR_UTILS CCP4_ERRSYSTEM(0x5) |
| #define | CCP4_ERR_PARS CCP4_ERRSYSTEM(0x6) |
| #define | CCP4_ERR_SYM CCP4_ERRSYSTEM(0x7) |
| #define | CCP4_ERR_GEN CCP4_ERRSYSTEM(0x8) |
| #define | CCP4_COUNT(x) sizeof(x)/sizeof(x[0]) |
Functions | |
| void | ccp4_error (const char *) |
| const char * | ccp4_strerror (int) |
| void | ccp4_fatal (const char *) |
| int | ccp4_liberr_verbosity (int iverb) |
| void | ccp4_signal (const int, const char *const, void(*)()) |
| int | cfile_perror (const char *) |
Variables | |
| int | ccp4_errno |
| void ccp4_error | ( | const char * | msg | ) |
Print out passed message and internal message based upon ccp4_errno "message : error message "
| msg | (const char *) |
| void ccp4_fatal | ( | const char * | message | ) |
Wrapper for ccp4_error which also calls exit(1)
| message |
| int ccp4_liberr_verbosity | ( | int | iverb | ) |
Set error verbosity level
| [in] | iverb | Error level |
| void ccp4_signal | ( | const int | code, | |
| const char *const | msg, | |||
| void(*)() | callback | |||
| ) |
Routine to set ccp4_errno and print out message for error tracing. This should be the only way in which ccp4_errno is set. See error codes above for levels and systems. A callback with prototype void function(void) may also be passed to the routine.
| [in] | code | error code (int) |
| [in] | msg | error message |
| [in] | callback | point to callback routine |
| const char* ccp4_strerror | ( | int | error | ) |
Obtain character string based upon error code. Typical use ccp4_strerror(ccp4_errno) The returned string is statically allocated in the library_err.c file and should not be freed.
| error | error code (int) |
| int ccp4_errno |
ccp4_errno: global to store data
1.4.7