#if 0
/*
this is the old ugly stuff for parsing options
now, getopt() is used
-Freek
*/
#error "Dont compile this"
i=1;
while (i < argc) {
if (argv[i][0] == '-')
switch (argv[i][1]) {
case 's':
s = argv[i] + 2; /* pointe après "-s" */
d = SortString;
SortFlag = TRUE;
if (!*s) /* s'il n'y a rien après "-s" */
break;
while (*d++ = *s++) /* recopie la suite de "-s" */
; /* dans SortString */
break;
case 'f':
s = argv[i] + 2; /* pointe après "-f" */
d = FormatString;
if (!*s) /* s'il n'y a rien après "-f" */
break;
len = 1;
while (c = *s++) { /* traite la suite de "-f" */
if (c == '\\')
switch (c = *s++) {
case 'n':
*d++ = '\n';
break;
case 't':
*d++ = '\t';
break;
case 'v':
*d++ = '\v';
break;
case 'b':
*d++ = '\b';
break;
case 'r':
*d++ = '\r';
break;
case 'f':
*d++ = '\f';
break;
case 'a':
*d++ = '\a';
break;
default:
*d++ = c;
break; /* \c devient c */
}
else
*d++ = c;
len++;
if (len == FORMATLEN - 1) {
fprintf(stderr, "Format String too long\n");
exit(1);
}
}
*d = '\0'; /* fin de FormatString */
break;
case 'o': /* redirige stdout */
s = argv[i] + 2; /* pointe le nom après "-o" */
if (!freopen(s, "w", stdout)) {
fprintf(stderr, "Can't open %s for output\n", s);
exit(1);
}
break;
case 'h':
Use_Error = TRUE; /* affiche syntaxe de genproto */
break;
case 'd':
DebugMode = TRUE; /* affiche info de debugging */
break;
case 'b':
DisplayBanner = FALSE; /* n'affiche plus BannerText */
break;
default:
fprintf(stderr, "Unknown option %s\n", argv[i]);
Use_Error = TRUE;
break;
}
i++; /* argv suivant */
}
if (Use_Error) {
Usage(argv[0]);
exit(1);
}
#endif
syntax highlighted by Code2HTML, v. 0.9.1