diff options
Diffstat (limited to 'lib/isobuilder.cpp')
-rw-r--r-- | lib/isobuilder.cpp | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/lib/isobuilder.cpp b/lib/isobuilder.cpp index a25243c..85760d5 100644 --- a/lib/isobuilder.cpp +++ b/lib/isobuilder.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: isobuilder.cpp,v 1.6 2003-12-06 04:26:17 pixel Exp $ */ +/* $Id: isobuilder.cpp,v 1.7 2003-12-08 15:12:57 pixel Exp $ */ #include "isobuilder.h"
@@ -425,6 +425,14 @@ isobuilder::~isobuilder() { delete root;
}
+void isobuilder::foreword(cdutils * cd) {
+ Byte sect[2352];
+ for (int i = 0; i < 16; i++) {
+ cd->read_sector(sect, MODE_RAW, i);
+ createsector(sect, MODE_RAW, i);
+ }
+}
+
void isobuilder::foreword(Handle * forewords, int mode) {
Byte sect[2352];
for (int i = 0; i < 16; i++) {
@@ -474,15 +482,18 @@ int isobuilder::putfile(Handle * file, int mode, int n) { return fsect;
}
-void isobuilder::putdatas(Byte * _datas, size_t size, int smode, int n) {
+int isobuilder::putdatas(Byte * _datas, size_t size, int smode, int n) {
Byte datas[2352];
size_t eating;
+ int dsect;
if (n >= 0) {
sector = n;
} else {
sector = lastdispsect;
}
+ dsect = sector;
+
if (smode < 0)
smode = dmode;
@@ -501,16 +512,21 @@ void isobuilder::putdatas(Byte * _datas, size_t size, int smode, int n) { }
createsector(datas, smode);
}
+
+ return dsect;
}
-void isobuilder::createsector(Byte * datas, int smode, int n) {
+int isobuilder::createsector(Byte * datas, int smode, int n) {
Byte dsector[2352];
+ int rsector;
if (n >= 0)
sector = n;
if (smode < 0)
smode = dmode;
+ rsector = sector;
+
w->seek(2352 * sector, SEEK_SET);
memcpy(dsector + sec_offsts[smode], datas, sec_sizes[smode]);
@@ -539,6 +555,8 @@ void isobuilder::createsector(Byte * datas, int smode, int n) { nsectors = MAX(nsectors, sector);
lastdispsect = MAX(lastdispsect, sector);
+
+ return rsector;
}
void isobuilder::setEOF() {
@@ -596,7 +614,10 @@ isobuilder::DirTree * isobuilder::createdir(DirTree * p, const String & _name, i r->name = _name;
r->size = size * 2048;
r->sector = lastdispsect;
- r->mode = mode;
+ if (mode >= 0)
+ r->mode = mode;
+ else
+ r->mode = dmode;
lastdispsect += size;
@@ -624,7 +645,10 @@ isobuilder::DirTree * isobuilder::createfile(DirTree * p, Handle * file, const S r->name = _name;
r->size = file->GetSize();
r->sector = putfile(file, mode);
- r->mode = mode;
+ if (mode >= 0)
+ r->mode = mode;
+ else
+ r->mode = dmode;
}
void isobuilder::copydir(isobuilder::DirTree * r, const String & _name, cdutils * cd, cdutils::DirEntry * d, int mode) {
@@ -633,6 +657,9 @@ void isobuilder::copydir(isobuilder::DirTree * r, const String & _name, cdutils int nsectors = d->Size / 2048, ssize, c = 0;
int fsize, osize;
+ if (mode < 0)
+ mode = dmode;
+
r->fromdir(d);
if (_name != "")
r->name = _name;
|