library_err.c File Reference

Error handling library. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "ccp4_errno.h"

Classes

struct  error_system

Functions

const char * ccp4_strerror (int error)
void ccp4_error (const char *msg)
void ccp4_fatal (const char *message)
int CFile_Perror (const char *msg)
int ccp4_liberr_verbosity (int iverb)
void ccp4_signal (const int code, const char *const msg, void(*callback)())

Variables

int ccp4_errno = 0


Detailed Description

Error handling library.

Author:
Charles Ballard

Function Documentation

void ccp4_error ( const char *  msg  ) 

Print out passed message and internal message based upon ccp4_errno "message : error message "

Parameters:
msg (const char *)
Returns:
void

void ccp4_fatal ( const char *  message  ) 

Wrapper for ccp4_error which also calls exit(1)

Parameters:
message 

int ccp4_liberr_verbosity ( int  iverb  ) 

Set error verbosity level

Parameters:
[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.

Note:
FATAL calls exit(1).
Parameters:
[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.

Parameters:
error error code (int)
Returns:
const pointer to error message.

int CFile_Perror ( const char *  msg  ) 

Output error messaage to stderr.

Parameters:
msg Error message.


Variable Documentation

int ccp4_errno = 0

ccp4_errno: global to store data


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