src/inc/bbiFile.h 1.19

1.19 2009/11/13 19:02:38 kent
Adding compression to bigBed. Improving bigWigInfo and bigBedInfo a little.
Index: src/inc/bbiFile.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/bbiFile.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -b -B -U 4 -r1.18 -r1.19
--- src/inc/bbiFile.h	12 Nov 2009 23:15:51 -0000	1.18
+++ src/inc/bbiFile.h	13 Nov 2009 19:02:38 -0000	1.19
@@ -260,12 +260,32 @@
 
 bits64 bbiBoundsArrayFetchOffset(const void *va, void *context);
 /* Fetch bbiBoundsArray file offset for r-tree */
 
+struct bbiSumOutStream
+/* Buffer output to file so have a chance to compress. */
+    {
+    struct bbiSummaryOnDisk *array;
+    int elCount;
+    int allocCount;
+    FILE *f;
+    boolean doCompress;
+    };
+
+struct bbiSumOutStream *bbiSumOutStreamOpen(int allocCount, FILE *f, boolean doCompress);
+/* Open new bbiSumOutStream. */
+
+void bbiSumOutStreamClose(struct bbiSumOutStream **pStream);
+/* Free up bbiSumOutStream */
+
+void bbiSumOutStreamWrite(struct bbiSumOutStream *stream, struct bbiSummary *sum);
+/* Write out next one to stream. */
+
 void bbiOutputOneSummaryFurtherReduce(struct bbiSummary *sum, 
 	struct bbiSummary **pTwiceReducedList, 
 	int doubleReductionSize, struct bbiBoundsArray **pBoundsPt, 
-	struct bbiBoundsArray *boundsEnd, bits32 chromSize, struct lm *lm, FILE *f);
+	struct bbiBoundsArray *boundsEnd, bits32 chromSize, struct lm *lm, 
+	struct bbiSumOutStream *stream);
 /* Write out sum to file, keeping track of minimal info on it in *pBoundsPt, and also adding
  * it to second level summary. */
 
 struct bbiSummary *bbiSummarySimpleReduce(struct bbiSummary *list, int reduction, struct lm *lm);