00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PANDA_GETOPT_IMPL_H
00016 #define PANDA_GETOPT_IMPL_H
00017
00018 #include "dtoolbase.h"
00019
00020
00021
00022
00023
00024 #if defined(HAVE_GETOPT) && defined(HAVE_GETOPT_LONG_ONLY)
00025
00026
00027
00028
00029 #else
00030
00031
00032
00033 #define getopt panda_getopt
00034 #define optind panda_optind
00035 #define opterr panda_opterr
00036 #define optopt panda_optopt
00037 #define optarg panda_optarg
00038 #define getopt_long panda_getopt_long
00039 #define getopt_long_only panda_getopt_long_only
00040
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045 extern EXPCL_DTOOL char *optarg;
00046 extern EXPCL_DTOOL int optind, opterr, optopt;
00047
00048 struct option {
00049 const char *name;
00050 int has_arg;
00051 int *flag;
00052 int val;
00053 };
00054
00055 #define no_argument 0
00056 #define required_argument 1
00057 #define optional_argument 2
00058
00059 extern EXPCL_DTOOL int
00060 getopt(int argc, char *const argv[], const char *optstring);
00061 extern EXPCL_DTOOL int
00062 getopt_long(int argc, char *const argv[], const char *optstring,
00063 const struct option *longopts, int *longindex);
00064 extern EXPCL_DTOOL int
00065 getopt_long_only(int argc, char *const argv[], const char *optstring,
00066 const struct option *longopts, int *longindex);
00067
00068 #ifdef __cplusplus
00069 }
00070 #endif
00071
00072 #endif // defined(HAVE_GETOPT) && defined(HAVE_GETOPT_LONG_ONLY)
00073
00074 #endif