}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
-void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
+void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
+ this->offset=offset;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
- if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength,SEEK_SET)==-1)
+ if (lseek(this->fd,(off_t)(((sector+track*this->sectrk)*this->secLength)+this->offset),SEEK_SET)==-1)
{
return strerror(errno);
}
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
- if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength, SEEK_SET)==-1)
+ if (lseek(this->fd,(off_t)(((sector+track*this->sectrk)*this->secLength)+this->offset),SEEK_SET)==-1)
{
return strerror(errno);
}