]> git.donarmstrong.com Git - samtools.git/blob - sam.h
* samtools-0.1.3-12 (r259)
[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         int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *func_data);
26
27 #ifdef __cplusplus
28 }
29 #endif
30
31 #endif