]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/simple.h
Fix test_filter_flags to match the new restriction of lc+lp.
[icculus/xz.git] / src / liblzma / api / lzma / simple.h
1 /**
2  * \file        lzma/simple.h
3  * \brief       So called "simple" filters
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 /* Filter IDs for lzma_options_filter.id */
25
26 #define LZMA_FILTER_X86         LZMA_VLI_C(0x04)
27         /**<
28          * BCJ (Branch, Call, Jump) filter for x86 binaries
29          */
30
31 #define LZMA_FILTER_POWERPC     LZMA_VLI_C(0x05)
32         /**<
33          * Filter for Big endian PowerPC binaries
34          */
35
36 #define LZMA_FILTER_IA64        LZMA_VLI_C(0x06)
37         /**<
38          * Filter for IA64 (Itanium) binaries.
39          */
40
41 #define LZMA_FILTER_ARM         LZMA_VLI_C(0x07)
42         /**<
43          * Filter for ARM binaries.
44          */
45
46 #define LZMA_FILTER_ARMTHUMB    LZMA_VLI_C(0x08)
47         /**<
48          * Filter for ARMThumb binaries.
49          */
50
51 #define LZMA_FILTER_SPARC       LZMA_VLI_C(0x09)
52         /**<
53          * Filter for SPARC binaries.
54          */
55
56
57 /**
58  * \brief       Options for so called "simple" filters
59  *
60  * The simple filters never change the size of the data. Specifying options
61  * for them is optional: if pointer to options is NULL, default values are
62  * used. You probably never need to specify these options, so just set the
63  * options pointer to NULL and be happy.
64  *
65  * If options with non-default values have been specified when encoding,
66  * the same options must also be specified when decoding.
67  *
68  * \note        At the moment, none of the simple filters support
69  *              LZMA_SYNC_FLUSH. If LZMA_SYNC_FLUSH is specified,
70  *              LZMA_HEADER_ERROR will be returned. If there is need,
71  *              partial support for LZMA_SYNC_FLUSH can be added in future.
72  *              Partial means that flushing would be possible only at
73  *              offsets that are multiple of 2, 4, or 16 depending on
74  *              the filter, except x86 which cannot be made to support
75  *              LZMA_SYNC_FLUSH predictably.
76  */
77 typedef struct {
78         /**
79          * \brief       Start offset for branch conversions
80          *
81          * This setting is useful only when the same filter is used
82          * _separately_ for multiple sections of the same executable file,
83          * and the sections contain cross-section branch/call/jump
84          * instructions. In that case it is benefical to set the start
85          * offset of the non-first sections so that the relative addresses
86          * of the cross-section branch/call/jump instructions will use the
87          * same absolute addresses as in the first section.
88          *
89          * When the pointer to options is NULL, the default value is used.
90          * The default value is zero.
91          */
92         uint32_t start_offset;
93
94 } lzma_options_simple;