getopt.h 605 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef INCLUDED_GETOPT_PORT_H
  2. #define INCLUDED_GETOPT_PORT_H
  3. #if defined(__cplusplus)
  4. extern "C" {
  5. #endif
  6. extern const int no_argument;
  7. extern const int required_argument;
  8. extern const int optional_argument;
  9. extern char* optarg;
  10. extern int optind, opterr, optopt;
  11. struct option {
  12. const char* name;
  13. int has_arg;
  14. int* flag;
  15. int val;
  16. };
  17. int getopt(int argc, char* const argv[], const char* optstring);
  18. int getopt_long(int argc, char* const argv[],
  19. const char* optstring, const struct option* longopts, int* longindex);
  20. #if defined(__cplusplus)
  21. }
  22. #endif
  23. #endif /* INCLUDED_GETOPT_PORT_H */