aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/api/lzma.h
blob: ad39d3498ade5a692937d1a929922f9935111daa (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
 * \file        lzma.h
 * \brief       The public API of liblzma
 *
 * liblzma is a LZMA compression library with a zlib-like API.
 * liblzma is based on LZMA SDK found from http://7-zip.org/sdk.html.
 *
 * \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.
 *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *
 * Before #including this file, you must make the following types available:
 *  - size_t
 *  - uint8_t
 *  - int32_t
 *  - uint32_t
 *  - int64_t
 *  - uint64_t
 *
 * Before #including this file, you must make the following macros available:
 *  - UINT32_C(n)
 *  - UINT64_C(n)
 *  - UINT32_MAX
 *  - UINT64_MAX
 *
 * Easiest way to achieve the above is to #include sys/types.h and inttypes.h
 * before #including lzma.h. However, some pre-C99 libc headers don't provide
 * all the required types in inttypes.h (that file may even be missing).
 * Portable applications need to provide these types themselves. This way
 * liblzma API can use the standard types instead of defining its own
 * (e.g. lzma_uint32).
 *
 * Note that the API still has lzma_bool, because using stdbool.h would
 * break C89 and C++ programs on many systems.
 */

#ifndef LZMA_H
#define LZMA_H

/******************
 * GCC extensions *
 ******************/

/*
 * GCC extensions are used conditionally in the public API. It doesn't
 * break anything if these are sometimes enabled and sometimes not, only
 * affects warnings and optimizations.
 */
#if defined(__GNUC__) && __GNUC__ >= 3
#	ifndef lzma_attribute
#		define lzma_attribute(attr) __attribute__(attr)
#	endif
#	ifndef lzma_restrict
#		define lzma_restrict __restrict__
#	endif
#else
#	ifndef lzma_attribute
#		define lzma_attribute(attr)
#	endif
#	ifndef lzma_restrict
#		define lzma_restrict
#	endif
#endif


/**************
 * Subheaders *
 **************/

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Subheaders check that this is defined. It is to prevent including
 * them directly from applications.
 */
#define LZMA_H_INTERNAL 1

/* Basic features */
#include "lzma/init.h"
#include "lzma/base.h"
#include "lzma/vli.h"
#include "lzma/filter.h"
#include "lzma/check.h"

/* Filters */
#include "lzma/copy.h"
#include "lzma/subblock.h"
#include "lzma/simple.h"
#include "lzma/delta.h"
#include "lzma/lzma.h"

/* Container formats and Metadata */
#include "lzma/block.h"
#include "lzma/index.h"
#include "lzma/extra.h"
#include "lzma/metadata.h"
#include "lzma/stream.h"
#include "lzma/alone.h"
#include "lzma/raw.h"
#include "lzma/auto.h"

/* Advanced features */
#include "lzma/info.h"
#include "lzma/alignment.h"
#include "lzma/stream_flags.h"
#include "lzma/memlimit.h"

/* Version number */
#include "lzma/version.h"

/*
 * All subheaders included. Undefine LZMA_H_INTERNAL to prevent applications
 * re-including the subheaders.
 */
#undef LZMA_H_INTERNAL

#ifdef __cplusplus
}
#endif

#endif /* ifndef LZMA_H */