bsd_getopt_win.h 757 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* bsd_getopt.h
  2. *
  3. * Chris Collins <chris@collins.id.au>
  4. */
  5. /** header created for NetBSD getopt/getopt_long */
  6. #ifndef HAVE_GETOPT_LONG
  7. #ifndef _BSD_GETOPT_H
  8. #define _BSD_GETOPT_H
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. extern int opterr;
  13. extern int optind;
  14. extern int optopt;
  15. extern int optreset;
  16. extern char *optarg;
  17. struct option {
  18. char *name;
  19. int has_arg;
  20. int *flag;
  21. int val;
  22. };
  23. #define no_argument 0
  24. #define required_argument 1
  25. #define optional_argument 2
  26. extern int getopt(int nargc, char *const *nargv, const char *options);
  27. extern int getopt_long(int nargc, char *const *nargv, const char *options,
  28. const struct option *long_options, int *idx);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif /* _BSD_GETOPT_H */
  33. #endif