]>
git.saurik.com Git - apt.git/blob - ftparchive/multicompress.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: multicompress.h,v 1.2 2001/02/20 07:03:18 jgg Exp $
4 /* ######################################################################
8 Multiple output class. Takes a single FILE* and writes it simultaneously
9 to many compressed files. Then checks if the resulting output is
10 different from any previous output and overwrites the old files. Care is
11 taken to ensure that the new files are not generally readable while they
14 ##################################################################### */
16 #ifndef MULTICOMPRESS_H
17 #define MULTICOMPRESS_H
20 #pragma interface "multicompress.h"
24 #include <apt-pkg/fileutl.h>
26 #include <sys/types.h>
30 // Enumeration of all supported compressors
34 const char *Extension
;
37 const char *UnCompArgs
;
45 const CompType
*CompressProg
;
56 static const CompType Compressors
[];
58 bool OpenCompress(const CompType
*Prog
,int &Pid
,int FileFd
,
59 int &OutFd
,bool Comp
);
66 // The FD to write to for compression.
68 unsigned long UpdateMTime
;
70 bool Finalize(unsigned long &OutSize
);
71 bool OpenOld(int &Fd
,int &Proc
);
72 bool CloseOld(int Fd
,int Proc
);
73 static bool GetStat(string Output
,string Compress
,struct stat
&St
);
75 MultiCompress(string Output
,string Compress
,mode_t Permissions
,