Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
CheckStatus.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Bernd Machenschalk, Jolien Creighton
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#include <lal/LALStdlib.h>
21#include <stdio.h>
22#include <string.h>
23
24extern BOOLEAN optVerbose;
25
26static INT4
27CheckStatus(LALStatus *status, const INT4 code, const CHAR *message,
28 const INT4 exitcode, const CHAR *error)
29{
30
31 if (optVerbose)
32 {
34 }
35 if (status->statusCode!= code)
36 {
37 if (code) printf (" FAIL: did not recognize \"%s\"\n", message);
38 if (optVerbose) printf("Exiting with error: %s\n", error);
39 return(exitcode);
40 }
41 else if (code && strcmp(message, status->statusDescription))
42 {
43 printf(" FAIL: incorrect error message \"%s\" not \"%s\"\n",
44 status->statusDescription, message);
45 if (optVerbose) printf("Exiting with error: %s\n", error);
46 return(exitcode);
47 }
48 return 0;
49}
static INT4 CheckStatus(LALStatus *status, const INT4 code, const CHAR *message, const INT4 exitcode, const CHAR *error)
Definition: CheckStatus.h:27
BOOLEAN optVerbose
void REPORTSTATUS(LALStatus *status)
Definition: LALError.c:322
static REAL8TimeSeries * error(const REAL8TimeSeries *s1, const REAL8TimeSeries *s0)
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
int32_t INT4
Four-byte signed integer.
LAL status structure, see The LALStatus structure for more details.
Definition: LALDatatypes.h:947