getopt_long.h 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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-2007, PostgreSQL Global Development Group
  6. *
  7. * $PostgreSQL: pgsql/src/include/getopt_long.h,v 1.8 2007/01/05 22:19:50 momjian Exp $
  8. */
  9. #ifndef GETOPT_LONG_H
  10. #define GETOPT_LONG_H
  11. #ifdef HAVE_GETOPT_H
  12. #include <getopt.h>
  13. #endif
  14. /* These are picked up from the system's getopt() facility. */
  15. extern int opterr;
  16. extern int optind;
  17. extern int optopt;
  18. extern char *optarg;
  19. /* Some systems have this, otherwise you need to define it somewhere. */
  20. extern int optreset;
  21. #ifndef HAVE_STRUCT_OPTION
  22. struct option
  23. {
  24. const char *name;
  25. int has_arg;
  26. int *flag;
  27. int val;
  28. };
  29. #define no_argument 0
  30. #define required_argument 1
  31. #endif
  32. #ifndef HAVE_GETOPT_LONG
  33. extern int getopt_long(int argc, char *const argv[],
  34. const char *optstring,
  35. const struct option * longopts, int *longindex);
  36. #endif
  37. #endif /* GETOPT_LONG_H */