]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/raw.h
Imported to git.
[icculus/xz.git] / src / liblzma / api / lzma / raw.h
1 /**
2  * \file        lzma/raw.h
3  * \brief       Raw encoder and decoder
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       Initializes raw encoder
26  *
27  * This function may be useful when implementing custom file formats.
28  *
29  * \param       strm    Pointer to properly prepared lzma_stream
30  * \param       options Array of lzma_options_filter structures.
31  *                      The end of the array must be marked with
32  *                      .id = LZMA_VLI_VALUE_UNKNOWN. The minimum
33  *                      number of filters is zero; the maximum is
34  *                      determined by available memory.
35  * \param       uncompressed_size
36  *                      Size of the uncompressed data. If it is unknown,
37  *                      use LZMA_VLI_VALUE_UNKNOWN. You need to give the
38  *                      same value to the raw decoder to decode the data.
39  * \param       allow_implicit
40  *                      If true, an implicit Copy or Subblock filter should be
41  *                      automatically added when needed. If this is false and
42  *                      an implicit filter would be needed, LZMA_PROG_ERROR is
43  *                      returned.
44  *
45  * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the
46  * filter chain support it), or LZMA_FINISH.
47  *
48  * \return      - LZMA_OK
49  *              - LZMA_MEM_ERROR
50  *              - LZMA_HEADER_ERROR
51  *              - LZMA_PROG_ERROR
52  */
53 extern lzma_ret lzma_raw_encoder(
54                 lzma_stream *strm, const lzma_options_filter *options,
55                 lzma_vli uncompressed_size, lzma_bool allow_implicit);
56
57
58 /**
59  * \brief       Initializes raw decoder
60  *
61  * The initialization of raw decoder goes similarly to raw encoder.
62  *
63  * The `action' with lzma_code() can be LZMA_RUN or LZMA_SYNC_FLUSH.
64  *
65  * \return      - LZMA_OK
66  *              - LZMA_MEM_ERROR
67  *              - LZMA_HEADER_ERROR
68  *              - LZMA_PROG_ERROR
69  */
70 extern lzma_ret lzma_raw_decoder(
71                 lzma_stream *strm, const lzma_options_filter *options,
72                 lzma_vli uncompressed_size, lzma_bool allow_implicit);