]> git.donarmstrong.com Git - samtools.git/blobdiff - bcftools/bcf.h
use zlib for direct reading when BCF_LITE is in use
[samtools.git] / bcftools / bcf.h
index 89feeb89ac3bd2e278329866996d02e7709414aa..f87ac1e6fa3021964753f051a944fdc95a59549d 100644 (file)
 
 #include <stdint.h>
 #include <zlib.h>
+
+#ifndef BCF_LITE
 #include "bgzf.h"
+typedef BGZF *bcfFile;
+#else
+typedef gzFile bcfFile;
+#define bgzf_open(fn, mode) gzopen(fn, mode)
+#define bgzf_fdopen(fd, mode) gzdopen(fd, mode)
+#define bgzf_close(fp) gzclose(fp)
+#define bgzf_read(fp, buf, len) gzread(fp, buf, len)
+#define bgzf_write(fp, buf, len)
+#define bgzf_flush(fp)
+#endif
 
 /*
   A member in the structs below is said to "primary" if its content
@@ -74,7 +86,7 @@ typedef struct {
 typedef struct {
        int is_vcf; // if the file in operation is a VCF
        void *v; // auxillary data structure for VCF
-       BGZF *fp; // file handler for BCF
+       bcfFile fp; // file handler for BCF
 } bcf_t;
 
 struct __bcf_idx_t;