9705bb76d49dcf669b40cb926c2f00e5827cc61f kent Tue Jan 18 23:57:14 2011 -0800 Moving a bbiFile processing routine from hgTracks to library, so hgc could use it too. Using it to make hgc on bigBed work better. diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index e859a8d..fa4c188 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -5,45 +5,30 @@ #include "common.h" #include "hash.h" #include "linefile.h" #include "jksql.h" #include "hdb.h" #include "bedCart.h" #include "hgTracks.h" #include "hmmstats.h" #include "localmem.h" #include "wigCommon.h" #include "bbiFile.h" #include "obscure.h" #include "bigWig.h" #include "bigBed.h" -char *bbiNameFromSettingOrTable(struct trackDb *tdb, struct sqlConnection *conn, char *table) -/* Return file name from little table. */ -{ -char *fileName = cloneString(trackDbSetting(tdb, "bigDataUrl")); -if (fileName == NULL) - { - char query[256]; - safef(query, sizeof(query), "select fileName from %s", table); - fileName = sqlQuickString(conn, query); - if (fileName == NULL) - errAbort("Missing fileName in %s table", table); - } -return fileName; -} - static struct bbiFile *fetchBbiForTrack(struct track *track) /* Fetch bbiFile from track, opening it if it is not already open. */ { struct bbiFile *bbi = track->bbiFile; if (bbi == NULL) { struct sqlConnection *conn = hAllocConnTrack(database, track->tdb); char *fileName = bbiNameFromSettingOrTable(track->tdb, conn, track->table); hFreeConn(&conn); bbi = track->bbiFile = bigBedFileOpen(fileName); } return bbi; } struct bigBedInterval *bigBedSelectRange(struct track *track,