X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/b28fad8f6834fd98481b19d1cf54a2c65e25c6d1..5f17b19f8f99eb6f80a10846d5891f53c16178dc:/ftparchive/multicompress.h diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 3ac3b8fb2..161716b86 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -16,45 +16,31 @@ #ifndef MULTICOMPRESS_H #define MULTICOMPRESS_H - +#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,pid_t &Pid,int const &FileFd, - int &OutFd,bool const &Comp); bool Child(int const &Fd); bool Start(); bool Die(); @@ -62,15 +48,14 @@ class MultiCompress public: // The FD to write to for compression. - FILE *Input; + FileFd Input; unsigned long UpdateMTime; - bool Finalize(unsigned long &OutSize); - bool OpenOld(int &Fd,pid_t &Proc); - bool CloseOld(int Fd,pid_t Proc); - static bool GetStat(string const &Output,string const &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 const &Output,string const &Compress, + MultiCompress(std::string const &Output,std::string const &Compress, mode_t const &Permissions, bool const &Write = true); ~MultiCompress(); };