1N/A/***********************************************************************
1N/A* *
1N/A* This software is part of the ast package *
1N/A* Copyright (c) 1986-2010 AT&T Intellectual Property *
1N/A* and is licensed under the *
1N/A* Common Public License, Version 1.0 *
1N/A* by AT&T Intellectual Property *
1N/A* *
1N/A* A copy of the License is available at *
1N/A* http://www.opensource.org/licenses/cpl1.0.txt *
1N/A* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
1N/A* *
1N/A* Information and Software Systems Research *
1N/A* AT&T Research *
1N/A* Florham Park NJ *
1N/A* *
1N/A* Glenn Fowler <gsf@research.att.com> *
1N/A* *
1N/A***********************************************************************/
1N/A#pragma prototyped
1N/A/*
1N/A * Glenn Fowler
1N/A * AT&T Research
1N/A *
1N/A * common preprocessor command line argument parse
1N/A * called by optjoin()
1N/A */
1N/A
1N/Astatic const char usage[] =
1N/A"[-?\n@(#)$Id: cpp (AT&T Research) 2009-02-02 $\n]"
1N/AUSAGE_LICENSE
1N/A"[+NAME?cpp - C language preprocessor]"
1N/A"[+DESCRIPTION?\bcpp\b is the preprocessor for all C language dialects. It is"
1N/A" a standalone version of the \blibpp\b(3) preprocessor library. The"
1N/A" C dialect implemented by \bcpp\b is determined by probing \bcc\b(1)"
1N/A" using \bprobe\b(1). The path of the emulated compiler can be changed"
1N/A" by the \b-D-X\b command line option.]"
1N/A"[+?If \aoutput\a is omitted then the standard output is written; if \ainput\a"
1N/A" is also omitted then the standard input is read. NOTE: this is an"
1N/A" ancient, non-standard, non-intuitiive file operand syntax that is"
1N/A" required by \bcc\b(1); use shell file name expansion at your peril.]"
1N/A"[+?\bcpp\b specific options are set by the \b-D-\b and \b-I-\b options.]"
1N/A
1N/A"[C:comments?Pass comments to the output. By default comments are omitted.]"
1N/A"[D:define?Define the macro \aname\a to have \avalue\a; \b1\b is assumed if"
1N/A" \b=\b\avalue\a is omitted. If \aname\a begins with \b:\b then it is"
1N/A" interpreted as a \blibpp\b(3) \b#pragma pp:\b statement; if \aname\a"
1N/A" begins with \b%\b then it is interpreted as a \blibpp\b(3) \b#\b"
1N/A" directive statement; if \aname\a begins with \b-\b or \b+\b then it is"
1N/A" interpreted as a \blibpp\b(3) option; \b-\b turns the option on,"
1N/A" \b+\b turns it off. Most options have a \b#pragma\b counterpart that"
1N/A" is listed with the option definition. Right, this is ugly, but its the"
1N/A" only portable way to pass options through \bcc\b(1) to"
1N/A" \bcpp\b:]:[name[=value]]]{"
1N/A" [+-D-C, pp::compatibility?Preprocess for K&R compatibility.]"
1N/A" [+-D-D\alevel\a, \bpp::debug\b \alevel\a?Set the debug trace level."
1N/A" Higher levels produce more output. Levels higher than 3"
1N/A" enabled only in \b-g\b compiled versions.]"
1N/A" [+-D-F\aname\a?Set the main input file name to \aname\a. This only"
1N/A" affects error message and line sync output.]"
1N/A" [+-D-H, pp::hosted?All directories are hosted; compatibility"
1N/A" warning messages from hosted directory headers are suppressed.]"
1N/A" [+-D-I, pp::cdir?All directories contain C headers; used only with"
1N/A" \b-D-+\b.]"
1N/A" [+-D-K, pp::keyargs?Enable the non-standard \aname=value\a macro"
1N/A" argument mode.]"
1N/A" [+-D-L\b[\aid\a]], \bpp::lineid\b [\aid\a]]?Set the line sync directive"
1N/A" id to \aid\a or null if omitted.]"
1N/A" [+-D-M, pp::nomultiple?Disable multiple include detection.]"
1N/A" [+-D-P, pp::passthrough?Enable the non-standard passthrough mode; may"
1N/A" be useful for processing non-C input.]"
1N/A" [+-D-Q, pp::dump?Dump macro definitions to the output so that the"
1N/A" output may be passed through \bcpp\b again. Used for"
1N/A" generating precompiled headers.]"
1N/A" [+-D-R, pp::transition?Enable the transition preprocessing mode. Used"
1N/A" for compilers that can't make up their semantics between"
1N/A" K&R and ISO.]"
1N/A" [+-D-S, pp::strict?Enable strict preprocessing semantics and warnings."
1N/A" Works with any mode (compatibiliy, transition,"
1N/A" or the default ISO).]"
1N/A" [+-D-T\atest\a, \bpp::test\b \atest\a?Enable implementation specific"
1N/A" test code according to \atest\a.]"
1N/A" [+-D-W, pp::warn?Enable warnings in non-hosted files.]"
1N/A" [+-D-X\b[\acc\a]]?Preprocess for the compiler \acc\a which must be"
1N/A" an executable path or an executable on \b$PATH\b.]"
1N/A" [+-D-Y, pp::pedantic?Enable pedantic \bpp::warn\b warnings in"
1N/A" non-hosted files.]"
1N/A" [+-D-Z, pp::pool?Enable pool mode. See \blibpp\b(3).]"
1N/A" [+-D-d?List canonicalized \b#define\b statements for non-predefined"
1N/A" macros in the output. ]"
1N/A" [+-D-m?List canonicalized \b#define\b statements for all macros. All"
1N/A" other output is disabled.]"
1N/A" [+-D-+, pp::plusplus?Preprocess for the C++ dialect.]"
1N/A"}"
1N/A"[I:include?Append \adirectory\a to the list of directories searched for"
1N/A" \b#include\b files. If \adirectory\a is \b-\b then: (1) \b-I\b"
1N/A" directories before \b-I-\b are searched only for \"...\" include"
1N/A" files; (2) \b-I\b directories after \b-I-\b are searched for"
1N/A" \"...\" and <...> include files; (3) the directory \b.\b is searched"
1N/A" only if it is explicitly specified by a \b-I\b option.]:?[directory]{"
1N/A" [+-I-C\adirectory\a, \bpp::cdir\b \adirectory\a?Mark \adirectory\a"
1N/A" as a C header directory. Used with \bpp:plusplus\b.]"
1N/A" [+-I-D[\afile\a]]?Read the default \bprobe\b(1) definitions from"
1N/A" \afile\a, or ignore the default definitions if \afile\a"
1N/A" is omitted.]"
1N/A" [+-I-H\adirectory\a, \bpp::hostdir\b \adirectory\a?Mark \adirectory\a"
1N/A" as a hosted directory. Headers from hosted directories have"
1N/A" compatibility warnings disabled.]"
1N/A" [+-I-I\aheader\a, \bpp::ignore\b \aheader\a?Add \aheader\a to the"
1N/A" list of ignored headers.]"
1N/A" [+-I-M\afile\a?\afile\a contains a sequence of \aheader\a"
1N/A" [= \"\amap\a\" ]] lines, where \aheader\a is either <\aname\a>"
1N/A" or \"\aname\a\", and \"\amap\a\" is an explicit binding"
1N/A" for \aheader\a. \aheader\a is ignored if = \"\amap\a\" is"
1N/A" omitted.]"
1N/A" [+-I-R\afile\a?Include \afile\a but do not emit text or line syncs.]"
1N/A" [+-I-S\adirectory\a?Add \adirectory\a to the default standard include"
1N/A" directory list.]"
1N/A" [+-I-T\afile\a?Include \afile\a and emit text to the output file.]"
1N/A"}"
1N/A"[M:dependencies?Generate \bmake\b(1) dependencies. Not needed with"
1N/A" \bnmake\b(1). \b-M\b may be followed by optional \aflags\a to change"
1N/A" dependency output styles:]{"
1N/A" [+D?Generate dependencies in a separate \b.d\b file. Preprocessed"
1N/A" output is still written to \aoutput\a, or the standard output"
1N/A" if \aoutput\a is omitted.]"
1N/A" [+G?Generate missing dependencies too.]"
1N/A" [+M?Only generate local header dependencies; \ahosted\a headers are"
1N/A" omitted. Note that \ahosted\a headers are determined by"
1N/A" \b-I-H\b and the \bpp:hosted\b and \bpp:hostdir\b pragmas;"
1N/A" no special distiction is made between \"\" and <> \binclude\b"
1N/A" styles.]"
1N/A"}"
1N/A"[P!:sync?Emit line syncs.]"
1N/A"[U:undefine?Remove the definition for the macro \aname\a.]:[name]"
1N/A
1N/A"[A:assert?Enter the assertion via \b#assert\b for system V"
1N/A" compatibility.]:[assertion]"
1N/A"[E:preprocess?Ignored for compatibility with ancient compilers.]"
1N/A"[H:include-reference?Emit \b#include\b file paths on the standard error,"
1N/A" one per line, indented to show nesting. If the optional \asize\a"
1N/A" argument is specified then the entire \b-H\b option is"
1N/A" ignored.]#?[size]"
1N/A"[T?If not \bgcc\b(1) then truncate identifiers to \alength\a"
1N/A" characters for compatibility with old AT&T (I guess only Lucent needs"
1N/A" them now) compilers.]#?[length]"
1N/A"[V:version?Emit the \blibpp\b(3) version.]"
1N/A"[X:argmode?Enable \aname\a=\avalue\a macro arguments for \beasel\b(1)"
1N/A" compatibility.]"
1N/A"[Y:standard?Add \adirectory\a to the list searched for"
1N/A" \b#include\b \b<...>\b files.]:[directory]"
1N/A
1N/A"\n"
1N/A"\n[ input [ output ] ]\n"
1N/A"\n"
1N/A
1N/A"[+SEE ALSO?\bcc\b(1), \bgcc\b(1), \blibpp\b(3)]"
1N/A;
1N/A
1N/A#include "pplib.h"
1N/A
1N/A#include <ctype.h>
1N/A
1N/A/*
1N/A * convert lint comments to pragmas
1N/A */
1N/A
1N/Astatic void
1N/Applint(char* head, char* comment, char* tail, int line)
1N/A{
1N/A NoP(line);
1N/A if (strmatch(comment, "(ARGSUSED|PRINTFLIKE|PROTOLIB|SCANFLIKE|VARARGS)*([0-9])|CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|FALLTHRU|FALLTHROUGH|LINTLIBRARY|LINTED*|NOTREACHED"))
1N/A {
1N/A strncopy(pp.token, comment, MAXTOKEN);
1N/A ppprintf("\n#%s %s:%s\n", dirname(PRAGMA), pp.pass, pp.token);
1N/A ppline(error_info.line, NiL);
1N/A }
1N/A}
1N/A
1N/A/*
1N/A * if last!=0 then argv[opt_info.index]==0 with return(0)
1N/A * else if argv[opt_info.index]==0 then return(0)
1N/A * otherwise argv[opt_info.index] is the first unrecognized
1N/A * option with return(1)
1N/A *
1N/A * use last=0 if the preprocessor is combined with other passes
1N/A * so that unknown options may be interpreted for those passes
1N/A */
1N/A
1N/Aint
1N/Appargs(char** argv, int last)
1N/A{
1N/A register char* s;
1N/A register int c;
1N/A register int n;
1N/A char* p;
1N/A
1N/A /*
1N/A * check the args and initialize
1N/A */
1N/A
1N/A if (!error_info.id)
1N/A error_info.id = "cpp";
1N/A for (;;)
1N/A {
1N/A for (; c = optget(argv, usage); last = 0) switch (c)
1N/A {
1N/A case 'C':
1N/A ppop(PP_COMMENT, ppcomment);
1N/A break;
1N/A case 'D':
1N/A /*
1N/A * this allows single arg pp option extensions
1N/A * without touching cc
1N/A * (not all cc wrappers have -W...)
1N/A */
1N/A
1N/A switch (*(s = opt_info.arg))
1N/A {
1N/A case '-':
1N/A case '+':
1N/A n = (*s++ == '-');
1N/A while (c = *s++) switch (c)
1N/A {
1N/A case 'C':
1N/A ppop(PP_COMPATIBILITY, n);
1N/A break;
1N/A case 'D':
1N/A if (n && ((c = strtol(s, &p, 0)) || p != s))
1N/A {
1N/A s = p;
1N/A n = c;
1N/A }
1N/A ppop(PP_DEBUG, -n);
1N/A break;
1N/A case 'F':
1N/A ppop(PP_FILENAME, n ? s : NiL);
1N/A goto hasarg;
1N/A case 'H':
1N/A ppop(PP_HOSTDIR, "-", n);
1N/A break;
1N/A case 'I':
1N/A ppop(PP_CDIR, "-", n);
1N/A break;
1N/A case 'K':
1N/A ppop(PP_KEYARGS, n);
1N/A break;
1N/A case 'L':
1N/A ppop(PP_LINEID, n && *s ? s : "line");
1N/A goto hasarg;
1N/A case 'M':
1N/A ppop(PP_MULTIPLE, !n);
1N/A break;
1N/A case 'P':
1N/A ppop(PP_PASSTHROUGH, n);
1N/A break;
1N/A case 'Q':
1N/A ppop(PP_DUMP, n);
1N/A break;
1N/A case 'R':
1N/A ppop(PP_TRANSITION, n);
1N/A break;
1N/A case 'S':
1N/A ppop(PP_STRICT, n);
1N/A break;
1N/A case 'T':
1N/A ppop(PP_TEST, s);
1N/A goto hasarg;
1N/A case 'V':
1N/A ppop(PP_VENDOR, "-", n);
1N/A break;
1N/A case 'W':
1N/A ppop(PP_WARN, n);
1N/A break;
1N/A case 'X':
1N/A ppop(PP_PROBE, n && *s ? s : 0);
1N/A goto hasarg;
1N/A case 'Y':
1N/A ppop(PP_PEDANTIC, n);
1N/A break;
1N/A case 'Z':
1N/A ppop(PP_POOL, n);
1N/A break;
1N/A case 'd':
1N/A pp.option |= DEFINITIONS;
1N/A break;
1N/A case 'm':
1N/A pp.state |= NOTEXT;
1N/A pp.option |= KEEPNOTEXT|DEFINITIONS|PREDEFINITIONS;
1N/A pp.linesync = 0;
1N/A break;
1N/A case '+':
1N/A ppop(PP_PLUSPLUS, n);
1N/A break;
1N/A default:
1N/A if (pp.optarg)
1N/A {
1N/A if ((c = (*pp.optarg)(n, c, s)) > 0) goto hasarg;
1N/A else if (!c) break;
1N/A }
1N/A error(1, "%c%s: unknown -D option overload", n ? '-' : '+', s - 1);
1N/A goto hasarg;
1N/A }
1N/A hasarg:
1N/A break;
1N/A case ':':
1N/A ppop(PP_OPTION, s + 1);
1N/A break;
1N/A case '%':
1N/A ppop(PP_DIRECTIVE, s + 1);
1N/A break;
1N/A case '_':
1N/A if (strmatch(s, "__GNUC__*"))
1N/A pp.arg_style |= STYLE_gnu;
1N/A else if (strmatch(s, "__(ANSI|STDC|STRICT)__*") || !(pp.arg_style & STYLE_gnu) && strmatch(s, "__STRICT_ANSI__*"))
1N/A ppop(PP_STRICT, 1);
1N/A else if (strmatch(s, "__cplusplus*"))
1N/A ppop(PP_PLUSPLUS, 1);
1N/A /*FALLTHROUGH*/
1N/A default:
1N/A ppop(PP_DEFINE, s);
1N/A break;
1N/A }
1N/A break;
1N/A case 'E':
1N/A /* historically ignored */
1N/A break;
1N/A case 'I':
1N/A if (!(s = opt_info.arg))
1N/A {
1N/A /*
1N/A * some compilers interpret `-I ...' as
1N/A * `-I-S' and arg ... while others interpret
1N/A * it as `-I...'
1N/A */
1N/A
1N/A p = "-S";
1N/A if ((s = argv[opt_info.index]) && ((n = *s++) == '-' || n == '+') && *s++ == 'D')
1N/A {
1N/A if (isalpha(*s) || *s == '_')
1N/A while (isalnum(*++s) || *s == '_');
1N/A if (*s && *s != '=' && *s != '-' && *s != '+')
1N/A p = argv[opt_info.index++];
1N/A }
1N/A s = p;
1N/A }
1N/A switch (*s)
1N/A {
1N/A case '-':
1N/A case '+':
1N/A n = *(p = s++) == '-';
1N/A c = *s++;
1N/A if (!n && !*s) s = 0;
1N/A switch (c)
1N/A {
1N/A case 0:
1N/A ppop(PP_LOCAL);
1N/A break;
1N/A case 'C':
1N/A ppop(PP_CDIR, s, n);
1N/A break;
1N/A case 'D':
1N/A ppop(PP_DEFAULT, s);
1N/A break;
1N/A case 'H':
1N/A ppop(PP_HOSTDIR, s, n);
1N/A break;
1N/A case 'I':
1N/A ppop(PP_IGNORE, s);
1N/A break;
1N/A case 'M':
1N/A ppop(PP_IGNORELIST, s);
1N/A break;
1N/A case 'R':
1N/A ppop(PP_READ, s);
1N/A break;
1N/A case 'S':
1N/A ppop(PP_STANDARD, s);
1N/A break;
1N/A case 'T':
1N/A ppop(PP_TEXT, s);
1N/A break;
1N/A case 'V':
1N/A ppop(PP_VENDOR, s, n);
1N/A break;
1N/A default:
1N/A error(1, "%s: unknown -I option overload", p);
1N/A break;
1N/A }
1N/A break;
1N/A default:
1N/A ppop(PP_INCLUDE, s);
1N/A break;
1N/A }
1N/A break;
1N/A case 'M':
1N/A for (n = PP_deps; argv[opt_info.index]; opt_info.offset++)
1N/A {
1N/A switch (argv[opt_info.index][opt_info.offset])
1N/A {
1N/A case 'D':
1N/A n |= PP_deps_file;
1N/A continue;
1N/A case 'G':
1N/A n |= PP_deps_generated;
1N/A continue;
1N/A case 'M':
1N/A n |= PP_deps_local;
1N/A continue;
1N/A }
1N/A break;
1N/A }
1N/A ppop(PP_FILEDEPS, n);
1N/A break;
1N/A case 'P':
1N/A ppop(PP_LINE, (PPLINESYNC)0);
1N/A break;
1N/A case 'U':
1N/A ppop(PP_UNDEF, opt_info.arg);
1N/A break;
1N/A
1N/A /*
1N/A * System V CCS compatibility
1N/A */
1N/A
1N/A case 'A':
1N/A if (isalpha(opt_info.arg[0]) || opt_info.arg[0] == '_' || opt_info.arg[0] == '$')
1N/A ppop(PP_ASSERT, opt_info.arg);
1N/A break;
1N/A case 'H':
1N/A if (!opt_info.arg)
1N/A ppop(PP_INCREF, ppincref);
1N/A break;
1N/A case 'T':
1N/A if (!(pp.arg_style & STYLE_gnu))
1N/A ppop(PP_TRUNCATE, TRUNCLENGTH);
1N/A /* else enable ANSI trigraphs -- default */
1N/A break;
1N/A case 'V':
1N/A error(0, "%s", pp.version);
1N/A break;
1N/A case 'X':
1N/A pp.arg_mode = (*(opt_info.arg + 1) || pp.arg_mode && pp.arg_mode != *opt_info.arg) ? '-' : *opt_info.arg;
1N/A break;
1N/A case 'Y':
1N/A if (*(s = opt_info.arg) && *(s + 1) == ',')
1N/A {
1N/A if (*s != 'I') break;
1N/A s += 2;
1N/A }
1N/A ppop(PP_STANDARD, s);
1N/A break;
1N/A
1N/A /*
1N/A * errors
1N/A */
1N/A
1N/A case '?':
1N/A error(ERROR_USAGE|4, "%s", opt_info.arg);
1N/A break;
1N/A case ':':
1N/A if (!last)
1N/A {
1N/A opt_info.again = 1;
1N/A return(1);
1N/A }
1N/A
1N/A /*
1N/A * cross your fingers
1N/A */
1N/A
1N/A if (!(s = argv[opt_info.index]))
1N/A error(3, "%s", opt_info.arg);
1N/A if (opt_info.offset == 2 && (pp.arg_style & STYLE_gnu))
1N/A {
1N/A p = argv[opt_info.index + 1];
1N/A if (streq(s, "-$"))
1N/A {
1N/A ppop(PP_OPTION, "noid \"$\"");
1N/A goto ignore;
1N/A }
1N/A else if (streq(s, "-dD"))
1N/A {
1N/A pp.option |= DEFINITIONS;
1N/A goto ignore;
1N/A }
1N/A else if (streq(s, "-dM"))
1N/A {
1N/A pp.state |= NOTEXT;
1N/A pp.option |= KEEPNOTEXT|DEFINITIONS|PREDEFINITIONS;
1N/A pp.linesync = 0;
1N/A goto ignore;
1N/A }
1N/A else if (streq(s, "-imacros"))
1N/A {
1N/A if (p)
1N/A {
1N/A ppop(PP_READ, p);
1N/A opt_info.index++;
1N/A opt_info.offset = 0;
1N/A }
1N/A goto ignore;
1N/A }
1N/A else if (streq(s, "-include"))
1N/A {
1N/A if (p)
1N/A {
1N/A ppop(PP_TEXT, p);
1N/A opt_info.index++;
1N/A opt_info.offset = 0;
1N/A }
1N/A opt_info.offset = 0;
1N/A goto ignore;
1N/A }
1N/A else if (strneq(s, "-lang-", 6))
1N/A {
1N/A s += 6;
1N/A if (streq(s, "c"))
1N/A c = 0;
1N/A else if (streq(s, "c++"))
1N/A c = 1;
1N/A else if (streq(s, "objc"))
1N/A c = 2;
1N/A else if (streq(s, "objc++"))
1N/A c = 3;
1N/A ppop(PP_PLUSPLUS, c & 1);
1N/A if (c & 2)
1N/A ppop(PP_DIRECTIVE, "pragma pp:map \"/#(pragma )?import>/\" \"/#(pragma )?import(.*)/__STDPP__IMPORT__(\\2)/\"\n\
1N/A#macdef __STDPP__IMPORT__(x)\n\
1N/A#pragma pp:noallmultiple\n\
1N/A#include x\n\
1N/A#pragma pp:allmultiple\n\
1N/A#endmac");
1N/A goto ignore;
1N/A }
1N/A else if (streq(s, "-lint"))
1N/A {
1N/A ppop(PP_COMMENT, pplint);
1N/A goto ignore;
1N/A }
1N/A }
1N/A s += opt_info.offset - 1;
1N/A if (strmatch(s, "i*.h"))
1N/A ppop((pp.arg_style & STYLE_gnu) || s[1] == '/' ? PP_READ : PP_TEXT, s + 1);
1N/A else if (strmatch(s, "*@(nostandard|nostdinc)*"))
1N/A ppop(PP_STANDARD, "");
1N/A else if (strmatch(s, "*@(exten|xansi)*|std"))
1N/A {
1N/A ppop(PP_COMPATIBILITY, 0);
1N/A ppop(PP_TRANSITION, 1);
1N/A }
1N/A else if (strmatch(s, "*@(ansi|conform|pedantic|stand|std1|strict[!-])*"))
1N/A {
1N/A ppop(PP_COMPATIBILITY, 0);
1N/A ppop(PP_STRICT, 1);
1N/A if (strmatch(s, "*pedantic*"))
1N/A ppop(PP_PEDANTIC, 1);
1N/A }
1N/A else if (strmatch(s, "*@(trans)*"))
1N/A {
1N/A ppop(PP_COMPATIBILITY, 1);
1N/A ppop(PP_TRANSITION, 1);
1N/A }
1N/A else if (strmatch(s, "*@(classic|compat|std0|tradition|[kK][n&+][rR])*"))
1N/A {
1N/A ppop(PP_COMPATIBILITY, 1);
1N/A ppop(PP_TRANSITION, 0);
1N/A }
1N/A else if (strmatch(s, "*@(plusplus|++)*"))
1N/A ppop(PP_PLUSPLUS, 1);
1N/A else if (strmatch(s, "*@(warn)*"))
1N/A ppop(PP_WARN, 1);
1N/A
1N/A /*
1N/A * ignore unknown options
1N/A * the probe info takes care of these
1N/A * fails if an option value is in the next arg
1N/A * and this is the last option
1N/A */
1N/A
1N/A if (argv[opt_info.index + 1] && argv[opt_info.index + 1][0] != '-' && argv[opt_info.index + 2] && argv[opt_info.index + 2][0] == '-')
1N/A {
1N/A opt_info.index++;
1N/A opt_info.offset = 0;
1N/A }
1N/A ignore:
1N/A while (argv[opt_info.index][opt_info.offset]) opt_info.offset++;
1N/A break;
1N/A }
1N/A if (!(s = argv[opt_info.index])) return(0);
1N/A switch (pp.arg_file)
1N/A {
1N/A case 0:
1N/A if (*s != '-' || *(s + 1)) ppop(PP_INPUT, s);
1N/A break;
1N/A case 1:
1N/A if (*s != '-' || *(s + 1)) ppop(PP_OUTPUT, s);
1N/A break;
1N/A default:
1N/A if (!last) return(1);
1N/A error(1, "%s: extraneous argument ignored", s);
1N/A break;
1N/A }
1N/A pp.arg_file++;
1N/A if (!argv[++opt_info.index]) return(0);
1N/A
1N/A /*
1N/A * old versions allow options after file args
1N/A */
1N/A }
1N/A}