| 646 | } |
| 647 | |
| 648 | int |
| 649 | main(int ac, char *av[]) |
| 650 | { |
| 651 | #if defined(_WIN32) && defined(TCC) |
| 652 | { |
| 653 | WSADATA wsaData; |
| 654 | int ret=0; |
| 655 | unsigned short wVersionRequested = MAKEWORD(2, 2); |
| 656 | ret = WSAStartup(wVersionRequested, &wsaData); |
| 657 | if (ret != 0) { |
| 658 | /* Tell the user that we could not find a usable */ |
| 659 | /* Winsock DLL. */ |
| 660 | printf("WSAStartup failed with error: %d\n", ret); |
| 661 | return 1; |
| 662 | } |
| 663 | } |
| 664 | #endif |
| 665 | /* |
| 666 | * If the last argument is an absolute pathname, interpret it |
| 667 | * as a file to be preprocessed. |
| 668 | */ |
| 669 | #ifdef FSTACK |
| 670 | ff_ipc_init(); |
| 671 | #endif |
| 672 | if (ac > 1 && av[ac - 1][0] == '/') { |
| 673 | if (access(av[ac - 1], R_OK) == 0) |
| 674 | ipfw_readfile(ac, av); |
| 675 | else |
| 676 | err(EX_USAGE, "pathname: %s", av[ac - 1]); |
| 677 | } else { |
| 678 | if (ipfw_main(ac, av)) { |
| 679 | errx(EX_USAGE, |
| 680 | "usage: ipfw [options]\n" |
| 681 | "do \"ipfw -h\" or \"man ipfw\" for details"); |
| 682 | } |
| 683 | } |
| 684 | #ifdef FSTACK |
| 685 | ff_ipc_exit(); |
| 686 | #endif |
| 687 | return EX_OK; |
| 688 | } |
nothing calls this directly
no test coverage detected