Commit ab9e0ff9 by Dave Brolley Committed by Dave Brolley

New interface for lang_decode_option.

Wed Jun 10 13:17:32 1998  Dave Brolley  <brolley@cygnus.com>
	* top.h (ffe_decode_option): New argc/argv interface.
	* top.c (ffe_decode_option): New argc/argv interface.
	* parse.c (yyparse): New argc/argv interface for ffe_decode_option.
	* com.c (lang_decode_option): New argc/argv interface.

From-SVN: r20409
parent 297441fd
Wed Jun 10 13:17:32 1998 Dave Brolley <brolley@cygnus.com>
* top.h (ffe_decode_option): New argc/argv interface.
* top.c (ffe_decode_option): New argc/argv interface.
* parse.c (yyparse): New argc/argv interface for ffe_decode_option.
* com.c (lang_decode_option): New argc/argv interface.
Mon Jun 1 19:37:42 1998 Craig Burley <burley@gnu.org> Mon Jun 1 19:37:42 1998 Craig Burley <burley@gnu.org>
* com.c (ffecom_init_0): Fix setup of INTEGER(KIND=7) * com.c (ffecom_init_0): Fix setup of INTEGER(KIND=7)
......
...@@ -14904,10 +14904,11 @@ insert_block (block) ...@@ -14904,10 +14904,11 @@ insert_block (block)
} }
int int
lang_decode_option (p) lang_decode_option (argc, argv)
char *p; int argc;
char **argv;
{ {
return ffe_decode_option (p); return ffe_decode_option (argc, argv);
} }
/* used by print-tree.c */ /* used by print-tree.c */
......
...@@ -52,11 +52,18 @@ yyparse () ...@@ -52,11 +52,18 @@ yyparse ()
#if FFECOM_targetCURRENT == FFECOM_targetFFE #if FFECOM_targetCURRENT == FFECOM_targetFFE
ffe_init_0 (); ffe_init_0 ();
for (--argc, ++argv; argc > 0; --argc, ++argv) {
{ int strings_processed;
if (!ffe_decode_option (argv[0])) for (--argc, ++argv; argc > 0; argc -= strings_processed, argv += strings_processed)
fprintf (stderr, "Unrecognized option: %s\n", argv[0]); {
} strings_processed = ffe_decode_option (argc, argv);
if (strings_processed == 0)
{
fprintf (stderr, "Unrecognized option: %s\n", argv[0]);
strings_processed = 1;
}
}
}
#elif FFECOM_targetCURRENT == FFECOM_targetGCC #elif FFECOM_targetCURRENT == FFECOM_targetGCC
if (!ffe_is_pedantic ()) if (!ffe_is_pedantic ())
ffe_set_is_pedantic (pedantic); ffe_set_is_pedantic (pedantic);
......
...@@ -160,8 +160,11 @@ ffe_is_digit_string_ (char *s) ...@@ -160,8 +160,11 @@ ffe_is_digit_string_ (char *s)
recognized and handled. */ recognized and handled. */
int int
ffe_decode_option (char *opt) ffe_decode_option (argc, argv)
int argc;
char **argv;
{ {
char *opt = argv[0];
if (opt[0] != '-') if (opt[0] != '-')
return 0; return 0;
if (opt[1] == 'f') if (opt[1] == 'f')
......
...@@ -141,7 +141,7 @@ extern bool ffe_in_4; ...@@ -141,7 +141,7 @@ extern bool ffe_in_4;
/* Declare functions with prototypes. */ /* Declare functions with prototypes. */
int ffe_decode_option (char *opt); int ffe_decode_option (int argc, char **argv);
void ffe_file (ffewhereFile wf, FILE *f); void ffe_file (ffewhereFile wf, FILE *f);
void ffe_init_0 (void); void ffe_init_0 (void);
void ffe_init_1 (void); void ffe_init_1 (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment