Minor changes
[jabaws.git] / binaries / src / iupred / gjutil.h
1 #ifndef GJ_UTIL_H
2 #define GJ_UTIL_H
3
4 /*
5 $Id: gjutil.h,v 1.8 2002/08/09 12:30:31 geoff Exp $
6 */
7
8 #include <stdio.h>
9
10
11 typedef int GJ_LIM;              /* type for limits - e.g. max buffer length */
12 typedef int GJ_PEN;              /* type for gap penalties */
13 typedef int GJ_FLG;              /* Flag type - usually just 1 or 0 */
14 typedef float GJ_FLOAT;          /* Single precision floating point type */
15 typedef double GJ_DBL;           /* a double precision floating point type */
16 typedef int GJ_S_COUNT;          /* small counter */
17 typedef long GJ_L_COUNT;         /* long counter */
18
19 typedef struct {                    /* structure to hold a filename and */
20   char *name;                    /* associated handle */
21   FILE *handle;
22 } GJFILE;
23
24 struct tokens {                  /* structure to hold tokens parsed from */
25   int ntok;                      /* string with strtok */
26   char **tok;
27 };
28
29 typedef struct {
30   int min;
31   int max;
32 } IRANGE;
33
34 typedef struct {
35   char *val;
36   int i;
37 } CWORK;
38
39 int Sworkcomp(const void *left, const void *right);
40 void GJindexxS(char **arrin,int n,int *indx);
41
42 #define STD_FILES extern FILE *std_in,*std_out,*std_err
43
44 /* utility.h function definitions */
45
46 void *GJmalloc(size_t);
47 void *GJrealloc(void *,size_t);
48 void *GJmallocNQ(size_t);
49 void *GJreallocNQ(void *,size_t);
50 void GJfree(void *);
51 void GJerror(const char *);
52 char *GJstrdup(const char *);
53 char *GJstoupper(const char *);
54 char *GJstolower(const char *);
55 char *GJstoup(char *);
56 char *GJstolo(char *);
57
58 FILE *GJfopen(const char *, const char *,int);
59 int  GJfclose(FILE *,int);
60 GJFILE *GJfilemake(const char *name,const char *type,int action);
61 GJFILE *GJfilerename(GJFILE *ret_val, const char *name);
62 GJFILE *GJfileclose(GJFILE *ret_val,int action);
63 GJFILE *GJfileopen(GJFILE *ret_val,const char *type,int action);
64 GJFILE *GJfileclean(GJFILE *fval,int action);
65 void GJinitfile(void);
66
67 char *GJfnonnull(char *);
68 char *GJstrappend(char *,char *);
69 char *GJremovechar(char *,char);
70 char *GJremovechar2(char *string,char c);
71 char *GJstrcreate(size_t, char *);
72 char *GJstrlocate(char *,char *);
73 char *GJsubchar(char *,char,char);
74 char *GJstrtok(char *,const char *);
75 void error(const char *, int);
76 unsigned char **uchararr(int,int);
77 void ucharfree(unsigned char **array,int i);
78 double **GJdarr(int i,int j);
79 void GJdarrfree(double **array,int i);
80 signed   char **chararr(int,int);
81 void GJCinit(signed char **,int ,int ,char );
82 void mcheck(void *, char *);
83 char *GJstrblank(char *, int);
84 void GJUCinit(unsigned char **,int ,int ,unsigned char );
85 char *GJcat(int N,...);
86 struct tokens *GJgettokens(const char *delims, char *buff);
87 void GJfreetokens(struct tokens *tok);
88 char * GJtoktostr(struct tokens *tok, char delim, int s, int e);
89 void GJ_start_clock(void);
90 void GJ_stop_clock(FILE *fp);
91 char *GJstrrename(char *old,const char *new);
92 void GJindexx(int *arrin,int n,int *indx);
93 void GJindexxD(double *arrin,int n,int *indx);
94 void GJindexxS(char **arrin,int n,int *indx);
95 int GJbsearchINXS(char **cod, int n, char *query);
96 int GJbsearchINX_IS(char **cod, int *inx, int n, char *query);
97
98 void GJpline(FILE *fp,char c,int n);
99 char *GJlocaltime(void);
100 void GJpstring(FILE *fp,char *s,int n);
101
102 IRANGE *irange(int *ivec, int n);
103
104 /*
105 $Log: gjutil.h,v $
106 Revision 1.8  2002/08/09 12:30:31  geoff
107 Experiment with different weighting schemes.
108 Changes to build_profile to accommodate new schemes
109 pwf 3  Complex clustering to get sequence weights at each position
110 pwf 4  Dirichlet mixture alone
111 pwf 5  Dirichlet mixture + psiblast windowing + blosum weights
112 pwf 6  local blosum matrix calculation + HH sequence weights + blosum
113
114 Also add wander_check opton
115 Also add option to turn off sw7 bug work around.
116 Add option to suppress multiple alignment output
117 Add gjnoc2 to distribution
118
119 Revision 1.7  2000/12/21 17:25:44  geoff
120 Add the option to output the sequence fragments from the multiple alignment
121 output option in fasta or pir format.  Unlike the block file output, these
122 fragments contain the complete sequence between the start and end points, including
123 any parts deleted in the alignment process.
124 Add appropriate commands to scanps_alias.dat, getpars and getcmd.
125
126 Revision 1.6  1999/11/17 21:06:47  geoff
127 Add setup_caleb and other changes to swpp2 and so on.
128
129 Revision 1.5  1997/06/27 07:17:32  gjb
130 Added rlic.c linfo.h and
131 changes to gjutil.c to give better support for
132 token manipulation
133
134 Revision 1.4  1997/05/12 11:10:54  gjb
135 Re-added gjutil.c and gjutil.h to repository
136 after deleting them
137
138 Revision 1.2  1997/05/12 10:47:52  gjb
139 Modified CVS header and log position
140
141 */
142 #endif  /* GJ_UTIL_H */
143