]> icculus.org git repositories - icculus/xz.git/blob - src/xz/process.h
709f287da6743686261b9b2c78344192ad4471c1
[icculus/xz.git] / src / xz / process.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       process.h
4 /// \brief      Compresses or uncompresses a file
5 //
6 //  Copyright (C) 2007 Lasse Collin
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 enum operation_mode {
21         MODE_COMPRESS,
22         MODE_DECOMPRESS,
23         MODE_TEST,
24         MODE_LIST,
25 };
26
27
28 // NOTE: The order of these is significant in suffix.c.
29 enum format_type {
30         FORMAT_AUTO,
31         FORMAT_XZ,
32         FORMAT_LZMA,
33         // HEADER_GZIP,
34         FORMAT_RAW,
35 };
36
37
38 /// Operation mode of the command line tool. This is set in args.c and read
39 /// in several files.
40 extern enum operation_mode opt_mode;
41
42 /// File format to use when encoding or what format(s) to accept when
43 /// decoding. This is a global because it's needed also in suffix.c.
44 /// This is set in args.c.
45 extern enum format_type opt_format;
46
47
48 /// Set the integrity check type used when compressing
49 extern void coder_set_check(lzma_check check);
50
51 /// Set preset number
52 extern void coder_set_preset(size_t new_preset);
53
54 /// Enable extreme mode
55 extern void coder_set_extreme(void);
56
57 /// Add a filter to the custom filter chain
58 extern void coder_add_filter(lzma_vli id, void *options);
59
60 ///
61 extern void coder_set_compression_settings(void);
62
63 extern void process_init(void);
64
65 extern void process_file(const char *filename);