--- ray/src/common/fgetval.c 1995/06/30 16:06:09 2.1 +++ ray/src/common/fgetval.c 2003/06/27 06:53:21 2.6 @@ -1,35 +1,23 @@ -/* Copyright (c) 1995 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: fgetval.c,v 2.6 2003/06/27 06:53:21 greg Exp $"; #endif - /* * Read white space separated values from stream + * + * External symbols declared in rtio.h */ -#include +#include "rtio.h" #include - #include - -#ifdef DCL_ATOF -extern double atof(); -#endif -extern int atoi(); -extern long atol(); -extern char *strcpy(); - - int fgetval(fp, ty, vp) /* get specified data word */ register FILE *fp; int ty; char *vp; { - static char delims[] = " \t\n\r\f#"; char wrd[64]; register char *cp; register int c; @@ -55,29 +43,29 @@ char *vp; *cp = '\0'; switch (ty) { /* check and convert it */ case 'h': /* short */ - if (!isintd(wrd, delims)) + if (!isint(wrd)) return(0); *(short *)vp = c = atoi(wrd); if (*(short *)vp != c) return(0); return(1); case 'i': /* integer */ - if (!isintd(wrd, delims)) + if (!isint(wrd)) return(0); *(int *)vp = atoi(wrd); return(1); case 'l': /* long */ - if (!isintd(wrd, delims)) + if (!isint(wrd)) return(0); *(long *)vp = atol(wrd); return(1); case 'f': /* float */ - if (!isfltd(wrd, delims)) + if (!isflt(wrd)) return(0); *(float *)vp = atof(wrd); return(1); case 'd': /* double */ - if (!isfltd(wrd, delims)) + if (!isflt(wrd)) return(0); *(double *)vp = atof(wrd); return(1);