]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fastbuf.h
New functions for manipulating attribute lists: obj_prepend_attr()
[libucw.git] / lib / fastbuf.h
index f644cc8171547e4e12256de3eb92812cc776679f..2948830ee4e0331e305a9c5a9ceb66486ca738db 100644 (file)
@@ -59,6 +59,7 @@ struct fastbuf {
 /* FastIO on standard files */
 
 struct fastbuf *bopen(byte *name, uns mode, uns buffer);
+struct fastbuf *bopen_tmp(uns buffer);
 struct fastbuf *bfdopen(int fd, uns buffer);
 void bbcopy(struct fastbuf *f, struct fastbuf *t, uns l);
 
@@ -91,13 +92,13 @@ static inline int bpeekc(struct fastbuf *f)
   return (f->bptr < f->bstop) ? (int) *f->bptr : bpeekc_slow(f);
 }
 
-static inline void bungetc(struct fastbuf *f, byte c)
+static inline void bungetc(struct fastbuf *f)
 {
-  *--f->bptr = c;
+  f->bptr--;
 }
 
-void bputc_slow(struct fastbuf *f, byte c);
-static inline void bputc(struct fastbuf *f, byte c)
+void bputc_slow(struct fastbuf *f, uns c);
+static inline void bputc(struct fastbuf *f, uns c)
 {
   if (f->bptr < f->bufend)
     *f->bptr++ = c;
@@ -161,8 +162,8 @@ static inline u64 bget5(struct fastbuf *f)
     return bget5_slow(f);
 }
 
-void bputw_slow(struct fastbuf *f, word w);
-static inline void bputw(struct fastbuf *f, word w)
+void bputw_slow(struct fastbuf *f, uns w);
+static inline void bputw(struct fastbuf *f, uns w)
 {
   if (f->bptr + 2 <= f->bufend)
     {