root/morphix/trunk/cloop/advancecomp-1.9_create_compressed_fs/compress.h

Revision 2, 2.4 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 /*
2  * This file is part of the Advance project.
3  *
4  * Copyright (C) 2002 Andrea Mazzoleni
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #ifndef __COMPRESS_H
22 #define __COMPRESS_H
23
24 #ifdef USE_7Z
25 #include "7z/7z.h"
26 #endif
27
28 #ifdef USE_BZIP2
29 #include <bzlib.h>
30 #endif
31
32 #include <zlib.h>
33
34 // --------------------------------------------------------------------------
35 // Compression
36
37 unsigned oversize_deflate(unsigned size);
38 unsigned oversize_zlib(unsigned size);
39
40 bool decompress_deflate_zlib(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned out_size);
41 bool compress_deflate_zlib(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned& out_size, int compression_level, int strategy, int mem_level);
42
43 bool decompress_bzip2(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned out_size);
44 bool compress_bzip2(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned& out_size, int blocksize, int workfactor);
45
46 bool decompress_rfc1950_zlib(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned out_size);
47 bool compress_rfc1950_zlib(const unsigned char* in_data, unsigned in_size, unsigned char* out_data, unsigned& out_size, int compression_level, int strategy, int mem_level);
48
49 // -------------------------------------------------------------------------
50 // Level
51
52 enum shrink_t {
53         shrink_none,
54         shrink_fast,
55         shrink_normal,
56         shrink_extra,
57         shrink_extreme
58 };
59
60 bool compress_zlib(shrink_t level, unsigned char* out_data, unsigned& out_size, const unsigned char* in_data, unsigned in_size);
61 bool compress_deflate(shrink_t level, unsigned char* out_data, unsigned& out_size, const unsigned char* in_data, unsigned in_size);
62
63 #endif
64
Note: See TracBrowser for help on using the browser.