diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/paq.cc | 21 |
1 files changed, 9 insertions, 12 deletions
@@ -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) { |