src/lib/bigBed.c 1.22

1.22 2009/11/05 19:29:31 kent
Adding bigBedAutoSqlText.
Index: src/lib/bigBed.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/bigBed.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -B -U 4 -r1.21 -r1.22
--- src/lib/bigBed.c	27 Aug 2009 03:54:39 -0000	1.21
+++ src/lib/bigBed.c	5 Nov 2009 19:29:31 -0000	1.22
@@ -749,17 +749,24 @@
 return bbiSummaryArray(bbi, chrom, start, end, bigBedCoverageIntervals,
 	summaryType, summarySize, summaryValues);
 }
 
+char *bigBedAutoSqlText(struct bbiFile *bbi)
+/* Get autoSql text if any associated with file.  Do a freeMem of this when done. */
+{
+if (bbi->asOffset == 0)
+    return NULL;
+struct udcFile *f = bbi->udc;
+udcSeek(f, bbi->asOffset);
+return udcReadStringAndZero(f);
+}
 
 struct asObject *bigBedAs(struct bbiFile *bbi)
 /* Get autoSql object definition if any associated with file. */
 {
 if (bbi->asOffset == 0)
     return NULL;
-struct udcFile *f = bbi->udc;
-udcSeek(f, bbi->asOffset);
-char *asText = udcReadStringAndZero(f);
+char *asText = bigBedAutoSqlText(bbi);
 struct asObject *as = asParseText(asText);
 freeMem(asText);
 return as;
 }