]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma.h
Introduced compatibility with systems that have pre-C99
[icculus/xz.git] / src / liblzma / api / lzma.h
1 /**
2  * \file        lzma.h
3  * \brief       The public API of liblzma
4  *
5  * liblzma is a LZMA compression library with a zlib-like API.
6  * liblzma is based on LZMA SDK found from http://7-zip.org/sdk.html.
7  *
8  * \author      Copyright (C) 1999-2006 Igor Pavlov
9  * \author      Copyright (C) 2007 Lasse Collin
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2.1 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
22  *
23  * Before #including this file, you must make the following types available:
24  *  - size_t
25  *  - uint8_t
26  *  - int32_t
27  *  - uint32_t
28  *  - int64_t
29  *  - uint64_t
30  *
31  * Before #including this file, you must make the following macros available:
32  *  - UINT32_C(n)
33  *  - UINT64_C(n)
34  *  - UINT32_MAX
35  *  - UINT64_MAX
36  *
37  * Easiest way to achieve the above is to #include sys/types.h and inttypes.h
38  * before #including lzma.h. However, some pre-C99 libc headers don't provide
39  * all the required types in inttypes.h (that file may even be missing).
40  * Portable applications need to provide these types themselves. This way
41  * liblzma API can use the standard types instead of defining its own
42  * (e.g. lzma_uint32).
43  *
44  * Note that the API still has lzma_bool, because using stdbool.h would
45  * break C89 and C++ programs on many systems.
46  */
47
48 #ifndef LZMA_H
49 #define LZMA_H
50
51 /******************
52  * GCC extensions *
53  ******************/
54
55 /*
56  * GCC extensions are used conditionally in the public API. It doesn't
57  * break anything if these are sometimes enabled and sometimes not, only
58  * affects warnings and optimizations.
59  */
60 #if defined(__GNUC__) && __GNUC__ >= 3
61 #       ifndef lzma_attribute
62 #               define lzma_attribute(attr) __attribute__(attr)
63 #       endif
64 #       ifndef lzma_restrict
65 #               define lzma_restrict __restrict__
66 #       endif
67 #else
68 #       ifndef lzma_attribute
69 #               define lzma_attribute(attr)
70 #       endif
71 #       ifndef lzma_restrict
72 #               define lzma_restrict
73 #       endif
74 #endif
75
76
77 /**************
78  * Subheaders *
79  **************/
80
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84
85 /*
86  * Subheaders check that this is defined. It is to prevent including
87  * them directly from applications.
88  */
89 #define LZMA_H_INTERNAL 1
90
91 /* Basic features */
92 #include "lzma/init.h"
93 #include "lzma/base.h"
94 #include "lzma/vli.h"
95 #include "lzma/filter.h"
96 #include "lzma/check.h"
97
98 /* Filters */
99 #include "lzma/copy.h"
100 #include "lzma/subblock.h"
101 #include "lzma/simple.h"
102 #include "lzma/delta.h"
103 #include "lzma/lzma.h"
104
105 /* Container formats and Metadata */
106 #include "lzma/block.h"
107 #include "lzma/index.h"
108 #include "lzma/extra.h"
109 #include "lzma/metadata.h"
110 #include "lzma/stream.h"
111 #include "lzma/alone.h"
112 #include "lzma/raw.h"
113 #include "lzma/auto.h"
114
115 /* Advanced features */
116 #include "lzma/info.h"
117 #include "lzma/alignment.h"
118 #include "lzma/stream_flags.h"
119 #include "lzma/memlimit.h"
120
121 /* Version number */
122 #include "lzma/version.h"
123
124 /*
125  * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications
126  * re-including the subheaders.
127  */
128 #undef LZMA_H_INTERNAL
129
130 #ifdef __cplusplus
131 }
132 #endif
133
134 #endif /* ifndef LZMA_H */