From 918e4ff20c4e843b5b32d27274fbe558ec1b0000 Mon Sep 17 00:00:00 2001 From: Nicholas Corgan Date: Mon, 29 Apr 2019 20:22:39 -0500 Subject: C: Add uhd_get_abi_string, uhd_get_version_string Clients that include the UHD C headers have access to the version and ABI #defines, but this is not available to clients that dynamically load the library. This commit adds publicly exported functions to provide this information. --- host/include/uhd.h | 2 ++ host/include/uhd/CMakeLists.txt | 1 + host/include/uhd/version.h | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 host/include/uhd/version.h (limited to 'host/include') diff --git a/host/include/uhd.h b/host/include/uhd.h index b9143baac..413e786f9 100644 --- a/host/include/uhd.h +++ b/host/include/uhd.h @@ -1,6 +1,7 @@ /* * Copyright 2015 Ettus Research LLC * Copyright 2018 Ettus Research, a National Instruments Company + * Copyright 2019 Ettus Research, a National Instruments Brand * * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -10,6 +11,7 @@ #include #include +#include #include #include diff --git a/host/include/uhd/CMakeLists.txt b/host/include/uhd/CMakeLists.txt index e4a186f8a..6a103fa18 100644 --- a/host/include/uhd/CMakeLists.txt +++ b/host/include/uhd/CMakeLists.txt @@ -44,6 +44,7 @@ if(ENABLE_C_API) UHD_INSTALL(FILES config.h error.h + version.h DESTINATION ${INCLUDE_DIR}/uhd COMPONENT headers ) diff --git a/host/include/uhd/version.h b/host/include/uhd/version.h new file mode 100644 index 000000000..b67098b36 --- /dev/null +++ b/host/include/uhd/version.h @@ -0,0 +1,35 @@ +// +// Copyright 2019 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef INCLUDED_UHD_VERSION_H +#define INCLUDED_UHD_VERSION_H + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +//! Get the ABI compatibility string for this build of the library +UHD_API uhd_error uhd_get_abi_string( + char* abi_string_out, + size_t buffer_len +); + +//! Get the version string (dotted version number + build info) +UHD_API uhd_error uhd_get_version_string( + char* version_out, + size_t buffer_len +); + +#ifdef __cplusplus +} +#endif + +#endif /* INCLUDED_UHD_VERSION_H */ -- cgit v1.2.3