src/lib/udc.c 1.21
1.21 2009/11/05 19:45:30 kent
Adding udcReadDouble.
Index: src/lib/udc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/udc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -b -B -U 4 -r1.20 -r1.21
--- src/lib/udc.c 5 Nov 2009 19:28:04 -0000 1.20
+++ src/lib/udc.c 5 Nov 2009 19:45:30 -0000 1.21
@@ -1104,8 +1104,18 @@
val = byteSwapFloat(val);
return val;
}
+double udcReadDouble(struct udcFile *file, boolean isSwapped)
+/* Read and optionally byte-swap double-precision floating point number. */
+{
+double val;
+udcMustRead(file, &val, sizeof(val));
+if (isSwapped)
+ val = byteSwapDouble(val);
+return val;
+}
+
char *udcReadStringAndZero(struct udcFile *file)
/* Read in zero terminated string from file. Do a freeMem of result when done. */
{
char shortBuf[2], *longBuf = NULL, *buf = shortBuf;