d5cbd45d0d3db423db2dbad15c653961c0bd29ac hiram Wed Feb 27 13:57:14 2019 -0800 one stop shopping for trackDb now in obtainTdb() function refs #18869 diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index 77d64ed..55fb6c2 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -172,31 +172,31 @@ // else // hPrintf("
  • %s: NO children
  • \n", tdb->track); struct hashEl *hel; struct hashCookie hc = hashFirst(tdb->settingsHash); while ((hel = hashNext(&hc)) != NULL) { if (sameWord("track", hel->name)) continue; // already output in header if (isEmpty((char *)hel->val)) hPrintf("
  • %s : <empty>
  • \n", hel->name); else hPrintf("
  • %s : '%s'
  • \n", hel->name, (char *)hel->val); } if (tdb->subtracks) { - struct trackDb *tdbEl = tdb->subtracks; + struct trackDb *tdbEl = NULL; hPrintf("
  • has %d subtrack(s)
  • \n", slCount(tdb->subtracks)); for (tdbEl = tdb->subtracks; tdbEl; tdbEl = tdbEl->next) { hPrintf("
  • subtrack: %s of parent: %s : type: '%s'
  • \n", tdbEl->track, tdbEl->parent->track, tdbEl->type); hashCountTrack(tdbEl, countTracks); trackSettings(tdbEl, countTracks); } } hPrintf(" \n"); } static int bbiBriefMeasure(char *type, char *bigDataUrl, char *bigDataIndex, long *chromCount, long *itemCount, struct dyString *errors) /* check a bigDataUrl to find chrom count and item count */ { int retVal = 0; @@ -379,32 +379,31 @@ totalTracks += ptToInt(hel->val); hashReplace(trackCounter, hel->name, intToPt(prevCount + ptToInt(hel->val))); hPrintf("
  • %d - %s
  • \n", ptToInt(hel->val), hel->name); } hPrintf(" \n"); } hPrintf(" \n"); } else hPrintf("
  • no trackTopDb
  • \n"); } /* static struct trackDb *hubTrackList() */ static struct trackDb *assemblySettings(struct trackHubGenome *genome) /* display all the assembly 'settingsHash' */ { -struct trackDb *tdb = trackHubTracksForGenome(genome->trackHub, genome); -tdb = trackDbLinkUpGenerations(tdb); +struct trackDb *tdb = obtainTdb(genome, NULL); hPrintf(" \n"); @@ -549,31 +548,31 @@ struct hashEl *hel = hashLookup(apiFunctionHash, words[0]); if (hel == NULL) apiErrAbort("no such command: '%s' for endpoint '/%s'", words[0], pathInfo); void (*apiFunction)(char **) = hel->val; // void (*apiFunction)(char **) = hashMustFindVal(apiFunctionHash, words[0]); (*apiFunction)(words); } /* static void apiFunctionSwitch(char *pathInfo) */ static void tracksForUcscDb(char *db) /* scan the specified database for all tracks */ { struct hash *countTracks = hashNew(0); hPrintf("

    Tracks in UCSC genome: '%s'
    \n", db); -struct trackDb *tdbList = hTrackDb(db); +struct trackDb *tdbList = obtainTdb(NULL, db); struct trackDb *tdb; hPrintf("