Lines 1-291
Link Here
|
1 |
--- sqio.c.orig 2002-04-12 20:12:04 UTC |
|
|
2 |
+++ sqio.c |
3 |
@@ -235,7 +235,7 @@ readline(FILE *f, char *s) |
4 |
} |
5 |
|
6 |
static void |
7 |
-getline(struct ReadSeqVars *V) |
8 |
+get_line(struct ReadSeqVars *V) |
9 |
{ |
10 |
readline(V->f, V->sbuffer); |
11 |
} |
12 |
@@ -306,7 +306,7 @@ readLoop(int addfirst, int (*endTest)(ch |
13 |
V->seqlen = 0; |
14 |
if (addfirst) addseq(V->sbuffer, V); |
15 |
do { |
16 |
- getline(V); |
17 |
+ get_line(V); |
18 |
done = feof(V->f); |
19 |
done |= (*endTest)(V->sbuffer, &addend); |
20 |
if (addend || !done) |
21 |
@@ -332,7 +332,7 @@ readPIR(struct ReadSeqVars *V) |
22 |
char *sptr; |
23 |
/* load first line of entry */ |
24 |
while (!feof(V->f) && strncmp(V->sbuffer, "ENTRY", 5) != 0) |
25 |
- getline(V); |
26 |
+ get_line(V); |
27 |
if (feof(V->f)) return; |
28 |
|
29 |
if ((sptr = strtok(V->sbuffer + 15, "\n\t ")) != NULL) |
30 |
@@ -341,7 +341,7 @@ readPIR(struct ReadSeqVars *V) |
31 |
SetSeqinfoString(V->sqinfo, sptr, SQINFO_ID); |
32 |
} |
33 |
do { |
34 |
- getline(V); |
35 |
+ get_line(V); |
36 |
if (!feof(V->f) && strncmp(V->sbuffer, "TITLE", 5) == 0) |
37 |
SetSeqinfoString(V->sqinfo, V->sbuffer+15, SQINFO_DESC); |
38 |
else if (!feof(V->f) && strncmp(V->sbuffer, "ACCESSION", 9) == 0) |
39 |
@@ -350,7 +350,7 @@ readPIR(struct ReadSeqVars *V) |
40 |
SetSeqinfoString(V->sqinfo, sptr, SQINFO_ACC); |
41 |
} |
42 |
} while (! feof(V->f) && (strncmp(V->sbuffer,"SEQUENCE", 8) != 0)); |
43 |
- getline(V); /* skip next line, coords */ |
44 |
+ get_line(V); /* skip next line, coords */ |
45 |
|
46 |
readLoop(0, endPIR, V); |
47 |
|
48 |
@@ -364,7 +364,7 @@ readPIR(struct ReadSeqVars *V) |
49 |
/* get next line |
50 |
*/ |
51 |
while (!feof(V->f) && strncmp(V->sbuffer, "ENTRY", 5) != 0) |
52 |
- getline(V); |
53 |
+ get_line(V); |
54 |
} |
55 |
|
56 |
|
57 |
@@ -382,7 +382,7 @@ readIG(struct ReadSeqVars *V) |
58 |
char *nm; |
59 |
/* position past ';' comments */ |
60 |
do { |
61 |
- getline(V); |
62 |
+ get_line(V); |
63 |
} while (! (feof(V->f) || ((*V->sbuffer != 0) && (*V->sbuffer != ';')) )); |
64 |
|
65 |
if (!feof(V->f)) |
66 |
@@ -394,7 +394,7 @@ readIG(struct ReadSeqVars *V) |
67 |
} |
68 |
|
69 |
while (!(feof(V->f) || ((*V->sbuffer != '\0') && (*V->sbuffer == ';')))) |
70 |
- getline(V); |
71 |
+ get_line(V); |
72 |
} |
73 |
|
74 |
static int |
75 |
@@ -416,7 +416,7 @@ readStrider(struct ReadSeqVars *V) |
76 |
if ((nm = strtok(V->sbuffer+16, ",\n\t ")) != NULL) |
77 |
SetSeqinfoString(V->sqinfo, nm, SQINFO_NAME); |
78 |
} |
79 |
- getline(V); |
80 |
+ get_line(V); |
81 |
} |
82 |
|
83 |
if (! feof(V->f)) |
84 |
@@ -425,7 +425,7 @@ readStrider(struct ReadSeqVars *V) |
85 |
/* load next line |
86 |
*/ |
87 |
while ((!feof(V->f)) && (*V->sbuffer != ';')) |
88 |
- getline(V); |
89 |
+ get_line(V); |
90 |
} |
91 |
|
92 |
|
93 |
@@ -443,7 +443,7 @@ readGenBank(struct ReadSeqVars *V) |
94 |
int in_definition; |
95 |
|
96 |
while (strncmp(V->sbuffer, "LOCUS", 5) != 0) |
97 |
- getline(V); |
98 |
+ get_line(V); |
99 |
|
100 |
if ((sptr = strtok(V->sbuffer+12, "\n\t ")) != NULL) |
101 |
{ |
102 |
@@ -454,7 +454,7 @@ readGenBank(struct ReadSeqVars *V) |
103 |
in_definition = FALSE; |
104 |
while (! feof(V->f)) |
105 |
{ |
106 |
- getline(V); |
107 |
+ get_line(V); |
108 |
if (! feof(V->f) && strstr(V->sbuffer, "DEFINITION") == V->sbuffer) |
109 |
{ |
110 |
if ((sptr = strtok(V->sbuffer+12, "\n")) != NULL) |
111 |
@@ -487,11 +487,11 @@ readGenBank(struct ReadSeqVars *V) |
112 |
|
113 |
|
114 |
while (!(feof(V->f) || ((*V->sbuffer!=0) && (strstr(V->sbuffer,"LOCUS") == V->sbuffer)))) |
115 |
- getline(V); |
116 |
+ get_line(V); |
117 |
/* SRE: V->s now holds "//", so sequential |
118 |
reads are wedged: fixed Tue Jul 13 1993 */ |
119 |
while (!feof(V->f) && strstr(V->sbuffer, "LOCUS ") != V->sbuffer) |
120 |
- getline(V); |
121 |
+ get_line(V); |
122 |
} |
123 |
|
124 |
static int |
125 |
@@ -521,12 +521,12 @@ readNBRF(struct ReadSeqVars *V) |
126 |
if ((sptr = strtok(V->sbuffer+4, "\n\t ")) != NULL) |
127 |
SetSeqinfoString(V->sqinfo, sptr, SQINFO_NAME); |
128 |
|
129 |
- getline(V); /*skip title-junk line*/ |
130 |
+ get_line(V); /*skip title-junk line*/ |
131 |
|
132 |
readLoop(0, endNBRF, V); |
133 |
|
134 |
while (!(feof(V->f) || (*V->sbuffer != 0 && *V->sbuffer == '>'))) |
135 |
- getline(V); |
136 |
+ get_line(V); |
137 |
} |
138 |
|
139 |
|
140 |
@@ -559,7 +559,7 @@ readGCGdata(struct ReadSeqVars *V) |
141 |
} else Die("bogus GCGdata format? %s", V->sbuffer); |
142 |
|
143 |
/* second line contains free text description */ |
144 |
- getline(V); |
145 |
+ get_line(V); |
146 |
SetSeqinfoString(V->sqinfo, V->sbuffer, SQINFO_DESC); |
147 |
|
148 |
if (binary) { |
149 |
@@ -579,7 +579,7 @@ readGCGdata(struct ReadSeqVars *V) |
150 |
else readLoop(0, endGCGdata, V); |
151 |
|
152 |
while (!(feof(V->f) || ((*V->sbuffer != 0) && (*V->sbuffer == '>')))) |
153 |
- getline(V); |
154 |
+ get_line(V); |
155 |
} |
156 |
|
157 |
static int |
158 |
@@ -625,7 +625,7 @@ readPearson(struct ReadSeqVars *V) |
159 |
readLoop(0, endPearson, V); |
160 |
|
161 |
while (!(feof(V->f) || ((*V->sbuffer != 0) && (*V->sbuffer == '>')))) |
162 |
- getline(V); |
163 |
+ get_line(V); |
164 |
} |
165 |
|
166 |
|
167 |
@@ -652,7 +652,7 @@ readEMBL(struct ReadSeqVars *V) |
168 |
|
169 |
/* make sure we have first line */ |
170 |
while (!feof(V->f) && strncmp(V->sbuffer, "ID ", 4) != 0) |
171 |
- getline(V); |
172 |
+ get_line(V); |
173 |
|
174 |
if ((sptr = strtok(V->sbuffer+5, "\n\t ")) != NULL) |
175 |
{ |
176 |
@@ -661,7 +661,7 @@ readEMBL(struct ReadSeqVars *V) |
177 |
} |
178 |
|
179 |
do { |
180 |
- getline(V); |
181 |
+ get_line(V); |
182 |
if (!feof(V->f) && strstr(V->sbuffer, "AC ") == V->sbuffer) |
183 |
{ |
184 |
if ((sptr = strtok(V->sbuffer+5, "; \t\n")) != NULL) |
185 |
@@ -685,7 +685,7 @@ readEMBL(struct ReadSeqVars *V) |
186 |
|
187 |
/* load next record's ID line */ |
188 |
while (!feof(V->f) && strncmp(V->sbuffer, "ID ", 4) != 0) |
189 |
- getline(V); |
190 |
+ get_line(V); |
191 |
} |
192 |
|
193 |
|
194 |
@@ -701,7 +701,7 @@ readZuker(struct ReadSeqVars *V) |
195 |
{ |
196 |
char *sptr; |
197 |
|
198 |
- getline(V); /*s == "seqLen seqid string..."*/ |
199 |
+ get_line(V); /*s == "seqLen seqid string..."*/ |
200 |
|
201 |
if ((sptr = strtok(V->sbuffer+6, " \t\n")) != NULL) |
202 |
SetSeqinfoString(V->sqinfo, sptr, SQINFO_NAME); |
203 |
@@ -712,7 +712,7 @@ readZuker(struct ReadSeqVars *V) |
204 |
readLoop(0, endZuker, V); |
205 |
|
206 |
while (!(feof(V->f) | ((*V->sbuffer != '\0') & (*V->sbuffer == '(')))) |
207 |
- getline(V); |
208 |
+ get_line(V); |
209 |
} |
210 |
|
211 |
static void |
212 |
@@ -734,7 +734,7 @@ readUWGCG(struct ReadSeqVars *V) |
213 |
|
214 |
do { |
215 |
done = feof(V->f); |
216 |
- getline(V); |
217 |
+ get_line(V); |
218 |
if (! done) addseq(V->sbuffer, V); |
219 |
} while (!done); |
220 |
} |
221 |
@@ -746,7 +746,7 @@ readSquid(struct ReadSeqVars *V) |
222 |
char *sptr; |
223 |
int dostruc = FALSE; |
224 |
|
225 |
- while (strncmp(V->sbuffer, "NAM ", 4) != 0) getline(V); |
226 |
+ while (strncmp(V->sbuffer, "NAM ", 4) != 0) get_line(V); |
227 |
|
228 |
if ((sptr = strtok(V->sbuffer+4, "\n\t ")) != NULL) |
229 |
SetSeqinfoString(V->sqinfo, sptr, SQINFO_NAME); |
230 |
@@ -754,7 +754,7 @@ readSquid(struct ReadSeqVars *V) |
231 |
/*CONSTCOND*/ |
232 |
while (1) |
233 |
{ |
234 |
- getline(V); |
235 |
+ get_line(V); |
236 |
if (feof(V->f)) {squid_errno = SQERR_FORMAT; return; } |
237 |
|
238 |
if (strncmp(V->sbuffer, "SRC ", 4) == 0) |
239 |
@@ -786,14 +786,14 @@ readSquid(struct ReadSeqVars *V) |
240 |
while (1) |
241 |
{ |
242 |
/* sequence line */ |
243 |
- getline(V); |
244 |
+ get_line(V); |
245 |
if (feof(V->f) || strncmp(V->sbuffer, "++", 2) == 0) |
246 |
break; |
247 |
addseq(V->sbuffer, V); |
248 |
/* structure line */ |
249 |
if (dostruc) |
250 |
{ |
251 |
- getline(V); |
252 |
+ get_line(V); |
253 |
if (feof(V->f)) { squid_errno = SQERR_FORMAT; return; } |
254 |
addstruc(V->sbuffer, V); |
255 |
} |
256 |
@@ -801,7 +801,7 @@ readSquid(struct ReadSeqVars *V) |
257 |
|
258 |
|
259 |
while (!feof(V->f) && strncmp(V->sbuffer, "NAM ", 4) != 0) |
260 |
- getline(V); |
261 |
+ get_line(V); |
262 |
} |
263 |
|
264 |
|
265 |
@@ -848,7 +848,7 @@ SeqfileOpen(char *filename, int format, |
266 |
|
267 |
/* Load the first line. |
268 |
*/ |
269 |
- getline(dbfp); |
270 |
+ get_line(dbfp); |
271 |
|
272 |
return dbfp; |
273 |
} |
274 |
@@ -862,7 +862,7 @@ void |
275 |
SeqfilePosition(SQFILE *sqfp, long offset) |
276 |
{ |
277 |
fseek(sqfp->f, offset, SEEK_SET); |
278 |
- getline(sqfp); |
279 |
+ get_line(sqfp); |
280 |
} |
281 |
|
282 |
|
283 |
@@ -954,7 +954,7 @@ ReadSeq(SQFILE *V, int format, char **re |
284 |
do { /* skip leading comments on GCG file */ |
285 |
gotuw = (strstr(V->sbuffer,"..") != NULL); |
286 |
if (gotuw) readUWGCG(V); |
287 |
- getline(V); |
288 |
+ get_line(V); |
289 |
} while (! feof(V->f)); |
290 |
break; |
291 |
|