aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api/lzma/alone.h
blob: 1a6b8e27eef3798b996c023c94f63d5cdea2b8c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
 * \file        lzma/alone.h
 * \brief       Handling of the legacy LZMA_Alone format
 *
 * \author      Copyright (C) 1999-2006 Igor Pavlov
 * \author      Copyright (C) 2007 Lasse Collin
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

#ifndef LZMA_H_INTERNAL
#	error Never include this file directly. Use <lzma.h> instead.
#endif


/**
 * \brief       Options for files in the LZMA_Alone format
 */
typedef struct {
	/**
	 * \brief       Uncompressed Size and usage of End of Payload Marker
	 *
	 * In contrast to .lzma Blocks, LZMA_Alone format cannot have both
	 * uncompressed size field in the header and end of payload marker.
	 * If you don't know the uncompressed size beforehand, set it to
	 * LZMA_VLI_VALUE_UNKNOWN and liblzma will embed end of payload
	 * marker.
	 */
	lzma_vli uncompressed_size;

	/**
	 * \brief       LZMA options
	 *
	 * The LZMA_Alone format supports only one filter: the LZMA filter.
	 *
	 * \note        There exists also an undocumented variant of the
	 *              LZMA_Alone format, which uses the x86 filter in
	 *              addition to LZMA. This format was never supported
	 *              by LZMA Utils and is not supported by liblzma either.
	 */
	lzma_options_lzma lzma;

} lzma_options_alone;


/**
 * \brief       Initializes LZMA_Alone encoder
 *
 * LZMA_Alone files have the suffix .lzma like the .lzma Stream files.
 * LZMA_Alone format supports only one filter, the LZMA filter. There is
 * no support for integrity checks like CRC32.
 *
 * Use this format if and only if you need to create files readable by
 * legacy LZMA tools.
 *
 * LZMA_Alone encoder doesn't support LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH.
 *
 * \return      - LZMA_OK
 *              - LZMA_MEM_ERROR
 *              - LZMA_PROG_ERROR
 */
extern lzma_ret lzma_alone_encoder(
		lzma_stream *strm, const lzma_options_alone *options);


/**
 * \brief       Initializes decoder for LZMA_Alone file
 *
 * The LZMA_Alone decoder supports LZMA_SYNC_FLUSH.
 *
 * \return      - LZMA_OK
 *              - LZMA_MEM_ERROR
 */
extern lzma_ret lzma_alone_decoder(lzma_stream *strm);