Lines Matching defs:io
28 static void _vdinit(reg Vdio_t* io)
30 static void _vdinit(io)
31 reg Vdio_t* io;
34 if((io->data = (uchar*)io->delta->data) )
35 io->size = io->delta->size;
37 { io->data = io->buf;
38 io->size = sizeof(io->buf);
40 io->next = io->data;
41 io->endb = io->data + io->size;
46 static int _vdfilbuf(reg Vdio_t* io)
48 static int _vdfilbuf(io)
49 reg Vdio_t* io;
53 if(!io->data)
54 _vdinit(io);
56 if(io->data != io->buf) /* all data was given in core */
57 return REMAIN(io);
59 if((n = (*READF(io))(DATA(io),SIZE(io),HERE(io),DELTA(io))) > 0)
60 { ENDB(io) = (NEXT(io) = DATA(io)) + n;
61 HERE(io) += n;
67 static int _vdflsbuf(reg Vdio_t* io)
69 static int _vdflsbuf(io)
70 reg Vdio_t* io;
74 if(!io->data )
75 _vdinit(io);
77 if(io->data != io->buf) /* all space was given */
78 return REMAIN(io);
80 if((n = NEXT(io) - DATA(io)) > 0 &&
81 (*WRITEF(io))(DATA(io),n,HERE(io),DELTA(io)) != n)
84 HERE(io) += n;
85 NEXT(io) = DATA(io);
86 return SIZE(io);
90 static ulong _vdgetu(reg Vdio_t* io, reg ulong v)
92 static ulong _vdgetu(io,v)
93 reg Vdio_t* io;
99 { if((c = VDGETC(io)) < 0)
108 static int _vdputu(reg Vdio_t* io, ulong v)
110 static int _vdputu(io, v)
111 reg Vdio_t* io;
125 if(REMAIN(io) < len && _vdflsbuf(io) < len)
128 next = io->next;
136 io->next = next;
142 static int _vdread(Vdio_t* io, reg uchar* s, reg int n)
144 static int _vdread(io, s, n)
145 Vdio_t* io;
154 { if((r = REMAIN(io)) <= 0 && (r = _vdfilbuf(io)) <= 0)
159 next = io->next;
161 io->next = next;
169 static int _vdwrite(Vdio_t* io, reg uchar* s, reg int n)
171 static int _vdwrite(io, s, n)
172 Vdio_t* io;
181 { if((w = REMAIN(io)) <= 0 && (w = _vdflsbuf(io)) <= 0)
186 next = io->next;
188 io->next = next;