You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
957 B
49 lines
957 B
/* |
|
* Portions Copyright (c) 1987, 1993, 1994 |
|
* The Regents of the University of California. All rights reserved. |
|
* |
|
* Portions Copyright (c) 2003-2010, PostgreSQL Global Development |
|
* Group |
|
* |
|
* Simple conversion to C++ by Andrew Tridgell for ArduPilot. Based on |
|
* getopt_long.h from ccache |
|
*/ |
|
#ifndef GETOPT_LONG_H |
|
#define GETOPT_LONG_H |
|
|
|
#include <stdbool.h> |
|
|
|
class GetOptLong { |
|
public: |
|
struct option { |
|
const char *name; |
|
bool has_arg; |
|
int *flag; |
|
int val; |
|
}; |
|
|
|
GetOptLong(int argc, char *const argv[], const char *optstring, const option * longopts); |
|
|
|
int opterr; |
|
int optind; |
|
int optopt; |
|
int longindex; |
|
const char *optarg; |
|
|
|
enum error_return { |
|
BADCH='?', |
|
BADARG=':' |
|
}; |
|
|
|
|
|
int getoption(void); |
|
|
|
private: |
|
int argc; |
|
char *const *argv; |
|
const char *optstring; |
|
const struct option *longopts; |
|
const char *place; |
|
}; |
|
|
|
#endif /* GETOPT_LONG_H */
|
|
|