]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/alone.h
Imported to git.
[icculus/xz.git] / src / liblzma / api / lzma / alone.h
1 /**
2  * \file        lzma/alone.h
3  * \brief       Handling of the legacy LZMA_Alone format
4  *
5  * \author      Copyright (C) 1999-2006 Igor Pavlov
6  * \author      Copyright (C) 2007 Lasse Collin
7  *
8  * This library 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 library 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 #ifndef LZMA_H_INTERNAL
20 #       error Never include this file directly. Use <lzma.h> instead.
21 #endif
22
23
24 /**
25  * \brief       Options for files in the LZMA_Alone format
26  */
27 typedef struct {
28         /**
29          * \brief       Uncompressed Size and usage of End of Payload Marker
30          *
31          * In contrast to .lzma Blocks, LZMA_Alone format cannot have both
32          * uncompressed size field in the header and end of payload marker.
33          * If you don't know the uncompressed size beforehand, set it to
34          * LZMA_VLI_VALUE_UNKNOWN and liblzma will embed end of payload
35          * marker.
36          */
37         lzma_vli uncompressed_size;
38
39         /**
40          * \brief       LZMA options
41          *
42          * The LZMA_Alone format supports only one filter: the LZMA filter.
43          *
44          * \note        There exists also an undocumented variant of the
45          *              LZMA_Alone format, which uses the x86 filter in
46          *              addition to LZMA. This format was never supported
47          *              by LZMA Utils and is not supported by liblzma either.
48          */
49         lzma_options_lzma lzma;
50
51 } lzma_options_alone;
52
53
54 /**
55  * \brief       Initializes LZMA_Alone encoder
56  *
57  * LZMA_Alone files have the suffix .lzma like the .lzma Stream files.
58  * LZMA_Alone format supports only one filter, the LZMA filter. There is
59  * no support for integrity checks like CRC32.
60  *
61  * Use this format if and only if you need to create files readable by
62  * legacy LZMA tools.
63  *
64  * LZMA_Alone encoder doesn't support LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH.
65  *
66  * \return      - LZMA_OK
67  *              - LZMA_MEM_ERROR
68  *              - LZMA_PROG_ERROR
69  */
70 extern lzma_ret lzma_alone_encoder(
71                 lzma_stream *strm, const lzma_options_alone *options);
72
73
74 /**
75  * \brief       Initializes decoder for LZMA_Alone file
76  *
77  * The LZMA_Alone decoder supports LZMA_SYNC_FLUSH.
78  *
79  * \return      - LZMA_OK
80  *              - LZMA_MEM_ERROR
81  */
82 extern lzma_ret lzma_alone_decoder(lzma_stream *strm);