File size: 1,394 Bytes
10764ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
--- gendb.c.old	2009-11-14 16:03:21.000000000 -0800
+++ gendb.c	2009-11-14 16:01:43.000000000 -0800
@@ -7,10 +7,13 @@
  * DESCRIPTION: Generate sequences using a Markov model.
  **************************************************************************/
 
+#ifndef MAIN
 #define DEFINE_GLOBALS
+#endif
 #include "macros.h"
 #include "fcodon.h"
 #include "background.h"
+#include "gendb.h"
 #include "hash_alph.h"
 #include "seq.h"
 
@@ -19,6 +22,7 @@
 #define SEQS 10				/* number of sequences */
 #define MAX_ORDER 10			// largest Markov model order
 
+#ifndef MAIN
 /**************************************************************************/
 /*
 	get_letters
@@ -301,7 +305,7 @@
 	Generate a file of synthetic sequences.
 */
 /**************************************************************************/
-extern SEQ_T *gendb(
+SEQ_T *gendb(
   FILE *out,			// Output stream; return output if null.
   int type,			// Type of alphabet.
 				// 0: protein w/ambigs
@@ -336,6 +340,7 @@
   // Print the random sequences.
   return (print_random_seqs(out, seed, nseqs, min, max, letters, r, c, order, cum));
 } // gendb
+#endif
 
 
 #ifdef MAIN
@@ -416,7 +421,7 @@
     }
   }
   if (option_index + 1 != argc) {
-    fprintf(stderr, usage);
+    fprintf(stderr, "%s", usage);
     exit(EXIT_FAILURE);
   }
   int nseqs = atoi(argv[option_index]);