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;
42 io->left = io->delta->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 = SIZE(io)) > LEFT(io))
60 n = LEFT(io);
61 if((n = (*READF(io))(DATA(io),n,HERE(io),DELTA(io))) > 0)
62 { ENDB(io) = (NEXT(io) = DATA(io)) + n;
63 HERE(io) += n;
64 LEFT(io) -= n;
70 static int _vdflsbuf(reg Vdio_t* io)
72 static int _vdflsbuf(io)
73 reg Vdio_t* io;
77 if(!io->data )
78 _vdinit(io);
80 if(io->data != io->buf) /* all space was given */
81 return REMAIN(io);
83 if((n = NEXT(io) - DATA(io)) > 0 &&
84 (*WRITEF(io))(DATA(io),n,HERE(io),DELTA(io)) != n)
87 HERE(io) += n;
88 NEXT(io) = DATA(io);
89 return SIZE(io);
93 static ulong _vdgetu(reg Vdio_t* io, reg ulong v)
95 static ulong _vdgetu(io,v)
96 reg Vdio_t* io;
102 { if((c = VDGETC(io)) < 0)
111 static int _vdputu(reg Vdio_t* io, ulong v)
113 static int _vdputu(io, v)
114 reg Vdio_t* io;
128 if(REMAIN(io) < len && _vdflsbuf(io) < len)
131 next = io->next;
139 io->next = next;
145 static int _vdread(Vdio_t* io, reg uchar* s, reg int n)
147 static int _vdread(io, s, n)
148 Vdio_t* io;
157 { if((r = REMAIN(io)) <= 0 && (r = _vdfilbuf(io)) <= 0)
162 next = io->next;
164 io->next = next;
172 static int _vdwrite(Vdio_t* io, reg uchar* s, reg int n)
174 static int _vdwrite(io, s, n)
175 Vdio_t* io;
184 { if((w = REMAIN(io)) <= 0 && (w = _vdflsbuf(io)) <= 0)
189 next = io->next;
191 io->next = next;