src/lib/udc.c 1.20
1.20 2009/11/05 19:28:04 kent
Adding udcReadFloat function.
Index: src/lib/udc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/lib/udc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -b -B -U 4 -r1.19 -r1.20
--- src/lib/udc.c 3 Nov 2009 20:00:19 -0000 1.19
+++ src/lib/udc.c 5 Nov 2009 19:28:04 -0000 1.20
@@ -1094,8 +1094,18 @@
val = byteSwap16(val);
return val;
}
+float udcReadFloat(struct udcFile *file, boolean isSwapped)
+/* Read and optionally byte-swap floating point number. */
+{
+float val;
+udcMustRead(file, &val, sizeof(val));
+if (isSwapped)
+ val = byteSwapFloat(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;