-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
| 40 | |
| 41 | /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ |
| 42 | void main_init(int argc, char *argv[]) |
| 43 | { |
| 44 | int c; |
| 45 | |
| 46 | while((c=getopt(argc, argv, "ihdc:sf:"))>=0) |
| 47 | { |
| 48 | switch(c) |
| 49 | { |
| 50 | case 'd': |
| 51 | lpverbose = 1; |
| 52 | if(isdigit(argv[optind-1][0])) sscanf(optarg, "%d", &lpverbose); |
| 53 | else optind--; |
| 54 | break; |
| 55 | case 'f': lib_file = argv[optind-1]; |
| 56 | break; |
| 57 | case 's': |
| 58 | check++; |
| 59 | break; |
| 60 | case 'i': |
| 61 | texinfo_out = 1; |
| 62 | break; |
| 63 | case 'c': |
| 64 | category_out = 1; |
| 65 | break; |
| 66 | |
| 67 | case 'h' : |
| 68 | usage(argv[0]); |
| 69 | break; |
| 70 | case -1 : printf("no such option:%s\n", argv[optind]); |
| 71 | usage(argv[0]); |
| 72 | break; |
| 73 | default: printf("no such option.%x, %c %s\n", c&0xff, c, argv[optind]); |
| 74 | usage(argv[0]); |
| 75 | } |
| 76 | } |
| 77 | if (texinfo_out || category_out) lpverbose = 0; |
| 78 | |
| 79 | if(lib_file!=NULL) |
| 80 | { |
| 81 | yylpin = fopen( lib_file, "rb" ); |
| 82 | if (! (texinfo_out || category_out)) |
| 83 | printf("Checking library '%s'\n", lib_file); |
| 84 | else if (! category_out) |
| 85 | printf("$library = \"%s\";\n", lib_file); |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | while(argc>optind && yylpin==NULL) |
| 90 | { |
| 91 | yylpin = fopen( argv[optind], "rb" ); |
| 92 | if(yylpin!=NULL) |
| 93 | { |
| 94 | lib_file = argv[optind]; |
| 95 | if (! (texinfo_out || category_out) ) |
| 96 | printf("Checking library '%s'\n", argv[optind]); |
| 97 | else if (! category_out) |
| 98 | printf("$library = \"%s\";\n", lib_file); |
| 99 | } |