/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1999-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include <ast.h>
#include <ctype.h>
#include <error.h>
#include <debug.h>
#if OPT_VERSION >= 20000101L
#else
#define NEW 0
#endif
#if !NEW
#endif
struct Info_s
{
char* name;
char* value;
};
#if NEW
static int
{
if (*s == ':')
if (streq(s, "options"))
return sfprintf(sp, "[Z:zoom?Do it as fast as possible.]\fmore#1\f\fmore#2\f[B:boom?Dump into \afile\a.]:[file]");
if (streq(s, "zero"))
if (streq(s, "more#1"))
if (streq(s, "more#2"))
if (streq(s, "more#3"))
if (streq(s, "more#4"))
if (streq(s, "more#5"))
return sfprintf(sp, "\bred\b, \borange\b, \byellow\b, \bgreen\b, \bblue\b, \bindigo\b, \bviolet\b");
if (streq(s, "more#6"))
}
static char*
{
register int c;
register int i;
register char* s;
register char* t;
register char* e;
register char* r;
static char rot[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMabcdefghijklmnopqrstuvwxyzabcdefghijklm";
i = !catalog;
s = (char*)msg;
t = buf;
while ((c = *s++) && t < e)
{
switch (c)
{
case '\\':
if (t < e)
*t++ = c;
if (!(c = *s++))
s--;
break;
case '%':
do
{
if (t >= e)
break;
*t++ = c;
if (!(c = *s++))
{
s--;
break;
}
break;
case '\b':
do
{
if (t >= e)
break;
*t++ = c;
if (!(c = *s++))
{
s--;
break;
}
} while (c != '\b');
break;
default:
{
c = *(r + 13);
if (i)
}
break;
}
*t++ = c;
}
*t = 0;
}
#endif
int
{
int n;
int ext;
int ostr;
int str;
int loop;
char* s;
char* command;
char* usage;
char** extra;
char** oargv;
#if NEW
#endif
extra = 0;
ext = 0;
str = 0;
{
{
argv++;
*s++ = 0;
command++;
{
}
}
{
argv++;
}
{
argv++;
#if NEW
#endif
}
{
ext += 2;
argv += 2;
if (!extra)
}
else
break;
}
#if NEW
#else
#endif
for (;;)
{
for (;;)
{
if (!str)
{
break;
}
{
if (!*++argv)
break;
continue;
}
if (loop)
if (n == '?')
{
sfprintf(sfstdout, "return=%c option=%s name=%s num=%I*d\n", n, opt_info.option, opt_info.name, sizeof(opt_info.number), opt_info.number);
}
else if (n == ':')
{
sfprintf(sfstdout, "return=%c option=%s name=%s num=%I*d", n, opt_info.option, opt_info.name, sizeof(opt_info.number), opt_info.number);
}
else if (n > 0)
sfprintf(sfstdout, "return=%c option=%s name=%s arg%-.1s=%s num=%I*d\n", n, opt_info.option, opt_info.name, &opt_info.assignment, opt_info.arg, sizeof(opt_info.number), opt_info.number);
else
sfprintf(sfstdout, "return=%d option=%s name=%s arg%-.1s=%s num=%I*d\n", n, opt_info.option, opt_info.name, &opt_info.assignment, opt_info.arg, sizeof(opt_info.number), opt_info.number);
if (extra)
{
for (n = 0; n < ext; n += 2)
extra = 0;
}
}
{
if (loop)
}
if (--loop <= 0)
break;
}
return error_info.errors != 0;
}