1
0

getopt.h 575 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _GETOPT_H
  2. #define _GETOPT_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. int getopt(int, char * const [], const char *);
  7. extern char *optarg;
  8. extern int optind, opterr, optopt;
  9. #ifdef _GNU_SOURCE
  10. struct option
  11. {
  12. const char *name;
  13. int has_arg;
  14. int *flag;
  15. int val;
  16. };
  17. int getopt_long(int, char *const *, const char *, const struct option *, int *);
  18. int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
  19. #define no_argument 0
  20. #define required_argument 1
  21. #define optional_argument 2
  22. #endif
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif