]> git.donarmstrong.com Git - biopieces.git/blob - code_c/Maasha/src/fasta_count.c
added test_common.c
[biopieces.git] / code_c / Maasha / src / fasta_count.c
1 #include "common.h"
2 #include "filesys.h"
3 #include "seq.h"
4 #include "fasta.h"
5
6
7 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> MAIN <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
8
9
10 int main( int argc, char *argv[] )
11 {
12     int i;
13     int count;
14     int total;
15     FILE *fp;
16
17     count = 0;
18     total = 0;
19
20     for ( i = 1; argv[ i ]; i++ )
21     {
22         fp = read_open( argv[ i ] );
23
24         count = fasta_count( fp );
25
26         close_stream( fp );
27
28         printf( "%s: %d\n", argv[ i ], count );
29
30         total += count;
31     }
32
33     if ( total > count ) {
34         printf( "total: %d\n", total );
35     }
36
37     return 0;
38 }
39
40
41 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< */