idlc 1.5.14
Interface Definition Language Compiler
Loading...
Searching...
No Matches
idl-version.h
Go to the documentation of this file.
1/**
2 * @file idl-version.h
3 * @brief Library version information and utilities.
4 * @details This header provides version information for the Idl library,
5 * including version number components and macros for version comparison
6 * and string generation. It supports:
7 * - Major/Minor/Micro version components
8 * - Integer version encoding
9 * - String version generation
10 *
11 * @author Vladimir Shaleev <vladimirshaleev@gmail.com>
12 * @ingroup files
13 * @copyright MIT License
14 */
15#ifndef IDL_VERSION_H
16#define IDL_VERSION_H
17
18/**
19 * @name Version Components.
20 * @brief Individual components of the library version.
21 * @{
22 */
23
24/**
25 * @brief Major version number (API-breaking changes).
26 * @sa IDL_VERSION
27 * @sa IDL_VERSION_STRING
28 * @ingroup macros
29 */
30#define IDL_VERSION_MAJOR 1
31
32/**
33 * @brief Minor version number (backwards-compatible additions).
34 * @sa IDL_VERSION
35 * @sa IDL_VERSION_STRING
36 * @ingroup macros
37 */
38#define IDL_VERSION_MINOR 5
39
40/**
41 * @brief Micro version number (bug fixes and patches).
42 * @sa IDL_VERSION
43 * @sa IDL_VERSION_STRING
44 * @ingroup macros
45 */
46#define IDL_VERSION_MICRO 14
47
48/** @} */
49
50/**
51 * @name Version Utilities.
52 * @brief Macros for working with version numbers.
53 * @{
54 */
55
56/**
57 * @brief Encodes version components into a single integer.
58 * @details Combines major, minor, and micro versions into a 32-bit value:
59 * - Bits 24-31: Major version
60 * - Bits 16-23: Minor version
61 * - Bits 0-15: Micro version
62 * @param[in] major Major version number.
63 * @param[in] minor Minor version number.
64 * @param[in] micro Micro version number.
65 * @return Encoded version as unsigned long.
66 * @sa IDL_VERSION
67 * @ingroup macros
68 */
69#define IDL_VERSION_ENCODE(major, minor, micro) (((unsigned long) major) << 16 | (minor) << 8 | (micro))
70
71/**
72 * @brief Internal macro for string version generation.
73 * @details Helper macro that stringizes version components (e.g., 1, 5, 14 -> "1.5.14").
74 * @param[in] major Major version number.
75 * @param[in] minor Minor version number.
76 * @param[in] micro Micro version number.
77 * @return Stringified version.
78 * @note For internal use only.
79 * @ingroup macros
80 * @private
81 */
82#define IDL_VERSION_STRINGIZE_(major, minor, micro) #major "." #minor "." #micro
83
84/**
85 * @brief Creates version string from components.
86 * @details Generates a string literal from version components (e.g., 1, 5, 14 -> "1.5.14").
87 * @param[in] major Major version number.
88 * @param[in] minor Minor version number.
89 * @param[in] micro Micro version number.
90 * @return Stringified version.
91 * @sa IDL_VERSION_STRING
92 * @ingroup macros
93 */
94#define IDL_VERSION_STRINGIZE(major, minor, micro) IDL_VERSION_STRINGIZE_(major, minor, micro)
95
96/** @} */
97
98/**
99 * @name Current Version.
100 * @brief Macros representing the current library version.
101 * @{
102 */
103
104/**
105 * @brief Encoded library version as integer.
106 * @details Combined version value suitable for numeric comparisons.
107 * Use #IDL_VERSION_STRING for human-readable format.
108 * @sa IDL_VERSION_STRING
109 * @ingroup macros
110 */
115
116/**
117 * @brief Library version as human-readable string.
118 * @details Version string in "MAJOR.MINOR.MICRO" format (e.g., "1.5.14").
119 * Use #IDL_VERSION for numeric comparisons.
120 * @sa IDL_VERSION
121 * @ingroup macros
122 */
127
128/** @} */
129
130#endif /* IDL_VERSION_H */
#define IDL_VERSION_ENCODE(major, minor, micro)
Encodes version components into a single integer.
Definition idl-version.h:69
#define IDL_VERSION_MAJOR
Major version number (API-breaking changes).
Definition idl-version.h:30
#define IDL_VERSION_MINOR
Minor version number (backwards-compatible additions).
Definition idl-version.h:38
#define IDL_VERSION_MICRO
Micro version number (bug fixes and patches).
Definition idl-version.h:46
#define IDL_VERSION_STRINGIZE(major, minor, micro)
Creates version string from components.
Definition idl-version.h:94
#define IDL_VERSION_STRINGIZE_(major, minor, micro)
Internal macro for string version generation.
Definition idl-version.h:82