1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#include "mltaln.h"
#define DEBUG 0
char *weboutfile = NULL;
void arguments( int argc, char *argv[] )
{
int c;
while( --argc > 0 && (*++argv)[0] == '-' )
{
while ( (c = *++argv[0]) )
{
switch( c )
{
case 'i':
inputfile = *++argv;
fprintf( stderr, "inputfile = %s\n", inputfile );
--argc;
goto nextoption;
case 'w':
weboutfile = *++argv;
fprintf( stderr, "weboutfile = %s\n", weboutfile );
--argc;
goto nextoption;
default:
fprintf( stderr, "illegal option %c\n", c );
argc = 0;
break;
}
}
nextoption:
;
}
if( argc != 0 )
{
fprintf( stderr, "options: Check source file !\n" );
exit( 1 );
}
}
int main( int argc, char *argv[] )
{
FILE *infp;
FILE *weboutfp;
int nlenmin;
int isaligned = 0;
arguments( argc, argv );
if( inputfile )
{
infp = fopen( inputfile, "r" );
if( !infp )
{
fprintf( stderr, "Cannot open %s\n", inputfile );
exit( 1 );
}
}
else
infp = stdin;
if( weboutfile )
{
weboutfp = fopen( weboutfile, "w" );
if( !weboutfp )
{
fprintf( stderr, "Cannot open %s\n", weboutfile );
exit( 1 );
}
}
dorp = NOTSPECIFIED;
if( weboutfile )
{
getnumlen_nogap_outallreg_web( infp, weboutfp, &nlenmin, &isaligned );
if( isaligned ) fprintf( stdout, "Aligned\n" );
else fprintf( stdout, "Not aligned\n" );
}
else
getnumlen_nogap_outallreg( infp, &nlenmin );
return( 0 );
}
|