header->text[header->l_text] = 0;
}
+int samthreads(samfile_t *fp, int n_threads, int n_sub_blks)
+{
+ if (!(fp->type&1) || (fp->type&2)) return -1;
+ bgzf_mt(fp->x.bam, n_threads, n_sub_blks);
+ return 0;
+}
+
samfile_t *samopen(const char *fn, const char *mode, const void *aux)
{
samfile_t *fp;
} else { // text
// open file
fp->x.tamw = strcmp(fn, "-")? fopen(fn, "w") : stdout;
- if (fp->x.tamr == 0) goto open_err_ret;
+ if (fp->x.tamw == 0) goto open_err_ret;
if (strchr(mode, 'X')) fp->type |= BAM_OFSTR<<2;
else if (strchr(mode, 'x')) fp->type |= BAM_OFHEX<<2;
else fp->type |= BAM_OFDEC<<2;