X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/3826564e07eaffb05eca5af34a0e76f6f161b89c..650faab01603caac04494d54cf6b10a65c00ea13:/ftparchive/multicompress.h diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 444d8626f..4839af47d 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -16,34 +16,22 @@ #ifndef MULTICOMPRESS_H #define MULTICOMPRESS_H -#ifdef __GNUG__ -#pragma interface "multicompress.h" -#endif + #include #include +#include #include #include class MultiCompress { - // Enumeration of all supported compressors - struct CompType - { - const char *Name; - const char *Extension; - const char *Binary; - const char *CompArgs; - const char *UnCompArgs; - unsigned char Cost; - }; - // An output file struct Files { string Output; - const CompType *CompressProg; - Files *Next; + APT::Configuration::Compressor CompressProg; + Files *Next; FileFd TmpFile; pid_t CompressProc; time_t OldMTime; @@ -53,11 +41,10 @@ class MultiCompress Files *Outputs; pid_t Outputter; mode_t Permissions; - static const CompType Compressors[]; - bool OpenCompress(const CompType *Prog,pid_t &Pid,int FileFd, - int &OutFd,bool Comp); - bool Child(int Fd); + bool OpenCompress(APT::Configuration::Compressor const &Prog, + pid_t &Pid,int const &FileFd, int &OutFd,bool const &Comp); + bool Child(int const &Fd); bool Start(); bool Die(); @@ -67,13 +54,13 @@ class MultiCompress FILE *Input; unsigned long UpdateMTime; - bool Finalize(unsigned long &OutSize); + bool Finalize(unsigned long long &OutSize); bool OpenOld(int &Fd,pid_t &Proc); bool CloseOld(int Fd,pid_t Proc); - static bool GetStat(string Output,string Compress,struct stat &St); + static bool GetStat(string const &Output,string const &Compress,struct stat &St); - MultiCompress(string Output,string Compress,mode_t Permissions, - bool Write = true); + MultiCompress(string const &Output,string const &Compress, + mode_t const &Permissions, bool const &Write = true); ~MultiCompress(); };