25 #include <lal/LALDebugLevel.h>
27 #include <lal/LALDatatypes.h>
29 #include <lal/XLALError.h>
46 int LALRaise(
int sig,
const char *fmt, ...);
62 const char *
id,
const char *
file,
const int line);
74 const char *
file,
const int line);
78 const char *mesg,
const char *statement,
79 const char *
file,
const int line);
83 const char *
file,
const int line);
85 #ifdef LAL_STATUS_MACROS_DISABLED
93 #ifndef LAL_STATUS_MACROS_DISABLED
95 #define LALError( statusptr, statement ) \
96 ( lalDebugLevel & LALERROR ? \
97 LALPrintError( "Error[%d] %d: function %s, file %s, line %d, %s\n" \
98 " %s %s\n", (statusptr)->level, (statusptr)->statusCode, \
99 (statusptr)->function, (statusptr)->file, (statusptr)->line, \
100 (statusptr)->Id, (statement), \
101 (statusptr)->statusDescription ) : 0 )
103 #define LALWarning( statusptr, warning ) \
104 ( lalDebugLevel & LALWARNING ? \
105 LALPrintError( "Warning[%d]: function %s, file %s, line %d, %s\n" \
106 " %s\n", (statusptr)->level, (statusptr)->function, \
107 (statusptr)->file, (statusptr)->line, (statusptr)->Id, (warning) ) \
110 #define LALInfo( statusptr, info ) \
111 ( lalDebugLevel & LALINFO ? \
112 LALPrintError( "Info[%d]: function %s, file %s, line %d, %s\n" \
113 " %s\n", (statusptr)->level, (statusptr)->function, \
114 (statusptr)->file, (statusptr)->line, (statusptr)->Id, (info) ) \
117 #define LALTrace( statusptr, exitflg ) \
118 ( lalDebugLevel & LALTRACE ? \
119 LALPrintError( "%s[%d]: function %s, file %s, line %d, %s\n", \
120 (exitflg) ? "Leave" : "Enter", (statusptr)->level, \
121 (statusptr)->function, (statusptr)->file, (statusptr)->line, \
136 volatile const char *
id
139 #define LAL_ERR_DFLT LAL_ERR_ABRT
147 volatile const char *
id
154 volatile const char *
id
161 volatile const char *
id
164 #define LAL_CALL( function, statusptr ) \
165 ((function),lal_errhandler(statusptr,#function,__FILE__,__LINE__,"$Id$"))
173 #define LAL_FAIL_ERR XLAL_EFAILED
174 #define LAL_FAIL_MSG "operation failed"
175 #define LAL_NULL_ERR XLAL_EFAULT
176 #define LAL_NULL_MSG "unexpected NULL pointer"
177 #define LAL_NNULL_ERR XLAL_EFAULT
178 #define LAL_NNULL_MSG "unexpected non-NULL pointer"
179 #define LAL_NOMEM_ERR XLAL_ENOMEM
180 #define LAL_NOMEM_MSG "out of memory"
181 #define LAL_RANGE_ERR XLAL_ERANGE
182 #define LAL_RANGE_MSG "parameter out of range"
183 #define LAL_BADPARM_ERR XLAL_EINVAL
184 #define LAL_BADPARM_MSG "invalid parameter value"
188 #elif defined(__cplusplus)
void FREESTATUSPTR(LALStatus *status)
void REPORTSTATUS(LALStatus *status)
int LAL_ERR_ABRT(LALStatus *, const char *func, const char *file, const int line, volatile const char *id)
int LAL_ERR_EXIT(LALStatus *, const char *func, const char *file, const int line, volatile const char *id)
int(* lalRaiseHook)(int, const char *,...)
int LALPrepareAbort(LALStatus *status, const INT4 code, const char *mesg, const char *file, const int line)
#define LALError(statusptr, statement)
void(* lalAbortHook)(const char *,...)
#define LALInfo(statusptr, info)
#define LALWarning(statusptr, warning)
int LALDetatchStatusPtr(LALStatus *status, const char *file, const int line)
int(* lal_errhandler_t)(LALStatus *, const char *func, const char *file, const int line, volatile const char *id)
lal_errhandler_t lal_errhandler
int LALPrepareAssertFail(LALStatus *status, const INT4 code, const char *mesg, const char *statement, const char *file, const int line)
int LALCheckStatusPtr(LALStatus *status, const char *statement, const char *file, const int line)
int LAL_ERR_RTRN(LALStatus *, const char *func, const char *file, const int line, volatile const char *id)
#define LALTrace(statusptr, exitflg)
int LALPrepareReturn(LALStatus *status, const char *file, const int line)
int LALInitStatus(LALStatus *status, const char *function, const char *id, const char *file, const int line)
int LALAttatchStatusPtr(LALStatus *status, const char *file, const int line)
int32_t INT4
Four-byte signed integer.
int LALRaise(int sig, const char *fmt,...)
void LALAbort(const char *fmt,...)
int LALPrintError(const char *fmt,...)
LAL status structure, see The LALStatus structure for more details.