]> git.donarmstrong.com Git - samtools.git/blobdiff - sam.h
* samtools-0.1.3-11 (r258)
[samtools.git] / sam.h
diff --git a/sam.h b/sam.h
new file mode 100644 (file)
index 0000000..1e50550
--- /dev/null
+++ b/sam.h
@@ -0,0 +1,30 @@
+#ifndef BAM_SAM_H
+#define BAM_SAM_H
+
+#include "bam.h"
+
+typedef struct {
+       int type;
+       union {
+               tamFile tamr;
+               bamFile bam;
+               FILE *tamw;
+       } x;
+       bam_header_t *header;
+} samfile_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+       // mode can be: r/w/rb/wb. On writing, aux points to bam_header_t; on reading, aux points to the name of fn_list for SAM
+       samfile_t *samopen(const char *fn, const char *mode, const void *aux);
+       void samclose(samfile_t *fp);
+       int samread(samfile_t *fp, bam1_t *b);
+       int samwrite(samfile_t *fp, const bam1_t *b);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif