LAL  7.2.0.1-a5e7375
XLALError.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 Jolien Creighton, Kipp Cannon
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 #ifndef XLALERROR_H
21 #define XLALERROR_H
22 
23 #include <stdlib.h>
24 #include <stdio.h>
25 #include <stdarg.h>
26 #include <stddef.h>
27 #include <lal/LALAtomicDatatypes.h>
28 #include <lal/LALString.h>
29 
30 #if defined(__cplusplus)
31 extern "C" {
32 #elif 0
33 } /* so that editors will match preceding brace */
34 #endif
35 
36 
37 /**
38  * \defgroup XLALError_h Header XLALError.h
39  * \ingroup lal_std
40  * \author Creighton, J. D. E.
41  * \date 2005
42  * \brief This header covers routines to provide the XLAL interface error
43  * handling.
44  *
45  * ### XLAL Errors ###
46  *
47  * When an XLAL routine fails, the routine should set the <tt>xlalErrno</tt> to
48  * an appropriate error number and return with the appropriate error code. The
49  * return value depends on the return type of the XLAL function. Furthermore,
50  * the XLAL error handler should be invoked.
51  *
52  * Whenever possible (i.e., always), standard XLAL error macros should be used
53  * when generating an error. These macros (i) invoke the current error handler,
54  * (ii) set the error code to the specified value, and (iii) return with the
55  * correct return value. In addition, these macros may take an optional
56  * printf-like format string (along with additional parameters for this format
57  * string) to provide additional information about the nature of the failure.
58  * The error macros that should be used are:
59  *
60  * <tt> #XLAL_ERROR(errnum [, fmt [, ...]])</tt> for XLAL routines returning an
61  * integer type.
62  *
63  * <tt> #XLAL_ERROR_VOID(errnum [, fmt [, ...]])</tt> for XLAL routines with no
64  * return value.
65  *
66  * <tt> #XLAL_ERROR_NULL(errnum [, fmt [, ...]])</tt> for XLAL routines returning
67  * a pointer.
68  *
69  * <tt> #XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</tt> for XLAL routines
70  * returning a <tt>REAL4</tt> floating-point value.
71  *
72  * <tt> #XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</tt> for XLAL routines
73  * returning a <tt>REAL8</tt> floating-point value.
74  *
75  * Assert-like error checking can be performed with <tt>#XLAL_CHECK</tt>-style
76  * macros. Unlike <tt>assert()</tt> statements, <tt>#XLAL_CHECK</tt> macros
77  * do <i>not</i> get removed when the code is not compiled with
78  * <tt>NDEBUG</tt> defined.
79  *
80  * Additional error, warning, and informational messages can be generated using
81  * the routines <tt>XLALPrintError()</tt>, <tt>XLALPrintWarning()</tt> and
82  * <tt>XLALPrintInfo()</tt>. These routines (which work just like
83  * <tt>printf()</tt>) print or suppress the message depending on the value of
84  * <tt>lalDebugLevel</tt>. To print error/warning/info messages with a
85  * standard format, use the macros
86  * <tt>#XLAL_PRINT_ERROR(fmt [, ...])</tt>
87  * <tt>#XLAL_PRINT_WARNING(fmt [, ...])</tt>
88  * <tt>#XLAL_PRINT_INFO(fmt [, ...])</tt>
89  *
90  * On rare occations, you may be prepared for an XLAL routine to fail, and may
91  * want to handle the failure immediately. In these circumstances, the XLAL
92  * error handler needs to be disabled before the routine is called so that the
93  * failure can be caught. The <tt>#XLAL_TRY(statement,errnum)</tt> macro is
94  * designed to be used in these situations. Here is an example:
95  * \code
96  * REAL8 XLALLogFactorial(INT4 n)
97  * {
98  * REAL8 y;
99  * int errnum;
100  * XLAL_TRY(y = XLALGammaFunction(n + 1), errnum);
101  * if (XLAL_IS_REAL8_FAIL_NAN(y))
102  * switch (errnum) {
103  * case XLAL_ERANGE:
104  * y = n * (log(n) - 1);
105  * y += 0.5 * log(2.0 * LAL_PI * n);
106  * return y;
107  * default:
108  * XLALSetErrno(errnum);
109  * XLAL_ERROR_REAL8(XLAL_EFUNC);
110  * }
111  * return log(y);
112  * }
113  * \endcode
114  *
115  * ### XLAL Function Return Codes ###
116  *
117  * XLAL functions that return an integer-type will return <tt>#XLAL_FAILURE</tt>
118  * on failure. XLAL functions that return a pointer will return <tt>NULL</tt>
119  * on failure.
120  *
121  * The LAL specification requires that XLAL functions that return a
122  * floating-point type (either ::REAL4 or ::REAL8) should return
123  * a particular value to indicate an error. These values are given by the
124  * macros <tt>#XLAL_REAL4_FAIL_NAN</tt> and <tt>#XLAL_REAL8_FAIL_NAN</tt> (they
125  * are Not a Number or NaN values). To implement these we choose hexadecimal
126  * representations and then provide static functions that return the equivalent
127  * ::REAL4 or ::REAL8 values. The macros then invoke these
128  * functions. This is done so that the compiler can easily inline the
129  * functions (or eliminate them if they are not used). Conversion from the
130  * hexadecimal representation to the floating-point representation is done
131  * using a union.
132  *
133  * The LAL specification also requires that there be two macros,
134  * <tt>#XLAL_IS_REAL4_FAIL_NAN(val)</tt> and
135  * <tt>#XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will test if val is one of these
136  * XLAL-specific fail NaNs. Again these macros invoke static functions that
137  * return the result of the comparison. The cmparison itself is done with the
138  * hexadecimal representation.
139  *
140  * ### XLAL Error Codes ###
141  *
142  * The LAL specification requires particular return code and error values.
143  * These are implemented here as enumeration constants in the
144  * ::XLALErrorValue enumeration.
145  */
146 /** @{ */
147 
148 
149 #ifndef SWIG /* exclude from SWIG interface */
150 
151 
152 /*
153  *
154  * Use these functions to print arbitrary messages as errors or warnings.
155  *
156  */
157 
158 /** Prints an error message if error printing is enabled by lalDebugLevel. */
159 int XLALPrintError(const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(1,2);
160 
161 /** Prints a warning message if warning printing is enabled by lalDebugLevel. */
162 int XLALPrintWarning(const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(1,2);
163 
164 /** Prints an info message if info printing is enabled by lalDebugLevel. */
165 int XLALPrintInfo(const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(1,2);
166 
167 /** Prints an error message if error printing is enabled by lalDebugLevel. */
168 int XLALVPrintError(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1);
169 
170 /** Prints a warning message if warning printing is enabled by lalDebugLevel. */
171 int XLALVPrintWarning(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1);
172 
173 /** Prints an info message if info printing is enabled by lalDebugLevel. */
174 int XLALVPrintInfo(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1);
175 
176 
177 /*
178  *
179  * Miscelaneous routines to print information with standard formatting.
180  *
181  */
182 
183 /**
184  * Print an error message with standard XLAL formatting (if error messages
185  * are enabled by lalDebugLevel).
186  */
187 void XLALPrintErrorMessage(const char *func, const char *file, int line,
188  const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(4,5);
189 
190 /**
191  * Print an warning message with standard XLAL formatting (if warning messages
192  * are enabled by lalDebugLevel).
193  */
194 void XLALPrintWarningMessage(const char *func, const char *file, int line,
195  const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(4,5);
196 
197 /**
198  * Print an info message with standard XLAL formatting (if info messages
199  * are enabled by lalDebugLevel).
200  */
201 void XLALPrintInfoMessage(const char *func, const char *file, int line,
202  const char *fmt, ...) _LAL_GCC_PRINTF_FORMAT_(4,5);
203 
204 /**
205  * Print an error message with standard XLAL formatting (if error messages
206  * are enabled by lalDebugLevel).
207  */
208 void XLALVPrintErrorMessage(const char *func, const char *file, int line,
209  const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4);
210 
211 /**
212  * Print an warning message with standard XLAL formatting (if warning messages
213  * are enabled by lalDebugLevel).
214  */
215 void XLALVPrintWarningMessage(const char *func, const char *file, int line,
216  const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4);
217 
218 /**
219  * Print an error message with standard XLAL formatting (if error messages
220  * are enabled by lalDebugLevel).
221  */
222 void XLALVPrintInfoMessage(const char *func, const char *file, int line,
223  const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4);
224 
225 /** Prints a progress bar at the "info" verbosity level. */
226 int XLALPrintProgressBar(double);
227 
228 /** Prints a deprecation warning at the "warning" verbosity level. */
229 #define XLAL_PRINT_DEPRECATION_WARNING(replacement) \
230  do { \
231  static int _xlal_print_deprecation_warning_ = 1; \
232  if (_xlal_print_deprecation_warning_) { \
233  XLALPrintWarning( \
234  "\nDEPRECATION WARNING: program has invoked obsolete function %s(). " \
235  "Please see %s() for information about a replacement.\n", \
236  __func__, replacement); \
237  _xlal_print_deprecation_warning_ = 0; \
238  } \
239  } while(0)
240 
241 
242 /*
243  *
244  * Macros that will print error/warning/info messages with a standard format.
245  *
246  */
247 
248 /**
249  * \brief Macro that will print an error message with a standard format.
250  *
251  * Prototype: <b>XLAL_PRINT_ERROR(fmt [, ...])</b>
252  *
253  * \b Parameters:<ul>
254  * <li> \b fmt A printf-like format string.
255  * <li> \b ... (Optional) Arguments to the format string.
256  * </ul>
257  */
258 #define XLAL_PRINT_ERROR(...) \
259  XLALPrintErrorMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
260 
261 /**
262  * \brief Macro that will print a warning message with a standard format.
263  *
264  * Prototype: <b>XLAL_PRINT_WARNING(fmt [, ...])</b>
265  *
266  * \b Parameters:<ul>
267  * <li> \b fmt A printf-like format string.
268  * <li> \b ... (Optional) Arguments to the format string.
269  * </ul>
270  */
271 #define XLAL_PRINT_WARNING(...) \
272  XLALPrintWarningMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
273 
274 /**
275  * \brief Macro that will print an info message with a standard format.
276  *
277  * Prototype: <b>XLAL_PRINT_INFO(fmt [, ...])</b>
278  *
279  * \b Parameters:<ul>
280  * <li> \b fmt A printf-like format string.
281  * <li> \b ... (Optional) Arguments to the format string.
282  * </ul>
283  */
284 #define XLAL_PRINT_INFO(...) \
285  XLALPrintInfoMessage(__func__, __FILE__, __LINE__, __VA_ARGS__)
286 
287 
288 /*
289  *
290  * The LAL specification requires that XLAL functions that return a
291  * floating-point type (either <tt>REAL4</tt> or <tt>REAL8</tt>) should return
292  * a particular value to indicate an error. These values are given by the
293  * macros <tt>XLAL_REAL4_FAIL_NAN</tt> and <tt>XLAL_REAL8_FAIL_NAN</tt> (they
294  * are Not a Number or NaN values). To implement these we choose hexadecimal
295  * representations and then provide static functions that return the equivalent
296  * <tt>REAL4</tt> or <tt>REAL8</tt> values. The macros then invoke these
297  * functions. This is done so that the compiler can easily inline the
298  * functions (or eliminate them if they are not used). Conversion from the
299  * hexadecimal representation to the floating-point representation is done
300  * using a union.
301  *
302  * The LAL specification also requires that there be two macros,
303  * <tt>XLAL_IS_REAL4_FAIL_NAN(val)</tt> and
304  * <tt>XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will
305  * test if val is one of these XLAL-specific fail NaNs. Again these macros
306  * invoke static functions that return the result of the comparison. The
307  * comparison itself is done with the hexadecimal representation.
308  *
309  */
310 
311 /* Hexadecimal representation of the <tt>REAL4</tt> and <tt>REAL8</tt> NaN
312  * failure bit pattern. */
313 #define XLAL_REAL4_FAIL_NAN_INT 0x7fc001a1 /**< Hexadecimal representation of <tt>REAL4</tt> NaN failure bit pattern */
314 #define XLAL_REAL8_FAIL_NAN_INT LAL_INT8_C(0x7ff80000000001a1) /**< Hexadecimal representation of <tt>REAL8</tt> NaN failure bit pattern */
315 
316 /*
317  * The floating point values themselves are returned by static functions that
318  * can be easily inlined by the compiler; similarly, the routines to test if a
319  * value is the LAL failure NaN can also be inlined.
320  */
321 
322 /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */
323 static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void);
325 {
326  volatile const union {
327  INT4 i;
328  REAL4 x;
329  } val = {
331  return val.x;
332 }
333 
334 /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */
335 static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void);
337 {
338  volatile const union {
339  INT8 i;
340  REAL8 x;
341  } val = {
343  return val.x;
344 }
345 
346 /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */
347 static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val);
349 {
350  volatile const union {
351  INT4 i;
352  unsigned char s[4];
353  } a = {
355  volatile union {
356  REAL4 x;
357  unsigned char s[4];
358  } b;
359  size_t n;
360  b.x = val;
361  for (n = 0; n < sizeof(val); ++n)
362  if (a.s[n] != b.s[n])
363  return 0;
364  return 1;
365 }
366 
367 /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */
368 static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val);
370 {
371  volatile const union {
372  INT8 i;
373  unsigned char s[8];
374  } a = {
376  volatile union {
377  REAL8 x;
378  unsigned char s[8];
379  } b;
380  size_t n;
381  b.x = val;
382  for (n = 0; n < sizeof(val); ++n)
383  if (a.s[n] != b.s[n])
384  return 0;
385  return 1;
386 }
387 
388 /* Here are the macro constants for the fail NaNs. */
389 #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point value of the XLAL <tt>REAL4</tt> failure NaN. */
390 #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point value of the XLAL <tt>REAL8</tt> failure NaN. */
391 
392 /* Here are the macros to test for fail NaNs. */
393 #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if <tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */
394 #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if <tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */
395 
396 
397 #endif /* SWIG */
398 
399 
400 /** XLAL error numbers and return values. */
402  XLAL_SUCCESS = 0, /**< Success return value (not an error number) */
403  XLAL_FAILURE = -1, /**< Failure return value (not an error number) */
404 
405  /* these are standard error numbers */
406  XLAL_ENOENT = 2, /**< No such file or directory */
407  XLAL_EIO = 5, /**< I/O error */
408  XLAL_ENOMEM = 12, /**< Memory allocation error */
409  XLAL_EFAULT = 14, /**< Invalid pointer */
410  XLAL_EINVAL = 22, /**< Invalid argument */
411  XLAL_EDOM = 33, /**< Input domain error */
412  XLAL_ERANGE = 34, /**< Output range error */
413  XLAL_ENOSYS = 38, /**< Function not implemented */
414 
415  /* extended error numbers start at 128 ...
416  * should be beyond normal errnos */
417 
418  /* these are common errors for XLAL functions */
419  XLAL_EFAILED = 128, /**< Generic failure */
420  XLAL_EBADLEN = 129, /**< Inconsistent or invalid length */
421  XLAL_ESIZE = 130, /**< Wrong size */
422  XLAL_EDIMS = 131, /**< Wrong dimensions */
423  XLAL_ETYPE = 132, /**< Wrong or unknown type */
424  XLAL_ETIME = 133, /**< Invalid time */
425  XLAL_EFREQ = 134, /**< Invalid freqency */
426  XLAL_EUNIT = 135, /**< Invalid units */
427  XLAL_ENAME = 136, /**< Wrong name */
428  XLAL_EDATA = 137, /**< Invalid data */
429 
430  /* user-defined errors */
431  XLAL_EUSR0 = 200, /**< User-defined error 0 */
432  XLAL_EUSR1 = 201, /**< User-defined error 1 */
433  XLAL_EUSR2 = 202, /**< User-defined error 2 */
434  XLAL_EUSR3 = 203, /**< User-defined error 3 */
435  XLAL_EUSR4 = 204, /**< User-defined error 4 */
436  XLAL_EUSR5 = 205, /**< User-defined error 5 */
437  XLAL_EUSR6 = 206, /**< User-defined error 6 */
438  XLAL_EUSR7 = 207, /**< User-defined error 7 */
439  XLAL_EUSR8 = 208, /**< User-defined error 8 */
440  XLAL_EUSR9 = 209, /**< User-defined error 9 */
441 
442  /* external or internal errors */
443  XLAL_ESYS = 254, /**< System error */
444  XLAL_EERR = 255, /**< Internal error */
445 
446  /* specific mathematical and numerical errors start at 256 */
447 
448  /* IEEE floating point errors */
449  XLAL_EFPINVAL = 256, /**< IEEE Invalid floating point operation, eg sqrt(-1), 0/0 */
450  XLAL_EFPDIV0 = 257, /**< IEEE Division by zero floating point error */
451  XLAL_EFPOVRFLW = 258, /**< IEEE Floating point overflow error */
452  XLAL_EFPUNDFLW = 259, /**< IEEE Floating point underflow error */
453  XLAL_EFPINEXCT = 260, /**< IEEE Floating point inexact error */
454 
455  /* numerical algorithm errors */
456  XLAL_EMAXITER = 261, /**< Exceeded maximum number of iterations */
457  XLAL_EDIVERGE = 262, /**< Series is diverging */
458  XLAL_ESING = 263, /**< Apparent singularity detected */
459  XLAL_ETOL = 264, /**< Failed to reach specified tolerance */
460  XLAL_ELOSS = 265, /**< Loss of accuracy */
461 
462  /* failure from within a function call: "or" error number with this */
463  XLAL_EFUNC = 1024 /**< Internal function call failed bit: "or" this with existing error number */
464 };
465 
466 
467 #ifndef SWIG /* exclude from SWIG interface */
468 
469 
470 /*
471  *
472  * These functions provide message associated with an error code and print
473  * an error message associated with the error code. The macro XLAL_PERROR
474  * fills in the current file and line information and uses the current
475  * value of xlalErrno as the error number.
476  *
477  */
478 
479 /** Returns the error message associated with an error number. */
480 const char *XLALErrorString(int errnum);
481 
482 /** Prints an error message for a particular error code in a standard format. */
483 void XLALPerror(const char *func, const char *file, int line, int errnum);
484 
485 /** Prints an error message for the current value of <tt>xlalErrno</tt>. */
486 #define XLAL_PERROR( ) XLALPerror(__func__, __FILE__, __LINE__, xlalErrno)
487 
488 
489 /*
490  *
491  * Here is the XLAL error handler type and the routines that set it.
492  * Also provide is the default error handler.
493  *
494  */
495 
496 /** The XLAL error handler type. */
497 typedef void XLALErrorHandlerType(const char *func, const char *file,
498  int line, int errnum);
499 
500 /** The default XLAL error handler. */
501 void XLALDefaultErrorHandler(const char *func, const char *file, int line,
502  int errnum);
503 /** A silent XLAL error handler. */
504 void XLALSilentErrorHandler(const char *func, const char *file, int line,
505  int errnum);
506 
507 /* Other useful XLAL error handlers. */
508 /** The XLAL error handler that raises SIGABRT. */
509 void XLALAbortErrorHandler(const char *func, const char *file, int line,
510  int errnum);
511 /** The XLAL error handler that calls exit. */
512 void XLALExitErrorHandler(const char *func, const char *file, int line,
513  int errnum);
514 /** The XLAL error handler that prints a function call backtrace then raises SIGABRT. */
515 void XLALBacktraceErrorHandler(const char *func, const char *file,
516  int line, int errnum);
517 
518 /** Function to return pointer to the XLAL error handler function pointer. */
520 
521 /** Sets the error handler to a new handler and returns the old handler. */
523  newHandler);
524 
525 /** Sets the error handler to the default handler and returns the old handler. */
527 /** Sets the error handler to a silent handler and returns the old handler. */
529 
530 
531 #endif /* SWIG */
532 
533 
534 /*
535  *
536  * Here are the routines that set or clear the XLAL error number.
537  *
538  */
539 
540 #ifdef SWIG /* SWIG interface directives */
541 SWIGLAL(DISABLE_EXCEPTIONS(XLALSetErrno, XLALGetBaseErrno, XLALClearErrno));
542 #endif /* SWIG */
543 
544 /** Sets the XLAL error number to errnum, returns the new value. */
545 int XLALSetErrno(int errnum);
546 
547 /** Gets the XLAL base error number ignoring the internal-function-failed flag. */
548 int XLALGetBaseErrno(void);
549 
550 /** Clears the XLAL error number, returns the old value. */
551 int XLALClearErrno(void);
552 
553 
554 #ifndef SWIG /* exclude from SWIG interface */
555 
556 
557 /*
558  *
559  * The LAL specifiation requires that the XLAL error number be a modifiable
560  * lvalue. Similarly, the function pointer to the XLAL error handler is
561  * a modifiable lvalue. These are implemented as macros that dereference
562  * pointers to the current value (in the current thread). The pointer is
563  * returned by the functions XLALGetErrnoPtr and XLALGetErrorHandlerPtr.
564  * Here these functions and macros are defined.
565  *
566  */
567 
568 /** Function to return pointer to the XLAL error number. */
569 int *XLALGetErrnoPtr(void);
570 
571 /* these are the modifiable lvalues for xlalErrno and XLALErrorHandler */
572 #define xlalErrno ( * XLALGetErrnoPtr() ) /**< Modifiable lvalue containing the XLAL error number */
573 #define XLALErrorHandler ( * XLALGetErrorHandlerPtr() ) /**< Modifiable lvalue containing the XLAL error handler */
574 
575 
576 /**
577  * A macro to (i) disable the XLAL error handling and preserve the
578  * current value of xlalErrno (ii) perform a statement that involves an
579  * XLAL function call and (iii) restore the XLAL error handler and value of
580  * xlalErrno while setting variable errnum to the xlalErrno set by the
581  * statement.
582  */
583 #define XLAL_TRY( statement, errnum ) \
584  do { \
585  XLALErrorHandlerType *xlalSaveErrorHandler; \
586  int xlalSaveErrno; \
587  xlalSaveErrorHandler = XLALSetSilentErrorHandler(); \
588  xlalSaveErrno = xlalErrno; \
589  XLALClearErrno(); \
590  statement ; \
591  errnum = xlalErrno; \
592  xlalErrno = xlalSaveErrno; \
593  XLALSetErrorHandler(xlalSaveErrorHandler); \
594  } while (0)
595 
596 /**
597  * Performs the same actions as XLAL_TRY(), but additionally silences
598  * any error/warning/etc. messages being printed while statement is
599  * executed, regardless of the value of #lalDebugLevel.
600  */
601 #define XLAL_TRY_SILENT( statement, errnum ) \
602  do { \
603  int xlalSaveDebugLevel = lalDebugLevel; \
604  XLALClobberDebugLevel(xlalSaveDebugLevel & ~(LALERRORBIT | LALWARNINGBIT | LALINFOBIT | LALTRACEBIT)); \
605  XLAL_TRY(statement, errnum); \
606  XLALClobberDebugLevel(xlalSaveDebugLevel); \
607  } while (0)
608 
609 /*
610  *
611  * Here are the routines and macros that are used to report errors when
612  * an XLAL function fails. They (i) set the XLAL error number and (ii)
613  * invoke the XLAL error handler. The macros also (iii) return the
614  * appropriate failure codes. The macros should be used to report all
615  * failures.
616  *
617  */
618 
619 /**
620  * Routine to set the XLAL error number and invoke the XLAL error handler.
621  * It is used by the error macros.
622  */
623 void XLALError(const char *func,
624  /**< name of function where the error occurs */
625  const char *file,
626  /**< source file name (use the __FILE__ macro) */
627  int line, /**< source line number (use the __LINE__ macro) */
628  int errnum /**< error code */
629  );
630 
631 /** \cond DONT_DOXYGEN */
632 /*
633  * Helper macros for internal use only:
634  * To allow for a possibly empty error message, these macros use
635  * snprintf(buf, sizeof(buf), "X" __VA_ARGS__)
636  * to print any error message preceded by "X" (to silence -Wformat-zero-length)
637  * to a buffer 'buf', then print the error message with XLAL_PRINT_ERROR() only
638  * if 'buf' contains any characters after the "X". This construct allows for
639  * XLAL_ERROR(XLAL_EFUNC);
640  * XLAL_ERROR(XLAL_EFUNC, "%i < 0", n);
641  * It does not allow a non-literal format string, e.g.
642  * const char *fmt = "%i < 0"; XLAL_ERROR(XLAL_EFUNC, fmt, n);
643  * but since this is a security risk, -Wformat does not allow this anyway.
644  */
645 
646 #define _XLAL_ERROR_IMPL_(statement, errnum, ...) \
647  do { \
648  char _XLAL_ERROR_IMPL_buf_[1024]; \
649  XLALStringPrint(_XLAL_ERROR_IMPL_buf_, sizeof(_XLAL_ERROR_IMPL_buf_), "X" __VA_ARGS__); \
650  if (_XLAL_ERROR_IMPL_buf_[1] != 0) { \
651  XLAL_PRINT_ERROR("%s", &_XLAL_ERROR_IMPL_buf_[1]); \
652  } \
653  XLALError(__func__, __FILE__, __LINE__, errnum); \
654  statement; \
655  } while (0)
656 
657 #define _XLAL_CHECK_IMPL_(statement, assertion, errnum, ...) \
658  do { \
659  if (!(assertion)) { \
660  char _XLAL_CHECK_IMPL_buf_[1024]; \
661  XLALStringPrint(_XLAL_CHECK_IMPL_buf_, sizeof(_XLAL_CHECK_IMPL_buf_), "X" __VA_ARGS__); \
662  if (_XLAL_CHECK_IMPL_buf_[1] != 0) { \
663  XLAL_PRINT_ERROR("%s", &_XLAL_CHECK_IMPL_buf_[1]); \
664  } else { \
665  XLAL_PRINT_ERROR("Check failed: %s", #assertion); \
666  } \
667  XLALError(__func__, __FILE__, __LINE__, errnum); \
668  statement; \
669  } \
670  } while (0)
671 
672 /** \endcond */
673 
674 /**
675  * \brief Macro to invoke the <tt>XLALError()</tt> function and return
676  * with code val (it should not really be used itself, but forms the basis for
677  * other macros).
678  *
679  * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b>
680  *
681  * \b Parameters:<ul>
682  * <li> \b val The value to return.
683  * <li> \b errnum The XLAL error number to set.
684  * <li> \b fmt (Optional) Format string for additional error information.
685  * <li> \b ... (Optional) Additional arguments for printf-like format.
686  * </ul>
687  */
688 #define XLAL_ERROR_VAL(val, ...) _XLAL_ERROR_IMPL_(return val, __VA_ARGS__)
689 
690 /**
691  * Macro to invoke a failure from a XLAL routine returning an integer.
692  *
693  * Prototype: <b>XLAL_ERROR(errnum [, fmt [, ...]])</b>
694  *
695  * \b Parameters:<ul>
696  * <li> \b errnum The XLAL error number to set.
697  * <li> \b fmt (Optional) Format string for additional error information.
698  * <li> \b ... (Optional) Additional arguments for printf-like format.
699  * </ul>
700  */
701 #define XLAL_ERROR(...) _XLAL_ERROR_IMPL_(return (int)XLAL_FAILURE, __VA_ARGS__)
702 
703 /**
704  * Macro to invoke a failure from a XLAL routine returning a pointer.
705  *
706  * Prototype: <b>XLAL_ERROR_NULL(errnum [, fmt [, ...]])</b>
707  *
708  * \b Parameters:<ul>
709  * <li> \b errnum The XLAL error number to set.
710  * <li> \b fmt (Optional) Format string for additional error information.
711  * <li> \b ... (Optional) Additional arguments for printf-like format.
712  * </ul>
713  */
714 #define XLAL_ERROR_NULL(...) _XLAL_ERROR_IMPL_(return NULL, __VA_ARGS__)
715 
716 /**
717  * \brief Macro to invoke a failure from a XLAL routine returning void.
718  *
719  * Prototype: <b>XLAL_ERROR_VOID(errnum [, fmt [, ...]])</b>
720  *
721  * \b Parameters:<ul>
722  * <li> \b errnum The XLAL error number to set.
723  * <li> \b fmt (Optional) Format string for additional error information.
724  * <li> \b ... (Optional) Additional arguments for printf-like format.
725  * </ul>
726  */
727 #define XLAL_ERROR_VOID(...) _XLAL_ERROR_IMPL_(return, __VA_ARGS__)
728 
729 /**
730  * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REAL4</tt>.
731  *
732  * Prototype: <b>XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</b>
733  *
734  * \b Parameters:<ul>
735  * <li> \b errnum The XLAL error number to set.
736  * <li> \b fmt (Optional) Format string for additional error information.
737  * <li> \b ... (Optional) Additional arguments for printf-like format.
738  * </ul>
739  */
740 #define XLAL_ERROR_REAL4(...) _XLAL_ERROR_IMPL_(return XLAL_REAL4_FAIL_NAN, __VA_ARGS__)
741 
742 /**
743  * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REAL8</tt>.
744  *
745  * Prototype <b>XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</b>
746  *
747  * \b Parameters:<ul>
748  * <li> \b errnum The XLAL error number to set.
749  * <li> \b fmt (Optional) Format string for additional error information.
750  * <li> \b ... (Optional) Additional arguments for printf-like format.
751  * </ul>
752  */
753 #define XLAL_ERROR_REAL8(...) _XLAL_ERROR_IMPL_(return XLAL_REAL8_FAIL_NAN, __VA_ARGS__)
754 
755 /**
756  * \brief Macro to invoke a failure from a C <tt>main()</tt> routine.
757  *
758  * Prototype <b>XLAL_ERROR_MAIN(errnum [, fmt [, ...]])</b>
759  *
760  * \b Parameters:<ul>
761  * <li> \b errnum The XLAL error number to set.
762  * <li> \b fmt (Optional) Format string for additional error information.
763  * <li> \b ... (Optional) Additional arguments for printf-like format.
764  * </ul>
765  */
766 #define XLAL_ERROR_MAIN(...) _XLAL_ERROR_IMPL_(return EXIT_FAILURE, __VA_ARGS__)
767 
768 /**
769  * \brief Macro to invoke a failure by jumping to a <tt>XLAL_FAIL</tt> label.
770  *
771  * Prototype <b>XLAL_ERROR_FAIL(errnum [, fmt [, ...]])</b>
772  *
773  * \b Parameters:<ul>
774  * <li> \b errnum The XLAL error number to set.
775  * <li> \b fmt (Optional) Format string for additional error information.
776  * <li> \b ... (Optional) Additional arguments for printf-like format.
777  * </ul>
778  */
779 #define XLAL_ERROR_FAIL(...) _XLAL_ERROR_IMPL_(goto XLAL_FAIL, __VA_ARGS__)
780 
781 /**
782  * \brief Macro to test an assertion; if it is not true, invoke the
783  * <tt>XLALError()</tt> function and return with code val (it should not really
784  * be used itself, but forms the basis for other macros).
785  *
786  * Prototype: <b>XLAL_CHECK_VAL(val, assertion, errnum [, fmt [, ...]])</b>
787  *
788  * \b Parameters:<ul>
789  * <li> \b val The value to return.
790  * <li> \b assertion The assertion to test.
791  * <li> \b errnum The XLAL error number to set if the assertion is false.
792  * <li> \b fmt (Optional) Format string for additional error information.
793  * <li> \b ... (Optional) Additional arguments for printf-like format.
794  * </ul>
795  */
796 #define XLAL_CHECK_VAL(val, assertion, ...) _XLAL_CHECK_IMPL_(return val, assertion, __VA_ARGS__)
797 
798 /**
799  * \brief Macro to test an assertion and invoke a failure if it is not true
800  * in a function that returns an integer.
801  *
802  * Prototype: <b>XLAL_CHECK(assertion, errnum [, fmt [, ...]])</b>
803  *
804  * \b Parameters:<ul>
805  * <li> \b assertion The assertion to test.
806  * <li> \b errnum The XLAL error number to set if the assertion is false.
807  * <li> \b fmt (Optional) Format string for additional error information.
808  * <li> \b ... (Optional) Additional arguments for printf-like format.
809  * </ul>
810  */
811 #define XLAL_CHECK(assertion, ...) _XLAL_CHECK_IMPL_(return (int)XLAL_FAILURE, assertion, __VA_ARGS__)
812 
813 /**
814  * \brief Macro to test an assertion and invoke a failure if it is not true
815  * in a function that returns a pointer.
816  *
817  * Prototype: <b>XLAL_CHECK_NULL(assertion, errnum [, fmt [, ...]])</b>
818  *
819  * \b Parameters:<ul>
820  * <li> \b assertion The assertion to test.
821  * <li> \b errnum The XLAL error number to set if the assertion is false.
822  * <li> \b fmt (Optional) Format string for additional error information.
823  * <li> \b ... (Optional) Additional arguments for printf-like format.
824  * </ul>
825  */
826 #define XLAL_CHECK_NULL(assertion, ...) _XLAL_CHECK_IMPL_(return NULL, assertion, __VA_ARGS__)
827 
828 /**
829  * \brief Macro to test an assertion and invoke a failure if it is not true
830  * in a function that returns void.
831  *
832  * Prototype: <b>XLAL_CHECK_VOID(assertion, errnum [, fmt [, ...]])</b>
833  *
834  * \b Parameters:<ul>
835  * <li> \b assertion The assertion to test.
836  * <li> \b errnum The XLAL error number to set if the assertion is false.
837  * <li> \b fmt (Optional) Format string for additional error information.
838  * <li> \b ... (Optional) Additional arguments for printf-like format.
839  * </ul>
840  */
841 #define XLAL_CHECK_VOID(assertion, ...) _XLAL_CHECK_IMPL_(return, assertion, __VA_ARGS__)
842 
843 /**
844  * \brief Macro to test an assertion and invoke a failure if it is not true
845  * in a function that returns a <tt>REAL4</tt>.
846  *
847  * Prototype: <b>XLAL_CHECK_REAL4(assertion, errnum [, fmt [, ...]])</b>
848  *
849  * \b Parameters:<ul>
850  * <li> \b assertion The assertion to test.
851  * <li> \b errnum The XLAL error number to set if the assertion is false.
852  * <li> \b fmt (Optional) Format string for additional error information.
853  * <li> \b ... (Optional) Additional arguments for printf-like format.
854  * </ul>
855  */
856 #define XLAL_CHECK_REAL4(assertion, ...) _XLAL_CHECK_IMPL_(return XLAL_REAL4_FAIL_NAN, assertion, __VA_ARGS__)
857 
858 /**
859  * \brief Macro to test an assertion and invoke a failure if it is not true
860  * in a function that returns a <tt>REAL8</tt>.
861  *
862  * Prototype: <b>XLAL_CHECK_REAL8(assertion, errnum [, fmt [, ...]])</b>
863  *
864  * \b Parameters:<ul>
865  * <li> \b assertion The assertion to test.
866  * <li> \b errnum The XLAL error number to set if the assertion is false.
867  * <li> \b fmt (Optional) Format string for additional error information.
868  * <li> \b ... (Optional) Additional arguments for printf-like format.
869  * </ul>
870  */
871 #define XLAL_CHECK_REAL8(assertion, ...) _XLAL_CHECK_IMPL_(return XLAL_REAL8_FAIL_NAN, assertion, __VA_ARGS__)
872 
873 /**
874  * \brief Macro to test an assertion and invoke a failure if it is not true
875  * in a C <tt>main()</tt> routine.
876  *
877  * Prototype: <b>XLAL_CHECK_MAIN(assertion, errnum [, fmt [, ...]])</b>
878  *
879  * \b Parameters:<ul>
880  * <li> \b assertion The assertion to test.
881  * <li> \b errnum The XLAL error number to set if the assertion is false.
882  * <li> \b fmt (Optional) Format string for additional error information.
883  * <li> \b ... (Optional) Additional arguments for printf-like format.
884  * </ul>
885  */
886 #define XLAL_CHECK_MAIN(assertion, ...) _XLAL_CHECK_IMPL_(return EXIT_FAILURE, assertion, __VA_ARGS__)
887 
888 /**
889  * \brief Macro to test an assertion and invoke a failure if it is not true
890  * by jumping to a <tt>XLAL_FAIL</tt> label.
891  *
892  * Prototype: <b>XLAL_CHECK_FAIL(assertion, errnum [, fmt [, ...]])</b>
893  *
894  * \b Parameters:<ul>
895  * <li> \b assertion The assertion to test.
896  * <li> \b errnum The XLAL error number to set if the assertion is false.
897  * <li> \b fmt (Optional) Format string for additional error information.
898  * <li> \b ... (Optional) Additional arguments for printf-like format.
899  * </ul>
900  */
901 #define XLAL_CHECK_FAIL(assertion, ...) _XLAL_CHECK_IMPL_(goto XLAL_FAIL, assertion, __VA_ARGS__)
902 
903 
904 #endif /* SWIG */
905 
906 
907 /** @} */
908 
909 #if 0
910 { /* so that editors will match succeeding brace */
911 #elif defined(__cplusplus)
912 }
913 #endif
914 
915 #endif /* XLALERROR_H */
void XLALDefaultErrorHandler(const char *func, const char *file, int line, int errnum)
The default XLAL error handler.
Definition: XLALError.c:561
System error.
Definition: XLALError.h:443
User-defined error 3.
Definition: XLALError.h:434
Failure return value (not an error number)
Definition: XLALError.h:403
XLALErrorHandlerType ** XLALGetErrorHandlerPtr(void)
Function to return pointer to the XLAL error handler function pointer.
Definition: XLALError.c:218
int XLALGetBaseErrno(void)
Gets the XLAL base error number ignoring the internal-function-failed flag.
Definition: XLALError.c:356
IEEE Floating point overflow error.
Definition: XLALError.h:451
Wrong size.
Definition: XLALError.h:421
static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void)
Returns the value of the XLAL REAL4 failure NaN.
Definition: XLALError.h:324
static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val)
Tests if a value is an XLAL REAL8 failure NaN.
Definition: XLALError.h:369
XLALErrorHandlerType * XLALSetSilentErrorHandler(void)
Sets the error handler to a silent handler and returns the old handler.
Definition: XLALError.c:392
void void void void XLALVPrintErrorMessage(const char *func, const char *file, int line, const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4)
Print an error message with standard XLAL formatting (if error messages are enabled by lalDebugLevel)...
Definition: XLALError.c:104
void XLALErrorHandlerType(const char *func, const char *file, int line, int errnum)
The XLAL error handler type.
Definition: XLALError.h:497
void XLALSilentErrorHandler(const char *func, const char *file, int line, int errnum)
A silent XLAL error handler.
void XLALVPrintWarningMessage(const char *func, const char *file, int line, const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4)
Print an warning message with standard XLAL formatting (if warning messages are enabled by lalDebugLe...
Definition: XLALError.c:118
Apparent singularity detected.
Definition: XLALError.h:458
void XLALError(const char *func, const char *file, int line, int errnum)
Routine to set the XLAL error number and invoke the XLAL error handler.
Definition: XLALError.c:582
#define XLAL_REAL4_FAIL_NAN_INT
Hexadecimal representation of REAL4 NaN failure bit pattern.
Definition: XLALError.h:313
XLALErrorValue
XLAL error numbers and return values.
Definition: XLALError.h:401
int XLALVPrintWarning(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1)
Prints a warning message if warning printing is enabled by lalDebugLevel.
Definition: XLALError.c:56
int * XLALGetErrnoPtr(void)
Function to return pointer to the XLAL error number.
Definition: XLALError.c:209
I/O error.
Definition: XLALError.h:407
User-defined error 8.
Definition: XLALError.h:439
Internal error.
Definition: XLALError.h:444
int XLALVPrintInfo(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1)
Prints an info message if info printing is enabled by lalDebugLevel.
Definition: XLALError.c:62
const char * XLALErrorString(int errnum)
Returns the error message associated with an error number.
Definition: XLALError.c:409
Series is diverging.
Definition: XLALError.h:457
Output range error.
Definition: XLALError.h:412
Invalid time.
Definition: XLALError.h:424
static const INT4 a
Definition: Random.c:79
float REAL4
Single precision real floating-point number (4 bytes).
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)
Sets the error handler to a new handler and returns the old handler.
Definition: XLALError.c:372
User-defined error 7.
Definition: XLALError.h:438
#define _LAL_INLINE_
Definition: LALStddef.h:27
void XLALPrintErrorMessage(const char *func, const char *file, int line, const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(4
Print an error message with standard XLAL formatting (if error messages are enabled by lalDebugLevel)...
User-defined error 6.
Definition: XLALError.h:437
void void XLALPrintWarningMessage(const char *func, const char *file, int line, const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(4
Print an warning message with standard XLAL formatting (if warning messages are enabled by lalDebugLe...
IEEE Division by zero floating point error.
Definition: XLALError.h:450
IEEE Floating point inexact error.
Definition: XLALError.h:453
IEEE Invalid floating point operation, eg sqrt(-1), 0/0.
Definition: XLALError.h:449
int XLALClearErrno(void)
Clears the XLAL error number, returns the old value.
Definition: XLALError.c:363
Invalid pointer.
Definition: XLALError.h:409
#define XLAL_REAL8_FAIL_NAN_INT
Hexadecimal representation of REAL8 NaN failure bit pattern.
Definition: XLALError.h:314
XLALErrorHandlerType * XLALSetDefaultErrorHandler(void)
Sets the error handler to the default handler and returns the old handler.
Definition: XLALError.c:383
int XLALSetErrno(int errnum)
Sets the XLAL error number to errnum, returns the new value.
Definition: XLALError.c:327
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
Prints a warning message if warning printing is enabled by lalDebugLevel.
static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val)
Tests if a value is an XLAL REAL4 failure NaN.
Definition: XLALError.h:348
Input domain error.
Definition: XLALError.h:411
void XLALAbortErrorHandler(const char *func, const char *file, int line, int errnum)
The XLAL error handler that raises SIGABRT.
Definition: XLALError.c:599
Invalid freqency.
Definition: XLALError.h:425
Function not implemented.
Definition: XLALError.h:413
double REAL8
Double precision real floating-point number (8 bytes).
IEEE Floating point underflow error.
Definition: XLALError.h:452
void void void XLALPrintInfoMessage(const char *func, const char *file, int line, const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(4
Print an info message with standard XLAL formatting (if info messages are enabled by lalDebugLevel)...
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
Prints an error message if error printing is enabled by lalDebugLevel.
Wrong dimensions.
Definition: XLALError.h:422
Success return value (not an error number)
Definition: XLALError.h:402
Failed to reach specified tolerance.
Definition: XLALError.h:459
int XLALPrintProgressBar(double)
Prints a progress bar at the "info" verbosity level.
Definition: XLALError.c:181
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
Prints an info message if info printing is enabled by lalDebugLevel.
void XLALBacktraceErrorHandler(const char *func, const char *file, int line, int errnum)
The XLAL error handler that prints a function call backtrace then raises SIGABRT. ...
Definition: XLALError.c:615
User-defined error 1.
Definition: XLALError.h:432
User-defined error 2.
Definition: XLALError.h:433
Memory allocation error.
Definition: XLALError.h:408
Invalid data.
Definition: XLALError.h:428
void XLALExitErrorHandler(const char *func, const char *file, int line, int errnum)
The XLAL error handler that calls exit.
Definition: XLALError.c:607
int int int int XLALVPrintError(const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(1)
Prints an error message if error printing is enabled by lalDebugLevel.
Definition: XLALError.c:50
Exceeded maximum number of iterations.
Definition: XLALError.h:456
int32_t INT4
Four-byte signed integer.
void XLALVPrintInfoMessage(const char *func, const char *file, int line, const char *fmt, va_list ap) _LAL_GCC_VPRINTF_FORMAT_(4)
Print an error message with standard XLAL formatting (if error messages are enabled by lalDebugLevel)...
Definition: XLALError.c:132
Generic failure.
Definition: XLALError.h:419
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
Internal function call failed bit: "or" this with existing error number.
Definition: XLALError.h:463
User-defined error 9.
Definition: XLALError.h:440
No such file or directory.
Definition: XLALError.h:406
Invalid units.
Definition: XLALError.h:426
#define _LAL_GCC_PRINTF_FORMAT_(NFMT, NARG)
Definition: LALStddef.h:38
Invalid argument.
Definition: XLALError.h:410
void XLALPerror(const char *func, const char *file, int line, int errnum)
Prints an error message for a particular error code in a standard format.
Definition: XLALError.c:539
static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void)
Returns the value of the XLAL REAL8 failure NaN.
Definition: XLALError.h:336
Inconsistent or invalid length.
Definition: XLALError.h:420
Wrong or unknown type.
Definition: XLALError.h:423
Wrong name.
Definition: XLALError.h:427
User-defined error 5.
Definition: XLALError.h:436
#define _LAL_GCC_VPRINTF_FORMAT_(NFMT)
Definition: LALStddef.h:39
User-defined error 0.
Definition: XLALError.h:431
User-defined error 4.
Definition: XLALError.h:435
Loss of accuracy.
Definition: XLALError.h:460