source: rtems/cpukit/include/rtems/version.h @ c1a1f2c

5
Last change on this file since c1a1f2c was c1a1f2c, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 10, 2019 at 7:21:11 AM

Add rtems_version_control_key_is_valid()

  • Property mode set to 100644
File size: 2.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/**@{**/
34
35/**
36 * @brief Returns the version string.
37 *
38 * @retval text The version as a string.
39 */
40const char *rtems_version( void );
41
42/**
43 * @brief Returns the version's major number.
44 *
45 * @retval int The version's major number.
46 */
47int rtems_version_major( void );
48
49/**
50 * @brief Returns the version's minor number.
51 *
52 * @retval int The version's minor number.
53 */
54int rtems_version_minor( void );
55
56/**
57 * @brief Returns the version's revision number.
58 *
59 * @retval int The version's revision number.
60 */
61int rtems_version_revision( void );
62
63/**
64 * @brief Returns the version control key for the current version of code that
65 * has been built.
66 *
67 * The key is specific to the version control system being used and allows the
68 * built version to be identified.
69 *
70 * Use rtems_version_control_key_is_valid() to check if the version control key
71 * is valid.
72 *
73 * @return The version control key.
74 */
75const char *rtems_version_control_key( void );
76
77/**
78 * @brief Returns true, if the version control key is valid, otherwise false.
79 *
80 * @retval true The version control key is valid.
81 * @retval false Otherwise.
82 */
83static inline bool rtems_version_control_key_is_valid( const char *key )
84{
85  return key[ 0 ] != '\0';
86}
87
88/**
89 * @brief Returns the board support package name.
90 *
91 * @return The board support package name.
92 */
93const char *rtems_board_support_package( void );
94
95/** @} */
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif
102/* end of include file */
Note: See TracBrowser for help on using the repository browser.