101 #ifdef __STDC_VERSION__ 102 # if (__STDC_VERSION__ >= 199901L) 103 # define HAVE_COPYSIGN 1 110 #define _POSIX_C_SOURCE 200112L 111 #define _ISOC99_SOURCE 113 # define ISBLANK isblank 117 return ( c ==
' ' || c ==
'\t' );
122 #ifdef HAVE_BSD_STRING_H 123 #include <bsd/string.h> 135 # define SCAN_FOR_MINUS 0 137 # define SCAN_FOR_MINUS 1 142 # include "star/util.h" 147 double *dreslt,
int *jflag ) {
150 char * endptr = NULL;
162 const char * cctemp = NULL;
168 cctemp = &(
string[ipos-1]);
169 while (!isdigit(*cctemp) && (*cctemp !=
',') && (*cctemp !=
'\0')) {
170 if (*cctemp ==
'-') {
182 star_strlcpy( tempbuf, &(
string[*nstrt-1]),
sizeof(tempbuf) );
185 strlcpy( tempbuf, &(
string[*nstrt-1]),
sizeof(tempbuf) );
188 strncpy( tempbuf, &(
string[*nstrt-1]),
sizeof(tempbuf));
189 tempbuf[
sizeof(tempbuf)-1] =
'\0';
195 while (*ctemp !=
'\0') {
196 if (*ctemp ==
'd' || *ctemp ==
'D') *ctemp =
'E';
205 retval = strtod( tempbuf, &endptr );
206 if (retval == 0.0 && endptr == tempbuf) {
214 while (
ISBLANK(*endptr) || isalpha(*endptr) ) {
218 }
else if ( errno == ERANGE ) {
222 *jflag = (dreslt_sign < 0 ? -1 : 0);
224 if ( retval < 0.0 ) {
226 }
else if ( retval == 0.0 ) {
228 double test = copysign( 1.0, retval );
241 *nstrt += endptr - tempbuf;
244 if (*endptr ==
',') {
256 if (*jflag != 1) *dreslt = retval;
void palDfltin(const char *string, int *nstrt, double *dreslt, int *jflag)
static int ISBLANK(int c)