]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/api/lzma/version.h
599c2cde95492b985374675c271f5150a8c68e9d
[icculus/xz.git] / src / liblzma / api / lzma / version.h
1 /**
2  * \file        lzma/version.h
3  * \brief       Version number
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  * Version number splitted in components
26  */
27 #define LZMA_VERSION_MAJOR 4
28 #define LZMA_VERSION_MINOR 999
29 #define LZMA_VERSION_PATCH 8
30 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_BETA
31
32 #ifndef LZMA_VERSION_COMMIT
33 #       define LZMA_VERSION_COMMIT ""
34 #endif
35
36
37 /*
38  * Map symbolic stability levels to integers.
39  */
40 #define LZMA_VERSION_STABILITY_ALPHA 0
41 #define LZMA_VERSION_STABILITY_BETA 1
42 #define LZMA_VERSION_STABILITY_STABLE 2
43
44
45 /**
46  * \brief       Compile-time version number
47  *
48  * The version number is of format xyyyzzzs where
49  *  - x = major
50  *  - yyy = minor
51  *  - zzz = revision
52  *  - s indicates stability: 0 = alpha, 1 = beta, 2 = stable
53  *
54  * The same xyyyzzz triplet is never reused with different stability levels.
55  * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta
56  * or 5.1.0 stable.
57  *
58  * \note        The version number of liblzma has nothing to with
59  *              the version number of Igor Pavlov's LZMA SDK.
60  */
61 #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \
62                 + LZMA_VERSION_MINOR * UINT32_C(10000) \
63                 + LZMA_VERSION_PATCH * UINT32_C(10) \
64                 + LZMA_VERSION_STABILITY)
65
66
67 /*
68  * Macros to construct the compile-time version string
69  */
70 #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA
71 #       define LZMA_VERSION_STABILITY_STRING "alpha"
72 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA
73 #       define LZMA_VERSION_STABILITY_STRING "beta"
74 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE
75 #       define LZMA_VERSION_STABILITY_STRING ""
76 #else
77 #       error Incorrect LZMA_VERSION_STABILITY
78 #endif
79
80 #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \
81                 #major "." #minor "." #patch stability commit
82
83 #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \
84                 LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
85
86
87 /**
88  * \brief       Compile-time version as a string
89  *
90  * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable
91  * versions don't have any "stable" suffix). In future, a snapshot built
92  * from source code repository may include an additional suffix, for example
93  * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form
94  * in LZMA_VERSION macro.
95  */
96 #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \
97                 LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \
98                 LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
99                 LZMA_VERSION_COMMIT)
100
101
102 /* #ifndef is needed for use with MinGW's windres. */
103 #ifndef LZMA_H_INTERNAL_RC
104
105 /**
106  * \brief       Run-time version number as an integer
107  *
108  * Returns the value of LZMA_VERSION macro at the compile time of liblzma.
109  * This allows the application to compare if it was built against the same,
110  * older, or newer version of liblzma that is currently running.
111  */
112 extern LZMA_API(uint32_t) lzma_version_number(void) lzma_attr_const;
113
114
115 /**
116  * \brief       Run-time version as a string
117  *
118  * This function may be useful if you want to display which version of
119  * liblzma your application is currently using.
120  */
121 extern LZMA_API(const char *) lzma_version_string(void) lzma_attr_const;
122
123 #endif