summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-10-20 17:33:51 -0700
committerRuss Cox <rsc@golang.org>2008-10-20 17:33:51 -0700
commit74a3cd2b7f43b6bf36f1f15c463b097a0846ce60 (patch)
treedaeb13aa7a7dcb2f4757560bcdaa444c6fb21981 /include
parent1f3919e2a6fb50a707b222f2dab5a9964888cfe5 (diff)
downloadgo-74a3cd2b7f43b6bf36f1f15c463b097a0846ce60.tar.gz
6l:
use libbio instead of maintaining own buffer libbio: always use vlong offsets; die if off_t is too small R=r DELTA=163 (23 added, 63 deleted, 77 changed) OCL=17508 CL=17512
Diffstat (limited to 'include')
-rw-r--r--include/bio.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/bio.h b/include/bio.h
index a56e320e0..c754d7a57 100644
--- a/include/bio.h
+++ b/include/bio.h
@@ -26,14 +26,13 @@ THE SOFTWARE.
#ifndef _BIO_H_
#define _BIO_H_ 1
#if defined(__cplusplus)
-extern "C" {
+extern "C" {
#endif
#ifdef AUTOLIB
AUTOLIB(bio)
#endif
-#include <sys/types.h> /* for off_t */
#include <fcntl.h> /* for O_RDONLY, O_WRONLY */
typedef struct Biobuf Biobuf;
@@ -63,7 +62,7 @@ struct Biobuf
int state; /* r/w/inactive */
int fid; /* open file */
int flag; /* magic if malloc'ed */
- off_t offset; /* offset of buffer in file */
+ vlong offset; /* offset of buffer in file */
int bsize; /* size of buffer */
unsigned char* bbuf; /* pointer to beginning of buffer */
unsigned char* ebuf; /* pointer to end of buffer */
@@ -96,7 +95,7 @@ long Bgetrune(Biobuf*);
int Binit(Biobuf*, int, int);
int Binits(Biobuf*, int, int, unsigned char*, int);
int Blinelen(Biobuf*);
-off_t Boffset(Biobuf*);
+vlong Boffset(Biobuf*);
Biobuf* Bopen(char*, int);
int Bprint(Biobuf*, char*, ...);
int Bputc(Biobuf*, int);
@@ -104,7 +103,7 @@ int Bputrune(Biobuf*, long);
void* Brdline(Biobuf*, int);
char* Brdstr(Biobuf*, int, int);
long Bread(Biobuf*, void*, long);
-off_t Bseek(Biobuf*, off_t, int);
+vlong Bseek(Biobuf*, vlong, int);
int Bterm(Biobuf*);
int Bungetc(Biobuf*);
int Bungetrune(Biobuf*);