/*
* Sherlock Library -- Fast Buffered I/O
*
- * (c) 1997--2002 Martin Mares <mj@ucw.cz>
+ * (c) 1997--2004 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
struct fastbuf *bopen_mm(byte *name, uns mode);
+/* FastI on file descriptors with limit */
+
+struct fastbuf *bopen_limited_fd(int fd, uns bufsize, uns limit);
+
+/* FastIO on static buffers */
+
+void fbbuf_init_read(struct fastbuf *f, byte *buffer, uns size);
+void fbbuf_init_write(struct fastbuf *f, byte *buffer, uns size);
+static inline uns
+fbbuf_count_written(struct fastbuf *f)
+{
+ return f->bptr - f->bstop;
+}
+
/* Configuring stream parameters */
int bconfig(struct fastbuf *f, uns type, int data);
void bflush(struct fastbuf *f);
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);
static inline sh_off_t btell(struct fastbuf *f)
{
}
byte *bgets(struct fastbuf *f, byte *b, uns l); /* Non-std */
+int bgets_nodie(struct fastbuf *f, byte *b, uns l);
byte *bgets0(struct fastbuf *f, byte *b, uns l);
static inline void
f->bptr = pos;
}
+/* Formatted output */
+
+int bprintf(struct fastbuf *b, byte *msg, ...);
+int vbprintf(struct fastbuf *b, byte *msg, va_list args);
+
#endif