summaryrefslogtreecommitdiff
path: root/ftparchive/multicompress.h
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-02-27 23:01:40 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-02-27 23:01:40 +0100
commit03bef78461c6f443187b60799402624326843396 (patch)
tree82befecf33cd7abd714a12502e7da0b20efd6133 /ftparchive/multicompress.h
parent31273d9ff4fa1a6e073168e9cbaa91d1f53be853 (diff)
- load the supported compressors from configuration
- support adding new compressors by configuration
Diffstat (limited to 'ftparchive/multicompress.h')
-rw-r--r--ftparchive/multicompress.h21
1 files changed, 5 insertions, 16 deletions
diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h
index 3ac3b8fb2..19dede174 100644
--- a/ftparchive/multicompress.h
+++ b/ftparchive/multicompress.h
@@ -20,28 +20,18 @@
#include <string>
#include <apt-pkg/fileutl.h>
+#include <apt-pkg/aptconfiguration.h>
#include <stdio.h>
#include <sys/types.h>
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;
@@ -51,10 +41,9 @@ class MultiCompress
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 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();