]> git.donarmstrong.com Git - samtools.git/blob - sam.h
* samtools-0.1.3-11 (r258)
[samtools.git] / sam.h
1 #ifndef BAM_SAM_H
2 #define BAM_SAM_H
3
4 #include "bam.h"
5
6 typedef struct {
7         int type;
8         union {
9                 tamFile tamr;
10                 bamFile bam;
11                 FILE *tamw;
12         } x;
13         bam_header_t *header;
14 } samfile_t;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20         // 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
21         samfile_t *samopen(const char *fn, const char *mode, const void *aux);
22         void samclose(samfile_t *fp);
23         int samread(samfile_t *fp, bam1_t *b);
24         int samwrite(samfile_t *fp, const bam1_t *b);
25
26 #ifdef __cplusplus
27 }
28 #endif
29
30 #endif