| 1 |
U. |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
m> |
| 22 |
|
| 23 |
|
| 24 |
#ifdef HAVE_CONFIG_H |
| 25 |
#include <config.h> |
| 26 |
#endif |
| 27 |
|
| 28 |
#ifndef HAVE_GETOPT_H |
| 29 |
|
| 30 |
#include <stdio.h> |
| 31 |
#include <stdlib.h> |
| 32 |
#include <string.h> |
| 33 |
|
| 34 |
#include "oscap-tool.h" |
| 35 |
|
| 36 |
|
| 37 |
#ifdef _LIBC |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
# include <libintl.h> |
| 46 |
# define fprintf __fxprintf_nocancel |
| 47 |
# define flockfile(fp) _IO_flockfile (fp) |
| 48 |
# define funlockfile(fp) _IO_funlockfile (fp) |
| 49 |
#else |
| 50 |
# define _(msgid) (msgid) |
| 51 |
|
| 52 |
|
| 53 |
# ifndef _POSIX_THREAD_SAFE_FUNCTIONS |
| 54 |
# define flockfile(fp) |
| 55 |
# define funlockfile(fp) |
| 56 |
# endif |
| 57 |
|
| 58 |
# define __libc_use_alloca(size) 0 |
| 59 |
# undef alloca |
| 60 |
# define alloca(size) (abort (), (void *)0) |
| 61 |
#endif |
| 62 |
|
| 63 |
enum __ord |
| 64 |
{ |
| 65 |
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER |
| 66 |
}; |
| 67 |
#define _GETOPT_DATA_INITIALIZER { 1, 1 } |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
struct _getopt_data |
| 72 |
{ |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
int optind; |
| 77 |
int opterr; |
| 78 |
int optopt; |
| 79 |
char *optarg; |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
int __initialized; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
char *__nextchar; |
| 93 |
|
| 94 |
|
| 95 |
enum __ord __ordering; |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
int __first_nonopt; |
| 104 |
int __last_nonopt; |
| 105 |
}; |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
char *optarg; |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
int optind = 1; |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
int opterr = 1; |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
int optopt = '?'; |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
static struct _getopt_data getopt_data; |
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
static void |
| 177 |
exchange (char **argv, struct _getopt_data *d) |
| 178 |
{ |
| 179 |
int bottom = d->__first_nonopt; |
| 180 |
int middle = d->__last_nonopt; |
| 181 |
int top = d->optind; |
| 182 |
char *tem; |
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
while (top > middle && middle > bottom) |
| 190 |
{ |
| 191 |
if (top - middle > middle - bottom) |
| 192 |
{ |
| 193 |
|
| 194 |
int len = middle - bottom; |
| 195 |
int i; |
| 196 |
|
| 197 |
|
| 198 |
for (i = 0; i < len; i++) |
| 199 |
{ |
| 200 |
tem = argv[bottom + i]; |
| 201 |
argv[bottom + i] = argv[top - (middle - bottom) + i]; |
| 202 |
argv[top - (middle - bottom) + i] = tem; |
| 203 |
} |
| 204 |
|
| 205 |
top -= len; |
| 206 |
} |
| 207 |
else |
| 208 |
{ |
| 209 |
|
| 210 |
int len = top - middle; |
| 211 |
int i; |
| 212 |
|
| 213 |
|
| 214 |
for (i = 0; i < len; i++) |
| 215 |
{ |
| 216 |
tem = argv[bottom + i]; |
| 217 |
argv[bottom + i] = argv[middle + i]; |
| 218 |
argv[middle + i] = tem; |
| 219 |
} |
| 220 |
|
| 221 |
bottom += len; |
| 222 |
} |
| 223 |
} |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
d->__first_nonopt += (d->optind - d->__last_nonopt); |
| 228 |
d->__last_nonopt = d->optind; |
| 229 |
} |
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
static int |
| 240 |
process_long_option (int argc, char **argv, const char *optstring, |
| 241 |
const struct option *longopts, int *longind, |
| 242 |
int long_only, struct _getopt_data *d, |
| 243 |
int print_errors, const char *prefix) |
| 244 |
{ |
| 245 |
char *nameend; |
| 246 |
size_t namelen; |
| 247 |
const struct option *p; |
| 248 |
const struct option *pfound = NULL; |
| 249 |
int n_options; |
| 250 |
int option_index; |
| 251 |
|
| 252 |
for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) |
| 253 |
; |
| 254 |
namelen = nameend - d->__nextchar; |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
for (p = longopts, n_options = 0; p->name; p++, n_options++) |
| 259 |
if (!strncmp (p->name, d->__nextchar, namelen) |
| 260 |
&& namelen == strlen (p->name)) |
| 261 |
{ |
| 262 |
|
| 263 |
pfound = p; |
| 264 |
option_index = n_options; |
| 265 |
break; |
| 266 |
} |
| 267 |
|
| 268 |
if (pfound == NULL) |
| 269 |
{ |
| 270 |
|
| 271 |
unsigned char *ambig_set = NULL; |
| 272 |
int ambig_malloced = 0; |
| 273 |
int ambig_fallback = 0; |
| 274 |
int indfound = -1; |
| 275 |
|
| 276 |
for (p = longopts, option_index = 0; p->name; p++, option_index++) |
| 277 |
if (!strncmp (p->name, d->__nextchar, namelen)) |
| 278 |
{ |
| 279 |
if (pfound == NULL) |
| 280 |
{ |
| 281 |
|
| 282 |
pfound = p; |
| 283 |
indfound = option_index; |
| 284 |
} |
| 285 |
else if (long_only |
| 286 |
|| pfound->has_arg != p->has_arg |
| 287 |
|| pfound->flag != p->flag |
| 288 |
|| pfound->val != p->val) |
| 289 |
{ |
| 290 |
|
| 291 |
if (!ambig_fallback) |
| 292 |
{ |
| 293 |
if (!print_errors) |
| 294 |
|
| 295 |
|
| 296 |
ambig_fallback = 1; |
| 297 |
else if (!ambig_set) |
| 298 |
{ |
| 299 |
if (__libc_use_alloca (n_options)) |
| 300 |
ambig_set = alloca (n_options); |
| 301 |
else if ((ambig_set = malloc (n_options)) == NULL) |
| 302 |
|
| 303 |
ambig_fallback = 1; |
| 304 |
else |
| 305 |
ambig_malloced = 1; |
| 306 |
|
| 307 |
if (ambig_set) |
| 308 |
{ |
| 309 |
memset (ambig_set, 0, n_options); |
| 310 |
ambig_set[indfound] = 1; |
| 311 |
} |
| 312 |
} |
| 313 |
if (ambig_set) |
| 314 |
ambig_set[option_index] = 1; |
| 315 |
} |
| 316 |
} |
| 317 |
} |
| 318 |
|
| 319 |
if (ambig_set || ambig_fallback) |
| 320 |
{ |
| 321 |
if (print_errors) |
| 322 |
{ |
| 323 |
if (ambig_fallback) |
| 324 |
fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"), |
| 325 |
argv[0], prefix, d->__nextchar); |
| 326 |
else |
| 327 |
{ |
| 328 |
flockfile (stderr); |
| 329 |
fprintf (stderr, |
| 330 |
_("%s: option '%s%s' is ambiguous; possibilities:"), |
| 331 |
argv[0], prefix, d->__nextchar); |
| 332 |
|
| 333 |
for (option_index = 0; option_index < n_options; option_index++) |
| 334 |
if (ambig_set[option_index]) |
| 335 |
fprintf (stderr, " '%s%s'", |
| 336 |
prefix, longopts[option_index].name); |
| 337 |
|
| 338 |
|
| 339 |
|
| 340 |
|
| 341 |
fprintf (stderr, "\n"); |
| 342 |
funlockfile (stderr); |
| 343 |
} |
| 344 |
} |
| 345 |
if (ambig_malloced) |
| 346 |
free (ambig_set); |
| 347 |
d->__nextchar += strlen (d->__nextchar); |
| 348 |
d->optind++; |
| 349 |
d->optopt = 0; |
| 350 |
return '?'; |
| 351 |
} |
| 352 |
|
| 353 |
option_index = indfound; |
| 354 |
} |
| 355 |
|
| 356 |
if (pfound == NULL) |
| 357 |
{ |
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
if (!long_only || argv[d->optind][1] == '-' |
| 362 |
|| strchr (optstring, *d->__nextchar) == NULL) |
| 363 |
{ |
| 364 |
if (print_errors) |
| 365 |
fprintf (stderr, _("%s: unrecognized option '%s%s'\n"), |
| 366 |
argv[0], prefix, d->__nextchar); |
| 367 |
|
| 368 |
d->__nextchar = NULL; |
| 369 |
d->optind++; |
| 370 |
d->optopt = 0; |
| 371 |
return '?'; |
| 372 |
} |
| 373 |
|
| 374 |
|
| 375 |
return -1; |
| 376 |
} |
| 377 |
|
| 378 |
|
| 379 |
d->optind++; |
| 380 |
d->__nextchar = NULL; |
| 381 |
if (*nameend) |
| 382 |
{ |
| 383 |
|
| 384 |
|
| 385 |
if (pfound->has_arg) |
| 386 |
d->optarg = nameend + 1; |
| 387 |
else |
| 388 |
{ |
| 389 |
if (print_errors) |
| 390 |
fprintf (stderr, |
| 391 |
_("%s: option '%s%s' doesn't allow an argument\n"), |
| 392 |
argv[0], prefix, pfound->name); |
| 393 |
|
| 394 |
d->optopt = pfound->val; |
| 395 |
return '?'; |
| 396 |
} |
| 397 |
} |
| 398 |
else if (pfound->has_arg == 1) |
| 399 |
{ |
| 400 |
if (d->optind < argc) |
| 401 |
d->optarg = argv[d->optind++]; |
| 402 |
else |
| 403 |
{ |
| 404 |
if (print_errors) |
| 405 |
fprintf (stderr, |
| 406 |
_("%s: option '%s%s' requires an argument\n"), |
| 407 |
argv[0], prefix, pfound->name); |
| 408 |
|
| 409 |
d->optopt = pfound->val; |
| 410 |
return optstring[0] == ':' ? ':' : '?'; |
| 411 |
} |
| 412 |
} |
| 413 |
|
| 414 |
if (longind != NULL) |
| 415 |
*longind = option_index; |
| 416 |
if (pfound->flag) |
| 417 |
{ |
| 418 |
*(pfound->flag) = pfound->val; |
| 419 |
return 0; |
| 420 |
} |
| 421 |
return pfound->val; |
| 422 |
} |
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
static const char * |
| 427 |
_getopt_initialize (int argc, |
| 428 |
char **argv, const char *optstring, |
| 429 |
struct _getopt_data *d, int posixly_correct) |
| 430 |
{ |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
if (d->optind == 0) |
| 435 |
d->optind = 1; |
| 436 |
|
| 437 |
d->__first_nonopt = d->__last_nonopt = d->optind; |
| 438 |
d->__nextchar = NULL; |
| 439 |
|
| 440 |
|
| 441 |
if (optstring[0] == '-') |
| 442 |
{ |
| 443 |
d->__ordering = RETURN_IN_ORDER; |
| 444 |
++optstring; |
| 445 |
} |
| 446 |
else if (optstring[0] == '+') |
| 447 |
{ |
| 448 |
d->__ordering = REQUIRE_ORDER; |
| 449 |
++optstring; |
| 450 |
} |
| 451 |
else if (posixly_correct || !!getenv ("POSIXLY_CORRECT")) |
| 452 |
d->__ordering = REQUIRE_ORDER; |
| 453 |
else |
| 454 |
d->__ordering = PERMUTE; |
| 455 |
|
| 456 |
d->__initialized = 1; |
| 457 |
return optstring; |
| 458 |
} |
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
|
| 476 |
|
| 477 |
|
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
|
| 493 |
|
| 494 |
|
| 495 |
|
| 496 |
|
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
|
| 501 |
|
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
|
| 516 |
int |
| 517 |
_getopt_internal_r (int argc, char **argv, const char *optstring, |
| 518 |
const struct option *longopts, int *longind, |
| 519 |
int long_only, struct _getopt_data *d, int posixly_correct) |
| 520 |
{ |
| 521 |
int print_errors = d->opterr; |
| 522 |
|
| 523 |
if (argc < 1) |
| 524 |
return -1; |
| 525 |
|
| 526 |
d->optarg = NULL; |
| 527 |
|
| 528 |
if (d->optind == 0 || !d->__initialized) |
| 529 |
optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct); |
| 530 |
else if (optstring[0] == '-' || optstring[0] == '+') |
| 531 |
optstring++; |
| 532 |
|
| 533 |
if (optstring[0] == ':') |
| 534 |
print_errors = 0; |
| 535 |
|
| 536 |
|
| 537 |
#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') |
| 538 |
|
| 539 |
if (d->__nextchar == NULL || *d->__nextchar == '\0') |
| 540 |
{ |
| 541 |
|
| 542 |
|
| 543 |
|
| 544 |
|
| 545 |
if (d->__last_nonopt > d->optind) |
| 546 |
d->__last_nonopt = d->optind; |
| 547 |
if (d->__first_nonopt > d->optind) |
| 548 |
d->__first_nonopt = d->optind; |
| 549 |
|
| 550 |
if (d->__ordering == PERMUTE) |
| 551 |
{ |
| 552 |
|
| 553 |
|
| 554 |
|
| 555 |
if (d->__first_nonopt != d->__last_nonopt |
| 556 |
&& d->__last_nonopt != d->optind) |
| 557 |
exchange (argv, d); |
| 558 |
else if (d->__last_nonopt != d->optind) |
| 559 |
d->__first_nonopt = d->optind; |
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
|
| 564 |
while (d->optind < argc && NONOPTION_P) |
| 565 |
d->optind++; |
| 566 |
d->__last_nonopt = d->optind; |
| 567 |
} |
| 568 |
|
| 569 |
|
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
if (d->optind != argc && !strcmp (argv[d->optind], "--")) |
| 575 |
{ |
| 576 |
d->optind++; |
| 577 |
|
| 578 |
if (d->__first_nonopt != d->__last_nonopt |
| 579 |
&& d->__last_nonopt != d->optind) |
| 580 |
exchange (argv, d); |
| 581 |
else if (d->__first_nonopt == d->__last_nonopt) |
| 582 |
d->__first_nonopt = d->optind; |
| 583 |
d->__last_nonopt = argc; |
| 584 |
|
| 585 |
d->optind = argc; |
| 586 |
} |
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
if (d->optind == argc) |
| 592 |
{ |
| 593 |
|
| 594 |
|
| 595 |
if (d->__first_nonopt != d->__last_nonopt) |
| 596 |
d->optind = d->__first_nonopt; |
| 597 |
return -1; |
| 598 |
} |
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
if (NONOPTION_P) |
| 604 |
{ |
| 605 |
if (d->__ordering == REQUIRE_ORDER) |
| 606 |
return -1; |
| 607 |
d->optarg = argv[d->optind++]; |
| 608 |
return 1; |
| 609 |
} |
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
if (longopts) |
| 614 |
{ |
| 615 |
if (argv[d->optind][1] == '-') |
| 616 |
{ |
| 617 |
|
| 618 |
|
| 619 |
d->__nextchar = argv[d->optind] + 2; |
| 620 |
return process_long_option (argc, argv, optstring, longopts, |
| 621 |
longind, long_only, d, |
| 622 |
print_errors, "--"); |
| 623 |
} |
| 624 |
|
| 625 |
|
| 626 |
|
| 627 |
|
| 628 |
|
| 629 |
|
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
if (long_only && (argv[d->optind][2] |
| 638 |
|| !strchr (optstring, argv[d->optind][1]))) |
| 639 |
{ |
| 640 |
int code; |
| 641 |
d->__nextchar = argv[d->optind] + 1; |
| 642 |
code = process_long_option (argc, argv, optstring, longopts, |
| 643 |
longind, long_only, d, |
| 644 |
print_errors, "-"); |
| 645 |
if (code != -1) |
| 646 |
return code; |
| 647 |
} |
| 648 |
} |
| 649 |
|
| 650 |
|
| 651 |
d->__nextchar = argv[d->optind] + 1; |
| 652 |
} |
| 653 |
|
| 654 |
|
| 655 |
|
| 656 |
{ |
| 657 |
char c = *d->__nextchar++; |
| 658 |
const char *temp = strchr (optstring, c); |
| 659 |
|
| 660 |
|
| 661 |
if (*d->__nextchar == '\0') |
| 662 |
++d->optind; |
| 663 |
|
| 664 |
if (temp == NULL || c == ':' || c == ';') |
| 665 |
{ |
| 666 |
if (print_errors) |
| 667 |
fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c); |
| 668 |
d->optopt = c; |
| 669 |
return '?'; |
| 670 |
} |
| 671 |
|
| 672 |
|
| 673 |
if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL) |
| 674 |
{ |
| 675 |
|
| 676 |
if (*d->__nextchar != '\0') |
| 677 |
d->optarg = d->__nextchar; |
| 678 |
else if (d->optind == argc) |
| 679 |
{ |
| 680 |
if (print_errors) |
| 681 |
fprintf (stderr, |
| 682 |
_("%s: option requires an argument -- '%c'\n"), |
| 683 |
argv[0], c); |
| 684 |
|
| 685 |
d->optopt = c; |
| 686 |
if (optstring[0] == ':') |
| 687 |
c = ':'; |
| 688 |
else |
| 689 |
c = '?'; |
| 690 |
return c; |
| 691 |
} |
| 692 |
else |
| 693 |
d->optarg = argv[d->optind]; |
| 694 |
|
| 695 |
d->__nextchar = d->optarg; |
| 696 |
d->optarg = NULL; |
| 697 |
return process_long_option (argc, argv, optstring, longopts, longind, |
| 698 |
0 , d, print_errors, "-W "); |
| 699 |
} |
| 700 |
if (temp[1] == ':') |
| 701 |
{ |
| 702 |
if (temp[2] == ':') |
| 703 |
{ |
| 704 |
|
| 705 |
if (*d->__nextchar != '\0') |
| 706 |
{ |
| 707 |
d->optarg = d->__nextchar; |
| 708 |
d->optind++; |
| 709 |
} |
| 710 |
else |
| 711 |
d->optarg = NULL; |
| 712 |
d->__nextchar = NULL; |
| 713 |
} |
| 714 |
else |
| 715 |
{ |
| 716 |
|
| 717 |
if (*d->__nextchar != '\0') |
| 718 |
{ |
| 719 |
d->optarg = d->__nextchar; |
| 720 |
|
| 721 |
|
| 722 |
d->optind++; |
| 723 |
} |
| 724 |
else if (d->optind == argc) |
| 725 |
{ |
| 726 |
if (print_errors) |
| 727 |
fprintf (stderr, |
| 728 |
_("%s: option requires an argument -- '%c'\n"), |
| 729 |
argv[0], c); |
| 730 |
|
| 731 |
d->optopt = c; |
| 732 |
if (optstring[0] == ':') |
| 733 |
c = ':'; |
| 734 |
else |
| 735 |
c = '?'; |
| 736 |
} |
| 737 |
else |
| 738 |
|
| 739 |
|
| 740 |
d->optarg = argv[d->optind++]; |
| 741 |
d->__nextchar = NULL; |
| 742 |
} |
| 743 |
} |
| 744 |
return c; |
| 745 |
} |
| 746 |
} |
| 747 |
|
| 748 |
int |
| 749 |
_getopt_internal (int argc, char **argv, const char *optstring, |
| 750 |
const struct option *longopts, int *longind, int long_only, |
| 751 |
int posixly_correct) |
| 752 |
{ |
| 753 |
int result; |
| 754 |
|
| 755 |
getopt_data.optind = optind; |
| 756 |
getopt_data.opterr = opterr; |
| 757 |
|
| 758 |
result = _getopt_internal_r (argc, argv, optstring, longopts, |
| 759 |
longind, long_only, &getopt_data, |
| 760 |
posixly_correct); |
| 761 |
|
| 762 |
optind = getopt_data.optind; |
| 763 |
optarg = getopt_data.optarg; |
| 764 |
optopt = getopt_data.optopt; |
| 765 |
|
| 766 |
return result; |
| 767 |
} |
| 768 |
|
| 769 |
int |
| 770 |
getopt_long(int argc, char *__getopt_argv_const *argv, const char *options, |
| 771 |
const struct option *long_options, int *opt_index) |
| 772 |
{ |
| 773 |
return _getopt_internal(argc, (char **)argv, options, long_options, |
| 774 |
opt_index, 0, 0); |
| 775 |
} |
| 776 |
|
| 777 |
#endif |