[6f3fb8a] | 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 | |
---|
[c1a1f2c] | 19 | #include <stdbool.h> |
---|
| 20 | |
---|
[6f3fb8a] | 21 | #ifdef __cplusplus |
---|
| 22 | extern "C" { |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | /** |
---|
[e78e7fe0] | 26 | * @defgroup RTEMSAPIClassicVersion Version |
---|
[6f3fb8a] | 27 | * |
---|
[e78e7fe0] | 28 | * @ingroup RTEMSAPIClassic |
---|
[6f3fb8a] | 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 | */ |
---|
| 40 | const char *rtems_version( void ); |
---|
| 41 | |
---|
| 42 | /** |
---|
| 43 | * @brief Returns the version's major number. |
---|
| 44 | * |
---|
| 45 | * @retval int The version's major number. |
---|
| 46 | */ |
---|
| 47 | int rtems_version_major( void ); |
---|
| 48 | |
---|
| 49 | /** |
---|
| 50 | * @brief Returns the version's minor number. |
---|
| 51 | * |
---|
| 52 | * @retval int The version's minor number. |
---|
| 53 | */ |
---|
| 54 | int rtems_version_minor( void ); |
---|
| 55 | |
---|
| 56 | /** |
---|
| 57 | * @brief Returns the version's revision number. |
---|
| 58 | * |
---|
| 59 | * @retval int The version's revision number. |
---|
| 60 | */ |
---|
| 61 | int rtems_version_revision( void ); |
---|
| 62 | |
---|
| 63 | /** |
---|
| 64 | * @brief Returns the version control key for the current version of code that |
---|
[eaa415b2] | 65 | * has been built. |
---|
[6f3fb8a] | 66 | * |
---|
[eaa415b2] | 67 | * The key is specific to the version control system being used and allows the |
---|
| 68 | * built version to be identified. |
---|
| 69 | * |
---|
[c1a1f2c] | 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. |
---|
[6f3fb8a] | 74 | */ |
---|
| 75 | const char *rtems_version_control_key( void ); |
---|
| 76 | |
---|
[c1a1f2c] | 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 | */ |
---|
| 83 | static inline bool rtems_version_control_key_is_valid( const char *key ) |
---|
| 84 | { |
---|
| 85 | return key[ 0 ] != '\0'; |
---|
| 86 | } |
---|
| 87 | |
---|
[20d472d] | 88 | /** |
---|
| 89 | * @brief Returns the board support package name. |
---|
| 90 | * |
---|
| 91 | * @return The board support package name. |
---|
| 92 | */ |
---|
| 93 | const char *rtems_board_support_package( void ); |
---|
| 94 | |
---|
[6f3fb8a] | 95 | /** @} */ |
---|
| 96 | |
---|
| 97 | #ifdef __cplusplus |
---|
| 98 | } |
---|
| 99 | #endif |
---|
| 100 | |
---|
| 101 | #endif |
---|
| 102 | /* end of include file */ |
---|