24 #include <lal/LALMalloc.h>
25 #include <lal/LALStdio.h>
26 #include <lal/LALString.h>
27 #include <lal/XLALError.h>
29 #include <lal/LALDatatypes.h>
31 #include <lal/UserInputPrint.h>
101 sprintf ( buf, (*valBOOLEAN) ?
"TRUE" :
"FALSE" );
125 if ( (*valSTRING) == NULL )
132 sprintf ( ret,
"\"%s\"", (*valSTRING) );
147 char *retn =
XLALMalloc(
sizeof(*retn) * (strlen(part0) + 1 + strlen(part1) + 1));
166 char *retn =
XLALMalloc(
sizeof(*retn) * (strlen(part0) + 1 + strlen(part1) + 1));
185 char *retn =
XLALMalloc(
sizeof(*retn) * (strlen(part0) + 1 + strlen(part1) + 1));
209 if ((*enumData)[i].val >= 0 && (*enumData)[i].name != NULL) {
210 if (*valEnum == (*enumData)[i].val) {
232 const char *prev_name = NULL;
234 if ((*enumData)[i].val >= 0 && (*enumData)[i].name != NULL) {
235 if (prev_name != NULL && strcmp(prev_name, (*enumData)[i].
name) == 0) {
240 }
else if (prev_val >= 0 && prev_val == (*enumData)[i].val) {
246 prev_val = (*enumData)[i].val;
247 prev_name = (*enumData)[i].name;
270 if ((*flagData)[0].val == 0 && (*flagData)[0].
name != NULL && *valFlag == 0) {
278 if ((*flagData)[i].val > 0 && (*flagData)[i].name != NULL) {
279 if (val & (*flagData)[i].val) {
280 val &= ~(*flagData)[i].val;
304 const char *prev_name = NULL;
306 if ((*flagData)[i].val > 0 && (*flagData)[i].name != NULL) {
307 if (prev_name != NULL && strcmp(prev_name, (*flagData)[i].
name) == 0) {
312 }
else if (prev_val > 0 && prev_val == (*flagData)[i].val ) {
318 prev_val = (*flagData)[i].val;
319 prev_name = (*flagData)[i].name;
324 if ((*flagData)[0].val == 0 && (*flagData)[0].
name != NULL) {
344 if ( (*valSTRINGVector == NULL) || ((*valSTRINGVector)->data == NULL) || ((*valSTRINGVector)->length == 0) )
350 for (
UINT4 i=0; i < (*valSTRINGVector)->length; i++ )
370 #define DEFN_XLALPrintStringValueOfVector(CTYPE) \
371 DECL_XLALPrintStringValueOfVector(CTYPE) \
373 XLAL_CHECK_NULL ( valVector != NULL, XLAL_EINVAL ); \
375 if ( (*valVector == NULL) || ((*valVector)->data == NULL) || ((*valVector)->length == 0) ) \
377 XLAL_CHECK_NULL ( (ret = XLALStringDuplicate("NULL")) != NULL, XLAL_EFUNC ); \
381 for ( UINT4 i=0; i < (*valVector)->length; i++ ) \
384 XLAL_CHECK_NULL ( (ret = XLALStringAppend ( ret, "," )) != NULL, XLAL_EFUNC ); \
387 XLAL_CHECK_NULL ( (tmp = XLALPrintStringValueOf##CTYPE ( &(*valVector)->data[i])) != NULL, XLAL_EFUNC ); \
388 XLAL_CHECK_NULL ( (ret = XLALStringAppend ( ret, tmp )) != NULL, XLAL_EFUNC ); \
char * XLALStringAppendFmt(char *s, const char *fmt,...)
Append the formatted string 'fmt' to the string 's', which is reallocated with XLALRealloc() to the r...
char * XLALGPSToStr(char *, const LIGOTimeGPS *t)
Return a string containing the ASCII base 10 representation of a LIGOTimeGPS.
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
#define XLAL_NUM_ELEM(x)
MACRO which gives the number of elements in a fixed-size array.
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.
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
char * XLALStringDuplicate(const char *s)
Like strdup but uses LAL allocation routines (free with LALFree).
char * XLALStringAppend(char *s, const char *append)
Like strcat but dynamically reallocates string with LALRealloc.
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
#define XLAL_CHECK_NULL(assertion,...)
Macro to test an assertion and invoke a failure if it is not true in a function that returns a pointe...
@ XLAL_ENOMEM
Memory allocation error.
@ XLAL_EFAULT
Invalid pointer.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
@ XLAL_EINVAL
Invalid argument.
Vector of type CHAR*, ie 'strings', see DATATYPE-Vector types for more details.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Possible choices the user may select for an enumeration or bitflag.