LAL  7.5.0.1-b72065a
UserInputPrint.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2016 Karl Wette
3 // Copyright (C) 2015 Reinhard Prix
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with with program; see the file COPYING. If not, write to the
17 // Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 // MA 02110-1301 USA
19 //
20 
21 #ifndef _USERINPUTPRINT_H /* Double-include protection. */
22 #define _USERINPUTPRINT_H
23 
24 #include <lal/LALDatatypes.h>
25 #include <lal/UserInputParse.h>
26 
27 /* C++ protection. */
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 /**
33  * \defgroup UserInputPrint_h Header UserInputPrint.h
34  * \ingroup UserInput_h
35  * \author Reinhard Prix
36  * \brief Sub-module for general printing of various input 'types' (as defined in \ref UserInput_h) as 'string values',
37  * These can be thought of as the 'inverse functions' to \ref UserInputParse_h.
38  *
39  */
40 
41 /** @{ */
42 
43 // ---------- exported defines & macros ----------
44 
45 // ----- printing of UTYPES that are mappings to other types
46 #define XLALPrintStringValueOfRAJ XLALPrintStringValueOfREAL8
47 #define XLALPrintStringValueOfDECJ XLALPrintStringValueOfREAL8
48 #define XLALPrintStringValueOfRAJRange XLALPrintStringValueOfREAL8Range
49 #define XLALPrintStringValueOfDECJRange XLALPrintStringValueOfREAL8Range
50 
51 // ---------- exported types ----------
52 
53 // ---------- Function prototypes ----------
54 
55 char *XLALPrintStringValueOfBOOLEAN ( const BOOLEAN *valBOOLEAN );
56 char *XLALPrintStringValueOfINT4 ( const INT4 *valINT4 );
57 char *XLALPrintStringValueOfINT8 ( const INT8 *valINT8 );
58 char *XLALPrintStringValueOfUINT4 ( const UINT4 *valUINT4 );
59 char *XLALPrintStringValueOfUINT8 ( const UINT8 *valUINT8 );
60 char *XLALPrintStringValueOfREAL4 ( const REAL4 *valREAL4 );
61 char *XLALPrintStringValueOfREAL8 ( const REAL8 *valREAL8 );
62 char *XLALPrintStringValueOfEPOCH ( const LIGOTimeGPS *valGPS );
63 
64 char *XLALPrintStringValueOfINT4Range ( const INT4Range *int4Range );
65 char *XLALPrintStringValueOfREAL8Range ( const REAL8Range *real8Range );
66 char *XLALPrintStringValueOfEPOCHRange ( const LIGOTimeGPSRange *gpsRange );
67 
68 char *XLALPrintStringValueOfUserEnum ( const int *valEnum, const UserChoices *enumData );
69 char *XLALFormatHelpStringOfUserEnum ( const UserChoices *enumData );
70 char *XLALPrintStringValueOfUserFlag ( const int *valFlag, const UserChoices *flagData );
71 char *XLALFormatHelpStringOfUserFlag ( const UserChoices *flagData );
72 
73 char *XLALPrintStringValueOfSTRING ( char **valSTRING );
74 char *XLALPrintStringValueOfSTRINGVector ( LALStringVector **valSTRINGVector );
75 
76 // use macro templating to define printers for numerical <CTYPE>vectors
77 #define DECL_XLALPrintStringValueOfVector(CTYPE) \
78 char *XLALPrintStringValueOf##CTYPE##Vector ( CTYPE##Vector **valVector )
79 
83 
84 /** @} */
85 
86 /* C++ protection. */
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif /* Double-include protection. */
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead.
double REAL8
Double precision real floating-point number (8 bytes).
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
LIGOTimeGPS LIGOTimeGPSRange[2]
A range of GPS times; first element is minimum, second element is maximum of range.
REAL8 REAL8Range[2]
A range of REAL8 values; first element is minimum, second element is maximum of range.
INT4 INT4Range[2]
A range of INT4 values; first element is minimum, second element is maximum of range.
char * XLALPrintStringValueOfREAL8Range(const REAL8Range *real8Range)
Return 'string value' (allocated here) of a REAL8Range, as parseable by XLALParseStringValueAsREAL8Ra...
char * XLALFormatHelpStringOfUserEnum(const UserChoices *enumData)
Return format help string (allocated here) for a user selection of an enumeration value.
char * XLALPrintStringValueOfINT4Range(const INT4Range *int4Range)
Return 'string value' (allocated here) of a INT4Range, as parseable by XLALParseStringValueAsINT4Rang...
char * XLALPrintStringValueOfSTRING(char **valSTRING)
Return 'string value' (allocated here) of a STRING, surrounded by double quotes.
char * XLALPrintStringValueOfUserFlag(const int *valFlag, const UserChoices *flagData)
Return 'string value' (allocated here) of a user selection of an bitflag value.
char * XLALPrintStringValueOfSTRINGVector(LALStringVector **valSTRINGVector)
Return 'string value' (allocated here) of a STRINGVector, by turning into comma-separated list of str...
char * XLALPrintStringValueOfINT4(const INT4 *valINT4)
Return 'string value' (allocated here) of an INT4.
char * XLALPrintStringValueOfEPOCH(const LIGOTimeGPS *valGPS)
Return 'string value' (allocated here) of a GPS epoch, as parseable by XLALParseStringValueAs[GPS|EPO...
char * XLALPrintStringValueOfINT8(const INT8 *valINT8)
Return 'string value' (allocated here) of an INT8.
char * XLALPrintStringValueOfUINT8(const UINT8 *valUINT8)
Return 'string value' (allocated here) of an UINT8.
char * XLALPrintStringValueOfUINT4(const UINT4 *valUINT4)
Return 'string value' (allocated here) of an UINT4.
char * XLALPrintStringValueOfUserEnum(const int *valEnum, const UserChoices *enumData)
Return 'string value' (allocated here) of a user selection of an enumeration value.
char * XLALPrintStringValueOfREAL4(const REAL4 *valREAL4)
Return 'string value' (allocated here) of a REAL4 (printed at full precision)
#define DECL_XLALPrintStringValueOfVector(CTYPE)
char * XLALPrintStringValueOfREAL8(const REAL8 *valREAL8)
Return 'string value' (allocated here) of a REAL8 (printed at full precision)
char * XLALPrintStringValueOfEPOCHRange(const LIGOTimeGPSRange *gpsRange)
Return 'string value' (allocated here) of a EPOCHRange, as parseable by XLALParseStringValueAsEPOCHRa...
char * XLALFormatHelpStringOfUserFlag(const UserChoices *flagData)
Return format help string (allocated here) for a user selection of an bitflag value.
char * XLALPrintStringValueOfBOOLEAN(const BOOLEAN *valBOOLEAN)
Return 'string value' (allocated here) of a BOOLEAN.
Vector of type CHAR*, ie 'strings', see DATATYPE-Vector types for more details.
Definition: LALDatatypes.h:82
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Definition: LALDatatypes.h:458
Possible choices the user may select for an enumeration or bitflag.