source: rtems/cpukit/include/rtems/version.h @ 50a8353

5
Last change on this file since 50a8353 was 50a8353, checked in by Christian Mauderer <christian.mauderer@…>, on May 26, 2021 at 7:39:13 AM

cpukit: Add description of release version numbers

The release version in the git sources doesn't change. Add a note why
that is the case.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief Version API.
5 */
6
7/*
8 *  Copyright (C) 2017.
9 *  Chris Johns <chrisj@rtems.org>
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#ifndef _RTEMS_VERSION_H
17#define _RTEMS_VERSION_H
18
19#include <stdbool.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/**
26 * @defgroup RTEMSAPIClassicVersion Version
27 *
28 * @ingroup RTEMSAPIClassic
29 *
30 * @brief The Version API provides functions to return the version or parts of
31 * the version of RTEMS you are using.
32 *
33 * A branch in the version control system will always fall back to a
34 * NOT-RELEASED version number with a minor number of 0. Only the release
35 * archives have a VERSION file with a final release number. That means for
36 * example that the 5 development branch will still show a version 5.0.0 even
37 * after the 5.1 release.
38 *
39 * The reason for that are the following:
40 *
41 * 1. All pre-release tests are performed with a specific git hash. A committed
42 * VERSION file would need to be changed and committed afterwards for releasing
43 * with the required release version causing the released version to have a
44 * different git hash and the test results couldn't be linked to the released
45 * version.
46 *
47 * 2. Users deploying RTEMS would need to commit a local change to a committed
48 * VERSION file and that would clash with the project changes. Deployment can
49 * use the project repos directly.
50 *
51 * 3. The VERSION file management and generation is the responsibility of the
52 * release manager and the release process.
53 */
54/**@{**/
55
56/**
57 * @brief Returns the version string.
58 *
59 * @retval text The version as a string.
60 */
61const char *rtems_version( void );
62
63/**
64 * @brief Returns the version's major number.
65 *
66 * @retval int The version's major number.
67 */
68int rtems_version_major( void );
69
70/**
71 * @brief Returns the version's minor number.
72 *
73 * @retval int The version's minor number.
74 */
75int rtems_version_minor( void );
76
77/**
78 * @brief Returns the version's revision number.
79 *
80 * @retval int The version's revision number.
81 */
82int rtems_version_revision( void );
83
84/**
85 * @brief Returns the version control key for the current version of code that
86 * has been built.
87 *
88 * The key is specific to the version control system being used and allows the
89 * built version to be identified.
90 *
91 * Use rtems_version_control_key_is_valid() to check if the version control key
92 * is valid.
93 *
94 * @return The version control key.
95 */
96const char *rtems_version_control_key( void );
97
98/**
99 * @brief Returns true, if the version control key is valid, otherwise false.
100 *
101 * @retval true The version control key is valid.
102 * @retval false Otherwise.
103 */
104static inline bool rtems_version_control_key_is_valid( const char *key )
105{
106  return key[ 0 ] != '\0';
107}
108
109/**
110 * @brief Returns the board support package name.
111 *
112 * @return The board support package name.
113 */
114const char *rtems_board_support_package( void );
115
116/** @} */
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif
123/* end of include file */
Note: See TracBrowser for help on using the repository browser.