liblzma: Improve documentation for version.h.
[xz/debian.git] / src / liblzma / api / lzma / version.h
blob4ee90d55e674f5a883976ff174b7a2dbcb71c14d
1 /**
2 * \file lzma/version.h
3 * \brief Version number
4 * \note Never include this file directly. Use <lzma.h> instead.
6 * See ../lzma.h for information about liblzma as a whole.
7 */
9 /*
10 * Author: Lasse Collin
12 * This file has been put into the public domain.
13 * You can do whatever you want with this file.
16 #ifndef LZMA_H_INTERNAL
17 # error Never include this file directly. Use <lzma.h> instead.
18 #endif
21 /** \brief Major version number of the liblzma release. */
22 #define LZMA_VERSION_MAJOR 5
24 /** \brief Minor version number of the liblzma release. */
25 #define LZMA_VERSION_MINOR 4
27 /** \brief Patch version number of the liblzma release. */
28 #define LZMA_VERSION_PATCH 1
30 /**
31 * \brief Version stability marker
33 * This will always be one of three values:
34 * - LZMA_VERSION_STABILITY_ALPHA
35 * - LZMA_VERSION_STABILITY_BETA
36 * - LZMA_VERSION_STABILITY_STABLE
38 #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
40 /** \brief Commit version number of the liblzma release */
41 #ifndef LZMA_VERSION_COMMIT
42 # define LZMA_VERSION_COMMIT ""
43 #endif
47 * Map symbolic stability levels to integers.
49 #define LZMA_VERSION_STABILITY_ALPHA 0
50 #define LZMA_VERSION_STABILITY_BETA 1
51 #define LZMA_VERSION_STABILITY_STABLE 2
54 /**
55 * \brief Compile-time version number
57 * The version number is of format xyyyzzzs where
58 * - x = major
59 * - yyy = minor
60 * - zzz = revision
61 * - s indicates stability: 0 = alpha, 1 = beta, 2 = stable
63 * The same xyyyzzz triplet is never reused with different stability levels.
64 * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta
65 * or 5.1.0 stable.
67 * \note The version number of liblzma has nothing to with
68 * the version number of Igor Pavlov's LZMA SDK.
70 #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \
71 + LZMA_VERSION_MINOR * UINT32_C(10000) \
72 + LZMA_VERSION_PATCH * UINT32_C(10) \
73 + LZMA_VERSION_STABILITY)
77 * Macros to construct the compile-time version string
79 #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA
80 # define LZMA_VERSION_STABILITY_STRING "alpha"
81 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA
82 # define LZMA_VERSION_STABILITY_STRING "beta"
83 #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE
84 # define LZMA_VERSION_STABILITY_STRING ""
85 #else
86 # error Incorrect LZMA_VERSION_STABILITY
87 #endif
89 #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \
90 #major "." #minor "." #patch stability commit
92 #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \
93 LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
96 /**
97 * \brief Compile-time version as a string
99 * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable
100 * versions don't have any "stable" suffix). In future, a snapshot built
101 * from source code repository may include an additional suffix, for example
102 * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form
103 * in LZMA_VERSION macro.
105 #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \
106 LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \
107 LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
108 LZMA_VERSION_COMMIT)
111 /* #ifndef is needed for use with windres (MinGW or Cygwin). */
112 #ifndef LZMA_H_INTERNAL_RC
115 * \brief Run-time version number as an integer
117 * This allows an application to compare if it was built against the same,
118 * older, or newer version of liblzma that is currently running.
120 * \return The value of LZMA_VERSION macro at the compile time of liblzma
122 extern LZMA_API(uint32_t) lzma_version_number(void)
123 lzma_nothrow lzma_attr_const;
127 * \brief Run-time version as a string
129 * This function may be useful to display which version of liblzma an
130 * application is currently using.
132 * \return Run-time version of liblzma
134 extern LZMA_API(const char *) lzma_version_string(void)
135 lzma_nothrow lzma_attr_const;
137 #endif