| 548 | } |
| 549 | |
| 550 | static void |
| 551 | do_ext_makedefs(int argc, char **argv) |
| 552 | { |
| 553 | int todo = 0; |
| 554 | |
| 555 | argc--; |
| 556 | argv++; /* skip program name */ |
| 557 | |
| 558 | while (argc) { |
| 559 | if (argv[0][0] != '-') |
| 560 | break; |
| 561 | if (argv[0][1] != '-') { |
| 562 | Fprintf(stderr, "Can't mix - and -- options.\n"); |
| 563 | makedefs_exit(EXIT_FAILURE); |
| 564 | /*NOTREACHED*/ |
| 565 | } |
| 566 | IS_OPTION("svs") { |
| 567 | /* short version string for packaging - note no \n */ |
| 568 | char buf[100]; |
| 569 | char delim[10]; |
| 570 | |
| 571 | argv++; /* not CONSUME */ |
| 572 | delim[0] = '\0'; |
| 573 | if (argv[0]) |
| 574 | strcpy(delim, argv[0]); |
| 575 | Fprintf(stdout, "%s", mdlib_version_string(buf, delim)); |
| 576 | makedefs_exit(EXIT_SUCCESS); |
| 577 | /*NOTREACHED*/ |
| 578 | } |
| 579 | IS_OPTION("debug") { |
| 580 | debug = TRUE; |
| 581 | CONTINUE; |
| 582 | } |
| 583 | IS_OPTION("make") { |
| 584 | CONSUME; |
| 585 | do_makedefs(argv[0]); |
| 586 | makedefs_exit(EXIT_SUCCESS); |
| 587 | /*NOTREACHED*/ |
| 588 | } |
| 589 | IS_OPTION("input") { |
| 590 | CONSUME; |
| 591 | if (!strcmp(argv[0], "-")) { |
| 592 | inputfp = stdin; |
| 593 | } else { |
| 594 | inputfp = fopen(argv[0], RDTMODE); |
| 595 | if (!inputfp) { |
| 596 | Fprintf(stderr, "Can't open '%s'.\n", argv[0]); |
| 597 | makedefs_exit(EXIT_FAILURE); |
| 598 | /*NOTREACHED*/ |
| 599 | } |
| 600 | } |
| 601 | CONTINUE; |
| 602 | } |
| 603 | IS_OPTION("output") { |
| 604 | CONSUME; |
| 605 | if (!strcmp(argv[0], "-")) { |
| 606 | outputfp = stdout; |
| 607 | } else { |
no test coverage detected