From 2a684c990a6ec2a9b01d964ff7e904afeafa8c0d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 20 Oct 2008 17:33:51 -0700 Subject: 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 --- include/bio.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include') 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 /* for off_t */ #include /* 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*); -- cgit v1.2.3