Commit 7e0f8f83 authored by Andrew Dunstan's avatar Andrew Dunstan

Give getopt() a prototype and modern style arg specs.

Welcome to the 1990s.
parent 76dd09bb
...@@ -61,6 +61,8 @@ extern char *optarg; ...@@ -61,6 +61,8 @@ extern char *optarg;
#define BADARG (int)':' #define BADARG (int)':'
#define EMSG "" #define EMSG ""
int getopt(int nargc, char *const * nargv, const char * ostr);
/* /*
* getopt * getopt
* Parse argc/argv argument vector. * Parse argc/argv argument vector.
...@@ -72,10 +74,7 @@ extern char *optarg; ...@@ -72,10 +74,7 @@ extern char *optarg;
* returning -1.) * returning -1.)
*/ */
int int
getopt(nargc, nargv, ostr) getopt(int nargc, char *const * nargv, const char * ostr)
int nargc;
char *const * nargv;
const char *ostr;
{ {
static char *place = EMSG; /* option letter processing */ static char *place = EMSG; /* option letter processing */
char *oli; /* option letter list index */ char *oli; /* option letter list index */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment