-
-int bam_lpileup_file(bamFile fp, int mask, bam_pileup_f func, void *func_data)
-{
- bam_lplbuf_t *buf;
- int ret;
- bam1_t *b;
- b = (bam1_t*)calloc(1, sizeof(bam1_t));
- buf = bam_lplbuf_init(func, func_data);
- bam_plbuf_set_mask(buf->plbuf, mask);
- while ((ret = bam_read1(fp, b)) >= 0)
- bam_lplbuf_push(b, buf);
- bam_lplbuf_push(0, buf);
- bam_lplbuf_destroy(buf);
- free(b->data); free(b);
- return 0;
-}