68315931f4a9ec4272a8df76e6a881339717ac16 braney Wed Jun 1 15:37:37 2016 -0700 changes to support longTabix files in hgIntegrator diff --git src/lib/bedTabix.c src/lib/bedTabix.c index 531dc57..a5b4dfc 100644 --- src/lib/bedTabix.c +++ src/lib/bedTabix.c @@ -1,40 +1,41 @@ #include "bedTabix.h" struct bedTabixFile *bedTabixFileMayOpen(char *fileOrUrl, char *chrom, int start, int end) { struct lineFile *lf = lineFileTabixMayOpen(fileOrUrl, TRUE); if (lf == NULL) return NULL; struct bedTabixFile *btf; AllocVar(btf); btf->lf = lf; if (isNotEmpty(chrom) && start != end) { lineFileSetTabixRegion(lf, chrom, start, end); } return btf; } struct bed *bedTabixReadBeds(struct bedTabixFile *btf, char *chrom, int start, int end, struct bed * (*loadBed)(void *tg)) { struct bed *bedList = NULL; int wordCount; char *words[100]; if (!lineFileSetTabixRegion(btf->lf, chrom, start, end)) return NULL; while ((wordCount = lineFileChopTab(btf->lf, words)) > 0) { struct bed *bed = loadBed(words); slAddHead(&bedList, bed); } return bedList; } -void bedTabixFileClose(struct bedTabixFile *btf) +void bedTabixFileClose(struct bedTabixFile **pBtf) { -lineFileClose(&btf->lf); +lineFileClose(&((*pBtf)->lf)); +*pBtf = NULL; }