xref: /dragonfly/contrib/xz/src/liblzma/api/lzma/version.h (revision e151908b)
12940b44dSPeter Avalos /**
22940b44dSPeter Avalos  * \file        lzma/version.h
32940b44dSPeter Avalos  * \brief       Version number
42940b44dSPeter Avalos  */
52940b44dSPeter Avalos 
62940b44dSPeter Avalos /*
72940b44dSPeter Avalos  * Author: Lasse Collin
82940b44dSPeter Avalos  *
92940b44dSPeter Avalos  * This file has been put into the public domain.
102940b44dSPeter Avalos  * You can do whatever you want with this file.
112940b44dSPeter Avalos  *
122940b44dSPeter Avalos  * See ../lzma.h for information about liblzma as a whole.
132940b44dSPeter Avalos  */
142940b44dSPeter Avalos 
152940b44dSPeter Avalos #ifndef LZMA_H_INTERNAL
162940b44dSPeter Avalos #	error Never include this file directly. Use <lzma.h> instead.
172940b44dSPeter Avalos #endif
182940b44dSPeter Avalos 
192940b44dSPeter Avalos 
202940b44dSPeter Avalos /*
212940b44dSPeter Avalos  * Version number split into components
222940b44dSPeter Avalos  */
232940b44dSPeter Avalos #define LZMA_VERSION_MAJOR 5
2415ab8c86SJohn Marino #define LZMA_VERSION_MINOR 2
25*e151908bSDaniel Fojt #define LZMA_VERSION_PATCH 5
262940b44dSPeter Avalos #define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
272940b44dSPeter Avalos 
282940b44dSPeter Avalos #ifndef LZMA_VERSION_COMMIT
292940b44dSPeter Avalos #	define LZMA_VERSION_COMMIT ""
302940b44dSPeter Avalos #endif
312940b44dSPeter Avalos 
322940b44dSPeter Avalos 
332940b44dSPeter Avalos /*
342940b44dSPeter Avalos  * Map symbolic stability levels to integers.
352940b44dSPeter Avalos  */
362940b44dSPeter Avalos #define LZMA_VERSION_STABILITY_ALPHA 0
372940b44dSPeter Avalos #define LZMA_VERSION_STABILITY_BETA 1
382940b44dSPeter Avalos #define LZMA_VERSION_STABILITY_STABLE 2
392940b44dSPeter Avalos 
402940b44dSPeter Avalos 
412940b44dSPeter Avalos /**
422940b44dSPeter Avalos  * \brief       Compile-time version number
432940b44dSPeter Avalos  *
442940b44dSPeter Avalos  * The version number is of format xyyyzzzs where
452940b44dSPeter Avalos  *  - x = major
462940b44dSPeter Avalos  *  - yyy = minor
472940b44dSPeter Avalos  *  - zzz = revision
482940b44dSPeter Avalos  *  - s indicates stability: 0 = alpha, 1 = beta, 2 = stable
492940b44dSPeter Avalos  *
502940b44dSPeter Avalos  * The same xyyyzzz triplet is never reused with different stability levels.
512940b44dSPeter Avalos  * For example, if 5.1.0alpha has been released, there will never be 5.1.0beta
522940b44dSPeter Avalos  * or 5.1.0 stable.
532940b44dSPeter Avalos  *
542940b44dSPeter Avalos  * \note        The version number of liblzma has nothing to with
552940b44dSPeter Avalos  *              the version number of Igor Pavlov's LZMA SDK.
562940b44dSPeter Avalos  */
572940b44dSPeter Avalos #define LZMA_VERSION (LZMA_VERSION_MAJOR * UINT32_C(10000000) \
582940b44dSPeter Avalos 		+ LZMA_VERSION_MINOR * UINT32_C(10000) \
592940b44dSPeter Avalos 		+ LZMA_VERSION_PATCH * UINT32_C(10) \
602940b44dSPeter Avalos 		+ LZMA_VERSION_STABILITY)
612940b44dSPeter Avalos 
622940b44dSPeter Avalos 
632940b44dSPeter Avalos /*
642940b44dSPeter Avalos  * Macros to construct the compile-time version string
652940b44dSPeter Avalos  */
662940b44dSPeter Avalos #if LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_ALPHA
672940b44dSPeter Avalos #	define LZMA_VERSION_STABILITY_STRING "alpha"
682940b44dSPeter Avalos #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_BETA
692940b44dSPeter Avalos #	define LZMA_VERSION_STABILITY_STRING "beta"
702940b44dSPeter Avalos #elif LZMA_VERSION_STABILITY == LZMA_VERSION_STABILITY_STABLE
712940b44dSPeter Avalos #	define LZMA_VERSION_STABILITY_STRING ""
722940b44dSPeter Avalos #else
732940b44dSPeter Avalos #	error Incorrect LZMA_VERSION_STABILITY
742940b44dSPeter Avalos #endif
752940b44dSPeter Avalos 
762940b44dSPeter Avalos #define LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit) \
772940b44dSPeter Avalos 		#major "." #minor "." #patch stability commit
782940b44dSPeter Avalos 
792940b44dSPeter Avalos #define LZMA_VERSION_STRING_C(major, minor, patch, stability, commit) \
802940b44dSPeter Avalos 		LZMA_VERSION_STRING_C_(major, minor, patch, stability, commit)
812940b44dSPeter Avalos 
822940b44dSPeter Avalos 
832940b44dSPeter Avalos /**
842940b44dSPeter Avalos  * \brief       Compile-time version as a string
852940b44dSPeter Avalos  *
862940b44dSPeter Avalos  * This can be for example "4.999.5alpha", "4.999.8beta", or "5.0.0" (stable
872940b44dSPeter Avalos  * versions don't have any "stable" suffix). In future, a snapshot built
882940b44dSPeter Avalos  * from source code repository may include an additional suffix, for example
892940b44dSPeter Avalos  * "4.999.8beta-21-g1d92". The commit ID won't be available in numeric form
902940b44dSPeter Avalos  * in LZMA_VERSION macro.
912940b44dSPeter Avalos  */
922940b44dSPeter Avalos #define LZMA_VERSION_STRING LZMA_VERSION_STRING_C( \
932940b44dSPeter Avalos 		LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, \
942940b44dSPeter Avalos 		LZMA_VERSION_PATCH, LZMA_VERSION_STABILITY_STRING, \
952940b44dSPeter Avalos 		LZMA_VERSION_COMMIT)
962940b44dSPeter Avalos 
972940b44dSPeter Avalos 
982940b44dSPeter Avalos /* #ifndef is needed for use with windres (MinGW or Cygwin). */
992940b44dSPeter Avalos #ifndef LZMA_H_INTERNAL_RC
1002940b44dSPeter Avalos 
1012940b44dSPeter Avalos /**
1022940b44dSPeter Avalos  * \brief       Run-time version number as an integer
1032940b44dSPeter Avalos  *
1042940b44dSPeter Avalos  * Return the value of LZMA_VERSION macro at the compile time of liblzma.
1052940b44dSPeter Avalos  * This allows the application to compare if it was built against the same,
1062940b44dSPeter Avalos  * older, or newer version of liblzma that is currently running.
1072940b44dSPeter Avalos  */
1082940b44dSPeter Avalos extern LZMA_API(uint32_t) lzma_version_number(void)
1092940b44dSPeter Avalos 		lzma_nothrow lzma_attr_const;
1102940b44dSPeter Avalos 
1112940b44dSPeter Avalos 
1122940b44dSPeter Avalos /**
1132940b44dSPeter Avalos  * \brief       Run-time version as a string
1142940b44dSPeter Avalos  *
1152940b44dSPeter Avalos  * This function may be useful if you want to display which version of
1162940b44dSPeter Avalos  * liblzma your application is currently using.
1172940b44dSPeter Avalos  */
1182940b44dSPeter Avalos extern LZMA_API(const char *) lzma_version_string(void)
1192940b44dSPeter Avalos 		lzma_nothrow lzma_attr_const;
1202940b44dSPeter Avalos 
1212940b44dSPeter Avalos #endif
122