Lines Matching refs:offset

83 static struct map *getmapping(Dosdisc_t *dp, Sfoff_t offset, register int whence)  in getmapping()  argument
85 static struct map *getmapping(dp, offset, whence) in getmapping()
87 Sfoff_t offset;
93 if(offset <= dp->begin)
95 dummy.logical = dummy.physical = offset;
104 while((++mp)->logical && (whence==SEEK_CUR?mp->physical:mp->logical) <= offset);
230 static Sfoff_t cur_offset(Dosdisc_t *dp, Sfoff_t offset,Sfio_t *iop,register int whence) in cur_offset() argument
232 static Sfoff_t cur_offset(dp, offset, iop, whence) in cur_offset()
234 Sfoff_t offset;
245 n = offset - dp->plast;
247 offset = dp->llast;
252 n = offset - dp->llast;
253 offset = dp->plast;
255 offset +=n;
272 return(offset+m);
276 static Sfoff_t dos_seek(Sfio_t *iop, Sfoff_t offset, register int whence, Sfdisc_t* disc) in dos_seek() argument
278 static Sfoff_t dos_seek(iop, offset, whence, disc) in dos_seek()
280 Sfoff_t offset;
293 offset = sfsk(iop, (Sfoff_t)0,SEEK_CUR,disc);
294 if(offset<=dp->begin)
295 return(offset);
297 if(offset==dp->phere)
299 else if(offset==dp->plast)
301 else if(offset<dp->plast || offset>dp->phere)
302 mp = getmapping(dp,offset,whence);
306 if(offset<dp->llast || offset > dp->lhere)
307 mp = getmapping(dp,offset,whence);
311 return(sfsk(iop,offset,SEEK_END,disc));
331 if(whence==SEEK_CUR && dp->phere>=offset)
333 if(whence==SEEK_SET && dp->lhere>=offset)
340 if(whence==SEEK_END && offset<0)
342 offset = dp->lhere;
350 offset += dp->lhere;
353 physical = cur_offset(dp,offset,iop,whence);
358 dp->lhere = offset;
361 offset = physical;
363 return(offset);