* of the GNU Lesser General Public License.
*/
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
#include <unistd.h>
int fd; /* File descriptor */
int limit;
};
-#define FB_LIMFD(f) ((struct fb_limfd *)(f)->is_fastbuf)
+#define FB_LIMFD(f) ((struct fb_limfd *)(f))
#define FB_BUFFER(f) (byte *)(FB_LIMFD(f) + 1)
static int
int max = MIN(FB_LIMFD(f)->limit - f->pos, f->bufend - f->buffer);
int l = read(FB_LIMFD(f)->fd, f->buffer, max);
if (l < 0)
- bthrow(f, "fb.read", "Error reading %s: %m", f->name);
+ bthrow(f, "read", "Error reading %s: %m", f->name);
f->bstop = f->buffer + l;
f->pos += l;
return l;
f->refill = bfl_refill;
f->close = bfl_close;
f->can_overwrite_buffer = 2;
- return fb_tie(f);
+ return f;
}
#ifdef TEST