toplev.h (read_integral_parameter): Declare.

* toplev.h (read_integral_parameter): Declare.
	* toplev.c (read_integral_parameter): New function.

From-SVN: r24985
This commit is contained in:
Theodore Papadopoulo 1999-02-02 22:43:19 +01:00 committed by Jeff Law
parent ca545bb569
commit 132e01b1e6
3 changed files with 33 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Tue Feb 2 22:38:19 1999 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* toplev.h (read_integral_parameter): Declare.
* toplev.c (read_integral_parameter): New function.
Fri Jan 29 21:00:56 1999 Bob Manson <manson@charmed.cygnus.com>
* resource.c, resource.h: New files.

View file

@ -1244,6 +1244,33 @@ FILE *asm_out_file;
FILE *aux_info_file;
FILE *rtl_dump_file = NULL;
/* Decode the string P as an integral parameter.
If the string is indeed an integer return its numeric value else
issue an Invalid Option error for the option PNAME and return DEFVAL. */
int
read_integral_parameter (p, pname, defval)
char *p;
char *pname;
int defval;
{
char *endp = p;
while (*endp)
{
if (*endp >= '0' && *endp <= '9')
endp++;
else
{
error ("Invalid option `%s'", pname);
return defval;
}
}
return atoi (p);
}
/* Time accumulators, to count the total time spent in various passes. */
int parse_time;

View file

@ -26,6 +26,7 @@ union tree_node;
struct rtx_def;
#endif
extern int read_integral_parameter PROTO ((char *, char *, int));
extern int count_error PROTO ((int));
extern void strip_off_ending PROTO ((char *, int));
extern void print_time PROTO ((const char *, int));