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