Description:
Extracts a number from an
input string starting at the specified index.
Invocation
void palIntin( const char
string, int
nstrt, long
ireslt, int
jflag );
Arguments
string = const char
(Given)
String containing number to be decoded.
nstrt = int
(Given and
Returned)
Character number indicating where decoding should start. On output its value is updated to
be the location of the possible next value. For compatibility with SLA the first character is index 1.
ireslt
= long
(Returned)
Result. Not updated when jflag=1.
jflag = int
(Returned)
status:
-1 = -OK, 0 = OK,
1 = null, 2 = error
Notes:
-
Uses the strtol() system call to do the parsing. This may lead to subtle differences when compared to
the SLA/F parsing.
-
Commas are recognized as a special case and are skipped if one happens to be the next character
when updating nstrt. Additionally the output nstrt position will skip past any trailing
space.
-
If no number can be found flag will be set to 1.
-
If the number overflows or underflows jflag will be set to 2. For overflow the returned
result will have the value LONG_MAX, for underflow it will have the value LONG_MIN.
Copyright © 2012 Science and Technology Facilities Council.
Copyright © 2014 Cornell University.
Copyright © 2015 Tim Jenness