Imported Upstream version 0.1.10
[samtools.git] / bcftools / bcf.h
index 36578956bbae06d4c216c121a2ddb3a94cad94d8..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;
@@ -128,6 +140,8 @@ extern "C" {
        int bcf_shrink_alt(bcf1_t *b, int n);
        // convert GL to PL
        int bcf_gl2pl(bcf1_t *b);
+       // if the site is an indel
+       int bcf_is_indel(const bcf1_t *b);
 
        // string hash table
        void *bcf_build_refhash(bcf_hdr_t *h);