mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
Centralize getopt-related declarations in a new header file pg_getopt.h.
We used to have externs for getopt() and its API variables scattered all over the place. Now that we find we're going to need to tweak the variable declarations for Cygwin, it seems like a good idea to have just one place to tweak. In this commit, the variables are declared "#ifndef HAVE_GETOPT_H". That may or may not work everywhere, but we'll soon find out. Andres Freund
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
|
||||
#include "c.h"
|
||||
|
||||
#include "pg_getopt.h"
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
@@ -49,20 +51,13 @@ int opterr = 1, /* if error message should be printed */
|
||||
optind = 1, /* index into parent argv vector */
|
||||
optopt; /* character checked for validity */
|
||||
char *optarg; /* argument associated with option */
|
||||
#else
|
||||
|
||||
extern int opterr;
|
||||
extern int optind;
|
||||
extern int optopt;
|
||||
extern char *optarg;
|
||||
#endif
|
||||
|
||||
#define BADCH (int)'?'
|
||||
#define BADARG (int)':'
|
||||
#define EMSG ""
|
||||
|
||||
int getopt(int nargc, char *const * nargv, const char *ostr);
|
||||
|
||||
/*
|
||||
* getopt
|
||||
* Parse argc/argv argument vector.
|
||||
|
Reference in New Issue
Block a user