X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bam_lite.c;h=93af6c4a8d96e226f2998c80ab929b93f61a4843;hb=f8941aebcb194dbe1ff32c161d3cd51d80805d5d;hp=12c719cccde34ce67916530e7dc299454d7591c5;hpb=ebb53787a79a02cfa51ce5baa303dc9cb805205f;p=samtools.git diff --git a/bam_lite.c b/bam_lite.c index 12c719c..93af6c4 100644 --- a/bam_lite.c +++ b/bam_lite.c @@ -552,6 +552,22 @@ int bam_plbuf_push(const bam1_t *b, bam_plbuf_t *buf) return 0; } +int bam_pileup_file(bamFile fp, int mask, bam_pileup_f func, void *func_data) +{ + bam_plbuf_t *buf; + int ret; + bam1_t *b; + b = bam_init1(); + buf = bam_plbuf_init(func, func_data); + bam_plbuf_set_mask(buf, mask); + while ((ret = bam_read1(fp, b)) >= 0) + bam_plbuf_push(b, buf); + bam_plbuf_push(0, buf); + bam_plbuf_destroy(buf); + bam_destroy1(b); + return 0; +} + /********************** *** from bam_aux.c *** **********************/