Added zillions of missing includes and fixed handling of EOF.
Mentioned in doc/changes.
/*
* UCW Library -- Fast Buffered I/O
*
- * (c) 1997--2006 Martin Mares <mj@ucw.cz>
+ * (c) 1997--2007 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
#include "lib/lib.h"
#include "lib/fastbuf.h"
+#include <stdio.h>
#include <stdlib.h>
void bclose(struct fastbuf *f)
if (f->bptr < f->bstop)
return *f->bptr++;
if (!f->refill(f))
- return EOF;
+ return -1;
return *f->bptr++;
}
if (f->bptr < f->bstop)
return *f->bptr;
if (!f->refill(f))
- return EOF;
+ return -1;
return *f->bptr;
}
/*
* UCW Library -- Fast Buffered I/O
*
- * (c) 1997--2004 Martin Mares <mj@ucw.cz>
+ * (c) 1997--2007 Martin Mares <mj@ucw.cz>
* (c) 2004 Robert Spalek <robert@ucw.cz>
*
* This software may be freely distributed and used according to the terms
#ifndef _UCW_FASTBUF_H
#define _UCW_FASTBUF_H
-#ifndef EOF
-#include <stdio.h>
-#endif
-
#include <string.h>
#include <alloca.h>
#include "lib/lib.h"
#include "lib/fastbuf.h"
+#include <stdio.h>
#include <stdlib.h>
static int
#include "lib/fastbuf.h"
#include "lib/lfs.h"
+#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include "lib/lib.h"
#include "lib/fastbuf.h"
+#include <stdio.h>
#include <stdlib.h>
struct fb_gbuf {
#include "lib/lib.h"
#include "lib/fastbuf.h"
+#include <stdio.h>
+
struct memstream {
unsigned blocksize;
unsigned uc;
#include "lib/fastbuf.h"
#include "lib/threads.h"
+#include <stdio.h>
#include <unistd.h>
#include <sys/fcntl.h>
#include "lib/lib.h"
#include "lib/fastbuf.h"
+#include <stdio.h>
#include <alloca.h>
int
#include "lib/fastbuf.h"
#include "lib/qache.h"
+#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>