summaryrefslogtreecommitdiff
path: root/lib/cdutils.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-08-25 14:39:48 +0000
committerPixel <Pixel>2002-08-25 14:39:48 +0000
commit38d60726082b04e79edae1c8c797c6dcb8314504 (patch)
tree4a056a158c6fc21c29dd8d8ed94c010a25cee19a /lib/cdutils.cpp
parent1b0a5db816b7610c83615e93095155b1709f55da (diff)
Workiiiiiiiiiiiiiiiiiing!!!!
Diffstat (limited to 'lib/cdutils.cpp')
-rw-r--r--lib/cdutils.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/cdutils.cpp b/lib/cdutils.cpp
index e4d7749..1049535 100644
--- a/lib/cdutils.cpp
+++ b/lib/cdutils.cpp
@@ -60,10 +60,12 @@ unsigned long from_MSF(unsigned long msf, unsigned long start) {
return from_MSF(m, s, f, start);
}
-Output * open_ppf(String ppf, Handle * iso, String comment) {
+Handle * open_ppf(String ppf, Handle * iso, String comment) throw (GeneralException) {
int i, l;
Byte buffer[1024];
+ if (ppf_file)
+ throw GeneralException("Tried to open_ppf() while already opened.");
ppf_file = new Output(ppf);
ppf_file->write("PPF20\001", 6);
@@ -112,6 +114,15 @@ void write_ppf(Byte * old_sec, Byte * new_sec, int sec_num) {
}
}
+void close_ppf() throw (GeneralException) {
+ if (ppf_file) {
+ delete ppf_file;
+ ppf_file = 0;
+ } else {
+ throw GeneralException("Tried to close_ppf() without previous opening");
+ }
+}
+
String format_date(String input) {
String output;
@@ -162,7 +173,7 @@ int guess_type(Handle * f_iso, int number) {
}
void sector_seek(Handle * f_iso, long sector) {
- f_iso->seek(2336 * sector);
+ f_iso->seek(2352 * sector);
}
long read_sector(Handle * f_iso, Byte * buffer, int type, int number) {