48#define my_index wcschr
50#define my_strtoul wcstoul
51#define my_strlen wcslen
52#define my_strncmp wcsncmp
53#define my_strcpy wcscpy
54#define my_strcat wcscat
55#define my_strcmp wcscmp
161 const WCHAR *optstring,
162 const struct option *longopts,
183 if (optstring[0] ==
'-') {
186 }
else if (optstring[0] ==
'+') {
280 while (*
s && *
s !=
'=')
284 for (
p = longopts, option_index = 0;
293 indfound = option_index;
296 }
else if (pfound ==
NULL) {
299 indfound = option_index;
306 if (
ambig && !exact) {
308 UDFPrint((
"%ws: option `%s' is ambiguous\n",
318 option_index = indfound;
330 "%ws: option `--%ws' doesn't allow an argument\n",
335 "%ws: option `%c%ws' doesn't allow an argument\n",
349 UDFPrint((
"%ws: option `%ws' requires an argument\n",
352 return optstring[0] ==
':' ?
':' :
BAD_OPTION;
357 *longind = option_index;
375 UDFPrint((
"%ws: unrecognized option `--%ws'\n",
379 UDFPrint((
"%ws: unrecognized option `%c%ws'\n",
435 UDFPrint((
"%ws: option requires an argument -- %c\n",
439 if (optstring[0] ==
':') {
463 const WCHAR *optstring)
466 (
const struct option *) 0,
int getopt_long(optarg_ctx *o, int argc, WCHAR *const *argv, const WCHAR *options, const struct option *long_options, int *opt_index)
void getopt_init(optarg_ctx *o)
static void exchange(optarg_ctx *o, WCHAR **argv)
static enum @963 ordering
int getopt(optarg_ctx *o, int argc, WCHAR *const *argv, const WCHAR *optstring)
int _getopt_internal(optarg_ctx *o, int argc, WCHAR *const *argv, const WCHAR *optstring, const struct option *longopts, int *longind, int long_only)
static const char ambig[]
static const struct option long_options[]