@@@ doc wip
[mLib] / struct / buf.h
index e346b37..2a37220 100644 (file)
@@ -400,6 +400,60 @@ extern int dbuf_putk64b(dbuf */*db*/, kludge64 /*w*/);
 #define dbuf_putk64l(db, w) (buf_putk64l(DBUF_BUF(db), (w)))
 #define dbuf_putk64b(db, w) (buf_putk64b(DBUF_BUF(db), (w)))
 
+/* --- @buf_getf{32,64}{,l,b} --- *
+ *
+ * Arguments:  @buf *b@ = a buffer to read from
+ *             @float *x_out@, @double *x_out@ = where to put the result
+ *
+ * Returns:    Zero on success, %$-1$% on failure (and the buffer is
+ *             broken).
+ *
+ * Use:                Get an IEEE Binary32 or Binary64 value from the buffer.
+ *             Conversion is performed using the `fltfmt' machinery, with
+ *             the usual round-to-nearest/ties-to-even rounding mode.
+ */
+
+extern int buf_getf32(buf */*b*/, float */*x_out*/);
+extern int buf_getf32l(buf */*b*/, float */*x_out*/);
+extern int buf_getf32b(buf */*b*/, float */*x_out*/);
+#define dbuf_getf32(db, x_out) (buf_getf32(DBUF_BUF(db), (x_out)))
+#define dbuf_getf32l(db, x_out) (buf_getf32l(DBUF_BUF(db), (x_out)))
+#define dbuf_getf32b(db, x_out) (buf_getf32b(DBUF_BUF(db), (x_out)))
+
+extern int buf_getf64(buf */*b*/, double */*x_out*/);
+extern int buf_getf64l(buf */*b*/, double */*x_out*/);
+extern int buf_getf64b(buf */*b*/, double */*x_out*/);
+#define dbuf_getf64(db, x_out) (buf_getf64(DBUF_BUF(db), (x_out)))
+#define dbuf_getf64l(db, x_out) (buf_getf64l(DBUF_BUF(db), (x_out)))
+#define dbuf_getf64b(db, x_out) (buf_getf64b(DBUF_BUF(db), (x_out)))
+
+/* --- @buf_putf{32,64}{,l,b} --- *
+ *
+ * Arguments:  @buf *b@ = a buffer to write to
+ *             @double x@ = a number to write
+ *
+ * Returns:    Zero on success, %$-1$% on failure (and the buffer is
+ *             broken).
+ *
+ * Use:                Get an IEEE Binary32 or Binary64 value from the buffer.
+ *             Conversion is performed using the `fltfmt' machinery, with
+ *             the usual round-to-nearest/ties-to-even rounding mode.
+ */
+
+extern int buf_putf32(buf */*b*/, float /*x*/);
+extern int buf_putf32l(buf */*b*/, float /*x*/);
+extern int buf_putf32b(buf */*b*/, float /*x*/);
+#define dbuf_putf32(db, x) (buf_putf32(DBUF_BUF(db), (x)))
+#define dbuf_putf32l(db, x) (buf_putf32l(DBUF_BUF(db), (x)))
+#define dbuf_putf32b(db, x) (buf_putf32b(DBUF_BUF(db), (x)))
+
+extern int buf_putf64(buf */*b*/, double /*x*/);
+extern int buf_putf64l(buf */*b*/, double /*x*/);
+extern int buf_putf64b(buf */*b*/, double /*x*/);
+#define dbuf_putf64(db, x) (buf_putf64(DBUF_BUF(db), (x)))
+#define dbuf_putf64l(db, x) (buf_putf64l(DBUF_BUF(db), (x)))
+#define dbuf_putf64b(db, x) (buf_putf64b(DBUF_BUF(db), (x)))
+
 /* --- @{,d}buf_getmem{8,{16,24,32,64}{,l,b},z} --- *
  *
  * Arguments:  @buf *b@ or @dbuf *db@ = pointer to a buffer block
@@ -610,60 +664,6 @@ BUF_DOSUFFIXES(BUF_DECL_PUTSTR_)
 #define dbuf_putstr64b(db, p) (buf_putstr64b(DBUF_BUF(db), (p)))
 #define dbuf_putstrz(db, p) (buf_putstrz(DBUF_BUF(db), (p)))
 
-/* --- @buf_getf{32,64}{,l,b} --- *
- *
- * Arguments:  @buf *b@ = a buffer to read from
- *             @float *x_out@, @double *x_out@ = where to put the result
- *
- * Returns:    Zero on success, %$-1$% on failure (and the buffer is
- *             broken).
- *
- * Use:                Get an IEEE Binary32 or Binary64 value from the buffer.
- *             Conversion is performed using the `fltfmt' machinery, with
- *             the usual round-to-nearest/ties-to-even rounding mode.
- */
-
-extern int buf_getf32(buf */*b*/, float */*x_out*/);
-extern int buf_getf32l(buf */*b*/, float */*x_out*/);
-extern int buf_getf32b(buf */*b*/, float */*x_out*/);
-#define dbuf_getf32(db, x_out) (buf_getf32(DBUF_BUF(db), (x_out)))
-#define dbuf_getf32l(db, x_out) (buf_getf32l(DBUF_BUF(db), (x_out)))
-#define dbuf_getf32b(db, x_out) (buf_getf32b(DBUF_BUF(db), (x_out)))
-
-extern int buf_getf64(buf */*b*/, double */*x_out*/);
-extern int buf_getf64l(buf */*b*/, double */*x_out*/);
-extern int buf_getf64b(buf */*b*/, double */*x_out*/);
-#define dbuf_getf64(db, x_out) (buf_getf64(DBUF_BUF(db), (x_out)))
-#define dbuf_getf64l(db, x_out) (buf_getf64l(DBUF_BUF(db), (x_out)))
-#define dbuf_getf64b(db, x_out) (buf_getf64b(DBUF_BUF(db), (x_out)))
-
-/* --- @buf_putf{32,64}{,l,b} --- *
- *
- * Arguments:  @buf *b@ = a buffer to write to
- *             @double x@ = a number to write
- *
- * Returns:    Zero on success, %$-1$% on failure (and the buffer is
- *             broken).
- *
- * Use:                Get an IEEE Binary32 or Binary64 value from the buffer.
- *             Conversion is performed using the `fltfmt' machinery, with
- *             the usual round-to-nearest/ties-to-even rounding mode.
- */
-
-extern int buf_putf32(buf */*b*/, float /*x*/);
-extern int buf_putf32l(buf */*b*/, float /*x*/);
-extern int buf_putf32b(buf */*b*/, float /*x*/);
-#define dbuf_putf32(db, x) (buf_putf32(DBUF_BUF(db), (x)))
-#define dbuf_putf32l(db, x) (buf_putf32l(DBUF_BUF(db), (x)))
-#define dbuf_putf32b(db, x) (buf_putf32b(DBUF_BUF(db), (x)))
-
-extern int buf_putf64(buf */*b*/, double /*x*/);
-extern int buf_putf64l(buf */*b*/, double /*x*/);
-extern int buf_putf64b(buf */*b*/, double /*x*/);
-#define dbuf_putf64(db, x) (buf_putf64(DBUF_BUF(db), (x)))
-#define dbuf_putf64l(db, x) (buf_putf64l(DBUF_BUF(db), (x)))
-#define dbuf_putf64b(db, x) (buf_putf64b(DBUF_BUF(db), (x)))
-
 /* --- @{,D}BUF_ENCLOSETAG@ --- *
  *
  * Arguments:  @tag@ = a control-structure macro tag