2018-10-31 19:50:43 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
2019-09-06 21:03:16 +03:00
|
|
|
#define no_argument 0
|
|
|
|
#define required_argument 1
|
|
|
|
#define optional_argument 2
|
|
|
|
|
|
|
|
struct option {
|
|
|
|
const char *name;
|
|
|
|
int has_arg;
|
|
|
|
int* flag;
|
|
|
|
int val;
|
|
|
|
};
|
|
|
|
|
2018-10-31 19:50:43 +03:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
2019-09-06 21:03:16 +03:00
|
|
|
int getopt_long(int, char* const*, const char*, const struct option*, int*);
|
|
|
|
int getopt_long_only(int, char* const*, const char*, const struct option*, int*);
|
|
|
|
|
|
|
|
#ifndef _GETOPT_DECLARED
|
|
|
|
#define _GETOPT_DECLARED
|
|
|
|
int getopt(int, char * const [], const char *);
|
|
|
|
extern char *optarg;
|
2018-10-31 19:50:43 +03:00
|
|
|
extern int optind;
|
|
|
|
extern int opterr;
|
|
|
|
extern int optopt;
|
2019-09-06 21:03:16 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _OPTRESET_DECLARED
|
|
|
|
#define _OPTRESET_DECLARED
|
|
|
|
extern int optreset;
|
|
|
|
#endif
|
2018-10-31 19:50:43 +03:00
|
|
|
|
|
|
|
__END_DECLS
|
2019-09-06 21:03:16 +03:00
|
|
|
|