From 0ddf2fc631fe6db08eed31c9a21438e2829ca024 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 10 Feb 2003 12:45:29 +0000 Subject: Whoups, daily commit... --- src/paq.cc | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/paq.cc b/src/paq.cc index 913e925..2cbddd4 100644 --- a/src/paq.cc +++ b/src/paq.cc @@ -57,7 +57,7 @@ void finalize(void) { cerr << "Finalize file " << *i << endl; file = new Input(*i); size = file->GetSize(); - Archive->write(&size, 4); + Archive->writeU32(size); delete file; file = new Input(*i + ".gz"); copy(file, Archive); @@ -89,18 +89,18 @@ void process_file(const String & filename) { size = from->GetSize() + 4; cerr << old_size << " --> " << from->GetSize() << " (" << 100 * from->GetSize() / old_size << "%)\n"; - Archive->write(&size, 4); + Archive->writeU32(size); delete from; t = 0; - Archive->write(&t, 1); + Archive->writeU8(t); } void process_directory(const String & dirname) throw (GeneralException) { struct dirent ** namelist; int n, i; - char t; + Uint32 t; struct stat fstats; String fname; @@ -118,21 +118,18 @@ void process_directory(const String & dirname) throw (GeneralException) { if (S_ISDIR(fstats.st_mode)) { if (!Regex("^\\.{1,2}$").Match(namelist[i]->d_name)) { t = strlen(namelist[i]->d_name); - Archive->write(&t, 1); + Archive->writeU8(t); Archive->write(namelist[i]->d_name, t); t = 0; - Archive->write(&t, 1); - Archive->write(&t, 1); - Archive->write(&t, 1); - Archive->write(&t, 1); + Archive->writeU32(t); t = 1; - Archive->write(&t, 1); + Archive->writeU8(t); process_directory(dirname + "/" + namelist[i]->d_name); } } else { if (!Regex("\\.gz$").Match(namelist[i]->d_name)) { t = strlen(namelist[i]->d_name); - Archive->write(&t, 1); + Archive->writeU8(t); Archive->write(namelist[i]->d_name, t); process_file(dirname + "/" + namelist[i]->d_name); } @@ -143,7 +140,7 @@ void process_directory(const String & dirname) throw (GeneralException) { free((void *)namelist); t = 0; - Archive->write(&t, 1); + Archive->writeU8(t); } void build_archive(const String & dirname) { -- cgit v1.2.3