diff options
Diffstat (limited to 'includes/cdutils.h')
-rw-r--r-- | includes/cdutils.h | 123 |
1 files changed, 69 insertions, 54 deletions
diff --git a/includes/cdutils.h b/includes/cdutils.h index e3cf8fb..38eb118 100644 --- a/includes/cdutils.h +++ b/includes/cdutils.h @@ -27,62 +27,77 @@ #define GUESS 5 -struct DirEntry { - unsigned char R; - unsigned char NExt; - unsigned long Sector; - unsigned long BESector; - unsigned long Size; - unsigned long BESize; - unsigned char Year; - unsigned char Month; - unsigned char Day; - unsigned char Hour; - unsigned char Minute; - unsigned char Second; - unsigned char Offset; - unsigned char Flags; - unsigned char HandleUnit; - unsigned char HandleGap; - unsigned short VolSeq; - unsigned short BEVolSeq; - unsigned char N; - char id; -} PACKED; +extern const long sec_sizes[]; +extern const long sec_offsts[]; +extern const String sec_modes[]; -extern struct DirEntry rootDir; +class cdutils : public Base { + public: + cdutils(Handle * f_iso_r, Handle * f_iso_w = 0); + virtual ~cdutils(); -extern long sec_sizes[]; -extern long sec_offsts[]; -extern String sec_modes[]; + struct DirEntry { + unsigned char R; + unsigned char NExt; + unsigned long Sector; + unsigned long BESector; + unsigned long Size; + unsigned long BESize; + unsigned char Year; + unsigned char Month; + unsigned char Day; + unsigned char Hour; + unsigned char Minute; + unsigned char Second; + unsigned char Offset; + unsigned char Flags; + unsigned char HandleUnit; + unsigned char HandleGap; + unsigned short VolSeq; + unsigned short BEVolSeq; + unsigned char N; + char id; + } PACKED; -Handle * open_ppf(String ppf, Handle * iso, String comment) throw(GeneralException); -void close_ppf() throw(GeneralException); -unsigned short int swap_word(unsigned short int i); -unsigned long int swap_dword(unsigned long int i); -int guess_type(Handle * f_iso, int number); -void sector_seek(Handle * f_iso, long sector); -long read_sector(Handle * f_iso, Byte * buffer, int type, int number = -1); -void read_datas(Handle * f_iso, Byte * buffer, int type, int number, long size); -void read_file(Handle * f_iso, Handle * Handle, int type, int number, long size); -void write_sector(Handle * f_iso_r, Handle * f_iso_w, Byte * buffer, int type, int number = -1); -void write_datas(Handle * f_iso_r, Handle * f_iso_w, Byte * buffer, int type, int number, long size); -void write_file(Handle * f_iso_r, Handle * f_iso_w, Handle * Handle, int type, int number = -1); -int get_iso_infos(Handle * h); -int show_iso_infos(Handle * h); -int get_pt_infos(Handle * h); -int show_pt_infos(Handle * h); -struct DirEntry find_path(Handle * h, String path); -struct DirEntry find_parent(Handle * h, String path); -void show_head_entry(void); -int show_entry(struct DirEntry * dir); -int show_dir(Handle * h, struct DirEntry * dir); -struct DirEntry find_dir_entry(Handle * h, struct DirEntry * dir, String name); -struct DirEntry * find_dir_entry(Handle * h, Byte ** buffer, struct DirEntry * dir, String name); -unsigned char from_BCD(unsigned char x); -unsigned char to_BCD(unsigned char x); -int is_valid_BCD(unsigned char x); -unsigned long from_MSF(unsigned long msf, unsigned long start = 150); -unsigned long from_MSF(unsigned char m, unsigned char s, unsigned char f, unsigned long start = 150); + + struct DirEntry rootDir; + + Handle * open_ppf(String ppf, String comment) throw(GeneralException); + void close_ppf() throw(GeneralException); + void set_iso_w(Handle *); + unsigned short int swap_word(unsigned short int i); + unsigned long int swap_dword(unsigned long int i); + int guess_type(int number = -1); + void sector_seek(long sector); + long read_sector(Byte * buffer, int type, int number = -1); + void read_datas(Byte * buffer, int type, int number, long size); + void read_file(Handle * Handle, int type, int number, long size); + void write_sector(Byte * buffer, int type, int number = -1); + void write_datas(Byte * buffer, int type, int number, long size); + void write_file(Handle * Handle, int type, int number = -1); + int get_iso_infos(); + int show_iso_infos(); + int get_pt_infos(); + int show_pt_infos(); + struct DirEntry find_path(String path); + struct DirEntry find_parent(String path); + void show_head_entry(void); + int show_entry(struct DirEntry * dir); + int show_dir(struct DirEntry * dir); + struct DirEntry find_dir_entry(struct DirEntry * dir, String name); + struct DirEntry * find_dir_entry(Byte ** buffer, struct DirEntry * dir, String name); + unsigned char from_BCD(unsigned char x); + unsigned char to_BCD(unsigned char x); + int is_valid_BCD(unsigned char x); + unsigned long from_MSF(unsigned long msf, unsigned long start = 150); + unsigned long from_MSF(unsigned char m, unsigned char s, unsigned char f, unsigned long start = 150); + private: + void write_ppf(Byte * old_sec, Byte * new_sec, int sec_num); + String format_date(String input); + yazedc yazedc_o; + + Handle * f_iso_r, * f_iso_w, * ppf_file; + int pt1, pt2, snum, ptl, root; +}; #endif |