fastq_t* fastq_open(FILE* f)
{
fastq_t* fqf = malloc_or_die(sizeof(fastq_t));
- or_die((int)(fqf->file = gzdopen(fileno(f), "rb")),
+ or_die((int)((fqf->file = gzdopen(fileno(f), "rb")) != NULL),
"Can not open gzip file.");
fqf->state = STATE_ID1;
void fastq_get_line(fastq_t* f, str_t* s)
{
- int i = 0;
+ size_t i = 0;
if (f->state == STATE_EOF) goto fastq_get_line_done;
}
/* skip comments */
+ /*
else if (*f->c == ';') {
fastq_get_line(f, NULL);
if (f->state == STATE_EOF) return 0;
}
+ */
/* read id1 */
else if (f->state == STATE_ID1) {
}
+void fastq_rewind(fastq_t* fqf)
+{
+ gzrewind(fqf->file);
+ fqf->state = STATE_ID1;
+ fqf->buf[0] = '\0';
+ fqf->c = fqf->buf;
+}
+
+
void fastq_print(FILE* fout, seq_t* seq)
{
/* FASTQ */