Lines Matching defs:sk
63 Seek_t* sk;
68 sk = (Seek_t*)disc;
69 sf = sk->shadow;
70 if(sk->eof)
75 if(addr+n <= sk->extent)
78 if((r = (ssize_t)(sk->extent-addr)) > 0)
87 { sk->eof = 1;
93 sk->eof = 1;
95 sk->extent += p;
111 Seek_t* sk;
116 sk = (Seek_t*)disc;
117 sf = sk->shadow;
122 addr -= sk->discard;
128 addr += sk->extent;
136 else if(addr > sk->extent)
137 { if(sk->eof)
141 while(addr > sk->extent)
142 { if(addr > sk->extent+sizeof(buf) )
144 else w = (int)(addr-sk->extent);
148 sk->extent += w;
150 { sk->eof = 1;
155 if(addr > sk->extent)
159 return sfseek(sf,addr,SEEK_SET) + sk->discard;
173 Seek_t* sk;
175 sk = (Seek_t*)disc;
181 sfclose(sk->shadow);
185 sk->eof = 0;
186 sk->discard += sk->extent;
187 sk->extent = 0;
188 sfseek(sk->shadow,(Sfoff_t)0,SEEK_SET);
201 reg Seek_t* sk;
207 if(!(sk = (Seek_t*)malloc(sizeof(Seek_t))) )
209 memset(sk, 0, sizeof(*sk));
211 sk->disc.readf = skread;
212 sk->disc.writef = skwrite;
213 sk->disc.seekf = skseek;
214 sk->disc.exceptf = skexcept;
215 sk->shadow = sftmp(SF_BUFSIZE);
216 sk->discard = 0;
217 sk->extent = 0;
218 sk->eof = 0;
220 if(sfdisc(f, (Sfdisc_t*)sk) != (Sfdisc_t*)sk)
221 { sfclose(sk->shadow);
222 free(sk);