58a183bd197abcc328541da7d3c221741f3cdcc4 angie Wed Feb 18 10:51:25 2015 -0800 In bbiChromSizesFromFile, use netLineFileOpen instead of lineFileOpen so we can open URLs as well as files. refs #14857 diff --git src/lib/bbiWrite.c src/lib/bbiWrite.c index 709f771..e36f591 100644 --- src/lib/bbiWrite.c +++ src/lib/bbiWrite.c @@ -1,28 +1,29 @@ /* bbiWrite.c - Routines to help write bigWig and bigBed files. See also bbiFile.h */ /* Copyright (C) 2014 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "sqlNum.h" #include "zlibFace.h" #include "cirTree.h" #include "bPlusTree.h" #include "bbiFile.h" +#include "net.h" #include "obscure.h" void bbiWriteDummyHeader(FILE *f) /* Write out all-zero header, just to reserve space for it. */ { repeatCharOut(f, 0, 64); } void bbiWriteDummyZooms(FILE *f) /* Write out zeroes to reserve space for ten zoom levels. */ { repeatCharOut(f, 0, bbiMaxZoomLevels * 24); } void bbiSummaryElementWrite(FILE *f, struct bbiSummaryElement *sum) @@ -81,31 +82,31 @@ f); freeMem(chromInfoArray); } void bbiWriteFloat(FILE *f, float val) /* Write out floating point val to file. Mostly to convert from double... */ { writeOne(f, val); } struct hash *bbiChromSizesFromFile(char *fileName) /* Read two column file into hash keyed by chrom. */ { struct hash *hash = hashNew(0); -struct lineFile *lf = lineFileOpen(fileName, TRUE); +struct lineFile *lf = netLineFileOpen(fileName); char *row[2]; while (lineFileRow(lf, row)) hashAddInt(hash, row[0], sqlUnsigned(row[1])); lineFileClose(&lf); return hash; } void bbiChromInfoKey(const void *va, char *keyBuf) /* Get key field out of bbiChromInfo. */ { const struct bbiChromInfo *a = ((struct bbiChromInfo *)va); strcpy(keyBuf, a->name); }