head	1.1;
access;
symbols
	RELEASE_8_3_0:1.1
	RELEASE_9_0_0:1.1
	RELEASE_7_4_0:1.1
	RELEASE_8_2_0:1.1
	RELEASE_6_EOL:1.1
	RELEASE_8_1_0:1.1
	RELEASE_7_3_0:1.1
	RELEASE_8_0_0:1.1
	RELEASE_7_2_0:1.1
	RELEASE_7_1_0:1.1
	RELEASE_6_4_0:1.1
	RELEASE_5_EOL:1.1
	RELEASE_7_0_0:1.1
	RELEASE_6_3_0:1.1
	PRE_XORG_7:1.1
	RELEASE_4_EOL:1.1
	RELEASE_6_2_0:1.1
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1;
locks; strict;
comment	@# @;


1.1
date	2001.08.22.12.07.26;	author wjv;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Add seqio 1.2.2, a set of C functions which can read/write
biological sequence files.

PR:		29922
Submitted by:	Tony Maher <tonym@@biolateral.com.au>
@
text
@--- fmtseq.c.orig	Wed Jul 10 12:58:39 1996
+++ fmtseq.c	Tue Aug 21 13:17:23 2001
@@@@ -37,7 +37,6 @@@@
 #include <sys/stat.h>
 #include "seqio.h"
 
-extern char *sys_errlist[];
 
 
 #ifdef WIN32
@@@@ -70,6 +69,7 @@@@
 #define ASK 2
 #define ITEMLIST 3
 
+#define	MAXLINE	128
 
 int pretty_flag, pretty_count;
 FILE *fpout;
@@@@ -81,7 +81,7 @@@@
 } pretty;
 
 
-char dna_complement[128], rna_complement[128];
+char dna_complement[MAXLINE], rna_complement[MAXLINE];
 
 
 /*
@@@@ -222,7 +222,7 @@@@
 void print_options(int flag)
 {
   int i, j;
-  char line[128];
+  char line[MAXLINE];
 
   printf("Program Options (text in [...] is optional):\n");
   printf("  -al[l]            select all sequences\n");
@@@@ -249,7 +249,7 @@@@
 
   if (flag) {
     printf("More? ");
-    gets(line);
+    fgets(line,MAXLINE-1,stdin);
     if (line[0] == 'q' || line[0] == 'Q')
       return;
   }
@@@@ -264,7 +264,7 @@@@
 
   if (flag) {
     printf("More? ");
-    gets(line);
+    fgets(line,MAXLINE-1,stdin);
     if (line[0] == 'q' || line[0] == 'Q')
       return;
   }
@@@@ -1646,7 +1646,7 @@@@
     s = line;
     while (*s == '\0') {
       printf("Enter: ");
-      gets(line);
+      fgets(line,MAXLINE-1,stdin);
       for (s=line; *s && isspace(*s); s++) ;
     }
     printf("----------------------\n\n");
@@@@ -1701,7 +1701,7 @@@@
 {
   static char defch = 'y';
   int init_print, count;
-  char *s, *entry, *eptr, line[128];
+  char *s, *entry, *eptr, line[MAXLINE];
 
   putchar('\n');
   if (seqcount == 1) {
@@@@ -1717,7 +1717,7 @@@@
   eptr = entry = NULL;
   while (1) {
     printf("Select? [%c] ", defch);
-    gets(line);
+    fgets(line,MAXLINE-1,stdin);
 
     if (line[0] == '\0')
       line[0] = defch;
@@@@ -1771,7 +1771,7 @@@@
                    SEQINFO *info, int mode)
 {
   int len;
-  char *temp, tempbuffer[128];
+  char *temp, tempbuffer[MAXLINE];
 
   if (buf != NULL)
     temp = buf;
@@@@ -1803,7 +1803,7 @@@@
 
 int pretty_store(char *seq, int seqlen, SEQINFO *info)
 {
-  char buffer[128];
+  char buffer[MAXLINE];
 
   if (pretty_count == psize) {
     if (psize == 0) {
@@@@ -2582,7 +2582,7 @@@@
 
 void blastout_store(SEQFILE *sfp, char *seq, int seqlen, SEQINFO *info)
 {
-  static otherstrand = 0;
+  static int otherstrand = 0;
   int pos, al_start, ingap, len;
   char *s, *t1, *entry, *end, *line1, *line2;
   ALIGN newalign;
@@@@ -3017,7 +3017,7 @@@@
 {
   int i;
 
-  for (i=0; i < 128; i++)
+  for (i=0; i < MAXLINE; i++)
     dna_complement[i] = dna_complement[i] = i;
 
   dna_complement['a'] = 't';  dna_complement['A'] = 'T';
@
