00001
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef FISH_WGETOPT_H
00048 #define FISH_WGETOPT_H
00049
00050 #include <wchar.h>
00051
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055
00062 extern wchar_t *woptarg;
00063
00076 extern int woptind;
00077
00081 extern int wopterr;
00082
00085 extern int woptopt;
00086
00108 struct woption
00109 {
00113 #if defined (__STDC__) && __STDC__
00114 const wchar_t *name;
00115 #else
00116 wchar_t *name;
00117 #endif
00118
00125 int has_arg;
00126
00130 int *flag;
00131
00136 int val;
00137 };
00138
00139
00140
00144 #define no_argument 0
00145
00148 #define required_argument 1
00149
00152 #define optional_argument 2
00153
00154 #if defined (__STDC__) && __STDC__
00155 #ifdef __GNU_LIBRARY__
00156
00159 extern int wgetopt (int argc, wchar_t *const *argv, const wchar_t *shortopts);
00160 #else
00161
00162 extern int wgetopt ();
00163 #endif
00164
00167 extern int wgetopt_long (int argc, wchar_t *const *argv, const wchar_t *shortopts,
00168 const struct woption *longopts, int *longind);
00172 extern int wgetopt_long_only (int argc, wchar_t *const *argv,
00173 const wchar_t *shortopts,
00174 const struct woption *longopts, int *longind);
00175
00179 extern int _wgetopt_internal (int argc, wchar_t *const *argv,
00180 const wchar_t *shortopts,
00181 const struct woption *longopts, int *longind,
00182 int long_only);
00183 #else
00184
00188 extern int wgetopt ();
00189
00193 extern int wgetopt_long ();
00194
00198 extern int wgetopt_long_only ();
00199
00203 extern int _wgetopt_internal ();
00204 #endif
00205
00206 #ifdef __cplusplus
00207 }
00208 #endif
00209
00210 #endif