]>
git.saurik.com Git - bison.git/blob - src/vmsgetargs.c
1 /* VMS version of getargs; Uses DCL command parsing.
2 Copyright (C) 1989 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
24 * VMS version of getargs(): Uses DCL command parsing
25 * (argc and argv are ignored)
31 extern int fixed_outfiles
;
32 extern char * version_string
;
34 /* Allocate storgate and initialize, since bison uses them elsewhere. */
35 char *spec_name_prefix
;
36 char *spec_file_prefix
;
43 static char Input_File
[256];
44 static char output_spec
[256], name_prefix_spec
[256], file_prefix_spec
[256];
53 * Check for /VERBOSE qualifier
55 if (cli_present("BISON$VERBOSE")) verboseflag
= 1;
57 * Check for /DEFINES qualifier
59 if (cli_present("BISON$DEFINES")) definesflag
= 1;
61 * Check for /FIXED_OUTFILES qualifier
63 if (cli_present("BISON$FIXED_OUTFILES")) fixed_outfiles
= 1;
64 if (cli_present("BISON$YACC")) fixed_outfiles
= 1;
66 * Check for /VERSION qualifier
68 if (cli_present("BISON$VERSION")) printf("%s",version_string
);
70 * Check for /NOLINES qualifier
72 if (cli_present("BISON$NOLINES")) nolinesflag
= 1;
74 * Check for /DEBUG qualifier
76 if (cli_present("BISON$DEBUG")) debugflag
= 1;
80 cli_get_value("BISON$INFILE", Input_File
, sizeof(Input_File
));
82 * Lowercaseify the input filename
87 if (isupper(*cp
)) *cp
= tolower(*cp
);
94 if (cli_present("BISON$OUTPUT"))
96 cli_get_value("BISON$OUTPUT", output_spec
, sizeof(output_spec
));
97 for (cp
= spec_outfile
= output_spec
; *cp
; cp
++)
102 * Get the output file
104 if (cli_present("BISON$FILE_PREFIX"))
106 cli_get_value("BISON$FILE_PREFIX", file_prefix_spec
,
107 sizeof(file_prefix_spec
));
108 for (cp
= spec_file_prefix
= file_prefix_spec
; *cp
; cp
++)
113 * Get the output file
115 if (cli_present("BISON$NAME_PREFIX"))
117 cli_get_value("BISON$NAME_PREFIX", name_prefix_spec
,
118 sizeof(name_prefix_spec
));
119 for (cp
= spec_name_prefix
= name_prefix_spec
; *cp
; cp
++)
125 /************ DCL PARSING ROUTINES **********/
128 * See if "NAME" is present
134 struct {int Size
; char *Ptr
;} Descr
;
137 Descr
.Size
= strlen(Name
);
138 return((cli$
present(&Descr
) & 1) ? 1 : 0);
142 * Get value of "NAME"
145 cli_get_value(Name
,Buffer
,Size
)
149 struct {int Size
; char *Ptr
;} Descr1
,Descr2
;
152 Descr1
.Size
= strlen(Name
);
154 Descr2
.Size
= Size
-1;
155 if (cli$
get_value(&Descr1
,&Descr2
,&Descr2
.Size
) & 1) {
156 Buffer
[Descr2
.Size
] = 0;