Category : C Source Code
Archive   : TCBISO.ZIP
Filename : GETARGS.C

 
Output of file : GETARGS.C contained in archive : TCBISO.ZIP
/* Parse command line arguments for bison,
Copyright (C) 1984, 1986 Bob Corbett and Free Software Foundation, Inc.

Modified for Turbo C and MS-DOS on December 14, 1987.
Modifications are Copyright (c) 1987 by Billy G. Allie.

BISON is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY. No author or distributor accepts responsibility to anyone
for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing.
Refer to the BISON General Public License for full details.

Everyone is granted permission to copy, modify and redistribute BISON,
but only under the conditions described in the BISON General Public
License. A copy of this license is supposed to have been given to you
along with BISON so you can know your rights and responsibilities. It
should be in a file named COPYING. Among other things, the copyright
notice and this notice must be preserved on all copies.

In other words, you are welcome to use, share and improve this program.
You are forbidden to forbid anyone else to use, share and improve
what you give them. Help stamp out software-hoarding! */

#include
#include
#include "files.h"

int verboseflag;
int definesflag;
extern int fixed_outfiles;/* JF */


getargs(argc, argv)
int argc;
char *argv[];
{
register int i;
register char *cp;
register int duplicates;

verboseflag = 0;
definesflag = 0;
duplicates = 0;

i = 1;
while (i < argc && *argv[i] == '-')
{
cp = argv[i] + 1;
while (*cp)
{
switch (*cp)
{
case 'y':/* JF this case */
case 'Y':
if(fixed_outfiles)
duplicates = 1;
else
fixed_outfiles = 1;
break;

case 'v':
case 'V':
if (verboseflag)
duplicates = 1;
else
verboseflag = 1;
break;

case 'd':
case 'D':
if (definesflag)
duplicates = 1;
else
definesflag = 1;
break;

default:
fatals("illegal option: %s", argv[i]);
}
cp++;
}
i++;
}

if (duplicates)
fprintf(stderr, "warning: repeated arguments ignored");

if (i == argc)
fatal("grammar file not specified");
else
infile = argv[i];

if (i < argc - 1)
fprintf(stderr, "warning: extra arguments ignored");
}


  3 Responses to “Category : C Source Code
Archive   : TCBISO.ZIP
Filename : GETARGS.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/