36#if defined(LIBC_SCCS) && !defined(lint)
37static char sccsid[] =
"@(#)getopt.c 8.3 (Berkeley) 4/27/95";
48#ifndef HAVE_INT_OPTERR
58#define BADARG (int)':'
72getopt(
int nargc,
char *
const *nargv,
const char *ostr)
74 static char *place =
EMSG;
84 if (place[1] && *++place ==
'-' && place[1] ==
'\0')
91 if ((
optopt = (
int) *place++) == (
int)
':' ||
92 !(oli = strchr(ostr,
optopt)))
104 if (
opterr && *ostr !=
':')
106 "illegal option -- %c\n",
optopt);
119 else if (nargc <= ++
optind)
126 "option requires an argument -- %c\n",
#define fprintf(file, fmt, msg)
int getopt(int nargc, char *const *nargv, const char *ostr)