diff options
author | Russ Cox <rsc@golang.org> | 2008-10-20 17:33:51 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2008-10-20 17:33:51 -0700 |
commit | 2a684c990a6ec2a9b01d964ff7e904afeafa8c0d (patch) | |
tree | daeb13aa7a7dcb2f4757560bcdaa444c6fb21981 /include | |
parent | 7e5d65776534dcef0fedeb6f947fea6bcc691879 (diff) | |
download | golang-2a684c990a6ec2a9b01d964ff7e904afeafa8c0d.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.h | 9 |
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*); |