comparison mafft/core/countlen.c @ 18:e4d75f9efb90 draft

planemo upload commit b'4303231da9e48b2719b4429a29b72421d24310f4\n'-dirty
author nick
date Thu, 02 Feb 2017 18:44:31 -0500
parents
children
comparison
equal deleted inserted replaced
17:836fa4fe9494 18:e4d75f9efb90
1 #include "mltaln.h"
2
3 #define DEBUG 0
4
5 void arguments( int argc, char *argv[] )
6 {
7 int c;
8
9 while( --argc > 0 && (*++argv)[0] == '-' )
10 {
11 while ( (c = *++argv[0]) )
12 {
13 switch( c )
14 {
15 case 'i':
16 inputfile = *++argv;
17 fprintf( stderr, "inputfile = %s\n", inputfile );
18 --argc;
19 goto nextoption;
20 default:
21 fprintf( stderr, "illegal option %c\n", c );
22 argc = 0;
23 break;
24 }
25 }
26 nextoption:
27 ;
28 }
29 if( argc != 0 )
30 {
31 fprintf( stderr, "options: Check source file !\n" );
32 exit( 1 );
33 }
34 }
35
36
37 int main( int argc, char *argv[] )
38 {
39 FILE *infp;
40 int nlenmin;
41
42 arguments( argc, argv );
43
44 if( inputfile )
45 {
46 infp = fopen( inputfile, "r" );
47 if( !infp )
48 {
49 fprintf( stderr, "Cannot open %s\n", inputfile );
50 exit( 1 );
51 }
52 }
53 else
54 infp = stdin;
55
56 dorp = NOTSPECIFIED;
57 getnumlen_nogap( infp, &nlenmin );
58
59 fprintf( stdout, "%d x %d - %d %c\n", njob, nlenmax, nlenmin, dorp );
60 return( 0 );
61 }