2 * UCW Library -- Fast Buffered I/O: Binary Numbers
4 * (c) 1997--2006 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU Lesser General Public License.
11 #include "ucw/fastbuf.h"
12 #include "ucw/ff-binary.h"
14 #define GEN(type, name, size, endian) \
15 type bget##name##_##endian##_slow(struct fastbuf *f) \
18 if (bread(f, buf, sizeof(buf)) != sizeof(buf)) \
20 return get_u##size##_##endian(buf); \
22 void bput##name##_##endian##_##slow(struct fastbuf *f, type x) \
25 put_u##size##_##endian(buf, x); \
26 bwrite_slow(f, buf, sizeof(buf)); \
29 #define FF_ALL(type, name, size) GEN(type,name,size,be) GEN(type,name,size,le)