JPRED-2 Add sources of all binaries (except alscript) to Git
[jpred.git] / sources / pairwise / docs / html / pairwise_8c.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>pairwise: pairwise.c File Reference</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3.2 -->
7 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
8 <h1>pairwise.c File Reference</h1><code>#include &lt;stdio.h&gt;</code><br>
9 <code>#include &lt;stdlib.h&gt;</code><br>
10 <code>#include &lt;errno.h&gt;</code><br>
11 <code>#include &lt;string.h&gt;</code><br>
12 <code>#include "<a class="el" href="pairwise_8h-source.html">pairwise.h</a>"</code><br>
13
14 <p>
15 Include dependency graph for pairwise.c:<p><center><img src="pairwise_8c__incl.png" border="0" usemap="#pairwise.c_map" alt="Include dependency graph"></center>
16 <map name="pairwise.c_map">
17 <area href="pairwise_8h.html" shape="rect" coords="135,86,207,105" alt="">
18 </map>
19
20 <p>
21 <a href="pairwise_8c-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
22 <tr><td></td></tr>
23 <tr><td colspan=2><br><h2>Defines</h2></td></tr>
24 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a0">ARRAY</a>&nbsp;&nbsp;&nbsp;50</td></tr>
25
26 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a1">FILEBUF</a>&nbsp;&nbsp;&nbsp;1000</td></tr>
27
28 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a2">MAX</a>(A, B)&nbsp;&nbsp;&nbsp;((A) &gt; (B) ? (A) : (B))</td></tr>
29
30 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a3">MIN</a>(A, B)&nbsp;&nbsp;&nbsp;((A) &lt; (B) ? (A) : (B))</td></tr>
31
32 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a4">MALLOC</a>(PTR, SIZE)&nbsp;&nbsp;&nbsp;do { PTR = malloc(SIZE); if (PTR == NULL) fatal_sys_error("malloc returned NULL"); } while (0)</td></tr>
33
34 <tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a5">REALLOC</a>(PTR, SIZE)&nbsp;&nbsp;&nbsp;do { PTR = realloc(PTR, SIZE); if (PTR == NULL &amp;&amp; SIZE != 0) fatal_sys_error("realloc returned NULL"); } while (0)</td></tr>
35
36 <tr><td colspan=2><br><h2>Functions</h2></td></tr>
37 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a6">fatal_error</a> (char *message)</td></tr>
38
39 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a7">fatal_sys_error</a> (char *message)</td></tr>
40
41 <tr><td class="memItemLeft" nowrap align=right valign=top>FILE *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a8">xfopen</a> (const char *path, const char *mode)</td></tr>
42
43 <tr><td class="memItemLeft" nowrap align=right valign=top>void *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a9">xmalloc</a> (size_t size)</td></tr>
44
45 <tr><td class="memItemLeft" nowrap align=right valign=top>void *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a10">xrealloc</a> (void *ptr, size_t size)</td></tr>
46
47 <tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a11">diff</a> (char a, char b)</td></tr>
48
49 <tr><td class="memItemLeft" nowrap align=right valign=top>float&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a12">pairwise</a> (struct <a class="el" href="structfasta.html">fasta</a> *a, struct <a class="el" href="structfasta.html">fasta</a> *b)</td></tr>
50
51 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a13">populate</a> (struct <a class="el" href="structfasta.html">fasta</a> *a)</td></tr>
52
53 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a14">check_length</a> (struct <a class="el" href="structfasta.html">fasta</a> **array)</td></tr>
54
55 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structfasta.html">fasta</a> **&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a15">read_fasta</a> (FILE *fh)</td></tr>
56
57 <tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="pairwise_8c.html#a16">main</a> (int argc, char **argv)</td></tr>
58
59 </table>
60 <hr><h2>Define Documentation</h2>
61 <a name="a0" doxytag="pairwise.c::ARRAY"></a><p>
62 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
63   <tr>
64     <td class="mdRow">
65       <table cellpadding="0" cellspacing="0" border="0">
66         <tr>
67           <td class="md" nowrap valign="top"> #define ARRAY&nbsp;&nbsp;&nbsp;50
68       </table>
69     </td>
70   </tr>
71 </table>
72 <table cellspacing=5 cellpadding=0 border=0>
73   <tr>
74     <td>
75       &nbsp;
76     </td>
77     <td>
78
79 <p>
80
81 <p>
82 Definition at line <a class="el" href="pairwise_8c-source.html#l00029">29</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
83 <p>
84 Referenced by <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.    </td>
85   </tr>
86 </table>
87 <a name="a1" doxytag="pairwise.c::FILEBUF"></a><p>
88 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
89   <tr>
90     <td class="mdRow">
91       <table cellpadding="0" cellspacing="0" border="0">
92         <tr>
93           <td class="md" nowrap valign="top"> #define FILEBUF&nbsp;&nbsp;&nbsp;1000
94       </table>
95     </td>
96   </tr>
97 </table>
98 <table cellspacing=5 cellpadding=0 border=0>
99   <tr>
100     <td>
101       &nbsp;
102     </td>
103     <td>
104
105 <p>
106
107 <p>
108 Definition at line <a class="el" href="pairwise_8c-source.html#l00030">30</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
109 <p>
110 Referenced by <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.    </td>
111   </tr>
112 </table>
113 <a name="a4" doxytag="pairwise.c::MALLOC"></a><p>
114 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
115   <tr>
116     <td class="mdRow">
117       <table cellpadding="0" cellspacing="0" border="0">
118         <tr>
119           <td class="md" nowrap valign="top"> #define MALLOC</td>
120           <td class="md" valign="top">(&nbsp;</td>
121           <td class="md" nowrap valign="top">PTR,         <tr>
122           <td></td>
123           <td></td>
124           <td class="md" nowrap>SIZE&nbsp;</td>
125           <td class="mdname1" valign="top" nowrap>          </td>
126           <td class="md" valign="top">&nbsp;)&nbsp;</td>
127           <td class="md" nowrap>&nbsp;&nbsp;&nbsp;do { PTR = malloc(SIZE); if (PTR == NULL) fatal_sys_error("malloc returned NULL"); } while (0)
128       </table>
129     </td>
130   </tr>
131 </table>
132 <table cellspacing=5 cellpadding=0 border=0>
133   <tr>
134     <td>
135       &nbsp;
136     </td>
137     <td>
138
139 <p>
140
141 <p>
142 Definition at line <a class="el" href="pairwise_8c-source.html#l00045">45</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.    </td>
143   </tr>
144 </table>
145 <a name="a2" doxytag="pairwise.c::MAX"></a><p>
146 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
147   <tr>
148     <td class="mdRow">
149       <table cellpadding="0" cellspacing="0" border="0">
150         <tr>
151           <td class="md" nowrap valign="top"> #define MAX</td>
152           <td class="md" valign="top">(&nbsp;</td>
153           <td class="md" nowrap valign="top">A,         <tr>
154           <td></td>
155           <td></td>
156           <td class="md" nowrap>B&nbsp;</td>
157           <td class="mdname1" valign="top" nowrap>          </td>
158           <td class="md" valign="top">&nbsp;)&nbsp;</td>
159           <td class="md" nowrap>&nbsp;&nbsp;&nbsp;((A) &gt; (B) ? (A) : (B))
160       </table>
161     </td>
162   </tr>
163 </table>
164 <table cellspacing=5 cellpadding=0 border=0>
165   <tr>
166     <td>
167       &nbsp;
168     </td>
169     <td>
170
171 <p>
172
173 <p>
174 Definition at line <a class="el" href="pairwise_8c-source.html#l00035">35</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
175 <p>
176 Referenced by <a class="el" href="pairwise_8c-source.html#l00106">pairwise()</a>.    </td>
177   </tr>
178 </table>
179 <a name="a3" doxytag="pairwise.c::MIN"></a><p>
180 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
181   <tr>
182     <td class="mdRow">
183       <table cellpadding="0" cellspacing="0" border="0">
184         <tr>
185           <td class="md" nowrap valign="top"> #define MIN</td>
186           <td class="md" valign="top">(&nbsp;</td>
187           <td class="md" nowrap valign="top">A,         <tr>
188           <td></td>
189           <td></td>
190           <td class="md" nowrap>B&nbsp;</td>
191           <td class="mdname1" valign="top" nowrap>          </td>
192           <td class="md" valign="top">&nbsp;)&nbsp;</td>
193           <td class="md" nowrap>&nbsp;&nbsp;&nbsp;((A) &lt; (B) ? (A) : (B))
194       </table>
195     </td>
196   </tr>
197 </table>
198 <table cellspacing=5 cellpadding=0 border=0>
199   <tr>
200     <td>
201       &nbsp;
202     </td>
203     <td>
204
205 <p>
206
207 <p>
208 Definition at line <a class="el" href="pairwise_8c-source.html#l00039">39</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
209 <p>
210 Referenced by <a class="el" href="pairwise_8c-source.html#l00106">pairwise()</a>.    </td>
211   </tr>
212 </table>
213 <a name="a5" doxytag="pairwise.c::REALLOC"></a><p>
214 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
215   <tr>
216     <td class="mdRow">
217       <table cellpadding="0" cellspacing="0" border="0">
218         <tr>
219           <td class="md" nowrap valign="top"> #define REALLOC</td>
220           <td class="md" valign="top">(&nbsp;</td>
221           <td class="md" nowrap valign="top">PTR,         <tr>
222           <td></td>
223           <td></td>
224           <td class="md" nowrap>SIZE&nbsp;</td>
225           <td class="mdname1" valign="top" nowrap>          </td>
226           <td class="md" valign="top">&nbsp;)&nbsp;</td>
227           <td class="md" nowrap>&nbsp;&nbsp;&nbsp;do { PTR = realloc(PTR, SIZE); if (PTR == NULL &amp;&amp; SIZE != 0) fatal_sys_error("realloc returned NULL"); } while (0)
228       </table>
229     </td>
230   </tr>
231 </table>
232 <table cellspacing=5 cellpadding=0 border=0>
233   <tr>
234     <td>
235       &nbsp;
236     </td>
237     <td>
238
239 <p>
240
241 <p>
242 Definition at line <a class="el" href="pairwise_8c-source.html#l00049">49</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.    </td>
243   </tr>
244 </table>
245 <hr><h2>Function Documentation</h2>
246 <a name="a14" doxytag="pairwise.c::check_length"></a><p>
247 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
248   <tr>
249     <td class="mdRow">
250       <table cellpadding="0" cellspacing="0" border="0">
251         <tr>
252           <td class="md" nowrap valign="top"> void check_length </td>
253           <td class="md" valign="top">(&nbsp;</td>
254           <td class="md" nowrap valign="top">struct <a class="el" href="structfasta.html">fasta</a> **&nbsp;</td>
255           <td class="mdname1" valign="top" nowrap> <em>array</em>          </td>
256           <td class="md" valign="top">&nbsp;)&nbsp;</td>
257           <td class="md" nowrap></td>
258         </tr>
259
260       </table>
261     </td>
262   </tr>
263 </table>
264 <table cellspacing=5 cellpadding=0 border=0>
265   <tr>
266     <td>
267       &nbsp;
268     </td>
269     <td>
270
271 <p>
272
273 <p>
274 Definition at line <a class="el" href="pairwise_8c-source.html#l00160">160</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
275 <p>
276 References <a class="el" href="pairwise_8c-source.html#l00053">fatal_error()</a>.
277 <p>
278 Referenced by <a class="el" href="pairwise_8c-source.html#l00253">main()</a>.
279 <p>
280 <div class="fragment"><pre>00160                                     {
281 00161         <span class="keywordtype">int</span> i, length;
282 00162 
283 00163         <span class="keywordflow">if</span> (array[0] != NULL)
284 00164                 length = strlen(array[0]-&gt;seq);
285 00165         <span class="keywordflow">else</span> {
286 00166                 fprintf(stderr, <span class="stringliteral">"check_length() not passed an array of fasta structs\n"</span>);
287 00167                 <span class="keywordflow">return</span>;
288 00168         }
289 00169 
290 00170         <span class="keywordflow">for</span> (i = 0; array[i] != NULL; i++) {
291 00171                 <span class="keywordflow">if</span> (length != strlen(array[i]-&gt;seq)) {
292 00172                         <a class="code" href="pairwise_8c.html#a6">fatal_error</a>(<span class="stringliteral">"Not all of the sequences are the same length\n"</span>);
293 00173                 }
294 00174         }
295 00175 }
296 </pre></div>    </td>
297   </tr>
298 </table>
299
300 <p>
301 Here is the call graph for this function:<p><center><img src="pairwise_8c_a14_cgraph.png" border="0" usemap="#pairwise_8c_a14_cgraph_map" alt=""></center>
302 <map name="pairwise_8c_a14_cgraph_map">
303 <area href="pairwise_8h.html#a0" shape="rect" coords="160,5,235,23" alt="">
304 </map>
305 <a name="a11" doxytag="pairwise.c::diff"></a><p>
306 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
307   <tr>
308     <td class="mdRow">
309       <table cellpadding="0" cellspacing="0" border="0">
310         <tr>
311           <td class="md" nowrap valign="top"> int diff </td>
312           <td class="md" valign="top">(&nbsp;</td>
313           <td class="md" nowrap valign="top">char&nbsp;</td>
314           <td class="mdname" nowrap> <em>a</em>, </td>
315         </tr>
316         <tr>
317           <td></td>
318           <td></td>
319           <td class="md" nowrap>char&nbsp;</td>
320           <td class="mdname" nowrap> <em>b</em></td>
321         </tr>
322         <tr>
323           <td></td>
324           <td class="md">)&nbsp;</td>
325           <td class="md" colspan="2"></td>
326         </tr>
327
328       </table>
329     </td>
330   </tr>
331 </table>
332 <table cellspacing=5 cellpadding=0 border=0>
333   <tr>
334     <td>
335       &nbsp;
336     </td>
337     <td>
338
339 <p>
340
341 <p>
342 Definition at line <a class="el" href="pairwise_8c-source.html#l00092">92</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
343 <p>
344 Referenced by <a class="el" href="pairwise_8c-source.html#l00106">pairwise()</a>.
345 <p>
346 <div class="fragment"><pre>00092                       {
347 00093         <span class="keywordflow">if</span> (a == b &amp;&amp; a == <span class="charliteral">'-'</span>)
348 00094                 <span class="keywordflow">return</span> 0;
349 00095         <span class="keywordflow">if</span> (a == b)
350 00096                 <span class="keywordflow">return</span> 1;
351 00097         <span class="keywordflow">return</span> 0;
352 00098 }
353 </pre></div>    </td>
354   </tr>
355 </table>
356 <a name="a6" doxytag="pairwise.c::fatal_error"></a><p>
357 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
358   <tr>
359     <td class="mdRow">
360       <table cellpadding="0" cellspacing="0" border="0">
361         <tr>
362           <td class="md" nowrap valign="top"> void fatal_error </td>
363           <td class="md" valign="top">(&nbsp;</td>
364           <td class="md" nowrap valign="top">char *&nbsp;</td>
365           <td class="mdname1" valign="top" nowrap> <em>message</em>          </td>
366           <td class="md" valign="top">&nbsp;)&nbsp;</td>
367           <td class="md" nowrap></td>
368         </tr>
369
370       </table>
371     </td>
372   </tr>
373 </table>
374 <table cellspacing=5 cellpadding=0 border=0>
375   <tr>
376     <td>
377       &nbsp;
378     </td>
379     <td>
380
381 <p>
382
383 <p>
384 Definition at line <a class="el" href="pairwise_8c-source.html#l00053">53</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
385 <p>
386 Referenced by <a class="el" href="pairwise_8c-source.html#l00160">check_length()</a>.
387 <p>
388 <div class="fragment"><pre>00053                             {
389 00054         printf(message);
390 00055         exit(EXIT_FAILURE);
391 00056 }
392 </pre></div>    </td>
393   </tr>
394 </table>
395 <a name="a7" doxytag="pairwise.c::fatal_sys_error"></a><p>
396 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
397   <tr>
398     <td class="mdRow">
399       <table cellpadding="0" cellspacing="0" border="0">
400         <tr>
401           <td class="md" nowrap valign="top"> void fatal_sys_error </td>
402           <td class="md" valign="top">(&nbsp;</td>
403           <td class="md" nowrap valign="top">char *&nbsp;</td>
404           <td class="mdname1" valign="top" nowrap> <em>message</em>          </td>
405           <td class="md" valign="top">&nbsp;)&nbsp;</td>
406           <td class="md" nowrap></td>
407         </tr>
408
409       </table>
410     </td>
411   </tr>
412 </table>
413 <table cellspacing=5 cellpadding=0 border=0>
414   <tr>
415     <td>
416       &nbsp;
417     </td>
418     <td>
419
420 <p>
421
422 <p>
423 Definition at line <a class="el" href="pairwise_8c-source.html#l00059">59</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
424 <p>
425 Referenced by <a class="el" href="pairwise_8c-source.html#l00065">xfopen()</a>, <a class="el" href="pairwise_8c-source.html#l00074">xmalloc()</a>, and <a class="el" href="pairwise_8c-source.html#l00083">xrealloc()</a>.
426 <p>
427 <div class="fragment"><pre>00059                                 {
428 00060         perror(message);
429 00061         exit(EXIT_FAILURE);
430 00062 }
431 </pre></div>    </td>
432   </tr>
433 </table>
434 <a name="a16" doxytag="pairwise.c::main"></a><p>
435 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
436   <tr>
437     <td class="mdRow">
438       <table cellpadding="0" cellspacing="0" border="0">
439         <tr>
440           <td class="md" nowrap valign="top"> int main </td>
441           <td class="md" valign="top">(&nbsp;</td>
442           <td class="md" nowrap valign="top">int&nbsp;</td>
443           <td class="mdname" nowrap> <em>argc</em>, </td>
444         </tr>
445         <tr>
446           <td></td>
447           <td></td>
448           <td class="md" nowrap>char **&nbsp;</td>
449           <td class="mdname" nowrap> <em>argv</em></td>
450         </tr>
451         <tr>
452           <td></td>
453           <td class="md">)&nbsp;</td>
454           <td class="md" colspan="2"></td>
455         </tr>
456
457       </table>
458     </td>
459   </tr>
460 </table>
461 <table cellspacing=5 cellpadding=0 border=0>
462   <tr>
463     <td>
464       &nbsp;
465     </td>
466     <td>
467
468 <p>
469
470 <p>
471 Definition at line <a class="el" href="pairwise_8c-source.html#l00253">253</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
472 <p>
473 References <a class="el" href="pairwise_8c-source.html#l00160">check_length()</a>, <a class="el" href="pairwise_8c-source.html#l00106">pairwise()</a>, <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>, and <a class="el" href="pairwise_8c-source.html#l00065">xfopen()</a>.
474 <p>
475 <div class="fragment"><pre>00253                              {
476 00254         FILE *fh;
477 00255         <span class="keyword">struct </span><a class="code" href="structfasta.html">fasta</a> **array;
478 00256         <span class="keywordtype">int</span> i = 0, j;
479 00257 
480 00258         <span class="comment">/* Read in the FASTA file */</span>
481 00259         <span class="keywordflow">if</span> (argc == 2) 
482 00260                 fh = <a class="code" href="pairwise_8c.html#a8">xfopen</a>(argv[1], <span class="stringliteral">"r"</span>);
483 00261         <span class="keywordflow">else</span>
484 00262                 fh = stdin;
485 00263 
486 00264         array = <a class="code" href="pairwise_8c.html#a15">read_fasta</a>(fh);
487 00265         fclose(fh);
488 00266 
489 00267         <a class="code" href="pairwise_8c.html#a14">check_length</a>(array);
490 00268         
491 00269         <span class="comment">/* start the OC output */</span>
492 00270         <span class="keywordflow">while</span> (array[i] != NULL)
493 00271                 i++;
494 00272 
495 00273         fprintf(stdout, <span class="stringliteral">"%i\n"</span>, i);
496 00274 
497 00275         <span class="keywordflow">for</span> (i = 0; array[i] != NULL; i++)
498 00276                 fprintf(stdout, <span class="stringliteral">"%s\n"</span>, array[i]-&gt;id);
499 00277         
500 00278         <span class="comment">/* do the pairwise comparison */</span>
501 00279         <span class="keywordflow">for</span> (i = 0; array[i] != NULL; i++) {
502 00280                 <span class="keywordflow">for</span> (j = i + 1; array[j] != NULL; j++) {
503 00281                         printf(<span class="stringliteral">"%f\n"</span>, <a class="code" href="pairwise_8c.html#a12">pairwise</a>(array[i], array[j]));
504 00282                 }
505 00283         }
506 00284 
507 00285         <span class="keywordflow">return</span> EXIT_SUCCESS;
508 00286 }
509 </pre></div>    </td>
510   </tr>
511 </table>
512
513 <p>
514 Here is the call graph for this function:<p><center><img src="pairwise_8c_a16_cgraph.png" border="0" usemap="#pairwise_8c_a16_cgraph_map" alt=""></center>
515 <map name="pairwise_8c_a16_cgraph_map">
516 <area href="pairwise_8h.html#a7" shape="rect" coords="108,5,201,24" alt="">
517 <area href="pairwise_8h.html#a5" shape="rect" coords="124,48,185,67" alt="">
518 <area href="pairwise_8h.html#a8" shape="rect" coords="116,209,193,228" alt="">
519 <area href="pairwise_8h.html#a1" shape="rect" coords="263,92,316,111" alt="">
520 <area href="pairwise_8h.html#a0" shape="rect" coords="252,5,327,24" alt="">
521 <area href="pairwise_8h.html#a4" shape="rect" coords="271,48,308,67" alt="">
522 <area href="pairwise_8h.html#a6" shape="rect" coords="377,153,444,172" alt="">
523 <area href="pairwise_8c.html#a15" shape="rect" coords="251,209,328,228" alt="">
524 <area href="pairwise_8c.html#a9" shape="rect" coords="381,252,440,271" alt="">
525 <area href="pairwise_8h.html#a3" shape="rect" coords="380,209,441,228" alt="">
526 <area href="pairwise_8c.html#a7" shape="rect" coords="492,209,596,228" alt="">
527 </map>
528 <a name="a12" doxytag="pairwise.c::pairwise"></a><p>
529 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
530   <tr>
531     <td class="mdRow">
532       <table cellpadding="0" cellspacing="0" border="0">
533         <tr>
534           <td class="md" nowrap valign="top"> float pairwise </td>
535           <td class="md" valign="top">(&nbsp;</td>
536           <td class="md" nowrap valign="top">struct <a class="el" href="structfasta.html">fasta</a> *&nbsp;</td>
537           <td class="mdname" nowrap> <em>a</em>, </td>
538         </tr>
539         <tr>
540           <td></td>
541           <td></td>
542           <td class="md" nowrap>struct <a class="el" href="structfasta.html">fasta</a> *&nbsp;</td>
543           <td class="mdname" nowrap> <em>b</em></td>
544         </tr>
545         <tr>
546           <td></td>
547           <td class="md">)&nbsp;</td>
548           <td class="md" colspan="2"></td>
549         </tr>
550
551       </table>
552     </td>
553   </tr>
554 </table>
555 <table cellspacing=5 cellpadding=0 border=0>
556   <tr>
557     <td>
558       &nbsp;
559     </td>
560     <td>
561
562 <p>
563
564 <p>
565 Definition at line <a class="el" href="pairwise_8c-source.html#l00106">106</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
566 <p>
567 References <a class="el" href="pairwise_8c-source.html#l00092">diff()</a>, <a class="el" href="pairwise_8h-source.html#l00007">fasta::end</a>, <a class="el" href="pairwise_8c-source.html#l00035">MAX</a>, <a class="el" href="pairwise_8c-source.html#l00039">MIN</a>, <a class="el" href="pairwise_8h-source.html#l00008">fasta::numres</a>, <a class="el" href="pairwise_8h-source.html#l00005">fasta::seq</a>, and <a class="el" href="pairwise_8h-source.html#l00006">fasta::start</a>.
568 <p>
569 Referenced by <a class="el" href="pairwise_8c-source.html#l00253">main()</a>.
570 <p>
571 <div class="fragment"><pre>00106                                             {
572 00107         <span class="keywordtype">float</span> result;
573 00108         <span class="keywordtype">int</span> start, end, numres, i, id = 0;
574 00109         
575 00110         <span class="comment">/* If the sequences don't overlap then the seq ID is 0 */</span>
576 00111         <span class="keywordflow">if</span> (a-&gt;<a class="code" href="structfasta.html#o3">end</a> &lt; b-&gt;<a class="code" href="structfasta.html#o2">start</a> || a-&gt;<a class="code" href="structfasta.html#o2">start</a> &gt; b-&gt;<a class="code" href="structfasta.html#o3">end</a>)
577 00112                 <span class="keywordflow">return</span> 0;
578 00113 
579 00114         start = <a class="code" href="pairwise_8c.html#a3">MIN</a>( a-&gt;<a class="code" href="structfasta.html#o2">start</a>, b-&gt;<a class="code" href="structfasta.html#o2">start</a> );
580 00115         end = <a class="code" href="pairwise_8c.html#a2">MAX</a>( a-&gt;<a class="code" href="structfasta.html#o3">end</a>, b-&gt;<a class="code" href="structfasta.html#o3">end</a> );
581 00116         numres = <a class="code" href="pairwise_8c.html#a2">MAX</a>( a-&gt;<a class="code" href="structfasta.html#o4">numres</a>, b-&gt;<a class="code" href="structfasta.html#o4">numres</a> );
582 00117 
583 00118         <span class="keywordflow">for</span> (i = start; i &lt; end; i++)
584 00119                 id += <a class="code" href="pairwise_8c.html#a11">diff</a>(a-&gt;<a class="code" href="structfasta.html#o1">seq</a>[i], b-&gt;<a class="code" href="structfasta.html#o1">seq</a>[i]);
585 00120 
586 00121         result = 100 * (<span class="keywordtype">float</span>) id / (<span class="keywordtype">float</span>) numres;
587 00122 
588 00123         <span class="keywordflow">return</span> result;
589 00124 }
590 </pre></div>    </td>
591   </tr>
592 </table>
593
594 <p>
595 Here is the call graph for this function:<p><center><img src="pairwise_8c_a12_cgraph.png" border="0" usemap="#pairwise_8c_a12_cgraph_map" alt=""></center>
596 <map name="pairwise_8c_a12_cgraph_map">
597 <area href="pairwise_8h.html#a4" shape="rect" coords="131,5,168,23" alt="">
598 </map>
599 <a name="a13" doxytag="pairwise.c::populate"></a><p>
600 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
601   <tr>
602     <td class="mdRow">
603       <table cellpadding="0" cellspacing="0" border="0">
604         <tr>
605           <td class="md" nowrap valign="top"> void populate </td>
606           <td class="md" valign="top">(&nbsp;</td>
607           <td class="md" nowrap valign="top">struct <a class="el" href="structfasta.html">fasta</a> *&nbsp;</td>
608           <td class="mdname1" valign="top" nowrap> <em>a</em>          </td>
609           <td class="md" valign="top">&nbsp;)&nbsp;</td>
610           <td class="md" nowrap></td>
611         </tr>
612
613       </table>
614     </td>
615   </tr>
616 </table>
617 <table cellspacing=5 cellpadding=0 border=0>
618   <tr>
619     <td>
620       &nbsp;
621     </td>
622     <td>
623
624 <p>
625
626 <p>
627 Definition at line <a class="el" href="pairwise_8c-source.html#l00133">133</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
628 <p>
629 References <a class="el" href="pairwise_8h-source.html#l00007">fasta::end</a>, <a class="el" href="pairwise_8h-source.html#l00008">fasta::numres</a>, <a class="el" href="pairwise_8h-source.html#l00005">fasta::seq</a>, and <a class="el" href="pairwise_8h-source.html#l00006">fasta::start</a>.
630 <p>
631 Referenced by <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.
632 <p>
633 <div class="fragment"><pre>00133                            {
634 00134         <span class="keywordtype">int</span> i;
635 00135         <span class="keywordtype">int</span> len = strlen(a-&gt;<a class="code" href="structfasta.html#o1">seq</a>);
636 00136 
637 00137         a-&gt;<a class="code" href="structfasta.html#o4">numres</a> = 0;
638 00138         
639 00139         <span class="keywordflow">for</span> (i = 0; i &lt;= len; i++) {
640 00140                 <span class="keywordflow">if</span> (a-&gt;<a class="code" href="structfasta.html#o1">seq</a>[i] != <span class="charliteral">'-'</span>) {
641 00141                         a-&gt;<a class="code" href="structfasta.html#o2">start</a> = i;
642 00142                         <span class="keywordflow">break</span>;
643 00143                 }
644 00144         }
645 00145         <span class="keywordflow">for</span> (i = len; i &gt; 0; i--) {
646 00146                 <span class="keywordflow">if</span> (a-&gt;<a class="code" href="structfasta.html#o1">seq</a>[i] != <span class="charliteral">'-'</span>) {
647 00147                         a-&gt;<a class="code" href="structfasta.html#o3">end</a> = i;
648 00148                         <span class="keywordflow">break</span>;
649 00149                 }
650 00150         }
651 00151         <span class="keywordflow">for</span> (i = a-&gt;<a class="code" href="structfasta.html#o2">start</a>; i &lt; a-&gt;<a class="code" href="structfasta.html#o3">end</a>; i++) {
652 00152                 <span class="keywordflow">if</span> (a-&gt;<a class="code" href="structfasta.html#o1">seq</a>[i] != <span class="charliteral">'-'</span>) {
653 00153                         a-&gt;<a class="code" href="structfasta.html#o4">numres</a>++;
654 00154                 }
655 00155         }
656 00156 }
657 </pre></div>    </td>
658   </tr>
659 </table>
660 <a name="a15" doxytag="pairwise.c::read_fasta"></a><p>
661 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
662   <tr>
663     <td class="mdRow">
664       <table cellpadding="0" cellspacing="0" border="0">
665         <tr>
666           <td class="md" nowrap valign="top"> struct <a class="el" href="structfasta.html">fasta</a>** read_fasta </td>
667           <td class="md" valign="top">(&nbsp;</td>
668           <td class="md" nowrap valign="top">FILE *&nbsp;</td>
669           <td class="mdname1" valign="top" nowrap> <em>fh</em>          </td>
670           <td class="md" valign="top">&nbsp;)&nbsp;</td>
671           <td class="md" nowrap></td>
672         </tr>
673
674       </table>
675     </td>
676   </tr>
677 </table>
678 <table cellspacing=5 cellpadding=0 border=0>
679   <tr>
680     <td>
681       &nbsp;
682     </td>
683     <td>
684
685 <p>
686
687 <p>
688 Definition at line <a class="el" href="pairwise_8c-source.html#l00179">179</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
689 <p>
690 References <a class="el" href="pairwise_8c-source.html#l00029">ARRAY</a>, <a class="el" href="pairwise_8c-source.html#l00030">FILEBUF</a>, <a class="el" href="pairwise_8h-source.html#l00004">fasta::id</a>, <a class="el" href="pairwise_8h-source.html#l00008">fasta::numres</a>, <a class="el" href="pairwise_8c-source.html#l00133">populate()</a>, <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>, <a class="el" href="pairwise_8h-source.html#l00005">fasta::seq</a>, <a class="el" href="pairwise_8c-source.html#l00074">xmalloc()</a>, and <a class="el" href="pairwise_8c-source.html#l00083">xrealloc()</a>.
691 <p>
692 Referenced by <a class="el" href="pairwise_8c-source.html#l00253">main()</a>, and <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.
693 <p>
694 <div class="fragment"><pre>00179                       {
695 00180         <span class="keywordtype">int</span> i, j, k, c, filesize = 1;
696 00181         <span class="keywordtype">char</span> *file;
697 00182         <span class="keyword">struct </span><a class="code" href="structfasta.html">fasta</a> **array;
698 00183 
699 00184         array = (<span class="keyword">struct </span><a class="code" href="structfasta.html">fasta</a> **) <a class="code" href="pairwise_8c.html#a9">xmalloc</a>(<a class="code" href="pairwise_8c.html#a0">ARRAY</a> * sizeof(struct fasta *));
700 00185         file = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a9">xmalloc</a>(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
701 00186 
702 00187         <span class="comment">/* Allocate initial space for the file */</span>
703 00188         file = <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(file, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * filesize);
704 00189         file[filesize] = <span class="charliteral">'\0'</span>;
705 00190 
706 00191         <span class="comment">/* Read in the file */</span>
707 00192         <span class="keywordflow">while</span> ((c = getc(fh)) != EOF) {
708 00193                 <span class="keywordflow">if</span> (filesize % <a class="code" href="pairwise_8c.html#a1">FILEBUF</a>)
709 00194                         file = <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(file, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (FILEBUF + filesize));
710 00195 
711 00196                 file[filesize] = c;
712 00197                 filesize++;
713 00198         }
714 00199 
715 00200         <span class="comment">/* Parse the FASTA file into an array of structures */</span>
716 00201         <span class="keywordflow">for</span> (i = 0, j = 0, k = 0; i &lt; filesize; i++) {
717 00202                 <span class="keywordflow">if</span> (file[i] == <span class="charliteral">'&gt;'</span>) {
718 00203                         <span class="keywordflow">if</span> (j % <a class="code" href="pairwise_8c.html#a0">ARRAY</a> == 0)
719 00204                                 array = (<span class="keyword">struct </span>fasta **) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array, sizeof(struct fasta *) * (j + <a class="code" href="pairwise_8c.html#a0">ARRAY</a>));
720 00205 
721 00206                         array[j] = (<span class="keyword">struct </span>fasta *) <a class="code" href="pairwise_8c.html#a9">xmalloc</a>(sizeof(struct fasta));
722 00207                         array[j]-&gt;<a class="code" href="structfasta.html#o0">id</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a9">xmalloc</a>(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
723 00208                         array[j]-&gt;<a class="code" href="structfasta.html#o1">seq</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a9">xmalloc</a>(<span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
724 00209                         array[j]-&gt;<a class="code" href="structfasta.html#o4">numres</a> = 0;
725 00210 
726 00211                         i++;
727 00212                         <span class="keywordflow">while</span> (file[i] != <span class="charliteral">'\0'</span> &amp;&amp; file[i] != <span class="charliteral">'\n'</span>) {
728 00213                                 <span class="keywordflow">if</span> (k % <a class="code" href="pairwise_8c.html#a0">ARRAY</a> == 0)
729 00214                                         array[j]-&gt;<a class="code" href="structfasta.html#o0">id</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array[j]-&gt;id, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (ARRAY + k));
730 00215                                 array[j]-&gt;<a class="code" href="structfasta.html#o0">id</a>[k] = file[i];
731 00216                                 k++; i++;
732 00217                         }
733 00218                         array[j]-&gt;<a class="code" href="structfasta.html#o0">id</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array[j]-&gt;id, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (ARRAY + k));
734 00219                         array[j]-&gt;<a class="code" href="structfasta.html#o0">id</a>[k] = <span class="charliteral">'\0'</span>;
735 00220                         k = 0;
736 00221 
737 00222                         <span class="keywordflow">while</span> (file[i] != <span class="charliteral">'\0'</span> &amp;&amp; file[i] != <span class="charliteral">'&gt;'</span>) {
738 00223                                 <span class="keywordflow">if</span> (file[i] == <span class="charliteral">'\n'</span>) {
739 00224                                         i++;
740 00225                                         <span class="keywordflow">continue</span>;
741 00226                                 }
742 00227                                 <span class="keywordflow">if</span> (k % <a class="code" href="pairwise_8c.html#a0">ARRAY</a> == 0)
743 00228                                         array[j]-&gt;<a class="code" href="structfasta.html#o1">seq</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array[j]-&gt;seq, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (ARRAY + k));
744 00229                                 array[j]-&gt;<a class="code" href="structfasta.html#o1">seq</a>[k] = file[i];
745 00230                                 k++; i++;
746 00231                         }
747 00232                         array[j]-&gt;<a class="code" href="structfasta.html#o1">seq</a> = (<span class="keywordtype">char</span> *) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array[j]-&gt;seq, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>) * (ARRAY + k));
748 00233                         array[j]-&gt;<a class="code" href="structfasta.html#o1">seq</a>[k] = <span class="charliteral">'\0'</span>;
749 00234                         k = 0;
750 00235                         i--;
751 00236                         j++;
752 00237                 }
753 00238         }
754 00239 
755 00240         free(file);
756 00241         array = (<span class="keyword">struct </span>fasta **) <a class="code" href="pairwise_8c.html#a10">xrealloc</a>(array, sizeof(struct fasta *) * j);
757 00242         array[j] = NULL;
758 00243 
759 00244         <span class="comment">/* find the start and end points for the alignments */</span>
760 00245         <span class="keywordflow">for</span> (i = 0; array[i] != NULL; i++) {
761 00246                 <a class="code" href="pairwise_8c.html#a13">populate</a>(array[i]);
762 00247         }
763 00248 
764 00249         <span class="keywordflow">return</span> array;
765 00250 }
766 </pre></div>    </td>
767   </tr>
768 </table>
769
770 <p>
771 Here is the call graph for this function:<p><center><img src="pairwise_8c_a15_cgraph.png" border="0" usemap="#pairwise_8c_a15_cgraph_map" alt=""></center>
772 <map name="pairwise_8c_a15_cgraph_map">
773 <area href="pairwise_8h.html#a6" shape="rect" coords="145,5,212,24" alt="">
774 <area href="pairwise_8c.html#a9" shape="rect" coords="149,48,208,67" alt="">
775 <area href="pairwise_8h.html#a3" shape="rect" coords="148,91,209,109" alt="">
776 <area href="pairwise_8c.html#a7" shape="rect" coords="260,69,364,88" alt="">
777 </map>
778 <a name="a8" doxytag="pairwise.c::xfopen"></a><p>
779 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
780   <tr>
781     <td class="mdRow">
782       <table cellpadding="0" cellspacing="0" border="0">
783         <tr>
784           <td class="md" nowrap valign="top"> FILE* xfopen </td>
785           <td class="md" valign="top">(&nbsp;</td>
786           <td class="md" nowrap valign="top">const char *&nbsp;</td>
787           <td class="mdname" nowrap> <em>path</em>, </td>
788         </tr>
789         <tr>
790           <td></td>
791           <td></td>
792           <td class="md" nowrap>const char *&nbsp;</td>
793           <td class="mdname" nowrap> <em>mode</em></td>
794         </tr>
795         <tr>
796           <td></td>
797           <td class="md">)&nbsp;</td>
798           <td class="md" colspan="2"></td>
799         </tr>
800
801       </table>
802     </td>
803   </tr>
804 </table>
805 <table cellspacing=5 cellpadding=0 border=0>
806   <tr>
807     <td>
808       &nbsp;
809     </td>
810     <td>
811
812 <p>
813
814 <p>
815 Definition at line <a class="el" href="pairwise_8c-source.html#l00065">65</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
816 <p>
817 References <a class="el" href="pairwise_8c-source.html#l00059">fatal_sys_error()</a>.
818 <p>
819 Referenced by <a class="el" href="pairwise_8c-source.html#l00253">main()</a>.
820 <p>
821 <div class="fragment"><pre>00065                                             {
822 00066         FILE *fh;
823 00067         fh = fopen(path, mode);
824 00068         <span class="keywordflow">if</span> (fh == NULL)
825 00069                 <a class="code" href="pairwise_8c.html#a7">fatal_sys_error</a>(<span class="stringliteral">"fopen returned NULL"</span>);
826 00070         <span class="keywordflow">return</span> fh;
827 00071 }
828 </pre></div>    </td>
829   </tr>
830 </table>
831
832 <p>
833 Here is the call graph for this function:<p><center><img src="pairwise_8c_a8_cgraph.png" border="0" usemap="#pairwise_8c_a8_cgraph_map" alt=""></center>
834 <map name="pairwise_8c_a8_cgraph_map">
835 <area href="pairwise_8c.html#a7" shape="rect" coords="121,5,225,23" alt="">
836 </map>
837 <a name="a9" doxytag="pairwise.c::xmalloc"></a><p>
838 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
839   <tr>
840     <td class="mdRow">
841       <table cellpadding="0" cellspacing="0" border="0">
842         <tr>
843           <td class="md" nowrap valign="top"> void* xmalloc </td>
844           <td class="md" valign="top">(&nbsp;</td>
845           <td class="md" nowrap valign="top">size_t&nbsp;</td>
846           <td class="mdname1" valign="top" nowrap> <em>size</em>          </td>
847           <td class="md" valign="top">&nbsp;)&nbsp;</td>
848           <td class="md" nowrap></td>
849         </tr>
850
851       </table>
852     </td>
853   </tr>
854 </table>
855 <table cellspacing=5 cellpadding=0 border=0>
856   <tr>
857     <td>
858       &nbsp;
859     </td>
860     <td>
861
862 <p>
863
864 <p>
865 Definition at line <a class="el" href="pairwise_8c-source.html#l00074">74</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
866 <p>
867 References <a class="el" href="pairwise_8c-source.html#l00059">fatal_sys_error()</a>.
868 <p>
869 Referenced by <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.
870 <p>
871 <div class="fragment"><pre>00074                       {
872 00075         <span class="keywordtype">void</span> *ptr;
873 00076         ptr = (<span class="keywordtype">void</span> *) malloc(size);
874 00077         <span class="keywordflow">if</span> (ptr == NULL)
875 00078                 <a class="code" href="pairwise_8c.html#a7">fatal_sys_error</a>(<span class="stringliteral">"malloc returned NULL"</span>);
876 00079         <span class="keywordflow">return</span> ptr;
877 00080 }
878 </pre></div>    </td>
879   </tr>
880 </table>
881
882 <p>
883 Here is the call graph for this function:<p><center><img src="pairwise_8c_a9_cgraph.png" border="0" usemap="#pairwise_8c_a9_cgraph_map" alt=""></center>
884 <map name="pairwise_8c_a9_cgraph_map">
885 <area href="pairwise_8c.html#a7" shape="rect" coords="127,5,231,23" alt="">
886 </map>
887 <a name="a10" doxytag="pairwise.c::xrealloc"></a><p>
888 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
889   <tr>
890     <td class="mdRow">
891       <table cellpadding="0" cellspacing="0" border="0">
892         <tr>
893           <td class="md" nowrap valign="top"> void* xrealloc </td>
894           <td class="md" valign="top">(&nbsp;</td>
895           <td class="md" nowrap valign="top">void *&nbsp;</td>
896           <td class="mdname" nowrap> <em>ptr</em>, </td>
897         </tr>
898         <tr>
899           <td></td>
900           <td></td>
901           <td class="md" nowrap>size_t&nbsp;</td>
902           <td class="mdname" nowrap> <em>size</em></td>
903         </tr>
904         <tr>
905           <td></td>
906           <td class="md">)&nbsp;</td>
907           <td class="md" colspan="2"></td>
908         </tr>
909
910       </table>
911     </td>
912   </tr>
913 </table>
914 <table cellspacing=5 cellpadding=0 border=0>
915   <tr>
916     <td>
917       &nbsp;
918     </td>
919     <td>
920
921 <p>
922
923 <p>
924 Definition at line <a class="el" href="pairwise_8c-source.html#l00083">83</a> of file <a class="el" href="pairwise_8c-source.html">pairwise.c</a>.
925 <p>
926 References <a class="el" href="pairwise_8c-source.html#l00059">fatal_sys_error()</a>.
927 <p>
928 Referenced by <a class="el" href="pairwise_8c-source.html#l00179">read_fasta()</a>.
929 <p>
930 <div class="fragment"><pre>00083                                   {
931 00084         ptr = (<span class="keywordtype">void</span> *) realloc(ptr, size);
932 00085         <span class="keywordflow">if</span> (ptr == NULL &amp;&amp; size != 0)
933 00086                 <a class="code" href="pairwise_8c.html#a7">fatal_sys_error</a>(<span class="stringliteral">"realloc returned NULL"</span>);
934 00087         <span class="keywordflow">return</span> ptr;
935 00088 }
936 </pre></div>    </td>
937   </tr>
938 </table>
939
940 <p>
941 Here is the call graph for this function:<p><center><img src="pairwise_8c_a10_cgraph.png" border="0" usemap="#pairwise_8c_a10_cgraph_map" alt=""></center>
942 <map name="pairwise_8c_a10_cgraph_map">
943 <area href="pairwise_8c.html#a7" shape="rect" coords="127,5,231,23" alt="">
944 </map>
945 <hr size="1"><address style="align: right;"><small>Generated on Thu Jul 24 12:17:51 2003 for pairwise by
946 <a href="http://www.doxygen.org/index.html">
947 <img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
948 </a>1.3.2 </small></address>
949 </body>
950 </html>