diff options
Diffstat (limited to 'lib/cdutils.cpp')
| -rw-r--r-- | lib/cdutils.cpp | 15 | 
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) { | 
