Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_GETOPT_H__
00021 #define __CS_GETOPT_H__
00022
00023 #ifndef __STDC__
00024 # define __STDC__ 1
00025 #endif
00026
00027 #include "csextern.h"
00028
00033 #if defined(CS_PLATFORM_MACOSX)
00034
00035 #define getopt __getopt
00036 #define optarg __optarg
00037 #define opterr __opterr
00038 #define optind __optind
00039 #define optopt __optopt
00040 #endif
00041
00048 extern CS_CRYSTALSPACE_EXPORT char *optarg;
00049
00062 extern CS_CRYSTALSPACE_EXPORT int optind;
00063
00067 extern CS_CRYSTALSPACE_EXPORT int opterr;
00068
00071 extern CS_CRYSTALSPACE_EXPORT int optopt;
00072
00096 struct CS_CRYSTALSPACE_EXPORT getopt_option
00097 {
00098 #if defined (__STDC__) && __STDC__
00099 const char *name;
00100 #else
00101 char *name;
00102 #endif
00103
00104
00105 int has_arg;
00106 int *flag;
00107 int val;
00108 };
00113 #define option getopt_option
00114
00115
00116
00117 #define no_argument 0
00118 #define required_argument 1
00119 #define optional_argument 2
00120
00121 extern CS_CRYSTALSPACE_EXPORT int getopt (int argc, char *const *argv,
00122 const char *shortopts);
00123 extern CS_CRYSTALSPACE_EXPORT int getopt_long (int argc, char *const *argv,
00124 const char *shortopts, const struct getopt_option *longopts,
00125 int *longind);
00126 extern CS_CRYSTALSPACE_EXPORT int getopt_long_only (int argc,
00127 char *const *argv, const char *shortopts,
00128 const struct getopt_option *longopts, int *longind);
00129
00130
00131 extern int _getopt_internal (int argc, char *const *argv,
00132 const char *shortopts,
00133 const struct getopt_option *longopts, int *longind,
00134 int long_only);
00135
00136 #endif // __CS_GETOPT_H__