void lineFileClose(struct lineFile **pLf) /* Close up a line file. */ { struct lineFile *lf; if ((lf = *pLf) != NULL) { if (lf->pl != NULL) { pipelineWait(lf->pl); pipelineFree(&lf->pl); } else if (lf->fd > 0 && lf->fd != fileno(stdin)) { close(lf->fd); freeMem(lf->buf); } #ifdef USE_TABIX else if (lf->tabix != NULL) { if (lf->tabixIter != NULL) ti_iter_destroy(lf->tabixIter); ti_close(lf->tabix); } #endif // USE_TABIX freeMem(lf->fileName); metaDataFree(lf); freez(pLf); } }
void lineFileClose(struct lineFile **pLf) /* Close up a line file. */ { struct lineFile *lf; if ((lf = *pLf) != NULL) { if (lf->pl != NULL) { pipelineWait(lf->pl); pipelineFree(&lf->pl); } else if (lf->fd > 0 && lf->fd != fileno(stdin)) { close(lf->fd); freeMem(lf->buf); } freeMem(lf->fileName); metaDataFree(lf); freez(pLf); } }