2 * UCW Library -- Fast Buffered I/O on Binary Values
4 * (c) 1997--2007 Martin Mares <mj@ucw.cz>
5 * (c) 2004 Robert Spalek <robert@ucw.cz>
7 * This software may be freely distributed and used according to the terms
8 * of the GNU Lesser General Public License.
11 #ifndef _UCW_FF_BINARY_H
12 #define _UCW_FF_BINARY_H
14 #include "lib/fastbuf.h"
15 #include "lib/unaligned.h"
17 int bgetw_slow(struct fastbuf *f);
18 static inline int bgetw(struct fastbuf *f)
31 u32 bgetl_slow(struct fastbuf *f);
32 static inline u32 bgetl(struct fastbuf *f)
45 u64 bgetq_slow(struct fastbuf *f);
46 static inline u64 bgetq(struct fastbuf *f)
59 u64 bget5_slow(struct fastbuf *f);
60 static inline u64 bget5(struct fastbuf *f)
73 void bputw_slow(struct fastbuf *f, uns w);
74 static inline void bputw(struct fastbuf *f, uns w)
85 void bputl_slow(struct fastbuf *f, u32 l);
86 static inline void bputl(struct fastbuf *f, u32 l)
97 void bputq_slow(struct fastbuf *f, u64 l);
98 static inline void bputq(struct fastbuf *f, u64 l)
109 void bput5_slow(struct fastbuf *f, u64 l);
110 static inline void bput5(struct fastbuf *f, u64 l)
121 /* I/O on uintptr_t */
123 #ifdef CPU_64BIT_POINTERS
124 #define bputa(x,p) bputq(x,p)
125 #define bgeta(x) bgetq(x)
127 #define bputa(x,p) bputl(x,p)
128 #define bgeta(x) bgetl(x)