src/hg/hgTables/custom.c 1.48
1.48 2010/05/14 23:32:00 kent
Refactoring a bit so can pass a table string rather than a track struct to eliminate a track/table potential blending of things.
Index: src/hg/hgTables/custom.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/custom.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -b -B -U 4 -r1.47 -r1.48
--- src/hg/hgTables/custom.c 11 May 2010 01:43:25 -0000 1.47
+++ src/hg/hgTables/custom.c 14 May 2010 23:32:00 -0000 1.48
@@ -523,9 +523,9 @@
*retFieldCount = fieldCount;
return bedList;
}
-static void doTabOutBedLike(struct customTrack *ct, struct trackDb *track,
+static void doTabOutBedLike(struct customTrack *ct, char *table,
struct sqlConnection *conn, char *fields, FILE *f)
/* Print out selected fields from a bed-like custom track. If fields
* is NULL, then print out all fields. */
{
@@ -550,9 +550,9 @@
for (region = regionList; region != NULL; region = region->next)
{
struct lm *lm = lmInit(64*1024);
- struct bed *bed, *bedList = cookedBedList(conn, track->table,
+ struct bed *bed, *bedList = cookedBedList(conn, table,
region, lm, NULL);
for (bed = bedList; bed != NULL; bed = bed->next)
{
tabBedRowFile(bed, chosenFields, f);
@@ -563,23 +563,23 @@
if (count == 0)
explainWhyNoResults(f);
}
-void doTabOutCustomTracks(char *db, struct trackDb *track, struct sqlConnection *conn,
+void doTabOutCustomTracks(char *db, char *table, struct sqlConnection *conn,
char *fields, FILE *f)
/* Print out selected fields from custom track. If fields
* is NULL, then print out all fields. */
{
-struct customTrack *ct = ctLookupName(track->table);
+struct customTrack *ct = ctLookupName(table);
char *type = ct->tdb->type;
if (startsWithWord("makeItems", type))
{
struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
- doTabOutDb(CUSTOM_TRASH, db, ct->dbTableName, track->table, f, conn, fields);
+ doTabOutDb(CUSTOM_TRASH, db, ct->dbTableName, table, f, conn, fields);
hFreeConn(&conn);
}
else
- doTabOutBedLike(ct, track, conn, fields, f);
+ doTabOutBedLike(ct, table, conn, fields, f);
}
void removeNamedCustom(struct customTrack **pList, char *name)