LAL  7.1.7.1-56c71ae
LALStatusMacros.h File Reference

Go to the source code of this file.

Macros

#define LAL_EXLAL   16384
 
#define LAL_MSGEXLAL   "Failure in an XLAL routine"
 
#define ABORTXLAL(sp)   ABORT(sp,LAL_EXLAL,LAL_MSGEXLAL)
 
#define XLAL_CHECK_LAL(sp, assertion, ...)   _XLAL_CHECK_IMPL_(ABORTXLAL(sp), assertion, __VA_ARGS__)
 
#define INITSTATUS(statusptr)
 
#define RETURN(statusptr)
 
#define ATTATCHSTATUSPTR(statusptr)
 
#define DETATCHSTATUSPTR(statusptr)
 
#define ABORT(statusptr, code, mesg)
 
#define ASSERT(assertion, statusptr, code, mesg)
 
#define TRY(func, statusptr)
 
#define CHECKSTATUSPTR(statusptr)
 
#define FREESTATUSPTR(statusptr)
 
#define REPORTSTATUS(statusptr)
 
#define BEGINFAIL(statusptr)
 
#define ENDFAIL(statusptr)
 
#define SETSTATUSFILELINE(statusptr)   ( ( void ) ( (statusptr)->file = __FILE__, (statusptr)->line = __LINE__ ) )
 
#define SETSTATUS(statusptr, code, mesg)
 

Variables

const int lalNoDebug
 

Macro Definition Documentation

◆ LAL_EXLAL

#define LAL_EXLAL   16384

Definition at line 49 of file LALStatusMacros.h.

◆ LAL_MSGEXLAL

#define LAL_MSGEXLAL   "Failure in an XLAL routine"

Definition at line 50 of file LALStatusMacros.h.

◆ ABORTXLAL

#define ABORTXLAL (   sp)    ABORT(sp,LAL_EXLAL,LAL_MSGEXLAL)

Definition at line 51 of file LALStatusMacros.h.

◆ XLAL_CHECK_LAL

#define XLAL_CHECK_LAL (   sp,
  assertion,
  ... 
)    _XLAL_CHECK_IMPL_(ABORTXLAL(sp), assertion, __VA_ARGS__)

Definition at line 52 of file LALStatusMacros.h.

◆ INITSTATUS

#define INITSTATUS (   statusptr)
Value:
do { if ( (statusptr) ) \
{ \
INT4 level_ = (statusptr)->level ; \
INT4 statp_ = (statusptr)->statusPtr ? 1 : 0 ; \
memset( (statusptr), 0, sizeof( LALStatus ) ); /* possible memory leak */ \
(statusptr)->level = level_ > 0 ? level_ : 1 ; \
(statusptr)->Id = "$Id$"; \
(statusptr)->function = __func__; \
SETSTATUSFILELINE( statusptr ); \
(void) LALTrace( statusptr, 0 ); \
if ( statp_ ) \
ABORT( statusptr, -2, "INITSTATUS: non-null status pointer" ); \
else if ( xlalErrno ) \
ABORT( statusptr, -16, "INITSTATUS: non-zero xlalErrno" ); \
} \
lalAbortHook( "Abort: function %s, file %s, line %d, %s\n" \
" Null status pointer passed to function\n", \
__func__, __FILE__, __LINE__, "$Id$" ); \
} while ( 0 )
#define xlalErrno
Modifiable lvalue containing the XLAL error number.
Definition: XLALError.h:572
LAL status structure, see The LALStatus structure for more details.
Definition: LALDatatypes.h:947
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126
void(* lalAbortHook)(const char *,...)
Definition: LALError.c:75

Definition at line 56 of file LALStatusMacros.h.

◆ RETURN

#define RETURN (   statusptr)
Value:
do { if ( 1 ) \
{ \
SETSTATUSFILELINE( statusptr ); \
if ( (statusptr)->statusCode ) \
(void) LALError( statusptr, "RETURN:" ); \
(void) LALTrace( statusptr, 1 ); \
if ( xlalErrno ) \
ABORT( statusptr, -32, "RETURN: untrapped XLAL error" ); \
return; \
} \
} while ( 0 )
#define xlalErrno
Modifiable lvalue containing the XLAL error number.
Definition: XLALError.h:572
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126

Definition at line 78 of file LALStatusMacros.h.

◆ ATTATCHSTATUSPTR

#define ATTATCHSTATUSPTR (   statusptr)
Value:
do { if ( !(statusptr)->statusPtr ) \
{ \
(statusptr)->statusPtr = (LALStatus *)LALCalloc( 1, sizeof( LALStatus ) );\
if ( !(statusptr)->statusPtr ) \
ABORT( statusptr, -4, "ATTATCHSTATUSPTR: memory allocation error" ); \
(statusptr)->statusPtr->level = (statusptr)->level + 1; \
} \
ABORT( statusptr, -2, "ATTATCHSTATUSPTR: non-null status pointer" ); \
} while ( 0 )
#define ABORT(statusptr, code, mesg)
LAL status structure, see The LALStatus structure for more details.
Definition: LALDatatypes.h:947
#define LALCalloc(m, n)
Definition: LALMalloc.h:90

Definition at line 91 of file LALStatusMacros.h.

◆ DETATCHSTATUSPTR

#define DETATCHSTATUSPTR (   statusptr)
Value:
do { if ( (statusptr)->statusPtr ) \
{ \
FREESTATUSPTR( statusptr ); \
(statusptr)->statusCode = 0; \
(statusptr)->statusDescription = NULL; \
} \
ABORT( statusptr, -8, "DETATCHSTATUSPTR: null status pointer" ); \
} while ( 0 )
#define ABORT(statusptr, code, mesg)

Definition at line 103 of file LALStatusMacros.h.

◆ ABORT

#define ABORT (   statusptr,
  code,
  mesg 
)
Value:
do { if ( (statusptr)->statusPtr ) FREESTATUSPTR( statusptr ); \
SETSTATUS( statusptr, code, mesg ); \
if ( code ) \
(void) LALError( statusptr, "ABORT:" ); \
(void) LALTrace( statusptr, 1 ); \
return; \
} while ( 0 )
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126
#define FREESTATUSPTR(statusptr)

Definition at line 114 of file LALStatusMacros.h.

◆ ASSERT

#define ASSERT (   assertion,
  statusptr,
  code,
  mesg 
)
Value:
do { if ( !(assertion) ) \
{ \
if ( (statusptr)->statusPtr ) \
FREESTATUSPTR( statusptr ); \
SETSTATUS( statusptr, code, mesg ); \
(void) LALError( statusptr, "Assertion \"" #assertion "\" failed:" ); \
(void) LALTrace( statusptr, 1 ); \
return; \
} \
} while ( 0 )
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126

Definition at line 126 of file LALStatusMacros.h.

◆ TRY

#define TRY (   func,
  statusptr 
)
Value:
do { if ( (func), (statusptr)->statusPtr->statusCode ) \
{ \
SETSTATUS( statusptr, -1, "Recursive error" ); \
(void) LALError( statusptr, "Function call \"" #func "\" failed:" ); \
(void) LALTrace( statusptr, 1 ); \
return; \
} \
} while ( 0 )
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126

Definition at line 139 of file LALStatusMacros.h.

◆ CHECKSTATUSPTR

#define CHECKSTATUSPTR (   statusptr)
Value:
do { if ( (statusptr)->statusPtr->statusCode ) \
{ \
SETSTATUS( statusptr, -1, "Recursive error" ); \
(void) LALError( statusptr, "CHECKSTATUSPTR:" ); \
(void) LALTrace( statusptr, 1 ); \
return; \
} \
} while ( 0 )
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126

Definition at line 149 of file LALStatusMacros.h.

◆ FREESTATUSPTR

#define FREESTATUSPTR (   statusptr)
Value:
do \
{ \
LALStatus *next_ = (statusptr)->statusPtr->statusPtr; \
LALFree( (statusptr)->statusPtr ); \
(statusptr)->statusPtr = next_; \
} \
while ( (statusptr)->statusPtr )
void LALFree(void *q)
Definition: LALMalloc.c:726

Definition at line 159 of file LALStatusMacros.h.

◆ REPORTSTATUS

#define REPORTSTATUS (   statusptr)
Value:
do \
{ \
LALStatus *ptr_; \
for ( ptr_ = (statusptr); ptr_; ptr_ = ptr_->statusPtr ) \
{ \
LALPrintError( "\nLevel %i: %s\n", ptr_->level, ptr_->Id ); \
if ( ptr_->statusCode ) \
LALPrintError( "\tStatus code %i: %s\n", ptr_->statusCode, \
ptr_->statusDescription ); \
LALPrintError( "\tStatus code 0: Nominal\n" ); \
LALPrintError( "\tfunction %s, file %s, line %i\n", \
ptr_->function, ptr_->file, ptr_->line ); \
} \
} while ( 0 )
int LALPrintError(const char *fmt,...)
Definition: LALError.c:46

Definition at line 168 of file LALStatusMacros.h.

◆ BEGINFAIL

#define BEGINFAIL (   statusptr)
Value:
do { \
if ( !(statusptr) ) \
ABORT( statusptr, -8, "BEGINFAIL: null status pointer" ); \
if ( !( (statusptr)->statusPtr ) ) \
ABORT( statusptr, -8, "BEGINFAIL: null status pointer pointer" ); \
if ( (statusptr)->statusPtr->statusCode ) { \
LALStatus *statusPtrSave_ = (statusptr)->statusPtr; \
(statusptr)->statusPtr = NULL; \
ATTATCHSTATUSPTR( statusptr ); \
do

Definition at line 233 of file LALStatusMacros.h.

◆ ENDFAIL

#define ENDFAIL (   statusptr)
Value:
while ( 0 ); \
DETATCHSTATUSPTR( statusptr ); \
(statusptr)->statusPtr = statusPtrSave_; \
SETSTATUS( statusptr, -1, "Recursive error" ); \
(void) LALError( statusptr, "ENDFAIL:" ); \
(void) LALTrace( statusptr, 1 ); \
return; \
} \
} while ( 0 )
#define LALError(statusptr, statement)
Definition: LALError.h:104
#define LALTrace(statusptr, exitflg)
Definition: LALError.h:126

Definition at line 245 of file LALStatusMacros.h.

◆ SETSTATUSFILELINE

#define SETSTATUSFILELINE (   statusptr)    ( ( void ) ( (statusptr)->file = __FILE__, (statusptr)->line = __LINE__ ) )

Definition at line 256 of file LALStatusMacros.h.

◆ SETSTATUS

#define SETSTATUS (   statusptr,
  code,
  mesg 
)
Value:
( SETSTATUSFILELINE( statusptr ), \
(statusptr)->statusDescription = (mesg), \
(statusptr)->statusCode = (code) )
#define SETSTATUSFILELINE(statusptr)

Definition at line 259 of file LALStatusMacros.h.

Variable Documentation

◆ lalNoDebug

const int lalNoDebug

Definition at line 28 of file LALMisc.c.