errmsg.h

Go to the documentation of this file.
00001 /*  _________________________________________________________________________
00002  *
00003  *  UTILIB: A utility library for developing portable C++ codes.
00004  *  Copyright (c) 2001, Sandia National Laboratories.
00005  *  This software is distributed under the GNU Lesser General Public License.
00006  *  For more information, see the README file in the top UTILIB directory.
00007  *  _________________________________________________________________________
00008  */
00009 
00023 #ifndef __errmsg_h
00024 #define __errmsg_h
00025 
00026 #include "utilib_dll.h"
00027 #include "_generic.h"
00028 
00030 #define Warning(str)  DoWarning(__FILE__,__LINE__,str);
00031 
00032 #define ErrReturn(str) {Warning(str); return ERR;}
00033 
00034 #define ErrAbort(str) DoErrAbort(__FILE__,__LINE__,str);
00035 
00036 #define ErrExit(str)  DoErrExit(__FILE__,__LINE__,str);
00037 
00038 #if defined(__cplusplus)
00039 extern "C" {
00040 #endif
00041 
00043 UTILIB_API char* errmsg(const char* string, ...);
00044 
00046 UTILIB_API void errmsg_abort(const int flag);
00048 typedef void (*null_fn_type)(void);
00051 UTILIB_API void errmsg_exit_fn(null_fn_type fn);
00052 
00054 UTILIB_API void DoWarning(const char* file , const int line , const char* str);
00056 UTILIB_API void DoErrAbort(const char* file, const int line, const char* str);
00058 UTILIB_API void DoErrExit(const char* file, const int line, const char* str);
00059 
00060 #if defined(__cplusplus)
00061 }
00062 #endif
00063 
00064 #endif