~ubuntu-branches/ubuntu/natty/9base/natty

« back to all changes in this revision

Viewing changes to lib9/bio.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-08-20 17:34:06 UTC
  • mfrom: (6.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090820173406-xpwqa9ruyevvc0ut
Tags: 1:3-3
* Updating maintainer field.
* Updating vcs fields.
* Updating package to standards version 3.8.3.
* Updatin variables writing in rules to consistent style.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
AUTOLIB(bio)
9
9
#endif
10
10
 
11
 
#include <sys/types.h>  /* for off_t */
12
 
#include <stdarg.h>
13
11
#include <fcntl.h>      /* for O_RDONLY, O_WRONLY */
14
12
 
15
 
#define OREAD   0       /* open for read */
16
 
#define OWRITE  1       /* write */
17
 
#define ORDWR   2       /* read and write */
18
 
#define OEXEC   3       /* execute, == read but check execute permission */
19
 
#define OTRUNC  16      /* or'ed in (except for exec), truncate file first */
20
 
#define OCEXEC  32      /* or'ed in, close on exec */
21
 
#define ORCLOSE 64      /* or'ed in, remove on close */
22
 
#define ODIRECT 128     /* or'ed in, direct access */
23
 
#define ONONBLOCK 256   /* or'ed in, non-blocking call */
24
 
#define OEXCL   0x1000  /* or'ed in, exclusive use (create only) */
25
 
#define OLOCK   0x2000  /* or'ed in, lock after opening */
26
 
#define OAPPEND 0x4000  /* or'ed in, append only */
27
 
 
28
13
typedef struct  Biobuf  Biobuf;
29
14
 
30
15
enum
52
37
        int     state;          /* r/w/inactive */
53
38
        int     fid;            /* open file */
54
39
        int     flag;           /* magic if malloc'ed */
55
 
        off_t   offset;         /* offset of buffer in file */
 
40
        long long       offset;         /* offset of buffer in file */
56
41
        int     bsize;          /* size of buffer */
57
42
        unsigned char*  bbuf;           /* pointer to beginning of buffer */
58
43
        unsigned char*  ebuf;           /* pointer to end of buffer */
85
70
int     Binit(Biobuf*, int, int);
86
71
int     Binits(Biobuf*, int, int, unsigned char*, int);
87
72
int     Blinelen(Biobuf*);
88
 
off_t   Boffset(Biobuf*);
 
73
long long       Boffset(Biobuf*);
89
74
Biobuf* Bopen(char*, int);
90
75
int     Bprint(Biobuf*, char*, ...);
91
76
int     Bputc(Biobuf*, int);
93
78
void*   Brdline(Biobuf*, int);
94
79
char*   Brdstr(Biobuf*, int, int);
95
80
long    Bread(Biobuf*, void*, long);
96
 
off_t   Bseek(Biobuf*, off_t, int);
 
81
long long       Bseek(Biobuf*, long long, int);
97
82
int     Bterm(Biobuf*);
98
83
int     Bungetc(Biobuf*);
99
84
int     Bungetrune(Biobuf*);