e87a5a48e160352d00b33be48abef65b46dc55ff
kent
  Thu Jun 17 14:23:40 2010 -0700
Adding a few functions to cart and trackDb to make it easier to buildcarts and trackDbs out of an existing string-valued hash.

diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c
index e5c8c38..c0b5173 100644
--- src/hg/lib/trackDbCustom.c
+++ src/hg/lib/trackDbCustom.c
@@ -19,6 +19,15 @@
 
 /* ----------- End of AutoSQL generated code --------------------- */
 
+struct trackDb *trackDbNew()
+/* Allocate a new trackDb with just very minimal stuff filled in. */
+{
+struct trackDb *tdb;
+AllocVar(tdb);
+tdb->canPack = 2;	/* Unknown value. */
+return tdb;
+}
+
 int trackDbCmp(const void *va, const void *vb)
 /* Compare to sort based on priority; use shortLabel as secondary sort key.
  * Note: parallel code to hgTracks.c:tgCmpPriority */
@@ -272,8 +281,7 @@
         break;
 
     /* Allocate track structure and fill it in until next blank line. */
-    AllocVar(bt);
-    bt->canPack = 2;	/* Unknown value */
+    bt = trackDbNew();
     slAddHead(&btList, bt);
     for (;;)
         {