annotate mrfast-2.1.0.5/Output.c @ 1:d4054b05b015 default tip

Version update to 2.1.0.5
author calkan
date Fri, 09 Mar 2012 07:35:51 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
1 /*
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
2 * Copyright (c) <2008 - 2012>, University of Washington, Simon Fraser University
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
3 * All rights reserved.
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
4 *
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
5 * Redistribution and use in source and binary forms, with or without modification,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
6 * are permitted provided that the following conditions are met:
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
7 *
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
8 * Redistributions of source code must retain the above copyright notice, this list
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
9 * of conditions and the following disclaimer.
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
10 * - Redistributions in binary form must reproduce the above copyright notice, this
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
11 * list of conditions and the following disclaimer in the documentation and/or other
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
12 * materials provided with the distribution.
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
13 * - Neither the names of the University of Washington, Simon Fraser University,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
14 * nor the names of its contributors may be
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
15 * used to endorse or promote products derived from this software without specific
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
16 * prior written permission.
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
17 *
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
22 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
23 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
24 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
26 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
27 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
29 */
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
30
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
31 /*
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
32 Authors:
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
33 Farhad Hormozdiari
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
34 Faraz Hach
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
35 Can Alkan
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
36 Emails:
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
37 farhadh AT uw DOT edu
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
38 fhach AT cs DOT sfu DOT ca
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
39 calkan AT uw DOT edu
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
40 */
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
41
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
42
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
43 #include <stdio.h>
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
44 #include <stdlib.h>
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
45 #include <zlib.h>
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
46 #include <string.h>
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
47 #include "Common.h"
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
48 #include "Output.h"
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
49
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
50 FILE *_out_fp;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
51 gzFile _out_gzfp;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
52
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
53 char buffer[300000];
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
54 int bufferSize = 0;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
55
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
56
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
57 void finalizeGZOutput()
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
58 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
59 gzclose(_out_gzfp);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
60 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
61
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
62 void finalizeTXOutput()
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
63 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
64 fclose(_out_fp);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
65 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
66
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
67
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
68 void gzOutputQ(SAM map)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
69 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
70 gzprintf(_out_gzfp, "%s\t%d\t%s\t%d\t%d\t%s\t%s\t%d\t%d\t%s\t%s",
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
71 map.QNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
72 map.FLAG,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
73 map.RNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
74 map.POS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
75 map.MAPQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
76 map.CIGAR,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
77 map.MRNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
78 map.MPOS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
79 map.ISIZE,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
80 map.SEQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
81 map.QUAL);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
82
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
83 int i;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
84
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
85 for ( i = 0; i < map.optSize; i++)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
86 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
87 switch (map.optFields[i].type)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
88 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
89 case 'A':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
90 gzprintf(_out_gzfp, "\t%s:%c:%c", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].cVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
91 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
92 case 'i':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
93 gzprintf(_out_gzfp, "\t%s:%c:%d", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].iVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
94 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
95 case 'f':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
96 gzprintf(_out_gzfp, "\t%s:%c:%f", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].fVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
97 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
98 case 'Z':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
99 case 'H':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
100 gzprintf(_out_gzfp, "\t%s:%c:%s", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].sVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
101 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
102 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
103 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
104 gzprintf(_out_gzfp, "\n");
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
105 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
106
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
107 void outputSAM(FILE *fp, SAM map)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
108 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
109 fprintf(fp, "%s\t%d\t%s\t%d\t%d\t%s\t%s\t%d\t%d\t%s\t%s",
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
110 map.QNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
111 map.FLAG,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
112 map.RNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
113 map.POS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
114 map.MAPQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
115 map.CIGAR,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
116 map.MRNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
117 map.MPOS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
118 map.ISIZE,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
119 map.SEQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
120 map.QUAL);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
121
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
122
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
123 int i;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
124
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
125 for ( i = 0; i < map.optSize; i++)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
126 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
127 switch (map.optFields[i].type)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
128 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
129 case 'A':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
130 fprintf(fp, "\t%s:%c:%c", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].cVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
131 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
132 case 'i':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
133 fprintf(fp, "\t%s:%c:%d", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].iVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
134 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
135 case 'f':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
136 fprintf(fp, "\t%s:%c:%f", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].fVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
137 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
138 case 'Z':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
139 case 'H':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
140 fprintf(fp, "\t%s:%c:%s", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].sVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
141 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
142 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
143 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
144
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
145 fprintf(fp, "\n");
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
146
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
147 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
148
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
149 void outputQ(SAM map)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
150 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
151
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
152 fprintf(_out_fp, "%s\t%d\t%s\t%d\t%d\t%s\t%s\t%d\t%d\t%s\t%s",
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
153 map.QNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
154 map.FLAG,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
155 map.RNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
156 map.POS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
157 map.MAPQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
158 map.CIGAR,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
159 map.MRNAME,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
160 map.MPOS,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
161 map.ISIZE,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
162 map.SEQ,
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
163 map.QUAL);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
164
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
165
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
166 int i;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
167
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
168 for ( i = 0; i < map.optSize; i++)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
169 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
170 switch (map.optFields[i].type)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
171 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
172 case 'A':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
173 fprintf(_out_fp, "\t%s:%c:%c", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].cVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
174 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
175 case 'i':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
176 fprintf(_out_fp, "\t%s:%c:%d", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].iVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
177 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
178 case 'f':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
179 fprintf(_out_fp, "\t%s:%c:%f", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].fVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
180 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
181 case 'Z':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
182 case 'H':
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
183 fprintf(_out_fp, "\t%s:%c:%s", map.optFields[i].tag, map.optFields[i].type, map.optFields[i].sVal);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
184 break;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
185 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
186 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
187
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
188 fprintf(_out_fp, "\n");
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
189 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
190
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
191 int initOutput ( char *fileName, int compressed)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
192 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
193 if (compressed)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
194 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
195 char newFileName[strlen(fileName)+4];
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
196 sprintf(newFileName, "%s.gz", fileName);
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
197
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
198 _out_gzfp = fileOpenGZ(newFileName, "w1f");
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
199 if (_out_gzfp == Z_NULL)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
200 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
201 return 0;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
202 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
203
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
204 finalizeOutput = &finalizeGZOutput;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
205
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
206 output = &gzOutputQ;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
207 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
208 else
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
209 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
210 _out_fp = fileOpen(fileName, "w");
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
211 if (_out_fp == NULL)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
212 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
213 return 0;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
214 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
215
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
216 finalizeOutput = &finalizeTXOutput;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
217 output = &outputQ;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
218 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
219 buffer[0] = '\0';
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
220 return 1;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
221 }
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
222
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
223 FILE* getOutputFILE()
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
224 {
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
225 if(_out_fp != NULL)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
226 return _out_fp;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
227 else if(_out_gzfp != NULL)
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
228 return _out_gzfp;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
229 else
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
230 return NULL;
d4054b05b015 Version update to 2.1.0.5
calkan
parents:
diff changeset
231 }