113 #include <lal/LALStdlib.h>
114 #include <lal/LALConstants.h>
115 #include <lal/StringInput.h>
117 #define LAL_INT8_ABSMIN LAL_UINT8_C(9223372036854775808)
118 #define LAL_INT4_ABSMIN LAL_UINT8_C(2147483648)
119 #define LAL_INT2_ABSMIN LAL_UINT8_C(32768)
122 #define LAL_UINT8_MAXDIGITS (20)
133 const CHAR *here = string;
135 UINT4 n = LAL_UINT8_MAXDIGITS - 1;
140 while (isspace(*here))
144 else if (*here ==
'-') {
150 if (isdigit((
int) (c = *here))) {
151 value = (
UINT8) (c -
'0');
161 while (isdigit((
int) (c = *here)) && --n) {
163 value += (
UINT8) (c -
'0');
172 if (isdigit((
int) (*here))) {
176 while (isdigit((
int) (*here)));
212 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
223 *value = (
UINT2) (absValue);
246 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
257 *value = (
UINT4) (absValue);
280 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
311 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
323 *value = (
INT2) (absValue);
325 if (absValue > LAL_INT2_ABSMIN)
326 *value = (
INT2) (-LAL_INT2_ABSMIN);
328 *value = (
INT2) (-absValue);
352 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
364 *value = (
INT4) (absValue);
366 if (absValue > LAL_INT4_ABSMIN)
367 *value = (
INT4) (-LAL_INT4_ABSMIN);
369 *value = (
INT4) (-absValue);
393 absValue = LALStringToU8AndSign(&
sign,
string, &
end);
405 *value = (
INT8) (absValue);
407 if (absValue > LAL_INT8_ABSMIN)
408 *value = (
INT8) (-LAL_INT8_ABSMIN);
410 *value = (
INT8) (-absValue);
433 myValue = strtod(
string, &
end);
446 *value = (
REAL4) (myValue);
468 myValue = strtod(
string, &
end);
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
void LALStringToU4(LALStatus *stat, UINT4 *value, const CHAR *string, CHAR **endptr)
void LALStringToZ(LALStatus *stat, COMPLEX16 *value, const CHAR *string, CHAR **endptr)
void LALStringToU8(LALStatus *stat, UINT8 *value, const CHAR *string, CHAR **endptr)
void LALStringToI4(LALStatus *stat, INT4 *value, const CHAR *string, CHAR **endptr)
void LALStringToS(LALStatus *stat, REAL4 *value, const CHAR *string, CHAR **endptr)
void LALStringToC(LALStatus *stat, COMPLEX8 *value, const CHAR *string, CHAR **endptr)
void LALStringToU2(LALStatus *stat, UINT2 *value, const CHAR *string, CHAR **endptr)
void LALStringToD(LALStatus *stat, REAL8 *value, const CHAR *string, CHAR **endptr)
void LALStringToI2(LALStatus *stat, INT2 *value, const CHAR *string, CHAR **endptr)
void LALStringToI8(LALStatus *stat, INT8 *value, const CHAR *string, CHAR **endptr)
#define LAL_REAL4_MAX
Largest normalized REAL4 number (2-2^-23)*2^127.
#define LAL_REAL8_MAX
Largest normalized REAL8 number (2-2^-52)*2^1023.
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
#define LAL_INT8_C(c)
Macro for use in defining v as an INT8 constant.
double REAL8
Double precision real floating-point number (8 bytes).
int16_t INT2
Two-byte signed integer.
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
uint16_t UINT2
Two-byte unsigned integer.
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
LAL status structure, see The LALStatus structure for more details.
struct tagLALStatus * statusPtr
Pointer to the next node in the list; NULL if this function is not reporting a subroutine error.