Bump version and soname for 5.6.0.
[xz.git] / src / liblzma / api / lzma / version.h
blobc13a82d5f3b57dc2d3a9de1ae12c53f111f46974
1 /* SPDX-License-Identifier: 0BSD */
3 /**
4 * \file lzma/version.h
5 * \brief Version number
6 * \note Never include this file directly. Use <lzma.h> instead.
7 */
9 /*
10 * Author: Lasse Collin
13 #ifndef LZMA_H_INTERNAL
14 # error Never include this file directly. Use <lzma.h> instead.
15 #endif
18 /** \brief Major version number of the liblzma release. */
19 #define LZMA_VERSION_MAJOR 5
21 /** \brief Minor version number of the liblzma release. */
22 #define LZMA_VERSION_MINOR 6
24 /** \brief Patch version number of the liblzma release. */
25 #define LZMA_VERSION_PATCH 0
27 /**
28 * \brief Version stability marker
30 * This will always be one of three values:
31 * - LZMA_VERSION_STABILITY_ALPHA
32 * - LZMA_VERSION_STABILITY_BETA
33 * - LZMA_VERSION_STABILITY_STABLE
35 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
37 /** \brief Commit version number of the liblzma release */
38 #ifndef LZMA_VERSION_COMMIT
39 # define LZMA_VERSION_COMMIT ""
40 #endif
44 * Map symbolic stability levels to integers.
46 #define LZMA_VERSION_STABILITY_ALPHA 0
47 #define LZMA_VERSION_STABILITY_BETA 1
48 #define LZMA_VERSION_STABILITY_STABLE 2
51 /**
52 * \brief Compile-time version number
54 * The version number is of format xyyyzzzs where
55 * - x = major
56 * - yyy = minor
57 * - zzz = revision
58 * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable
60 * The same xyyyzzz triplet is never reused with different stability levels.
61 * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta
62 * or 5.1.0 stable.
64 * \note The version number of liblzma has nothing to with
65 * the version number of Igor Pavlov's LZMA SDK.
67 #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \
68 + LZMA_VERSION_MINOR * UINT32_C(10000) \
69 + LZMA_VERSION_PATCH * UINT32_C(10) \
70 + LZMA_VERSION_STABILITY)
74 * Macros to construct the compile-time version string
76 #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA
77 # define LZMA_VERSION_STABILITY_STRING "alpha"
78 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA
79 # define LZMA_VERSION_STABILITY_STRING "beta"
80 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE
81 # define LZMA_VERSION_STABILITY_STRING ""
82 #else
83 # error Incorrect LZMA_VERSION_STABILITY
84 #endif
86 #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \
87 #major "." #minor "." #patch stability commit
89 #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \
90 LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
93 /**
94 * \brief Compile-time version as a string
96 * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable
97 * versions don't have any "stable" suffix). In future, a snapshot built
98 * from source code repository may include an additional suffix, for example
99 * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form
100 * in LZMA_VERSION macro.
102 #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \
103 LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \
104 LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
105 LZMA_VERSION_COMMIT)
108 /* #ifndef is needed for use with windres (MinGW-w64 or Cygwin). */
109 #ifndef LZMA_H_INTERNAL_RC
112 * \brief Run-time version number as an integer
114 * This allows an application to compare if it was built against the same,
115 * older, or newer version of liblzma that is currently running.
117 * \return The value of LZMA_VERSION macro at the compile time of liblzma
119 extern LZMA_API(uint32_t) lzma_version_number(void)
120 lzma_nothrow lzma_attr_const;
124 * \brief Run-time version as a string
126 * This function may be useful to display which version of liblzma an
127 * application is currently using.
129 * \return Run-time version of liblzma
131 extern LZMA_API(const char *) lzma_version_string(void)
132 lzma_nothrow lzma_attr_const;
134 #endif