src/inc/common.h 1.158
1.158 2009/11/12 19:33:54 kent
Adding a few new utilities to common.h/common.c for benefit of bbi compressed encoders.
Index: src/inc/common.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/inc/common.h,v
retrieving revision 1.157
retrieving revision 1.158
diff -b -B -U 4 -r1.157 -r1.158
--- src/inc/common.h 2 Nov 2009 21:27:45 -0000 1.157
+++ src/inc/common.h 12 Nov 2009 19:33:54 -0000 1.158
@@ -1000,8 +1000,13 @@
struct fileOffsetSize *fileOffsetSizeMerge(struct fileOffsetSize *inList);
/* Returns a new list which is inList transformed to have adjacent blocks
* merged. Best to use this with a sorted list. */
+void fileOffsetSizeFindGap(struct fileOffsetSize *list,
+ struct fileOffsetSize **pBeforeGap, struct fileOffsetSize **pAfterGap);
+/* Starting at list, find all items that don't have a gap between them and the previous item.
+ * Return at gap, or at end of list, returning pointers to the items before and after the gap. */
+
void maybeSystem(char *cmd);
/* Execute cmd using "sh -c" or die. (See man 3 system.) warning on errors */
void mustSystem(char *cmd);
@@ -1040,9 +1045,18 @@
/* Return amount of bases two ranges intersect over, 0 if no
* intersection. */
void memRead(char **pPt, void *buf, int size);
-/* Copy memory from *pPt to buf, and advance *pPt by size */
+/* Copy memory from *pPt to buf, and advance *pPt by size. */
+
+void memWrite(char **pPt, void *buf, int size);
+/* Copy memory from buf to *pPt and advance *pPt by size. */
+
+#define memWriteOne(pPt, var) memWrite((pPt), &(var), sizeof(var))
+/* Write out one variable to memory stream. */
+
+void memWriteFloat(char **pPt, float val);
+/* Write out floating point val to file. Mostly to convert from double... */
bits64 byteSwap64(bits64 a);
/* Swap from intel to sparc order of a 64 bit quantity. */