summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/include
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-11-07 16:43:11 +1100
committerChris Johns <chrisj@rtems.org>2017-11-10 13:34:06 +1100
commit6f3fb8a547f5700416744a7dc82b3cb83177c7a8 (patch)
tree5a5869b9dcf63196c0c1ef06b2ccdc4006d48f05 /cpukit/sapi/include
parentpppd/Makefile.am: Add support/include (diff)
downloadrtems-6f3fb8a547f5700416744a7dc82b3cb83177c7a8.tar.bz2
cpukit: Add a Version API.
Provide functions to get the version string, major, minor and revision numbers and the version control identifer that is a unique tag for the version control system. Update #3199.
Diffstat (limited to 'cpukit/sapi/include')
-rw-r--r--cpukit/sapi/include/rtems/version.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/cpukit/sapi/include/rtems/version.h b/cpukit/sapi/include/rtems/version.h
new file mode 100644
index 0000000000..b806cb8c2f
--- /dev/null
+++ b/cpukit/sapi/include/rtems/version.h
@@ -0,0 +1,77 @@
+/**
+ * @file
+ *
+ * @brief Version API.
+ */
+
+/*
+ * Copyright (C) 2017.
+ * Chris Johns <chrisj@rtems.org>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _RTEMS_VERSION_H
+#define _RTEMS_VERSION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @defgroup ClassicVersion Version
+ *
+ * @ingroup ClassicVersion
+ *
+ * @brief The Version API provides functions to return the version or parts of
+ * the version of RTEMS you are using.
+ */
+/**@{**/
+
+/**
+ * @brief Returns the version string.
+ *
+ * @retval text The version as a string.
+ */
+const char *rtems_version( void );
+
+/**
+ * @brief Returns the version's major number.
+ *
+ * @retval int The version's major number.
+ */
+int rtems_version_major( void );
+
+/**
+ * @brief Returns the version's minor number.
+ *
+ * @retval int The version's minor number.
+ */
+int rtems_version_minor( void );
+
+/**
+ * @brief Returns the version's revision number.
+ *
+ * @retval int The version's revision number.
+ */
+int rtems_version_revision( void );
+
+/**
+ * @brief Returns the version control key for the current version of code that
+ * has been built. The key is specific to the version control system being used
+ * and allows the built version to be identified.
+ *
+ * @retval int The version's version control key.
+ */
+const char *rtems_version_control_key( void );
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/* end of include file */