1 #include <../../nrnconf.h> 32 static char rcsid[] =
"otherio.c,v 1.1 1997/12/04 17:55:44 hines Exp";
55 if ( ! isatty(fileno(
fp)) )
64 while ( isspace(*cp) )
66 if ( *cp ==
'y' || *cp ==
'Y' )
68 if ( *cp ==
'n' || *cp ==
'N' )
70 fprintf(stderr,
"Please reply with 'y' or 'Y' for yes ");
71 fprintf(stderr,
"and 'n' or 'N' for no.\n");
92 if ( ! isatty(fileno(
fp)) )
95 if ( (retcode=fscanf(
fp,
"%d",&x)) == EOF )
99 if ( low <= high && ( x < low || x > high ) )
109 retcode = sscanf(
scratch,
"%d",&x);
110 if ( ( retcode==1 && low > high ) ||
111 ( x >= low && x <= high ) )
113 fprintf(stderr,
"Please type an integer in range [%d,%d].\n",
131 if ( ! isatty(fileno(
fp)) )
135 if ( (retcode=fscanf(
fp,
"%lf",&x)) == EOF )
137 if ( (retcode=fscanf(
fp,
"%f",&x)) == EOF )
142 if ( low <= high && ( x < low || x > high ) )
153 retcode = sscanf(
scratch,
"%lf",&x);
155 retcode = sscanf(
scratch,
"%f",&x);
157 if ( ( retcode==1 && low > high ) ||
158 ( x >= low && x <= high ) )
160 fprintf(stderr,
"Please type an double in range [%g,%g].\n",
fprintf(stderr, "Don't know the location of params at %p\, pp)
static char scratch[MAXLINE+1]
int fin_int(FILE *fp, char *s, int low, int high)
#define error(err_num, fn_name)
int fy_or_n(FILE *fp, char *s)
double fin_double(FILE *fp, char *s, double low, double high)