Lines Matching refs:disc

45 {	Sfdisc_t	disc;
51 static int _dccaexcept(Sfio_t* f, int type, Void_t* val, Sfdisc_t* disc)
53 static int _dccaexcept(f,type,val,disc)
57 Sfdisc_t* disc;
60 if(disc && type == SF_FINAL)
61 free(disc);
66 static ssize_t _dccaread(Sfio_t* f, Void_t* buf, size_t size, Sfdisc_t* disc)
68 static ssize_t _dccaread(f, buf, size, disc)
72 Sfdisc_t* disc;
83 for(prev = f->disc; prev; prev = prev->disc)
84 if(prev->disc == disc)
93 dcca = (Dccache_t*)disc;
99 { prev->disc = disc->disc;
100 free(disc);
107 Sfdisc_t* sfdisc(Sfio_t* f, Sfdisc_t* disc)
109 Sfdisc_t* sfdisc(f,disc)
111 Sfdisc_t* disc;
124 if((Sfio_t*)disc == f) /* special case to get the top discipline */
125 SFMTXRETURN(f,f->disc);
141 if(!disc && f->disc && f->disc->disc && f->disc->disc->readf == _dccaread )
156 if(rv == 0 && f->disc && f->disc->exceptf) /* ask current discipline */
158 rv = (*f->disc->exceptf)(f, SF_DBUFFER, &n, f->disc);
161 if(rv == 0 && disc && disc->exceptf) /* ask discipline being pushed */
163 rv = (*disc->exceptf)(f, SF_DBUFFER, &n, disc);
171 if((f->mode&SF_READ) && n > 0 && disc && disc->readf )
176 dcca->disc.readf = _dccaread;
177 dcca->disc.exceptf = _dccaexcept;
189 { for(d = f->disc; d && !d->iof; d = d->disc) ; \
196 if(disc == SF_POPDISC)
198 if(!(d = f->disc) )
200 disc = d->disc;
203 if((*(d->exceptf))(f,SF_DPOP,(Void_t*)disc,d) < 0 )
207 f->disc = disc;
214 d = f->disc;
217 if( (*(d->exceptf))(f,SF_DPUSH,(Void_t*)disc,d) < 0 )
221 } while(d != f->disc);
224 for(; d; d = d->disc)
225 if(d == disc)
228 /* set new disc */
230 { dcca->disc.disc = f->disc;
231 disc->disc = &dcca->disc;
233 else disc->disc = f->disc;
234 f->disc = disc;
235 rdisc = disc;
244 { for(d = f->disc; d && !d->iof; d = d->disc) ; \