1
0

getopt.h 549 B

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