/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1996-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "common.h"
int
{
char c;
char *arg;
argv++;
while (--argc > 1) {
if (*arg == '-') {
if (!*(arg + 1)) {
/* not an option */
break;
}
loop:
if ((c = *++arg) == '\0') {
/* next argument */
argv++;
continue;
} else if (c != '-') {
/* Sun option */
switch (c) {
case 'D':
/*
* add directory to list for input
* files search.
*/
if (*(arg + 1)) {
/*
* no spaces between -D and
* optarg
*/
argv++;
continue;
}
if (--argc > 1) {
else
++argv;
argv++;
continue;
}
/* not enough args */
return (-1);
/* NOTREACHED */
case 'f':
/*
* Use fuzzy entry
*/
goto loop;
/* NOTREACHED */
case 'o':
/*
* Specify output file name
*/
if (*(arg + 1)) {
/*
* no spaces between -o and
* optarg
*/
argv++;
continue;
}
if (--argc > 1) {
argv++;
continue;
}
/* not enough args */
return (-1);
case 'g':
/*
* GNU mode
*/
goto loop;
case 's':
/*
* Sun mode
*/
goto loop;
case 'v':
/*
* verbose mode
*/
goto loop;
default:
/* illegal option */
return (-1);
}
/* NOTREACHED */
}
/* option end */
argv++;
argc--;
break;
}
/* GNU options */
arg++;
/*
* add directory to list for input
* files search.
*/
/*
* inputdir has already been specified
*/
argv++;
continue;
}
arg += 10;
if (*arg == '\0') {
/* illegal option */
return (-1);
}
argv++;
continue;
}
/*
* Use fuzzy entry
*/
argv++;
continue;
}
/*
* Specify output file name
*/
arg += 12;
if (*arg == '\0') {
/* illegal option */
return (-1);
}
argv++;
continue;
}
/*
* strict mode
*/
argv++;
continue;
}
/*
* verbose mode
*/
argv++;
continue;
}
/* illegal option */
return (-1);
}
break;
}
if (argc == 0)
return (-1);
return (0);
}