1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 // vim: expandtab:ts=8:sw=4:softtabstop=4:
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file       coder.h
6 /// \brief      Compresses or uncompresses a file
7 //
8 //  Author:     Lasse Collin
9 //
10 //  This file has been put into the public domain.
11 //  You can do whatever you want with this file.
12 //
13 ///////////////////////////////////////////////////////////////////////////////
14 
15 enum operation_mode {
16 	MODE_COMPRESS,
17 	MODE_DECOMPRESS,
18 	MODE_TEST,
19 	MODE_LIST,
20 };
21 
22 
23 // NOTE: The order of these is significant in suffix.c.
24 enum format_type {
25 	FORMAT_AUTO,
26 	FORMAT_XZ,
27 	FORMAT_LZMA,
28 	// HEADER_GZIP,
29 	FORMAT_RAW,
30 };
31 
32 
33 /// Operation mode of the command line tool. This is set in args.c and read
34 /// in several files.
35 extern enum operation_mode opt_mode;
36 
37 /// File format to use when encoding or what format(s) to accept when
38 /// decoding. This is a global because it's needed also in suffix.c.
39 /// This is set in args.c.
40 extern enum format_type opt_format;
41 
42 
43 /// Set the integrity check type used when compressing
44 extern void coder_set_check(lzma_check check);
45 
46 /// Set preset number
47 extern void coder_set_preset(size_t new_preset);
48 
49 /// Enable extreme mode
50 extern void coder_set_extreme(void);
51 
52 /// Add a filter to the custom filter chain
53 extern void coder_add_filter(lzma_vli id, void *options);
54 
55 ///
56 extern void coder_set_compression_settings(void);
57 
58 /// Compress or decompress the given file
59 extern void coder_run(const char *filename);
60