|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T p
Length: 1229 (0x4cd)
Types: TextFile
Names: »printsw.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦3658e588a⟧ »EurOpenD3/mail/mh/mh-6.7.tar.Z«
└─⟦c75e36ecb⟧
└─⟦this⟧ »mh-6.7/sbr/printsw.c«
/* printsw.c - print switches */
#include "../h/mh.h"
void printsw (substr, swp, prefix)
register char *substr,
*prefix;
register struct swit *swp;
{
int len,
optno;
register int i;
register char *cp,
*cp1,
*sp;
char buf[128];
len = strlen (substr);
for (; swp -> sw; swp++) {
if (!*substr || /* null matches all strings */
(ssequal (substr, swp -> sw) && len >= swp -> minchars)) {
optno = 0;
if (sp = (&swp[1]) -> sw) /* next switch */
if (!*substr && sp[0] == 'n' && sp[1] == 'o' &&
strcmp (&sp[2], swp -> sw) == 0 && (
((&swp[1]) -> minchars == 0 && swp -> minchars == 0) ||
((&swp[1]) -> minchars == (swp -> minchars) + 2)))
optno++;
if (swp -> minchars > 0) {
cp = buf;
*cp++ = '(';
if (optno) {
(void) strcpy (cp, "[no]");
cp += strlen (cp);
}
for (cp1 = swp -> sw, i = 0; i < swp -> minchars; i++)
*cp++ = *cp1++;
*cp++ = ')';
while (*cp++ = *cp1++);
printf (" %s%s\n", prefix, buf);
}
else
if (swp -> minchars == 0)
printf (optno ? " %s[no]%s\n" : " %s%s\n",
prefix, swp -> sw);
if (optno)
swp++; /* skip -noswitch */
}
}
}