c4e21e1e64356236569f1c709cbb01f84875daa8
tdreszer
  Fri Dec 10 08:56:10 2010 -0800
Added tdbForTrack to replace hTrackDbForTrack.  New version allows passing in the list of tdbs, so that the list is not regenerated time and time again.
diff --git src/hg/inc/hdb.h src/hg/inc/hdb.h
index ae92681..1a7defe 100644
--- src/hg/inc/hdb.h
+++ src/hg/inc/hdb.h
@@ -418,36 +418,38 @@
 /* Return TRUE if this is running on private web-server. */
 
 boolean hTrackOnChrom(struct trackDb *tdb, char *chrom);
 /* Return TRUE if track exists on this chromosome. */
 
 struct trackDb *hTrackDb(char *db);
 /* Load tracks associated with current db.
  * Supertracks are loaded as a trackDb, but are not in the returned list,
  * but are accessible via the parent pointers of the member tracks.  Also,
  * the supertrack trackDb subtrack fields are not set here (would be
  * incompatible with the returned list)
  * Returns list sorted by priority
  *	NOTE: this result is cached, do not free it !
  */
 
-struct trackDb *hTrackDbForTrack(char *db, char *track);
+struct trackDb *tdbForTrack(char *db, char *track,struct trackDb **tdbList);
 /* Load trackDb object for a track. If track is composite, its subtracks 
  * will also be loaded and inheritance will be handled; if track is a 
  * subtrack then inheritance will be handled.  (Unless a subtrack has 
  * "noInherit on"...) This will die if the current database does not have
- * a trackDb, but will return NULL if track is not found. */
+ * a trackDb, but will return NULL if track is not found.
+ * MAY pass in prepopulated trackDb list, or may receive the trackDb list as an inout. */
+#define hTrackDbForTrack(db,track) tdbForTrack(db,track,NULL)
 
 struct trackDb *hTrackDbForTrackAndAncestors(char *db, char *track);
 /* Load trackDb object for a track. If need be grab its ancestors too. 
  * This does not load children. hTrackDbForTrack will handle children, and
  * is actually faster if being called on lots of tracks.  This function
  * though is faster on one or two tracks. */
 
 struct trackDb *hCompositeTrackDbForSubtrack(char *db, struct trackDb *sTdb);
 /* Given a trackDb that may be for a subtrack of a composite track, 
  * return the trackDb for the composite track if we can find it, else NULL.
  * Note: if the composite trackDb is found and returned, then its subtracks 
  * member will contain a newly allocated tdb like sTdb (but not ==). */
 
 void hTrackDbLoadSuper(char *db, struct trackDb *tdb);
 /* Populate child trackDbs of this supertrack */