X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b2e465d6d32d2dc884f58b94acb7e35f671a87fe..8d1cb6da6e21302c654da3f09de3975af7e4a11f:/ftparchive/multicompress.h diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 212dec63d..161716b86 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -16,64 +16,47 @@ #ifndef MULTICOMPRESS_H #define MULTICOMPRESS_H -#ifdef __GNUG__ -#pragma interface "multicompress.h" -#endif +#include +#include #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; + std::string Output; + APT::Configuration::Compressor CompressProg; + Files *Next; FileFd TmpFile; pid_t CompressProc; time_t OldMTime; - int Fd; }; Files *Outputs; pid_t Outputter; mode_t Permissions; - static const CompType Compressors[]; - bool OpenCompress(const CompType *Prog,int &Pid,int FileFd, - int &OutFd,bool Comp); - bool Child(int Fd); + bool Child(int const &Fd); bool Start(); bool Die(); public: // The FD to write to for compression. - FILE *Input; + FileFd Input; unsigned long UpdateMTime; - bool Finalize(unsigned long &OutSize); - bool OpenOld(int &Fd,int &Proc); - bool CloseOld(int Fd,int Proc); - static bool GetStat(string Output,string Compress,struct stat &St); + bool Finalize(unsigned long long &OutSize); + bool OpenOld(FileFd &Fd); + static bool GetStat(std::string const &Output,std::string const &Compress,struct stat &St); - MultiCompress(string Output,string Compress,mode_t Permissions, - bool Write = true); + MultiCompress(std::string const &Output,std::string const &Compress, + mode_t const &Permissions, bool const &Write = true); ~MultiCompress(); };