--- ray/src/common/fgetval.c 1995/06/30 16:06:09 2.1 +++ ray/src/common/fgetval.c 2003/06/07 12:50:20 2.5 @@ -1,35 +1,28 @@ -/* 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.5 2003/06/07 12:50:20 schorsch Exp $"; #endif - /* * Read white space separated values from stream + * + * External symbols declared in standard.h */ -#include +#include "copyright.h" +#include #include - +#include +#include #include +#include "standard.h" -#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 +48,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);