src/hg/hgTables/custom.c 1.41

1.41 2009/05/20 20:59:56 mikep
Libified findTdbForTable, findTypeForTable, trackIsType, hIsBigBed from hgTables so that other code can easily determine if a track is a bigBed.
Index: src/hg/hgTables/custom.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/custom.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -b -B -U 4 -r1.40 -r1.41
--- src/hg/hgTables/custom.c	10 Apr 2009 20:04:28 -0000	1.40
+++ src/hg/hgTables/custom.c	20 May 2009 20:59:56 -0000	1.41
@@ -27,8 +27,14 @@
     theCtList = customTracksParseCart(database, cart, &browserLines, NULL);
 return(theCtList);
 }
 
+struct customTrack *ctLookupName(char *name)
+/* Lookup name in custom track list */
+{
+return ctFind(getCustomTracks(),name);
+}
+
 void flushCustomTracks()
 /* Flush custom track list. */
 {
 theCtList = NULL;
@@ -459,9 +465,9 @@
 /* Get list of beds from custom track of given name that are
  * in current regions and that pass filters.  You can bedFree
  * this when done. */
 {
-struct customTrack *ct = lookupCt(name);
+struct customTrack *ct = ctLookupName(name);
 struct bedFilter *bf = NULL;
 struct bed *bedList = NULL;
 struct hash *idHash = NULL;
 struct region *region;
@@ -517,9 +523,9 @@
 struct slName *chosenFields, *field;
 int count = 0;
 if (fields == NULL)
     {
-    struct customTrack *ct = lookupCt(track->tableName);
+    struct customTrack *ct = ctLookupName(track->tableName);
     chosenFields = getBedFields(ct->fieldCount);
     }
 else
     chosenFields = commaSepToSlNames(fields);