diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mafft/core/countlen.c	Thu Feb 02 18:44:31 2017 -0500
@@ -0,0 +1,61 @@
+#include "mltaln.h"
+
+#define DEBUG 0
+
+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;
+                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;
+	int nlenmin;
+
+	arguments( argc, argv );
+
+	if( inputfile )
+	{
+		infp = fopen( inputfile, "r" );
+		if( !infp )
+		{
+			fprintf( stderr, "Cannot open %s\n", inputfile );
+			exit( 1 );
+		}
+	}
+	else
+		infp = stdin;
+
+	dorp = NOTSPECIFIED;
+	getnumlen_nogap( infp, &nlenmin );
+
+	fprintf( stdout, "%d x %d - %d %c\n", njob, nlenmax, nlenmin, dorp );
+	return( 0 );
+}