/*
- * Sherlock Library -- Fast Buffered I/O
+ * UCW Library -- Fast Buffered I/O
*
* (c) 1997--2004 Martin Mares <mj@ucw.cz>
* (c) 2004 Robert Spalek <robert@ucw.cz>
* of the GNU Lesser General Public License.
*/
-#ifndef _SHERLOCK_FASTBUF_H
-#define _SHERLOCK_FASTBUF_H
+#ifndef _UCW_FASTBUF_H
+#define _UCW_FASTBUF_H
#ifndef EOF
#include <stdio.h>
void bseek(struct fastbuf *f, sh_off_t pos, int whence);
void bsetpos(struct fastbuf *f, sh_off_t pos);
void brewind(struct fastbuf *f);
-int bskip(struct fastbuf *f, uns len);
sh_off_t bfilesize(struct fastbuf *f);
static inline sh_off_t btell(struct fastbuf *f)
bbcopy_slow(f, t, l);
}
+int bskip_slow(struct fastbuf *f, uns len);
+static inline int bskip(struct fastbuf *f, uns len)
+{
+ if (bavailr(f) >= len)
+ {
+ f->bptr += len;
+ return 1;
+ }
+ else
+ return bskip_slow(f, len);
+}
+
/* I/O on addr_int_t */
#ifdef CPU_64BIT_POINTERS