getopt.h 559 B

123456789101112131415161718192021222324252627282930
  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, optreset;
  9. struct option {
  10. const char *name;
  11. int has_arg;
  12. int *flag;
  13. int val;
  14. };
  15. int getopt_long(int, char *const *, const char *, const struct option *, int *);
  16. int getopt_long_only(int, char *const *, const char *, const struct option *, int *);
  17. #define no_argument 0
  18. #define required_argument 1
  19. #define optional_argument 2
  20. #ifdef __cplusplus
  21. }
  22. #endif
  23. #endif