1 /* 2 * Portions Copyright (c) 1987, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Portions Copyright (c) 2003-2010, PostgreSQL Global Development Group 6 * 7 * $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.12 2010-01-02 16:58:00 momjian Exp $ 8 */ 9 #ifndef GETOPT_LONG_H 10 #define GETOPT_LONG_H 11 12 #ifdef HAVE_GETOPT_H 13 #include <getopt.h> 14 #endif 15 16 /* These are picked up from the system's getopt() facility. */ 17 extern int opterr; 18 extern int optind; 19 extern int optopt; 20 extern char *optarg; 21 extern int optreset; 22 23 #ifndef HAVE_STRUCT_OPTION 24 25 struct option 26 { 27 const char *name; 28 int has_arg; 29 int *flag; 30 int val; 31 }; 32 33 #define no_argument 0 34 #define required_argument 1 35 #endif 36 37 #ifndef HAVE_GETOPT_LONG 38 39 extern int getopt_long(int argc, char *const argv[], 40 const char *optstring, 41 const struct option * longopts, int *longindex); 42 #endif 43 44 #endif /* GETOPT_LONG_H */ 45