diff -Nru libiio-0.24/artifact_manifest.txt.cmakein libiio-0.25/artifact_manifest.txt.cmakein --- libiio-0.24/artifact_manifest.txt.cmakein 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/artifact_manifest.txt.cmakein 2023-08-09 15:58:07.000000000 +0000 @@ -4,6 +4,18 @@ Linux-Fedora-34/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-34.rpm Linux-Fedora-34/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-34.tar.gz +Linux-Fedora-28/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-28.deb +Linux-Fedora-28/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-28.rpm +Linux-Fedora-28/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-28.tar.gz + +Linux-CentOS-7/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-CentOS-7.deb +Linux-CentOS-7/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-CentOS-7.rpm +Linux-CentOS-7/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-CentOS-7.tar.gz + +Linux-Debian-11/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Debian-11.deb +Linux-Debian-11/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Debian-11.rpm +Linux-Debian-11/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Debian-11.tar.gz + Linux-Ubuntu-18.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-18.04.deb Linux-Ubuntu-18.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-18.04.tar.gz @@ -13,8 +25,8 @@ Linux-Ubuntu-22.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-22.04.deb Linux-Ubuntu-22.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-22.04.tar.gz -macOS-10.15/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-macOS-10.15.tar.gz -macOS-10.15/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@.pkg +Linux-openSUSE-15.4/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-openSUSE-15.4.deb +Linux-openSUSE-15.4/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-openSUSE-15.4.tar.gz macOS-11/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-macOS-11.tar.gz macOS-11/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@.pkg @@ -22,6 +34,12 @@ macOS-12/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-macOS-12.tar.gz macOS-12/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@.pkg +macOS-13-x64/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-macOS-13-x64.tar.gz +macOS-13-x64/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@.pkg + +macOS-13-arm64/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-macOS-13-arm64.tar.gz +macOS-13-arm64/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@.pkg + Ubuntu-arm32v7/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Ubuntu-arm32v7.deb Ubuntu-arm32v7/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Ubuntu-arm32v7.tar.gz @@ -71,3 +89,23 @@ Windows-VS-2022-x64/libxml2.dll Windows-VS-2022-x64/msvcp140.dll Windows-VS-2022-x64/vcruntime140.dll + +Windows-MinGW--W64/iio.h +Windows-MinGW-W64/iio_attr.exe +Windows-MinGW-W64/iio_genxml.exe +Windows-MinGW-W64/iio_info.exe +Windows-MinGW-W64/iio_readdev.exe +Windows-MinGW-W64/iio_reg.exe +Windows-MinGW-W64/iio_writedev.exe +Windows-MinGW-W64/libgcc_s_seh-1.dll +Windows-MinGW-W64/libiconv-2.dll +Windows-MinGW-W64/libiio.dll +Windows-MinGW-W64/libiio.dll.a +Windows-MinGW-W64/liblzma-5.dll +Windows-MinGW-W64/libserialport-0.dll +Windows-MinGW-W64/libstdc++-6.dll +Windows-MinGW-W64/libusb-1.0.dll +Windows-MinGW-W64/libwinpthread-1.dll +Windows-MinGW-W64/libxml2-2.dll +Windows-MinGW-W64/zlib1.dll +Windows-MinGW-W64/libiio-py39-amd64.tar.gz diff -Nru libiio-0.24/azure-pipelines.yml libiio-0.25/azure-pipelines.yml --- libiio-0.24/azure-pipelines.yml 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/azure-pipelines.yml 2023-08-09 15:58:07.000000000 +0000 @@ -6,6 +6,7 @@ include: - main - master + - next_stable - staging/* - 20* tags: @@ -41,9 +42,21 @@ ubuntu_22_04: image: 'tfcollins/libiio_ubuntu_22_04-ci:latest' artifactName: 'Linux-Ubuntu-22.04' + fedora28: + image: 'tfcollins/libiio_fedora_28-ci:latest' + artifactName: 'Linux-Fedora-28' fedora34: image: 'tfcollins/libiio_fedora_34-ci:latest' artifactName: 'Linux-Fedora-34' + debian_bullseye: + image: 'tfcollins/libiio_debian_bullseye-ci:latest' + artifactName: 'Linux-Debian-11' + opensuse_15_4: + image: 'tfcollins/libiio_opensuse_15_4-ci:latest' + artifactName: 'Linux-openSUSE-15.4' + centos_7: + image: 'tfcollins/libiio_centos_7-ci:latest' + artifactName: 'Linux-CentOS-7' container: $[ variables['image'] ] steps: - checkout: self @@ -53,9 +66,15 @@ - script: | set -e mkdir build && cd build - cmake .. -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} + if [ "$ARTIFACTNAME" != "Linux-CentOS-7" ]; then + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON -DWITH_MAN=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} + else + # CentOS 7 does not have new enough kernel headers to support modern libusb. nor libserialport + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_MAN=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} -DWITH_USB_BACKEND=OFF -DWITH_IIOD_USBD=OFF + fi make make package + make required2tar displayName: 'Build' - task: CopyFiles@2 inputs: @@ -67,6 +86,88 @@ sh generateDocumentationAndDeploy.sh displayName: 'Documentation' condition: eq(variables['artifactName'], 'Linux-Fedora-34') + - script: ./CI/azure/check_kernel.sh + displayName: 'Kernel check' + condition: and(eq(variables['artifactName'], 'Linux-Ubuntu-22.04'), eq(variables['Build.Reason'], 'PullRequest')) + - script: ./CI/azure/check_README_BUILD.sh + displayName: 'README_BUILD check' + condition: and(eq(variables['artifactName'], 'Linux-Ubuntu-22.04'), eq(variables['Build.Reason'], 'PullRequest')) + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)' + artifactName: '$(artifactName)' + + ############################################# + - job: MinGWBuilds + strategy: + matrix: + MinGW_W64: + COMPILER: 'MinGW Makefiles' + ARCH: 'x86_64' + USE_CSHARP: 'OFF' + artifactName: 'Windows-MinGW-W64' + pool: + vmImage: 'windows-2022' + steps: + - checkout: self + fetchDepth: 1 + clean: true + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.9' + - task: PowerShell@2 + displayName: 'Dependencies' + inputs: + targetType: inline + script: | + git submodule update --init + if ( !( Test-Path deps ) ) { + mkdir deps + } + cd deps + mkdir libxml + wget https://www.zlatkovic.com/pub/libxml/64bit/libxml2-2.9.3-win32-x86_64.7z -OutFile "libxml.7z" + 7z x -y libxml.7z + rm libxml.7z + cd C:\ + wget http://swdownloads.analog.com/cse/build/libiio-win-deps-libusb1.0.24.zip -OutFile "libiio-win-deps.zip" + 7z x -y "C:\libiio-win-deps.zip" + - task: PowerShell@2 + inputs: + targetType: 'filePath' + filePath: .\CI\build_win.ps1 + displayName: 'Build' + - task: CopyFiles@2 + displayName: 'Copy .exe files' + inputs: + sourceFolder: '$(Agent.BuildDirectory)/s/build-x64/tests' + contents: '*.exe' + targetFolder: '$(Build.ArtifactStagingDirectory)' + - task: CopyFiles@2 + displayName: 'Copy iio.h header' + inputs: + sourceFolder: '$(Agent.BuildDirectory)/s/' + contents: 'iio.h' + targetFolder: '$(Build.ArtifactStagingDirectory)' + - task: CopyFiles@2 + displayName: 'Copy libiio.dll and libiio.dll.a' + inputs: + sourceFolder: '$(Agent.BuildDirectory)/s/build-x64' + contents: | + libiio.dll + libiio.dll.a + targetFolder: '$(Build.ArtifactStagingDirectory)' + - task: CopyFiles@2 + displayName: 'Copy .tar.gz files' + inputs: + sourceFolder: '$(Agent.BuildDirectory)/s/build-x64/bindings/python' + contents: '*.gz' + targetFolder: '$(Build.ArtifactStagingDirectory)' + - task: PowerShell@2 + displayName: 'Copy dependencies' + inputs: + targetType: 'filePath' + filePath: .\CI\publish_deps.ps1 - task: PublishPipelineArtifact@1 inputs: targetPath: '$(Build.ArtifactStagingDirectory)' @@ -81,11 +182,13 @@ vmImage: 'windows-2022' COMPILER: 'Visual Studio 17 2022' ARCH: 'x64' + USE_CSHARP: 'ON' artifactName: 'Windows-VS-2022-x64' VS2019: vmImage: 'windows-2019' COMPILER: 'Visual Studio 16 2019' ARCH: 'x64' + USE_CSHARP: 'ON' artifactName: 'Windows-VS-2019-x64' pool: vmImage: $[ variables['vmImage'] ] @@ -179,32 +282,54 @@ ############################################# - job: macOSBuilds # Host Box + workspace: + clean: all strategy: matrix: - macOS_10_15: - vmImage: 'macOS-10.15' - artifactName: 'macOS-10.15' macOS_11: + poolName: 'Azure Pipelines' vmImage: 'macOS-11' + agentName: 'Azure Pipelines 4' artifactName: 'macOS-11' macOS_12: + poolName: 'Azure Pipelines' vmImage: 'macOS-12' + agentName: 'Azure Pipelines 3' artifactName: 'macOS-12' + macOS_13_x64: + poolName: 'Azure Pipelines' + vmImage: 'macOS-13' + agentName: 'Azure Pipelines 2' + artifactName: 'macOS-13-x64' + macOS_13_arm64: + poolName: 'Default' + vmImage: + agentName: 'macOS_arm64' + artifactName: 'macOS-13-arm64' pool: - vmImage: $[ variables['vmImage'] ] + name: $(poolName) + vmImage: $(vmImage) + demands: + - agent.name -equals $(agentName) steps: - checkout: self fetchDepth: 1 clean: true + - task: UsePythonVersion@0 + condition: ne(variables['agentName'],'macOS_arm64') + inputs: + versionSpec: '3.x' + addToPath: true - script: | set -e - brew install doxygen libusb libxml2 ncurses cdk libserialport - pip3 install sphinx sphinx-rtd-theme + brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config + pip3 install sphinx displayName: 'Dependencies' + condition: ne(variables['agentName'],'macOS_arm64') - script: | set -e mkdir build && cd build - cmake .. -DOSX_PACKAGE=ON -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=OFF -DWITH_ZSTD=ON + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON -DWITH_ZSTD=OFF make sudo make install cd .. @@ -212,15 +337,18 @@ - script: | set -e mkdir build_tar && cd build_tar - cmake .. -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=OFF -DWITH_ZSTD=ON -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -DWITH_ZSTD=OFF -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} make make package + mv ../CI/azure/macos_tar_fixup.sh . + chmod +x macos_tar_fixup.sh + ./macos_tar_fixup.sh cd .. displayName: 'Build tar' - script: | set -e cd build - cmake .. -DPYTHON_BINDINGS=ON -DWITH_DOC=ON + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON make cd .. displayName: 'Build With Doc' @@ -270,6 +398,7 @@ steps: - script: | set -e + sudo apt-get update sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross sudo apt-get install -y g++-arm-linux-gnueabihf sudo apt-get install -y g++-aarch64-linux-gnu diff -Nru libiio-0.24/bindings/CMakeLists.txt libiio-0.25/bindings/CMakeLists.txt --- libiio-0.24/bindings/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,3 +1,7 @@ +if (CPP_BINDINGS) + add_subdirectory(cpp) +endif() + if (CSHARP_BINDINGS) add_subdirectory(csharp) endif() @@ -6,8 +10,8 @@ add_subdirectory(python) endif() -list(APPEND IIOB_FEATURES_${PYTHON_BINDINGS} python-bindings) -list(APPEND IIOB_FEATURES_${CSHARP_BINDINGS} "c#-bindings") +toggle_iio_feature("${PYTHON_BINDINGS}" python-bindings) +toggle_iio_feature("${CSHARP_BINDINGS}" "c#-bindings") -set(IIOB_FEATURES_ON "${IIOB_FEATURES_ON}" PARENT_SCOPE) -set(IIOB_FEATURES_OFF "${IIOB_FEATURES_OFF}" PARENT_SCOPE) +set(IIOB_FEATURES_ON "${IIO_FEATURES_ON}" PARENT_SCOPE) +set(IIOB_FEATURES_OFF "${IIO_FEATURES_OFF}" PARENT_SCOPE) diff -Nru libiio-0.24/bindings/cpp/CMakeLists.txt libiio-0.25/bindings/cpp/CMakeLists.txt --- libiio-0.24/bindings/cpp/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/bindings/cpp/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) + +project(iiopp-enum CXX) +add_executable(iiopp-enum examples/iiopp-enum.cpp iiopp.h ${LIBIIO_RC}) +target_include_directories(iiopp-enum PRIVATE ./) +set_target_properties(iiopp-enum PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON) +target_link_libraries(iiopp-enum iio) diff -Nru libiio-0.24/bindings/cpp/examples/iiopp-enum.cpp libiio-0.25/bindings/cpp/examples/iiopp-enum.cpp --- libiio-0.24/bindings/cpp/examples/iiopp-enum.cpp 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/bindings/cpp/examples/iiopp-enum.cpp 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * libiio - C++ API usage + * + * This example libiio program shows the usage of the C++ API for enumerating + * devices, channels and attributes. + * + * Copyright (c) 2023, DIFITEC GmbH + * Author: Tilman Blumhagen + */ + +#include + +#include +#include + +using namespace iiopp; +using namespace std; + +string get(IAttr const & att) +{ + char value[1024] = {0}; // Flawfinder: ignore + att.read(value, sizeof(value)); // Flawfinder: ignore + return value; +} + +void enumerateIioEntities() +{ + cout << boolalpha; + + shared_ptr context = create_default_context(); + + for (Device device : *context) + { + cout << "Device:" << endl; + cout << " id: " << quoted(string(device.id())) << endl; + + cout << " name: "; + if (auto name = device.name()) + cout << quoted(string(*name)); + cout << endl; + + cout << " is trigger: " << device.is_trigger() << endl; + + for (auto att : device.attrs) + cout << " attribute " << att.name() << " = " << quoted(get(att)) << endl; + + for (auto att : device.debug_attrs) + cout << " debug attribute " << att.name() << " = " << quoted(get(att)) << endl; + + for (auto att : device.buffer_attrs) + cout << " buffer attribute " << att.name() << " = " << quoted(get(att)) << endl; + + for (Channel channel : device) + { + cout << " Channel: " << channel.id() << endl; + + cout << " name: "; + if (auto name = channel.name()) + cout << quoted(string(*name)); + cout << endl; + + cout << " is output: " << channel.is_output() << endl; + cout << " is enabled: " << channel.is_enabled() << endl; + + for (auto att : channel.attrs) + cout << " attribute " << quoted(att.name().c_str()) << " = " << quoted(get(att)) << endl; + } + } + + shared_ptr scanCtx = create_scan_context({}, 0); + shared_ptr infoList = scanCtx->info_list(); + + cout << "scan context info list:" << endl; + for (ContextInfo info : *infoList) + { + cout << " uri: " << quoted(info.uri().c_str()) << endl; + cout << " description: " << quoted(info.description().c_str()) << endl; + } + + cout << "scan block:" << endl; + shared_ptr blk = create_scan_block({}, 0); + for (ContextInfo info : *blk) + { + cout << " uri: " << quoted(info.uri().c_str()) << endl; + cout << " description: " << quoted(info.description().c_str()) << endl; + } +} + +int main(int argc, char ** argv) +{ + try + { + enumerateIioEntities(); + } + catch (error & e) + { + cerr << "ERROR " << e.code().value() << ": " << e.what() << endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff -Nru libiio-0.24/bindings/cpp/iiopp.h libiio-0.25/bindings/cpp/iiopp.h --- libiio-0.24/bindings/cpp/iiopp.h 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/bindings/cpp/iiopp.h 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,826 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * libiio - Library for interfacing industrial I/O (IIO) devices + * + * Copyright (C) 2023, DIFITEC GmbH + * Author: Tilman Blumhagen + */ + +/** @file iiopp.h + * @brief Public C++ interface + * + * @see @ref iiopp +*/ + +#pragma once + +#include +#include + +#if __cplusplus < 201703L +#include +#else +#include +#endif +#include +#include +#include +#include + +/** @brief Public C++ API + * + * This is a C++ wrapper for @ref iio.h + * + * It requires C++17 or C++11 with Boost (for boost::optional). + * + * It provides: + * + * - Classes that model the major types, providing member functions for easy usage. + * - Uniform access to attributes of channels and devices (with their attr/debug_attr/buffer_attr variants). + * - Error handling (error codes are checked and turned into exceptions). + * - Functions that may return \c NULL for "no string" are explicit by returning an std::optional. + * - Iterators for idiomatic access to devices of context and channels of devices. + * - Iterators for attributes. + * - Implicit conversion to the wrapped C-types, so C++ instances can easily be passed to the C-API. + * + * @warning All objects live in the @ref iiopp::Context that created them. When a context gets destroyed (when + * the last std::shared_ptr to it releases it) all its child objects die as well. All types have + * weak reference semantic and become invalid when the context gets destroyed. + * Lifetime is managed by std::shared_ptr. + * + * In consequence all types are cheap to copy (at the cost of assigning a pointer and maybe an integer). Copies refer + * to the same underlying object. + * + * See @ref iiopp-enum.cpp for an example. + */ +namespace iiopp +{ + +#if __cplusplus < 201703L +using boost::optional; +#else +using std::optional; +#endif + +class Context; +class Device; +class Buffer; + +/** @brief Non-owning immutable null terminated string + * + * Used for argument/return type for functions that expect/return a C-string (null terminated char-array). + * Provides implicit conversion of std::string while still retaining efficient pass-through for char const*. + * Only valid as long as the original string is valid. + */ +class cstr +{ + char const * const s; +public: + cstr(std::string const & s) : s(s.c_str()){} + cstr(char const * s) : s(s){assert(s);} + + char const * c_str() const {return s;} + operator char const * () const {return s;} +}; + +/** @brief Thrown to report errors. + */ +class error : public std::system_error +{ +public: + using std::system_error::system_error; +}; + +/** @brief Common interface for attribute access + */ +class IAttr +{ +public: + virtual ~IAttr(){} + + virtual cstr name() const = 0; + + virtual size_t read(char * dst, size_t size) const = 0; // Flawfinder: ignore + virtual bool read_bool() const = 0; + virtual double read_double() const = 0; + virtual long long read_longlong() const = 0; + + virtual size_t write(cstr src) = 0; + virtual void write_bool(bool val) = 0; + virtual void write_double(double val) = 0; + virtual void write_longlong(long long val) = 0; + + operator bool () const {return read_bool();} + operator double () const {return read_double();} + operator long long () const {return read_longlong();} + + cstr operator = (cstr val){write(val); return val;} + bool operator = (bool val){write_bool(val); return val;} + double operator = (double val){write_double(val); return val;} + long long operator = (long long val){write_longlong(val); return val;} +}; + +/** @brief Optional string, used for C-functions that return @c nullptr for "no value". + */ +typedef optional optstr; + +namespace impl +{ + +std::shared_ptr new_ctx(iio_context * ctx); + +inline optstr opt(char const * s) +{ + return s ? optstr{{s}} : optstr{}; +} + +inline std::string err_str(int err) +{ + char buf[1024]; // Flawfinder: ignore + iio_strerror(err, buf, sizeof(buf)); + return buf; +} + +[[noreturn]] inline void err(int err, char const * ctx) +{ + assert(err > 0); + throw error(err, std::generic_category(), ctx); +} + +inline void check(int ret, char const * ctx) +{ + if (ret) + { + assert(ret < 0); + err(-ret, ctx); + } +} + +template +T check_n(T n, char const * s) +{ + if (n < 0) + impl::err(static_cast(-n), s); + return n; +} + +/** @brief Serves as base class to implement a @c vector-like interface + * + * Implements begin(), end() and the index operator for a type @a container_T (which should be derived from it) with elements of type @a element_T. + */ +template +class IndexedSequence +{ + container_T & _me() {return *static_cast(this);} +public: + + /** @brief A random access iterator for an @ref IndexedSequence + */ + class Iterator + { + container_T & c; + size_t i; + public: + typedef std::random_access_iterator_tag iterator_category; + typedef element_T value_type; + typedef std::ptrdiff_t difference_type; + typedef element_T *pointer; + typedef element_T &reference; + Iterator(container_T &cont, size_t idx) : c(cont), i(idx) {assert(idx <= cont.size());} + + element_T operator*() const { return c[i]; } + Iterator& operator++() { assert(i <= c.size()); ++i; return *this;} + Iterator operator++(int) { Iterator tmp = *this; ++(*this); return tmp; } + bool operator == (const Iterator& rhs) const { assert(&c == &rhs.c); return i == rhs.i; } + bool operator != (const Iterator& rhs) const { assert(&c == &rhs.c); return i != rhs.i; } + bool operator < (const Iterator& rhs) const { assert(&c == &rhs.c); return i < rhs.i; } + bool operator > (const Iterator& rhs) const { assert(&c == &rhs.c); return i > rhs.i; } + bool operator <= (const Iterator& rhs) const { assert(&c == &rhs.c); return i <= rhs.i; } + bool operator >= (const Iterator& rhs) const { assert(&c == &rhs.c); return i >= rhs.i; } + Iterator operator + (ssize_t x) const { return Iterator(c, i + x); } + ssize_t operator - (Iterator rhs) const { assert(&c == &rhs.c); return i - rhs.i; } + }; + + Iterator begin() {return Iterator(_me(), 0);} + Iterator end() {return Iterator(_me(), _me().size());} +}; + +template +class AttrT : public IAttr +{ + obj_T const * const _obj; + cstr const _name; +public: + + AttrT(obj_T const * obj, cstr name) : _obj(obj), _name(name){assert(obj && name);} + + cstr name() const override {return _name;} + + size_t read(char * dst, size_t size) const override {return check_n(read_T(_obj, _name, dst, size), "iio_..._attr_read");} // Flawfinder: ignore + bool read_bool() const override {bool val; check(read_bool_T(_obj, _name, &val), "iio_..._attr_read_bool"); return val;} + double read_double() const override {double val; check(read_double_T(_obj, _name, &val), "iio_..._attr_read_double"); return val;} + long long read_longlong() const override {long long val; check(read_longlong_T(_obj, _name, &val), "iio_..._attr_read_longlong"); return val;} + + size_t write(cstr src) override {return check_n(write_T(_obj, _name, src), "iio_..._attr_write");} + void write_bool(bool val) override {check(write_bool_T(_obj, _name, val), "iio_..._attr_write_bool");} + void write_double(double val) override {check(write_double_T(_obj, _name, val), "iio_..._attr_write_double");} + void write_longlong(long long val) override {check(write_longlong_T(_obj, _name, val), "iio_..._attr_write_longlong");} +}; + +template +optional attr(obj_T const * obj, cstr name) +{ + char const * s = find_attr_T(obj, name); + if (s) + return {attr_T(obj, s)}; + return {}; +} + +template +optional attr(obj_T const * obj, unsigned int idx) +{ + char const * s = get_attr_T(obj, idx); + if (s) + return {attr_T(obj, s)}; + return {}; +} + +/** @brief Vector-like accessor for all attributes of an object + */ +#ifdef DOXYGEN +template +class AttrSeqT : public IndexedSequence, attr_T> +#else +template +class AttrSeqT : public IndexedSequence, attr_T> +#endif +{ + obj_T const * const _obj; +public: + AttrSeqT(obj_T const * obj) : _obj(obj){assert(obj);} + + /** @brief Count of attributes + */ + size_t size() const {return get_attrs_count_T(_obj);} + + /** @brief Access by attribute index + */ + attr_T operator [](size_t idx) + { + if (auto ret = attr(_obj, idx)) + return *ret; + throw std::out_of_range("invalid attribute index"); + } + + /** @brief Access by attribute name + */ + attr_T operator [](cstr name) + { + if (auto ret = attr(_obj, name)) + return *ret; + throw std::out_of_range("invalid attribute name"); + } +}; + +} // namespace impl + +/** @brief C++ wrapper for the @ref Channel C-API + */ +class Channel +{ + iio_channel * const p; +public: + + Channel() = delete; + Channel(iio_channel * chan) : p(chan), attrs(chan){} + operator iio_channel * () const {return p;} + +#ifndef DOXYGEN + typedef impl::AttrT Attr; + + typedef impl::AttrSeqT AttrSeq; +#else + typedef IAttr Attr; + typedef impl::AttrSeqT AttrSeq; +#endif + + optional attr(cstr name) {return impl::attr(p, name);} + optional attr(unsigned int idx) {return impl::attr(p, idx);} + + AttrSeq attrs; + + void disable() {iio_channel_disable(p);} + void enable() {iio_channel_enable(p);} + optstr find_attr(cstr name) {return impl::opt(iio_channel_find_attr(p, name));} + unsigned int attrs_count() const {return iio_channel_get_attrs_count(p);} + void * data() const {return iio_channel_get_data(p);} + Device device(); + cstr id() const {return iio_channel_get_id(p);} + iio_modifier modifier() const {return iio_channel_get_modifier(p);} + optstr name() const { return impl::opt(iio_channel_get_name(p));} + iio_chan_type type() const {return iio_channel_get_type(p);} + bool is_enabled() const { return iio_channel_is_enabled(p);} + bool is_output() const { return iio_channel_is_output(p);} + bool is_scan_element() const { return iio_channel_is_scan_element(p);} + size_t read(Buffer buffer, void * dst, size_t len) const; // Flawfinder: ignore + size_t read_raw(Buffer buffer, void * dst, size_t len) const; + void set_data(void * data){iio_channel_set_data(p, data);} + size_t write(Buffer buffer, void const * src, size_t len); + size_t write_raw(Buffer buffer, void const * src, size_t len); + + void convert(void * dst, void const * src) const {iio_channel_convert(p, dst, src);} + void convert_inverse(void * dst, void const * src) const {iio_channel_convert_inverse(p, dst, src);} + iio_data_format const * data_format() const {return iio_channel_get_data_format(p);} + unsigned long index() const { return impl::check_n(iio_channel_get_index(p), "iio_channel_get_index");} +}; + +/** @brief C++ wrapper for the @ref Buffer C-API + */ +class Buffer +{ + iio_buffer * const p; +public: + Buffer(iio_buffer * buffer) : p(buffer){} + operator iio_buffer * () const {return p;} + void cancel() {iio_buffer_cancel(p);} + void * end() {return iio_buffer_end(p);} + void * first(Channel channel){ return iio_buffer_first(p, channel);} + ssize_t for_each(ssize_t (*callback)(const struct iio_channel *chn, void *src, size_t bytes, void *d), void *data){return iio_buffer_foreach_sample(p, callback, data);} + void * data() {return iio_buffer_get_data(p);} + Device device(); + int poll_fd() const { + int const ret = iio_buffer_get_poll_fd(p); + if (ret < 0) + impl::err(-ret, "iio_buffer_get_poll_fd"); + return ret; + } + size_t push() const { return impl::check_n(iio_buffer_push(p), "iio_buffer_push");} + size_t push_partial(size_t samples_count) const {return impl::check_n(iio_buffer_push_partial(p, samples_count), "iio_buffer_push_partial");} + size_t refill() const { return impl::check_n(iio_buffer_refill(p), "iio_buffer_refill");} + void set_blocking_mode(bool blocking){impl::check(iio_buffer_set_blocking_mode(p, blocking), "iio_buffer_set_blocking_mode");} + void set_data(void * data){iio_buffer_set_data(p, data);} + void * start() {return iio_buffer_start(p);} + ptrdiff_t step() const {return iio_buffer_step(p);} +}; + +/** @brief C++ wrapper for the @ref Device C-API + */ +class Device : public impl::IndexedSequence +{ + iio_device * const p; +public: + + size_t size() const + { + return channels_count(); + } + + Channel operator [](size_t i) + { + assert(i < channels_count()); + return channel(i); + } + +#ifndef DOXYGEN + typedef impl::AttrT Attr; + + typedef impl::AttrSeqT AttrSeq; +#else + typedef IAttr Attr; + typedef impl::AttrSeqT AttrSeq; +#endif + optional attr(cstr name) {return impl::attr(p, name);} + optional attr(unsigned int idx) {return impl::attr(p, idx);} + + AttrSeq attrs; + +#ifndef DOXYGEN + typedef impl::AttrT DebugAttr; + + typedef impl::AttrSeqT DebugAttrSeq; +#else + typedef IAttr DebugAttr; + typedef impl::AttrSeqT DebugAttrSeq; +#endif + + optional debug_attr(cstr name) {return impl::attr(p, name);} + optional debug_attr(unsigned int idx) {return impl::attr(p, idx);} + + DebugAttrSeq debug_attrs; + +#ifndef DOXYGEN + typedef impl::AttrT BufferAttr; + + typedef impl::AttrSeqT BufferAttrSeq; +#else + typedef IAttr BufferAttr; + typedef impl::AttrSeqT BufferAttrSeq; +#endif + + optional buffer_attr(cstr name) {return impl::attr(p, name);} + optional buffer_attr(unsigned int idx) {return impl::attr(p, idx);} + + BufferAttrSeq buffer_attrs; + + Device() = delete; + Device(iio_device * dev) : p(dev), attrs(dev), debug_attrs(dev), buffer_attrs(dev){} + operator iio_device * () const {return p;} + + optstr find_attr(cstr name) const {return impl::opt(iio_device_find_attr(p, name));} + optstr find_buffer_attr(cstr name) const {return impl::opt(iio_device_find_buffer_attr(p, name));} + Channel find_channel(cstr name, bool output) const {return Channel{iio_device_find_channel(p, name, output)};} + unsigned int attrs_count() const {return iio_device_get_attrs_count(p);} + unsigned int buffer_attrs_count() const {return iio_device_get_buffer_attrs_count(p);} + Channel channel(unsigned int idx) const {return Channel{iio_device_get_channel(p, idx)};} + unsigned int channels_count() const {return iio_device_get_channels_count(p);} + Context context(); + void * data() const {return iio_device_get_data(p);} + cstr id() const { return iio_device_get_id(p);} + optstr label() const { return impl::opt(iio_device_get_label(p));} + optstr name() const { return impl::opt(iio_device_get_name(p));} + Device trigger() const {iio_device const * ret; impl::check(iio_device_get_trigger(p, &ret), "iio_device_get_trigger"); return const_cast(ret);} + bool is_trigger() const {return iio_device_is_trigger(p);} + void set_data(void * data){iio_device_set_data(p, data);} + void set_kernel_buffers_count(unsigned int nb_buffers) {impl::check(iio_device_set_kernel_buffers_count(p, nb_buffers), "iio_device_set_kernel_buffers_count");} + void set_trigger(iio_device const * trigger) {impl::check(iio_device_set_trigger(p, trigger), "iio_device_set_trigger");} + std::shared_ptr create_buffer(size_t samples_count, bool cyclic) + { + iio_buffer * buffer = iio_device_create_buffer(p, samples_count, cyclic); + if (!buffer) + impl::err(errno, "iio_device_create_buffer"); + + auto deleter = [](Buffer * buf) { + if (buf) + { + iio_buffer_destroy(*buf); + delete buf; + } + }; + + return std::shared_ptr{new Buffer(buffer), deleter}; + } +}; + +/** @brief C++ wrapper for the @ref Context C-API + */ +class Context : public impl::IndexedSequence +{ + iio_context * const p; +public: + size_t size() const + { + return devices_count(); + } + + Device operator [](size_t i) + { + assert(i < devices_count()); + return device(i); + } + + Context() = delete; + Context(iio_context * ctx) : p(ctx){assert(ctx);} + operator iio_context * () const {return p;} + + std::shared_ptr clone() const { + iio_context * ctx = iio_context_clone(p); + if (!ctx) + impl::err(errno, "iio_context_clone"); + + return impl::new_ctx(ctx); + } + + Device find_device(cstr name) const {return iio_context_find_device(p, name);} + std::pair attr(unsigned int idx) const + { + char const * name, * value; + impl::check(iio_context_get_attr(p, idx, &name, &value), "iio_context_get_attr"); + return {name, value}; + } + optstr attr_value(cstr name) const {return impl::opt(iio_context_get_attr_value(p, name));} + unsigned int attrs_count() const {return iio_context_get_attrs_count(p);} + cstr description() const {return iio_context_get_description(p);} + Device device(unsigned int idx) const + { + return Device{iio_context_get_device(p, idx)}; + } + unsigned int devices_count() const {return iio_context_get_devices_count(p);} + cstr name() const {return iio_context_get_name(p);} + + struct Version + { + unsigned int major, minor; + std::string git_tag; + }; + + Version version() const { + Version ver; + char git_tag[8]; // Flawfinder: ignore + impl::check(iio_context_get_version(p, &ver.major, &ver.minor, git_tag), "iio_context_get_version"); + ver.git_tag = git_tag; + return ver; + } + + cstr xml() const {return iio_context_get_xml(p);} + void set_timeout(unsigned int timeout_ms){impl::check(iio_context_set_timeout(p, timeout_ms), "iio_context_set_timeout");} +}; + +inline Context Device::context(){return const_cast(iio_device_get_context(p));} +inline Device Channel::device() {return const_cast(iio_channel_get_device(p));} +inline Device Buffer::device() {return const_cast(iio_buffer_get_device(p));} +inline size_t Channel::read(Buffer buffer, void * dst, size_t len) const {return iio_channel_read(p, buffer, dst, len);} // Flawfinder: ignore +inline size_t Channel::read_raw(Buffer buffer, void * dst, size_t len) const {return iio_channel_read_raw(p, buffer, dst, len);} +inline size_t Channel::write(Buffer buffer, void const * src, size_t len) {return iio_channel_write(p, buffer, src, len);} +inline size_t Channel::write_raw(Buffer buffer, void const * src, size_t len) {return iio_channel_write_raw(p, buffer, src, len);} + +namespace impl +{ +inline std::shared_ptr new_ctx(iio_context * ctx) +{ + assert(ctx); + + auto deleter = [](Context * ctx) { + if (ctx) + { + iio_context_destroy(*ctx); + delete ctx; + } + }; + + return std::shared_ptr{new Context(ctx), deleter}; +} +} // namespace impl + + +/** @brief C++ wrapper for @ref iio_create_context_from_uri + */ +inline std::shared_ptr create_from_uri(cstr uri) +{ + iio_context * ctx = iio_create_context_from_uri(uri); + if (!ctx) + impl::err(errno, "iio_create_context_from_uri"); + + return impl::new_ctx(ctx); +} + +/** @brief C++ wrapper for @ref iio_create_default_context + */ +inline std::shared_ptr create_default_context() +{ + iio_context * ctx = iio_create_default_context(); + if (!ctx) + impl::err(errno, "iio_create_default_context"); + + return impl::new_ctx(ctx); +} + +/** @brief C++ wrapper for @ref iio_create_local_context + */ +inline std::shared_ptr create_local_context() +{ + iio_context * ctx = iio_create_local_context(); + if (!ctx) + impl::err(errno, "iio_create_local_context"); + + return impl::new_ctx(ctx); +} + +/** @brief C++ wrapper for @ref iio_create_network_context + */ +inline std::shared_ptr create_network_context(cstr host) +{ + iio_context * ctx = iio_create_network_context(host); + if (!ctx) + impl::err(errno, "iio_create_network_context"); + + return impl::new_ctx(ctx); +} + +/** @brief C++ wrapper for @ref iio_create_xml_context + */ +inline std::shared_ptr create_xml_context(cstr xml_file) +{ + iio_context * ctx = iio_create_xml_context(xml_file); + if (!ctx) + impl::err(errno, "iio_create_xml_context"); + + return impl::new_ctx(ctx); +} + +/** @brief C++ wrapper for @ref iio_create_xml_context_mem + */ +inline std::shared_ptr create_xml_context_mem(char const * xml, size_t len) +{ + iio_context * ctx = iio_create_xml_context_mem(xml, len); + if (!ctx) + impl::err(errno, "iio_create_xml_context_mem"); + + return impl::new_ctx(ctx); +} + +class ContextInfo +{ + iio_context_info const * const p; +public: + ContextInfo() = delete; + ContextInfo(iio_context_info const * i) : p(i){assert(i);} + operator iio_context_info const * () const {return p;} + + cstr description() const {return iio_context_info_get_description(p);} + cstr uri() const {return iio_context_info_get_uri(p);} +}; + +class ScanContext +{ + iio_scan_context * const p; +public: + ScanContext() = delete; + ScanContext(iio_scan_context * ctx) : p(ctx){assert(ctx);} + operator iio_scan_context * () const {return p;} + + class InfoList : public impl::IndexedSequence + { + iio_context_info ** const p; + size_t const n; + public: + InfoList() = delete; + InfoList(iio_context_info ** p, size_t n) : p(p), n(n){assert(p);} + operator iio_context_info ** () const {return p;} + + size_t size() const {return n;} + + ContextInfo operator [] (size_t i) const + { + if (i >= n) + throw std::out_of_range("invalid info index"); + + return ContextInfo(p[i]); + } + }; + + std::shared_ptr info_list() const + { + iio_context_info ** lst; + ssize_t const n = iio_scan_context_get_info_list(p, &lst); + if (n < 0) + impl::err(static_cast(-n), "iio_scan_context_get_info_list"); + + + auto deleter = [](InfoList * lst) { + if (lst) + { + iio_context_info_list_free(*lst); + delete lst; + } + }; + + return std::shared_ptr{new InfoList(lst, n), deleter}; + } +}; + +std::shared_ptr create_scan_context(optstr backend, int flags) +{ + iio_scan_context * ctx = iio_create_scan_context(backend ? static_cast(*backend) : nullptr, flags); + if (!ctx) + impl::err(errno, "iio_create_scan_context"); + + auto deleter = [](ScanContext * ctx) { + if (ctx) + { + iio_scan_context_destroy(*ctx); + delete ctx; + } + }; + + return std::shared_ptr{new ScanContext(ctx), deleter}; +} + +class ScanBlock : public impl::IndexedSequence +{ + iio_scan_block * const p; + size_t const n; +public: + ScanBlock() = delete; + ScanBlock(iio_scan_block * blk) : p(blk), n(impl::check_n(iio_scan_block_scan(blk), "iio_scan_block_scan")){assert(blk);} + operator iio_scan_block * () const {return p;} + + + size_t size() const {return n;} + + ContextInfo operator [] (unsigned int i) const + { + if (iio_context_info * info = iio_scan_block_get_info(p, i)) + return ContextInfo(info); + impl::err(errno, "iio_scan_block_get_info"); + } + +}; + +std::shared_ptr create_scan_block(optstr backend, int flags) +{ + iio_scan_block * blk = iio_create_scan_block(backend ? static_cast(*backend) : nullptr, flags); + if (!blk) + impl::err(errno, "iio_create_scan_block"); + + auto deleter = [](ScanBlock * blk) { + if (blk) + { + iio_scan_block_destroy(*blk); + delete blk; + } + }; + + return std::shared_ptr{new ScanBlock(blk), deleter}; +} + + +/** @brief Reads the value of a channel by using "input" or "raw" attribute and applying "scale" and "offset" if available + * + * @see @c get_channel_value in the example @ref iio-monitor.c + */ +inline double value(Channel ch) +{ + { + double val; + if (!iio_channel_attr_read_double(ch, "input", &val)) + return val / 1000.; + } + + double scale = 1; + iio_channel_attr_read_double(ch, "scale", &scale); + + double offset = 0; + iio_channel_attr_read_double(ch, "offset", &offset); + + double raw; + impl::check(iio_channel_attr_read_double(ch, "raw", &raw), "reading raw value"); + + return (raw + offset) * scale / 1000.; +} + +} // namespace iiopp diff -Nru libiio-0.24/bindings/csharp/CMakeLists.txt libiio-0.25/bindings/csharp/CMakeLists.txt --- libiio-0.24/bindings/csharp/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/csharp/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(libiio-sharp NONE) if (WIN32) diff -Nru libiio-0.24/bindings/csharp/Device.cs libiio-0.25/bindings/csharp/Device.cs --- libiio-0.24/bindings/csharp/Device.cs 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/csharp/Device.cs 2023-08-09 15:58:07.000000000 +0000 @@ -450,7 +450,7 @@ return new DeviceBufferAttr(dev, Marshal.PtrToStringAnsi(attr)); } - /// Finds the channel attribute coresponding to the given filename from the current device. + /// Finds the channel attribute corresponding to the given filename from the current device. /// The name of the attribute. /// Output variable. It will contain a pointer to the resulting . /// Output variable. It will contain a pointer to the resulting . diff -Nru libiio-0.24/bindings/csharp/Doxyfile.in libiio-0.25/bindings/csharp/Doxyfile.in --- libiio-0.24/bindings/csharp/Doxyfile.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/csharp/Doxyfile.in 2023-08-09 15:58:07.000000000 +0000 @@ -1,5 +1,43 @@ +# Doxyfile 1.9.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + PROJECT_NAME = "C# bindings for libiio" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + PROJECT_NUMBER = @LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@ # Using the PROJECT_BRIEF tag one can provide an optional one line description @@ -8,10 +46,10 @@ PROJECT_BRIEF = "C# bindings for libIIO" -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -21,17 +59,56 @@ # left blank the current directory will be used. OUTPUT_DIRECTORY = @CMAKE_HTML_DEST_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -66,7 +143,7 @@ INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -110,6 +187,16 @@ JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -130,15 +217,23 @@ MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -157,16 +252,15 @@ # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -175,25 +269,60 @@ OPTIMIZE_OUTPUT_FOR_C = NO +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -201,22 +330,72 @@ MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -271,11 +450,24 @@ LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -285,35 +477,41 @@ EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -328,6 +526,13 @@ EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -338,21 +543,21 @@ # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -365,22 +570,36 @@ INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = @CMAKE_CASE_SENSITIVE_FILESYSTEM@ # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -408,14 +627,14 @@ # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -460,27 +679,25 @@ STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -505,8 +722,8 @@ MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -551,11 +768,10 @@ # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -571,7 +787,7 @@ QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -579,7 +795,7 @@ WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -596,12 +812,22 @@ # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -625,7 +851,7 @@ # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = @CMAKE_SOURCE_DIR@/bindings/csharp/ @@ -633,22 +859,32 @@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. -FILE_PATTERNS = *.cs *.dox +FILE_PATTERNS = *.cs \ + *.dox # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -663,7 +899,7 @@ # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -732,6 +968,10 @@ # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -741,11 +981,15 @@ # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -793,7 +1037,7 @@ STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -805,7 +1049,7 @@ REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -825,12 +1069,12 @@ # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -852,6 +1096,44 @@ VERBATIM_HEADERS = YES +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to +# YES then doxygen will add the directory of each input to the include path. +# The default value is: YES. + +CLANG_ADD_INC_PATHS = YES + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -863,13 +1145,6 @@ ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -882,7 +1157,7 @@ # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -944,13 +1219,15 @@ HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -966,9 +1243,9 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -997,12 +1274,24 @@ # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1026,13 +1315,14 @@ # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1071,8 +1361,8 @@ # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1094,28 +1384,29 @@ CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1146,7 +1437,8 @@ # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1154,8 +1446,8 @@ # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1163,30 +1455,30 @@ # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1228,7 +1520,7 @@ # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1256,13 +1548,24 @@ TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1272,7 +1575,7 @@ FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1283,9 +1586,15 @@ FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1296,7 +1605,7 @@ # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1311,8 +1620,8 @@ # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1326,7 +1635,8 @@ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1354,12 +1664,12 @@ SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There -# are two flavours of web server based searching depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. See -# the section "External Indexing and Searching" for details. +# implemented using a web server instead of a web client using JavaScript. There +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1371,9 +1681,10 @@ # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1384,10 +1695,11 @@ # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1422,24 +1734,428 @@ # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = makeindex + +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the +# generated LaTeX document. The header should contain everything until the first +# chapter. If it is left blank doxygen will generate a standard header. See +# section "Doxygen usage" for information on how to let doxygen write the +# default header to a separate file. +# +# Note: Only use a user-defined header if you know what you are doing! The +# following commands have a special meaning inside the header: $title, +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the +# generated LaTeX document. The footer should contain everything after the last +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. +# +# Note: Only use a user-defined footer if you know what you are doing! +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_FOOTER = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode +# command to the generated LaTeX files. This will instruct LaTeX to keep running +# if errors occur, instead of asking the user for help. This option is also used +# when generating formulas in HTML. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = NO + +# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source +# code with syntax highlighting in the LaTeX output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. See +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BIB_STYLE = plain + +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + GENERATE_MAN = NO +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1455,7 +2171,7 @@ EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1497,9 +2213,9 @@ EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all refrences to function-like macros that are alone on a line, have an -# all uppercase name, and do not end with a semicolon. Such function macros are -# typically used for boiler-plate code, and will confuse the parser if not +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not # removed. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1519,7 +2235,7 @@ # where loc1 and loc2 can be relative or absolute paths or URLs. See the # section "Linking to external documentation" for more information about the use # of tag files. -# Note: Each tag file must have an unique name (where the name does NOT include +# Note: Each tag file must have a unique name (where the name does NOT include # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. @@ -1531,37 +2247,32 @@ GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -1570,15 +2281,6 @@ CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -1586,7 +2288,7 @@ DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -1597,7 +2299,7 @@ # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO -# The default value is: NO. +# The default value is: YES. HAVE_DOT = @DOXYGEN_DOT_FOUND@ @@ -1611,7 +2313,7 @@ DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen +# When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -1659,7 +2361,7 @@ GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -1676,10 +2378,32 @@ # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -1711,7 +2435,8 @@ # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1722,7 +2447,8 @@ # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1745,11 +2471,17 @@ DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, +# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, +# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1771,7 +2503,7 @@ # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = "@DOXYGEN_DOT_PATH@" +DOT_PATH = @DOXYGEN_DOT_PATH@ # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile @@ -1792,6 +2524,24 @@ DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -1828,7 +2578,7 @@ DOT_TRANSPARENT = YES -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -1845,9 +2595,11 @@ GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc and +# plantuml temporary files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff -Nru libiio-0.24/bindings/csharp/mainpage.dox libiio-0.25/bindings/csharp/mainpage.dox --- libiio-0.24/bindings/csharp/mainpage.dox 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/csharp/mainpage.dox 2023-08-09 15:58:07.000000000 +0000 @@ -15,7 +15,7 @@ The full terms of the library license can be found at: http://opensource.org/licenses/LGPL-2.1 and the iio-utils license can be found at: https://opensource.org/licenses/GPL-2.0 @section code_model Code Model -The basic bricks of the libiio API, and therefore the C# bindings are the the iio namepace, and the classes of that nameplace: iio.Channel, iio.Context, iio.Device, iio.IOBuffer, iio.Trigger, and iio.Attr (channel or device attributes). +The basic bricks of the libiio API, and therefore the C# bindings are the the iio namespace, and the classes of that nameplace: iio.Channel, iio.Context, iio.Device, iio.IOBuffer, iio.Trigger, and iio.Attr (channel or device attributes). ![Caption text](doc/codemodel.svg) diff -Nru libiio-0.24/bindings/python/CMakeLists.txt libiio-0.25/bindings/python/CMakeLists.txt --- libiio-0.24/bindings/python/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(libiio-py NONE) if(${CMAKE_VERSION} VERSION_LESS "3.12.0") @@ -42,10 +42,6 @@ endif() if(WITH_DOC) - if(${CMAKE_VERSION} VERSION_LESS "3.2.0") - # cmake -E env was added in 3.2 - message(FATAL_ERROR "Sorry, you can't build python doc with ancient cmake, please update") - endif() find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx Documentation Builder (sphinx-doc.org)" diff -Nru libiio-0.24/bindings/python/doc/conf.py.in libiio-0.25/bindings/python/doc/conf.py.in --- libiio-0.24/bindings/python/doc/conf.py.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/doc/conf.py.in 2023-08-09 15:58:07.000000000 +0000 @@ -15,8 +15,6 @@ sys.path.insert(0, os.path.abspath('../.')) sys.path.insert(0, os.path.abspath('../examples')) -import sphinx_rtd_theme - # -- Project information ----------------------------------------------------- project = '@PROJECT_NAME@' @@ -32,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ["sphinx.ext.githubpages", "sphinx_rtd_theme", 'sphinx.ext.viewcode', 'sphinx.ext.autodoc'] +extensions = ["sphinx.ext.githubpages", 'sphinx.ext.viewcode', 'sphinx.ext.autodoc'] #] # Add any paths that contain templates here, relative to this directory. @@ -46,11 +44,6 @@ # -- Options for HTML output ------------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = "sphinx_rtd_theme" - # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". diff -Nru libiio-0.24/bindings/python/doc/iio_attr.rst libiio-0.25/bindings/python/doc/iio_attr.rst --- libiio-0.24/bindings/python/doc/iio_attr.rst 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/doc/iio_attr.rst 2023-08-09 15:58:07.000000000 +0000 @@ -1,7 +1,7 @@ iio_attr ====================== | iio_attr is part of the Libiio package, a library that has been developed to ease the development of software interfacing Linux Industrial I/O (IIO) devices. -| This tool is written using the libiio Python bindings. It works in a very similar way of how the base iio_attr works. You can find more informations about it on this `page `_. +| This tool is written using the libiio Python bindings. It works in a very similar way of how the base iio_attr works. You can find more information about it on this `page `_. .. automodule:: iio_attr :members: diff -Nru libiio-0.24/bindings/python/doc/iio_info.rst libiio-0.25/bindings/python/doc/iio_info.rst --- libiio-0.24/bindings/python/doc/iio_info.rst 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/doc/iio_info.rst 2023-08-09 15:58:07.000000000 +0000 @@ -1,7 +1,7 @@ iio_info ===================== | iio_info is part of the Libiio package, a library that has been developed to ease the development of software interfacing Linux Industrial I/O (IIO) devices. -| This tool is written using the libiio Python bindings. It works in the same way as the base iio_info works. You can find more informations about it on this `page `_. +| This tool is written using the libiio Python bindings. It works in the same way as the base iio_info works. You can find more information about it on this `page `_. .. automodule:: iio_info :members: diff -Nru libiio-0.24/bindings/python/doc/iio_readdev.rst libiio-0.25/bindings/python/doc/iio_readdev.rst --- libiio-0.24/bindings/python/doc/iio_readdev.rst 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/doc/iio_readdev.rst 2023-08-09 15:58:07.000000000 +0000 @@ -1,7 +1,7 @@ iio_readdev ===================== | iio_readdev is part of the Libiio package, a library that has been developed to ease the development of software interfacing Linux Industrial I/O (IIO) devices. -| This tool is written using the libiio Python bindings. It works in the same way as the base iio_readdev works. You can find more informations about it on this `page `_. +| This tool is written using the libiio Python bindings. It works in the same way as the base iio_readdev works. You can find more information about it on this `page `_. .. automodule:: iio_readdev :members: diff -Nru libiio-0.24/bindings/python/doc/iio_writedev.rst libiio-0.25/bindings/python/doc/iio_writedev.rst --- libiio-0.24/bindings/python/doc/iio_writedev.rst 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/doc/iio_writedev.rst 2023-08-09 15:58:07.000000000 +0000 @@ -1,7 +1,7 @@ iio_writedev ===================== | iio_writedev is part of the Libiio package, a library that has been developed to ease the development of software interfacing Linux Industrial I/O (IIO) devices. -| This tool is written using the libiio Python bindings. It works in the same way as the base iio_writedev works. You can find more informations about it on this `page `_. +| This tool is written using the libiio Python bindings. It works in the same way as the base iio_writedev works. You can find more information about it on this `page `_. .. automodule:: iio_writedev :members: diff -Nru libiio-0.24/bindings/python/iio.py libiio-0.25/bindings/python/iio.py --- libiio-0.24/bindings/python/iio.py 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/iio.py 2023-08-09 15:58:07.000000000 +0000 @@ -375,7 +375,7 @@ _d_get_attr = _lib.iio_device_get_attr _d_get_attr.restype = c_char_p -_d_get_attr.argtypes = (_DevicePtr,) +_d_get_attr.argtypes = (_DevicePtr, c_uint) _d_get_attr.errcheck = _check_null _d_read_attr = _lib.iio_device_attr_read @@ -394,7 +394,7 @@ _d_get_debug_attr = _lib.iio_device_get_debug_attr _d_get_debug_attr.restype = c_char_p -_d_get_debug_attr.argtypes = (_DevicePtr,) +_d_get_debug_attr.argtypes = (_DevicePtr, c_uint) _d_get_debug_attr.errcheck = _check_null _d_read_debug_attr = _lib.iio_device_debug_attr_read @@ -413,7 +413,7 @@ _d_get_buffer_attr = _lib.iio_device_get_buffer_attr _d_get_buffer_attr.restype = c_char_p -_d_get_buffer_attr.argtypes = (_DevicePtr,) +_d_get_buffer_attr.argtypes = (_DevicePtr, c_uint) _d_get_buffer_attr.errcheck = _check_null _d_read_buffer_attr = _lib.iio_device_buffer_attr_read @@ -506,7 +506,7 @@ _c_get_attr = _lib.iio_channel_get_attr _c_get_attr.restype = c_char_p -_c_get_attr.argtypes = (_ChannelPtr,) +_c_get_attr.argtypes = (_ChannelPtr, c_uint) _c_get_attr.errcheck = _check_null _c_get_filename = _lib.iio_channel_attr_get_filename diff -Nru libiio-0.24/bindings/python/setup.py.cmakein libiio-0.25/bindings/python/setup.py.cmakein --- libiio-0.24/bindings/python/setup.py.cmakein 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/bindings/python/setup.py.cmakein 2023-08-09 15:58:07.000000000 +0000 @@ -55,22 +55,18 @@ from platform import system as _system from ctypes import CDLL as _cdll from ctypes.util import find_library + from os import getenv + from os.path import join + + iiolib = "iio" if "Darwin" in _system() else "libiio${CMAKE_SHARED_LIBRARY_SUFFIX}" + + destdir = getenv("DESTDIR", "") or "" + destdir = join("${CMAKE_INSTALL_FULL_LIBDIR}", destdir) + fulllibpath = find_recursive(destdir, iiolib) - if "Windows" in _system(): - _iiolib = "libiio.dll" - else: - # Non-windows, possibly Posix system - _iiolib = "iio" try: - import os - destdir = os.getenv("DESTDIR", "") - if destdir: - destdir = os.path.join("${CMAKE_BINARY_DIR}", destdir) - fulllibpath = find_recursive(destdir, "libiio.so") - _lib = _cdll(fulllibpath, use_errno=True, use_last_error=True) - else: - _lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True) + _lib = _cdll(fulllibpath, use_errno=True, use_last_error=True) if not _lib._name: raise OSError except OSError: diff -Nru libiio-0.24/channel.c libiio-0.25/channel.c --- libiio-0.24/channel.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/channel.c 2023-08-09 15:58:07.000000000 +0000 @@ -108,6 +108,12 @@ [IIO_MOD_PM2P5] = "pm2p5", [IIO_MOD_PM4] = "pm4", [IIO_MOD_PM10] = "pm10", + [IIO_MOD_LINEAR_X] = "x-g", + [IIO_MOD_LINEAR_Y] = "y-g", + [IIO_MOD_LINEAR_Z] = "z-g", + [IIO_MOD_PITCH] = "pitch", + [IIO_MOD_YAW] = "yaw", + [IIO_MOD_ROLL] = "roll", }; /* @@ -338,21 +344,55 @@ return chn->attrs[index].name; } -const char * iio_channel_find_attr(const struct iio_channel *chn, - const char *name) +static const char * +iio_channel_do_find_attr(const struct iio_channel *chn, const char *name) { unsigned int i; + for (i = 0; i < chn->nb_attrs; i++) { const char *attr = chn->attrs[i].name; if (!strcmp(attr, name)) return attr; } + + return NULL; +} + +const char * iio_channel_find_attr(const struct iio_channel *chn, + const char *name) +{ + const char *attr; + size_t len; + + attr = iio_channel_do_find_attr(chn, name); + if (attr) + return attr; + + /* Support attribute names that start with the channel's label to avoid + * breaking compatibility with old kernels, which did not offer a + * 'label' attribute, and caused Libiio to sometimes misdetect the + * channel's extended name as being part of the attribute name. */ + if (chn->name) { + len = strlen(chn->name); + + if (!strncmp(chn->name, name, len) && name[len] == '_') { + name += len + 1; + return iio_channel_do_find_attr(chn, name); + } + } + return NULL; } ssize_t iio_channel_attr_read(const struct iio_channel *chn, const char *attr, char *dst, size_t len) { + if (attr) { + attr = iio_channel_find_attr(chn, attr); + if (!attr) + return -ENOENT; + } + if (chn->dev->ctx->ops->read_channel_attr) return chn->dev->ctx->ops->read_channel_attr(chn, attr, dst, len); @@ -363,6 +403,10 @@ ssize_t iio_channel_attr_write_raw(const struct iio_channel *chn, const char *attr, const void *src, size_t len) { + attr = iio_channel_find_attr(chn, attr); + if (!attr) + return -ENOENT; + if (chn->dev->ctx->ops->write_channel_attr) return chn->dev->ctx->ops->write_channel_attr(chn, attr, src, len); diff -Nru libiio-0.24/CI/azure/check_kernel.sh libiio-0.25/CI/azure/check_kernel.sh --- libiio-0.24/CI/azure/check_kernel.sh 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/CI/azure/check_kernel.sh 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,70 @@ +#!/bin/bash +set -e + +KERNEL_TYPES="/tmp/mainline_types.h" +IIOH="./iio.h" +CHANNELC="./channel.c" + +if [ ! -f ${IIOH} ] ; then + echo can not find ${IIOH} + exit 1 +fi + +if [ ! -f ${CHANNELC} ] ; then + echo can not find ${CHANNELC} + exit 1 +fi + +rm -f ${KERNEL_TYPES} +wget -O ${KERNEL_TYPES} https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/linux/iio/types.h + +ret=0 + +for enum in iio_chan_type iio_modifier iio_event_type iio_event_direction +do + echo looking for ${enum} + rm -f /tmp/kernel_${enum} /tmp/libiio_${enum} + sed "0,/${enum}/d" ${KERNEL_TYPES} | sed -n '/}/q;p' > /tmp/kernel_${enum} + sed "0,/^enum.*${enum}/d" ${IIOH} | sed -n '/}/q;p' | grep -v IIO_CHAN_TYPE_UNKNOWN > /tmp/libiio_${enum} + echo Differences in ${enum} + # diff exit status of 1 means a difference, not an error + set +e + diff -u /tmp/libiio_${enum} /tmp/kernel_${enum} + count=$(diff -u /tmp/libiio_${enum} /tmp/kernel_${enum} | wc -l) + set -e + if [ "$count" -ne "0" ] ; then + ret=1 + echo difference between upstream kernel types.h and iio.h in ${enum} + else + echo none + fi +done + +for enum in iio_chan_type_name_spec modifier_names +do + sed "0,/^static.*${enum}/d" ${CHANNELC} | sed -n '/}/q;p' | \ + grep -v IIO_CHAN_TYPE_UNKNOWN > /tmp/libiio_${enum} +done + +while IFS="" read -r p ; do + key=$(echo "${p//[[:space:],]/}") + count=$(grep "\[$key\]" /tmp/libiio_iio_chan_type_name_spec | wc -l) + if [ "$count" -eq "0" ] ; then + echo "$key missing from channel.c iio_chan_type_name_spec" + ret=1 + fi +done < /tmp/libiio_iio_chan_type + +echo +sed -i '/IIO_NO_MOD/d' /tmp/libiio_iio_modifier + +while IFS="" read -r p ; do + key=$(echo "${p//[[:space:],]/}") + count=$(grep "\[$key\]" /tmp/libiio_modifier_names | wc -l) + if [ "$count" -eq "0" ] ; then + echo "$key missing from channel.c modifier_names" + ret=1 + fi +done < /tmp/libiio_iio_modifier + +exit $ret diff -Nru libiio-0.24/CI/azure/check_README_BUILD.sh libiio-0.25/CI/azure/check_README_BUILD.sh --- libiio-0.24/CI/azure/check_README_BUILD.sh 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/CI/azure/check_README_BUILD.sh 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,34 @@ +#!/bin/sh + +# Check the project CMake for options, which are not described in the README_BUILD.md file +# At the same time, check to make sure the defaults are described properly. + +error=0 + +options() { + for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) + do + grep option[[:space:]]*\( "${file}" | \ + sed -e "s/^[[:space:]]*//g" -e "s/(/ /g" | \ + awk '{print $2}' + done | sort | uniq +} + +for opt in $(options) +do + default=$(for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) + do + grep "option[[:space:]]*(${opt} " "${file}" | \ + sed -e "s/^[[:space:]]*//g" -e "s/)[[:space:]]*$//" | \ + awk '{print $NF}' + done) + if ! grep -q "${opt}.*${default}" README_BUILD.md ; then + echo "no match with ${opt} set with ${default}" + grep -R "${opt}" ./* + error=1 + fi +done + +if [ "${error}" -eq "1" ] ; then + exit 1 +fi diff -Nru libiio-0.24/CI/azure/ci-ubuntu.sh libiio-0.25/CI/azure/ci-ubuntu.sh --- libiio-0.24/CI/azure/ci-ubuntu.sh 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/azure/ci-ubuntu.sh 2023-08-09 15:58:07.000000000 +0000 @@ -3,6 +3,7 @@ uname -a echo "$PWD" mkdir build && cd build -cmake .. -DWITH_HWMON=ON -DWITH_SERIAL_BACKEND=ON -DWITH_EXAMPLES=ON -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DCPACK_SYSTEM_NAME="${ARTIFACTNAME}" +cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DWITH_SERIAL_BACKEND=ON -DWITH_EXAMPLES=ON -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DCPACK_SYSTEM_NAME="${ARTIFACTNAME}" make make package +make required2tar diff -Nru libiio-0.24/CI/azure/generateDocumentationAndDeploy.sh.in libiio-0.25/CI/azure/generateDocumentationAndDeploy.sh.in --- libiio-0.24/CI/azure/generateDocumentationAndDeploy.sh.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/azure/generateDocumentationAndDeploy.sh.in 2023-08-09 15:58:07.000000000 +0000 @@ -8,7 +8,7 @@ # # Preconditions: # - Packages doxygen graphviz must be installed. -# - An gh-pages branch should already exist. See below for mor info on how to +# - An gh-pages branch should already exist. See below for more info on how to # create a gh-pages branch. # # This script will generate Doxygen documentation and push the documentation to diff -Nru libiio-0.24/CI/azure/macos_tar_fixup.sh libiio-0.25/CI/azure/macos_tar_fixup.sh --- libiio-0.24/CI/azure/macos_tar_fixup.sh 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/CI/azure/macos_tar_fixup.sh 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,51 @@ +#!/bin/bash -xe + +# Extract tar.gz to temp folder +tarname=$(find . -maxdepth 1 -name '*.tar.gz') +if [ -z "${tarname}" ]; then + echo "tar.gz not found" + exit 1 +fi +# Remove .tar.gz from filename +subfoldername=$(echo "${tarname}" | rev | cut -b 8- | rev) + +mkdir -p temp_tar +tar -xzf "${tarname}" -C temp_tar +mv "temp_tar/${subfoldername}" temp +cd temp + +deps_dir=Library/Frameworks/iio.framework/Versions/Current/Dependencies +libiio_loc=Library/Frameworks/iio.framework/Versions/Current/iio +libiioheader_loc=Library/Frameworks/iio.framework/Versions/Current/Headers/iio.h + +mkdir -p "${deps_dir}" + +# Create links to framework files +mkdir -p usr/local/{lib,include} +ln -fs "../../../${libiio_loc}" usr/local/lib/libiio.dylib +ln -fs "../../../${libiioheader_loc}" usr/local/include/iio.h + +# Update rpath of library +install_name_tool -add_rpath @loader_path/. "${libiio_loc}" + +# Copy dependent libs to local libs, and update rpath of dependencies +for each in $(otool -L "${libiio_loc}" |grep homebrew |cut -f2 | cut -d' ' -f1) ; do + name=$(basename "${each}") + cp "${each}" "${deps_dir}" + chmod +w "${deps_dir}/${name}" + install_name_tool -id "@rpath/Dependencies/${name}" "${deps_dir}/${name}" + install_name_tool -change "${each}" "@rpath/Dependencies/${name}" "${libiio_loc}" + codesign --force -s - "${deps_dir}/${name}" +done + +# Update tools +for tool in Library/Frameworks/iio.framework/Tools/*; +do + install_name_tool -add_rpath @loader_path/../.. "${tool}" +done + +# Remove old tar and create new one +rm "../${tarname}" +tar -czf "../${tarname}" . +cd .. +rm -rf temp diff -Nru libiio-0.24/CI/azure/prepare_assets.sh libiio-0.25/CI/azure/prepare_assets.sh --- libiio-0.24/CI/azure/prepare_assets.sh 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/azure/prepare_assets.sh 2023-08-09 15:58:07.000000000 +0000 @@ -1,19 +1,20 @@ #!/bin/bash -e release_artifacts() { - local deb_linux_assets='Fedora-34 Ubuntu-18.04 Ubuntu-20.04 Ubuntu-22.04' + local deb_linux_assets='Fedora-34 Fedora-28 Ubuntu-18.04 Ubuntu-20.04 Ubuntu-22.04 Debian-11 openSUSE-15.4 CentOS-7' cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}" for i in $deb_linux_assets; do cd "Linux-${i}" - if [ "${i}" == "Fedora-34" ]; then + if [ "${i}" == "Fedora-34" ] || [ "${i}" == "Fedora-28" ] || [ "${i}" == "CentOS-7" ]; then find . -name '*.rpm' -exec mv {} ../ ";" fi find . -name '*.deb' -exec mv {} ../ ";" + find . -name '*.tar.gz' -exec mv {} ../ ";" cd ../ rm -r "Linux-${i}" done - local pkg_assets='macOS-10.15 macOS-11 macOS-12' + local pkg_assets='macOS-11 macOS-12 macOS-13-x64 macOS-13-arm64' cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}" for i in $pkg_assets; do cd "${i}" @@ -30,18 +31,30 @@ rm -r "${i}" done - local zip_assets='2019 2022' + local zip_assets='VS-2019-x64 VS-2022-x64 MinGW-W64' cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}" + mkdir Windows + cd Windows + mkdir include + cd .. + cp ./Windows-VS-2019-x64/iio.h ./Windows/include for i in $zip_assets; do - zip -r "Windows-VS-${i}-x64".zip "Windows-VS-${i}-x64" - rm -r "Windows-VS-${i}-x64" + rm ./"Windows-${i}"/iio.h + mv ./"Windows-${i}" Windows done + cp /home/vsts/work/1/s/CI/azure/README.txt ./Windows + cd Windows + zip -r Windows.zip ./* + cp ./Windows.zip ../ + cd .. + rm -r Windows local deb_arm_assets='arm32v7 arm64v8 ppc64le x390x' cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}" for i in $deb_arm_assets; do cd "Ubuntu-${i}" find . -name '*.deb' -exec mv {} ../ ";" + find . -name '*.tar.gz' -exec mv {} ../ ";" cd ../ rm -r "Ubuntu-${i}" done @@ -49,10 +62,10 @@ } swdownloads_artifacts() { - local linux_dist='Fedora-34 Ubuntu-18.04 Ubuntu-20.04 Ubuntu-22.04' + local linux_dist='Fedora-34 Fedora-28 Ubuntu-18.04 Ubuntu-20.04 Ubuntu-22.04 Debian-11 openSUSE-15.4 CentOS-7' for distribution in $linux_dist; do cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}/Linux-${distribution}" - if [ "${distribution}" == "Fedora-34" ]; then + if [ "${distribution}" == "Fedora-34" ] || [ "${distribution}" == "Fedora-28" ] || [ "${distribution}" == "CentOS-7" ]; then find . -name '*.rpm' -exec mv {} ../"${distribution}_latest_master_libiio.rpm" ";" fi find . -name '*.tar.gz' -exec mv {} ../"${distribution}_latest_master_libiio.tar.gz" ";" @@ -60,7 +73,7 @@ rm -r ../Linux-"${distribution}" done - local macOS_dist='macOS-10.15 macOS-11 macOS-12' + local macOS_dist='macOS-11 macOS-12 macOS-13-x64 macOS-13-arm64' for distribution in $macOS_dist; do cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}/${distribution}" find . -name '*.pkg' -exec mv {} ../"${distribution}_latest_master_libiio.pkg" ";" @@ -86,6 +99,10 @@ cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}/Libiio-Setup-Exe" mv libiio-setup.exe ../libiio-setup.exe rm -r ../Libiio-Setup-Exe + + cd "${BUILD_ARTIFACTSTAGINGDIRECTORY}" + zip -r Windows-MinGW-W64-latest_master_libiio.zip Windows-MinGW-W64 + rm -r Windows-MinGW-W64 } check_artifacts() { diff -Nru libiio-0.24/CI/azure/README.txt libiio-0.25/CI/azure/README.txt --- libiio-0.24/CI/azure/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/CI/azure/README.txt 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,61 @@ + libiio Windows binary snapshot - README + + ********************************************************************* + * The latest version of this snapshot can always be downloaded at: * + * https://github.com/analogdevicesinc/libiio * + ********************************************************************* + +In this archive, you should find the following directories: +o ./include : Common include files +o ./Windows-MinGW-W64 : 64-bit binaries compiled by the MinGW toolchain +o ./Windows-VS-2019-x64 : 64-bit binaries compiled by the MicroSoft toolchain, VS-2019 +o ./Windows-VS-2022-x64 : 64-bit binaries compiled by the MicroSoft toolchain, VS-2022 + +o Visual Studio: + - Open existing or create a new project for your application + - Copy iio.h, from the include\ directory, into your project and make sure that + the location where the file reside appears in the 'Additional Include + Directories' section (Configuration Properties -> C/C++ -> General). + - Copy the relevant .lib file from Windows-VS-2019-x64\ or Windows-VS-2022-x64\ and add 'libiio.lib' to + your 'Additional Dependencies' (Configuration Properties -> Linker -> Input) + Also make sure that the directory where libiio.lib resides is added to + 'Additional Library Directories' (Configuration Properties -> Linker + -> General) + - If you use the static version of the libiio library, make sure that + 'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration + Properties -> C/C++ -> Code Generation). + - Compile and run your application. If you use the DLL version of libiio, + remember that you need to have a copy of the DLL either in the runtime + directory or in system32 + +o WDK/DDK: + - The following is an example of a sources files that you can use to compile + a libiio 1.0 based console application. In this sample ..\libiio\ is the + directory where you would have copied libiio.h as well as the relevant + libiio.lib + + TARGETNAME=your_app + TARGETTYPE=PROGRAM + USE_MSVCRT=1 + UMTYPE=console + INCLUDES=..\libiio;$(DDK_INC_PATH) + TARGETLIBS=..\libiio\libiio.lib + SOURCES=your_app.c + +o MinGW/cygwin + - Copy iio.h, from include/ to your default include directory, + and copy the MinGW32/ or MinGW64/ .a files to your default library directory. + Or, if you don't want to use the default locations, make sure that you feed + the relevant -I and -L options to the compiler. + - Add the '-liio' linker option when compiling. + +o Additional information: + - The libiio API documentation can be accessed at: + http://analogdevicesinc.github.io/libiio/ + - For some libiio samples (including source), please have a look in examples/ + and tests/ directories + - The MinGW and MS generated DLLs are fully interchangeable, provided that you + use the import libs provided or generate one from the .def also provided. + - If you find any issue, please visit + http://analogdevicesinc.github.io/libiio/ + and check the Issues section diff -Nru libiio-0.24/CI/azure/zip.txt libiio-0.25/CI/azure/zip.txt --- libiio-0.24/CI/azure/zip.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/azure/zip.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ - libiio Windows binary snapshot - README - - ********************************************************************* - * The latest version of this snapshot can always be downloaded at: * - * https://github.com/analogdevicesinc/libiio * - ********************************************************************* - -In this archive, you should find the following directories: -o ./include : Common include files -o ./MinGW32 : 32-bit binaries compiled by the MinGW toolchain -o ./MinGW64 : 64-bit binaries compiled by the MinGW toolchain -o ./MS32 : 32-bit binaries compiled by the MicroSoft toolchain -o ./MS64 : 364bit binaries compiled by the MicroSoft toolchain - -o Visual Studio: - - Open existing or create a new project for your application - - Copy iio.h, from the include\ directory, into your project and make sure that - the location where the file reside appears in the 'Additional Include - Directories' section (Configuration Properties -> C/C++ -> General). - - Copy the relevant .lib file from MS32\ or MS64\ and add 'libiio.lib' to - your 'Additional Dependencies' (Configuration Properties -> Linker -> Input) - Also make sure that the directory where libiio.lib resides is added to - 'Additional Library Directories' (Configuration Properties -> Linker - -> General) - - If you use the static version of the libiio library, make sure that - 'Runtime Library' is set to 'Multi-threaded DLL (/MD)' (Configuration - Properties -> C/C++ -> Code Generation). - - Compile and run your application. If you use the DLL version of libiio, - remember that you need to have a copy of the DLL either in the runtime - directory or in system32 - -o WDK/DDK: - - The following is an example of a sources files that you can use to compile - a libiio 1.0 based console application. In this sample ..\libiio\ is the - directory where you would have copied libiio.h as well as the relevant - libiio.lib - - TARGETNAME=your_app - TARGETTYPE=PROGRAM - USE_MSVCRT=1 - UMTYPE=console - INCLUDES=..\libiio;$(DDK_INC_PATH) - TARGETLIBS=..\libiio\libiio.lib - SOURCES=your_app.c - -o MinGW/cygwin - - Copy libiio.h, from include/ to your default include directory, - and copy the MinGW32/ or MinGW64/ .a files to your default library directory. - Or, if you don't want to use the default locations, make sure that you feed - the relevant -I and -L options to the compiler. - - Add the '-liio' linker option when compiling. - -o Additional information: - - The libiio API documentation can be accessed at: - http://analogdevicesinc.github.io/libiio/ - - For some libiio samples (including source), please have a look in examples/ - and tests/ directories - - The MinGW and MS generated DLLs are fully interchangeable, provided that you - use the import libs provided or generate one from the .def also provided. - - If you find any issue, please visit - http://analogdevicesinc.github.io/libiio/ - and check the Issues section diff -Nru libiio-0.24/CI/build_win.ps1 libiio-0.25/CI/build_win.ps1 --- libiio-0.24/CI/build_win.ps1 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/build_win.ps1 2023-08-09 15:58:07.000000000 +0000 @@ -3,6 +3,7 @@ $ErrorView = "NormalView" $COMPILER=$Env:COMPILER +$USE_CSHARP=$Env:USE_CSHARP $src_dir=$pwd echo "Running cmake for $COMPILER on 64 bit..." @@ -10,7 +11,7 @@ cp .\libiio.iss.cmakein .\build-x64 cd build-x64 -cmake -G "$COMPILER" -DCMAKE_SYSTEM_PREFIX_PATH="C:" -DENABLE_IPV6=ON -DWITH_USB_BACKEND=ON -DWITH_SERIAL_BACKEND=ON -DPYTHON_BINDINGS=ON -DCSHARP_BINDINGS:BOOL=ON -DLIBXML2_LIBRARIES="C:\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\64\\libserialport.dll.a" -DLIBUSB_INCLUDE_DIR="C:\\include\\libusb-1.0" -DLIBXML2_INCLUDE_DIR="C:\\include\\libxml2" .. +cmake -G "$COMPILER" -DCMAKE_SYSTEM_PREFIX_PATH="C:" -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DENABLE_IPV6=ON -DWITH_USB_BACKEND=ON -DWITH_SERIAL_BACKEND=ON -DPYTHON_BINDINGS=ON -DCSHARP_BINDINGS:BOOL=$USE_CSHARP -DLIBXML2_LIBRARIES="C:\\libs\\64\\libxml2.lib" -DLIBUSB_LIBRARIES="C:\\libs\\64\\libusb-1.0.lib" -DLIBSERIALPORT_LIBRARIES="C:\\libs\\64\\libserialport.dll.a" -DLIBUSB_INCLUDE_DIR="C:\\include\\libusb-1.0" -DLIBXML2_INCLUDE_DIR="C:\\include\\libxml2" .. cmake --build . --config Release if ( $LASTEXITCODE -ne 0 ) { throw "[*] cmake build failure" diff -Nru libiio-0.24/CI/publish_deps.ps1 libiio-0.25/CI/publish_deps.ps1 --- libiio-0.24/CI/publish_deps.ps1 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CI/publish_deps.ps1 2023-08-09 15:58:07.000000000 +0000 @@ -5,22 +5,34 @@ $src_dir=$pwd $COMPILER=$Env:COMPILER -if ($COMPILER -eq "Visual Studio 16 2019") { - cd 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT' - cp .\msvcp140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY - cp .\vcruntime140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY -}else { - cd 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT' - cp .\msvcp140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY - cp .\vcruntime140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY -} - cd $src_dir mkdir dependencies cd dependencies wget http://swdownloads.analog.com/cse/build/libiio-win-deps-libusb1.0.24.zip -OutFile "libiio-win-deps.zip" 7z x -y "libiio-win-deps.zip" -cp .\libs\64\libxml2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY -cp .\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY -cp .\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY +if ($COMPILER -eq "MinGW Makefiles") { + cp $src_dir\dependencies\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp $src_dir\dependencies\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.2.8\mingw\bin\libgcc_s_seh-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.4.5\mingw\bin\libiconv-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.4.5\mingw\bin\zlib1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.4.5\mingw\bin\liblzma-5.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.4.5\mingw\bin\libwinpthread-1.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.4.5\mingw\bin\libxml2-2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp C:\ghcup\ghc\9.2.8\mingw\bin\libstdc++-6.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY +} else { + cp $src_dir\dependencies\libs\64\libxml2.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp $src_dir\dependencies\libs\64\libserialport-0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp $src_dir\dependencies\libs\64\libusb-1.0.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + + if ($COMPILER -eq "Visual Studio 16 2019") { + cd 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT' + cp .\msvcp140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp .\vcruntime140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + } else { + cd 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT' + cp .\msvcp140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + cp .\vcruntime140.dll $env:BUILD_ARTIFACTSTAGINGDIRECTORY + } +} diff -Nru libiio-0.24/cmake/add_requirements2tar.sh.in libiio-0.25/cmake/add_requirements2tar.sh.in --- libiio-0.24/cmake/add_requirements2tar.sh.in 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/cmake/add_requirements2tar.sh.in 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,69 @@ +#!/bin/sh +# should be called from "make required2tar" +set -e + +cd @CMAKE_BINARY_DIR@ + +manifest=./require_manifest.txt +if [ ! -f ${manifest} ] ; then + echo "Can not find manifest at ${manifest}" + exit 1 +fi + +gz=$(ls ./libiio*.tar.gz) +if [ -z "${gz}" ] ; then + echo "try make package first" + exit 1 +fi +if [ "$(echo -n ${gz} | tr -cd ' \t' | wc -c)" -ne "0" ] ; then + echo "too many tar, there should be only one, but found ${gz}" + exit 1 +fi +tar=$(echo ${gz} | sed 's/\.gz$//') + +#unzip the file (can not append while it is gzipped) +#gunzip ${gz} + +# We should be able to just "tar --append -f ${tar} -T manufest.txt, but the tar on +# CenrOS7 doesn't support that - so we we need to split it apart, and add +# files manually. + +if [ -d tarball_fixup ] ; then + rm -rf tarball_fixup +fi +mkdir tarball_fixup +tar -xzf ${gz} -C ./tarball_fixup + +while read -r line +do + if [ -f ${line} ] ; then + echo "adding ${line} to architve" + #make sure the directory exists as a target + mkdir -p ./tarball_fixup$(dirname ${line}) + cp ${line} ./tarball_fixup${line} + + cd ./tarball_fixup$(dirname ${line}) + line=$(basename ${line}) + + until echo ${line} | grep -q \.so.[0-9]*$ + do + tmp=$(echo ${line} | sed 's/\.[0-9]*$//') + if [ ! -f "${tmp}" ] ; then + ln -s ${line} ${tmp} + else + echo "target ${tmp} already exists" + ls -l ${tmp} + fi + line=${tmp} + done + cd @CMAKE_BINARY_DIR@ + + else + echo "could not find ${line} to copy" + exit 1 + fi +done < ${manifest} + +tar -czf ${gz} -C ./tarball_fixup/ . +rm -rf tarball_fixup + diff -Nru libiio-0.24/cmake/cmake_uninstall.cmake.in libiio-0.25/cmake/cmake_uninstall.cmake.in --- libiio-0.24/cmake/cmake_uninstall.cmake.in 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/cmake/cmake_uninstall.cmake.in 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,83 @@ +# based on https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake +# per : https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#what-is-its-license +# The snippets on this wiki are provided under the same license. (BSD 3-clause) +# +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2023 Kitware, Inc. and Contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the name of Kitware, Inc. nor the names of Contributors +# may be used to endorse or promote products derived from this +# software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +#D ATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Add uninstall target + +cmake_policy(SET CMP0007 NEW) + +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif() + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + else() + # delete empty directories (if they are empty) + get_filename_component(dir ${file} DIRECTORY) + string(REPLACE "/" ";" dir_list ${dir}) + list(LENGTH dir_list dir_len) + foreach(X RANGE ${dir_len}) + file(GLOB result LIST_DIRECTORIES true "${dir}/*") + list(LENGTH result result_len) + if (NOT result_len EQUAL 0) + # if directory not empty, stop + break() + endif() + message(STATUS "Removing empty directory: ${dir}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove_directory ${dir}" + OUTPUT_VARIABLE stdout + RETURN_VALUE result + ) + if(NOT "${result}" STREQUAL 0) + message(FATAL_ERROR "Failed to remove directory: '${file}'.") + endif() + get_filename_component(dir ${dir} DIRECTORY) + endforeach() + endif() + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach() diff -Nru libiio-0.24/cmake/LinuxPackaging.cmake libiio-0.25/cmake/LinuxPackaging.cmake --- libiio-0.24/cmake/LinuxPackaging.cmake 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/cmake/LinuxPackaging.cmake 2023-08-09 15:58:07.000000000 +0000 @@ -1,12 +1,51 @@ # support creating some basic binpkgs via `make package` set(CPACK_SET_DESTDIR ON) -set(CPACK_GENERATOR TGZ;DEB) +set(CPACK_GENERATOR TGZ) -FIND_PROGRAM(RPMBUILD_CMD rpmbuild) -if (RPMBUILD_CMD) - set(CPACK_PACKAGE_RELOCATABLE OFF) +# Top level settings +set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) +set(CPACK_PACKAGE_VERSION_MAJOR ${LIBIIO_VERSION_MAJOR}) +set(CPACK_PACKAGE_VERSION_MINOR ${LIBIIO_VERSION_MINOR}) +set(CPACK_PACKAGE_VERSION_PATCH g${LIBIIO_VERSION_GIT}) +set(CPACK_BUNDLE_NAME libiio) +set(CPACK_PACKAGE_VERSION ${LIBIIO_VERSION}) + +# Start with empty file +set(REQUIRES "${CMAKE_BINARY_DIR}/require_manifest.txt") +file(WRITE ${REQUIRES} "") + +# Determine the distribution we are on +file(STRINGS /etc/os-release distro REGEX "^NAME=") +string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" distro "${distro}") +file(STRINGS /etc/os-release disversion REGEX "^VERSION_ID=") +string(REGEX REPLACE "VERSION_ID=\"(.*)\"" "\\1" disversion "${disversion}") + +if(distro MATCHES "\\.*Ubuntu\\.*") + set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB) +elseif (distro MATCHES "\\.*Debian\\.*") + set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB) +elseif (distro MATCHES "\\.*Fedora\\.*") set(CPACK_GENERATOR ${CPACK_GENERATOR};RPM) - set(CPACK_RPM_PACKAGE_REQUIRES "libaio >= 0.3.107, avahi >= 0.6.25, libusb1 >= 1.0.9, libxml2 >= 2.7.6") +elseif (distro MATCHES "\\.*CentOS\\.*") + set(CPACK_GENERATOR ${CPACK_GENERATOR};RPM) +elseif (distro MATCHES "\\.*SUSE\\.*") + set(CPACK_GENERATOR ${CPACK_GENERATOR};RPM) +else() + message(STATUS "found unknown distribution ${distro}, Version : ${disversion}") + message(FATAL_ERROR "please report an error to https:\\/\\/github.com\\/analogdevicesinc\\/libiio\\/issues") +endif() + +if (CPACK_GENERATOR MATCHES "RPM") + FIND_PROGRAM(RPMBUILD rpmbuild) + FIND_PROGRAM(RPM_CMD rpm) + set(CPACK_PACKAGE_RELOCATABLE OFF) + if (NOT RPMBUILD) + message (FATAL_ERROR "To build packages, please install rpmbuild") + elseif(NOT RPM_CMD) + message(STATUS "assuming default package versions") + else() + message(STATUS "querying ${RPM_CMD} for package dependencies") + endif() # Add these for CentOS 7 set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION @@ -21,120 +60,222 @@ ) endif() -set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) -set(CPACK_PACKAGE_VERSION_MAJOR ${LIBIIO_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${LIBIIO_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH g${LIBIIO_VERSION_GIT}) -set(CPACK_BUNDLE_NAME libiio) -set(CPACK_PACKAGE_VERSION ${LIBIIO_VERSION}) -# debian specific package settings -set(CPACK_PACKAGE_CONTACT "Engineerzone ") - -option(DEB_DETECT_DEPENDENCIES "Detect dependencies for .deb packages" OFF) - # if we are going to be looking for things, make sure we have the utilities -if(DEB_DETECT_DEPENDENCIES) +if(CPACK_GENERATOR MATCHES "DEB") FIND_PROGRAM(DPKG_CMD dpkg) FIND_PROGRAM(DPKGQ_CMD dpkg-query) + if (NOT DPKG_CMD) + message (FATAL_ERROR "To build packages, please install dpkg") + elseif (NOT DPKGQ_CMD) + message(STATUS "assuming default package versions") + else() + message(STATUS "querying ${DPKGQ_CMD} for package dependencies") + endif() + # debian specific package settings + set(CPACK_PACKAGE_CONTACT "Engineerzone ") endif() -# if we want to, and have the capabilities find what is needed, -# based on what backends are turned on and what libraries are installed -if(DEB_DETECT_DEPENDENCIES AND DPKG_CMD AND DPKGQ_CMD) - message(STATUS "querying installed packages on system for dependancies") - execute_process(COMMAND "${DPKG_CMD}" --print-architecture +if(NOT CMAKE_CROSSCOMPILING) + execute_process(COMMAND "${DPKG_CMD}" --print-architecture OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE) - # don't add a package dependancy if it is not installed locally - # these should be the debian package names +else() + message(FATAL_ERROR "package building with cross compile not handled - please -DENABLE_PACKAGING=OFF") +endif() + +# don't add a package dependency if it is not installed locally +# these should be the debian package names +if (CPACK_GENERATOR MATCHES "DEB") set(PACKAGES "libc6") - if (WITH_LOCAL_BACKEND) - set(PACKAGES "${PACKAGES} libaio") + set(DEFAULT_DEB "libc6 (>= 2.17), ") +elseif(CPACK_GENERATOR MATCHES "RPM") + set(PACKAGES "glibc") + set(DEFAULT_RPM "glibc >=2.17, ") +endif() + +if (WITH_ZSTD) + set(PACKAGES "${PACKAGES} libzstd") + if (CPACK_GENERATOR MATCHES "DEB") + set(DEFAULT_DEB "${DEFAULT_DEB}libzstd (>= 1.5.0), ") + elseif (CPACK_GENERATOR MATCHES "RPM") + set(DEFAULT_RPM "${DEFAULT_RPM}libzstd >= 1.5.0, ") + endif() +endif() +# libpthread.so is provided by libc6, so don't check NEED_THREADS +if (WITH_LOCAL_BACKEND) + set(PACKAGES "${PACKAGES} libaio") + if (CPACK_GENERATOR MATCHES "DEB") + set(DEFAULT_DEB "${DEFAULT_DEB}libaio (>= 0.3.109), ") + elseif(CPACK_GENERATOR MATCHES "RPM") + set(DEFAULT_RPM "${DEFAULT_RPM}libaio >=0.3.109, ") endif() - if(HAVE_AVAHI) + # librt.so is provided by libc6 which is already included +endif() +if(HAVE_AVAHI) + if (CPACK_GENERATOR MATCHES "DEB") set(PACKAGES "${PACKAGES} libavahi-client libavahi-common") + set(DEFAULT_DEB "${DEFAULT_DEB}libavahi-client3 (>= 0.6.31), libavahi-common3 (>= 0.6.31), ") + elseif(CPACK_GENERATOR MATCHES "RPM") + set(PACKAGES "${PACKAGES} avahi") + set(DEFAULT_RPM "${DEFAULT_RPM}avahi >= 0.6.31, avahi-libs >= 0.6.31, ") endif() - if(WITH_USB_BACKEND) +endif() +if(WITH_USB_BACKEND) + if (CPACK_GENERATOR MATCHES "DEB") set(PACKAGES "${PACKAGES} libusb-1") + set(DEFAULT_DEB "${DEFAULT_DEB}libusb-1 (<2:1.0.5), ") + elseif(CPACK_GENERATOR MATCHES "RPM") + set(PACKAGES "${PACKAGES} libusb") + set(DEFAULT_RPM "${DEFAULT_RPM}libuse>= 0.1.5, ") endif() - if(WITH_XML_BACKEND) - set(PACKAGES "${PACKAGES} libxml2") - endif() - if(WITH_SERIAL_BACKEND) +endif() +if(WITH_XML_BACKEND) + set(PACKAGES "${PACKAGES} libxml2") + if (CPACK_GENERATOR MATCHES "DEB") + set(DEFAULT_DEB "${DEFAULT_DEB}libxml2 (>= 2.9.4), ") + elseif (CPACK_GENERATOR MATCHES "RPM") + set(DEFAULT_RPM "${DEFAULT_RPM}libxml2 >= 2.9.4, ") + endif() +endif() +if(WITH_SERIAL_BACKEND) + if (CPACK_GENERATOR MATCHES "DEB") set(PACKAGES "${PACKAGES} libserialport0") + set(DEFAULT_DEB "${DEFAULT_DEB}libserialport0 (>= 0.1.1), ") + else() + set(PACKAGES "${PACKAGES} libserialport") + set(DEFAULT_RPM "${DEFAULT_RPM}libserialport >= 0.1.1, ") endif() - # find the version of the installed package, which is hard to do in - # cmake first, turn the list into an list (seperated by semicolons) - string(REGEX REPLACE " " ";" PACKAGES ${PACKAGES}) - # then iterate over each - foreach(package ${PACKAGES}) - # List packages matching given pattern ${package}, - # key is the glob (*) at the end of the ${package} name, - # so we don't need to be so specific +endif() + +# find the version of the installed package, which is hard to do in +# cmake first, turn the list into a list (separated by semicolons) +string(REGEX REPLACE " " ";" PACKAGES ${PACKAGES}) +# then iterate over each +foreach(package ${PACKAGES}) + # List packages matching given pattern ${package}, + # key is the glob (*) at the end of the ${package} name, + # so we don't need to be so specific + if (CPACK_GENERATOR MATCHES "DEB" AND DPKG_CMD) execute_process(COMMAND "${DPKG_CMD}" -l ${package}* OUTPUT_VARIABLE DPKG_PACKAGES) # returns a string, in a format: # ii libxml2:amd64 2.9.4+dfsg1- amd64 GNOME XML library # 'ii' means installed - which is what we are looking for - STRING(REGEX MATCHALL "ii ${package}[a-z0-9A-Z.-]*" + STRING(REGEX MATCHALL "ii ${package}[a-z0-9A-Z.-]*:${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}" DPKG_INSTALLED_PACKAGES ${DPKG_PACKAGES}) # get rid of the 'ii', and split things up, so we can look # at the name STRING(REGEX REPLACE "ii " ";" NAME_INSTALLED_PACKAGES ${DPKG_INSTALLED_PACKAGES}) - foreach(match ${NAME_INSTALLED_PACKAGES}) - # ignore packages marked as dev, debug, - # documentations, or utils - STRING(REGEX MATCHALL "dev|dbg|doc|utils" TEMP_TEST - ${match}) + elseif (CPACK_GENERATOR MATCHES "RPM" AND RPM_CMD) + execute_process(COMMAND "${RPM_CMD}" -qa --qf "%{n};" "${package}*" + OUTPUT_VARIABLE NAME_INSTALLED_PACKAGES) + else() + set(NAME_INSTALLED_PACKAGES ${package}) + endif() + list(REMOVE_DUPLICATES NAME_INSTALLED_PACKAGES) + string(STRIP "${NAME_INSTALLED_PACKAGES}" NAME_INSTALLED_PACKAGES) + if (NAME_INSTALLED_PACKAGES STREQUAL "") + message(FATAL_ERROR "could not find ${package} installed") + endif() + foreach(match ${NAME_INSTALLED_PACKAGES}) + # ignore packages marked as dev, debug, + # documentations, utils, data or cross + STRING(REGEX MATCHALL "-dev|-dbg|-doc|-lang|-extra|-data|-utils|-cross|-plugins|-python|-headers|-gobject|-locale|-tools|glibc-common|libusbmuxd|libusbx" TEMP_TEST + ${match}) + if(NOT "${TEMP_TEST}" STREQUAL "") + continue() + endif() + if (CPACK_GENERATOR MATCHES "DEB" AND DPKGQ_CMD) + # find the actual version, executes: + # dpkg-query --showformat='\${Version}' + # --show libusb-1.0-0 + execute_process(COMMAND "${DPKGQ_CMD}" + --showformat='\${Version}' + --show "${match}" + OUTPUT_VARIABLE DPKGQ_VER) + # debian standard is package_ver-debian_ver, + # "'2.9.4+dfsg1-2.1'" + # ignore patches and debian suffix version, and + # remove single quote + string(REGEX REPLACE "[+-][a-z0-9A-Z.]*" "" DPKGQ_VER ${DPKGQ_VER}) + string(REGEX REPLACE "'" "" DPKGQ_VER ${DPKGQ_VER}) + # build the string for the Debian dependency + STRING(REGEX REPLACE ":.*" "" TEMP_TEST ${match}) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" + "${TEMP_TEST} (>= ${DPKGQ_VER}), ") + elseif (CPACK_GENERATOR MATCHES "RPM" AND RPM_CMD) + # find the actual version, executes: + # rpm -qp --queryformat '%{VERSION}' libusb1 + execute_process(COMMAND "${RPM_CMD}" -q --queryformat '%{VERSION}' ${match} + OUTPUT_VARIABLE RPM_VER) + STRING(REGEX REPLACE "'" "" RPM_VER ${RPM_VER}) + set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}" + "${match} >= ${RPM_VER}, ") + endif() + # find the actual so files + STRING(REGEX MATCHALL "libc6|glibc" TEMP_TEST ${match}) + if(NOT "${TEMP_TEST}" STREQUAL "") + continue() + endif() + if (CPACK_GENERATOR MATCHES "DEB" AND DPKG_CMD) + # build up the so locations + execute_process(COMMAND "${DPKG_CMD}" + -L "${match}" + OUTPUT_VARIABLE DPK_RESULT) + elseif (CPACK_GENERATOR MATCHES "RPM" AND RPM_CMD) + execute_process(COMMAND "${RPM_CMD}" -ql ${match} + OUTPUT_VARIABLE DPK_RESULT) + else() + continue() + endif() + STRING(STRIP ${DPK_RESULT} STRIPPED) + STRING(REGEX REPLACE "[\r\n]" ";" POSSIBLE_SO "${STRIPPED}") + foreach(is_so ${POSSIBLE_SO}) + # match with ".so." or ".so" (and the end) + STRING(REGEX MATCHALL "\\.so$|\\.so\\." TEMP_TEST ${is_so}) if("${TEMP_TEST}" STREQUAL "") - # find the actual version, executes: - # dpkg-query --showformat='\${Version}' - # --show libusb-1.0-0 - execute_process(COMMAND "${DPKGQ_CMD}" - --showformat='\${Version}' - --show "${match}" - OUTPUT_VARIABLE DPKGQ_VER) - # debian standard is package_ver-debian_ver, - # "'2.9.4+dfsg1-2.1'" - # ignore patches and debian suffix version, and - # remove single quote - string(REGEX REPLACE "[+-][a-z0-9A-Z.]*" "" - DPKGQ_VER ${DPKGQ_VER}) - string(REGEX REPLACE "'" "" DPKGQ_VER - ${DPKGQ_VER}) - # build the string for the Debian dependancy - set(CPACK_DEBIAN_PACKAGE_DEPENDS - "${CPACK_DEBIAN_PACKAGE_DEPENDS}" - "${match} (>= ${DPKGQ_VER}), ") + continue() + endif() + if(IS_SYMLINK ${is_so}) + continue() endif() - endforeach(match) - endforeach(package) + file(APPEND ${REQUIRES} "${is_so}\n") + endforeach(is_so) + endforeach(match) +endforeach(package) + +configure_file( "${CMAKE_SOURCE_DIR}/cmake/add_requirements2tar.sh.in" + "${CMAKE_BINARY_DIR}/add_requirements2tar.sh" + IMMEDIATE @ONLY + ) +add_custom_target(required2tar + COMMAND sh ${CMAKE_BINARY_DIR}/add_requirements2tar.sh + COMMENT "Adding requirements to tarball" + ) + +if (CPACK_GENERATOR MATCHES "DEB") + if (NOT DPKGQ_CMD) + set(CPACK_DEBIAN_PACKAGE_DEPENDS "${DEFAULT_DEB}") + endif() # remove the dangling end comma string(REGEX REPLACE ", $" "" CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_DEPENDS}) -else() - # assume everything is turned on, and running on a modern OS - set(CPACK_DEBIAN_PACKAGE_DEPENDS "libaio1 (>= 0.3.109), libavahi-client3 (>= 0.6.31), libavahi-common3 (>= 0.6.31), libavahi-common-data (>= 0.6.31), libc6 (>= 2.19), libusb-1.0-0 (>= 2:1.0.17), libxml2 (>= 2.9.1), libserialport0 (>=0.1.1)") - message(STATUS "Using default dependencies for packaging") -endif() - -message(STATUS "Package dependencies (.deb): " ${CPACK_DEBIAN_PACKAGE_DEPENDS}) -if (CPACK_RPM_PACKAGE_REQUIRES) - message(STATUS "Package dependencies (.rpm): " ${CPACK_RPM_PACKAGE_REQUIRES}) -endif() - -if(${CMAKE_MAJOR_VERSION} LESS 3) - # old versions of cmake dont include this, but the same vintage of dpkg requires it - IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) - FIND_PROGRAM(DPKG_CMD dpkg) - IF(NOT DPKG_CMD) - MESSAGE(STATUS "Can not find dpkg in your path, default to i386.") - SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386) - ENDIF(NOT DPKG_CMD) - EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture - OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE - OUTPUT_STRIP_TRAILING_WHITESPACE) - ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) + message(STATUS "Dependencies (.deb): " ${CPACK_DEBIAN_PACKAGE_DEPENDS}) +elseif (CPACK_GENERATOR MATCHES "RPM") + if (NOT RPM_CMD) + set(CPACK_RPM_PACKAGE_REQUIRES "${DEFAULT_RPM}") + endif() + string(REGEX REPLACE ", $" "" CPACK_RPM_PACKAGE_REQUIRES + ${CPACK_RPM_PACKAGE_REQUIRES}) + message(STATUS "Dependencies (.rpm): " ${CPACK_RPM_PACKAGE_REQUIRES}) endif() + +# Make sure the generated .deb cannot be installed alongside the Debian ones +set(CPACK_DEBIAN_PACKAGE_PROVIDES + "libiio0 (= ${LIBIIO_VERSION}), libiio-dev (= ${LIBIIO_VERSION}), libiio-utils (= ${LIBIIO_VERSION}), iiod (= ${LIBIIO_VERSION})" +) +set(CPACK_DEBIAN_PACKAGE_CONFLICTS "libiio0, libiio-dev, libiio-utils, iiod") +set(CPACK_DEBIAN_PACKAGE_REPLACES "libiio0, libiio-dev, libiio-utils, iiod") + include(CPack) diff -Nru libiio-0.24/CMakeLists.txt libiio-0.25/CMakeLists.txt --- libiio-0.24/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,5 +1,5 @@ message(STATUS "cmake version: ${CMAKE_VERSION}") -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(libiio C) if (MINGW) @@ -7,7 +7,7 @@ endif() set(LIBIIO_VERSION_MAJOR 0) -set(LIBIIO_VERSION_MINOR 24) +set(LIBIIO_VERSION_MINOR 25) set(VERSION "${LIBIIO_VERSION_MAJOR}.${LIBIIO_VERSION_MINOR}") if (WIN32) string(TIMESTAMP BUILD_YEAR "%Y") @@ -94,13 +94,6 @@ if (HAS_WSHADOW) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow") endif() - # cmake 2.8 doesn't support C_STANDARD defined in set_target_properties - if (${CMAKE_VERSION} VERSION_LESS "3.2") - check_c_compiler_flag(-std=c99 HAS_C99) - if (HAS_C99) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") - endif() - endif() # Per http://www.mingw.org/wiki/Use_more_recent_defined_functions if (MINGW) @@ -156,11 +149,12 @@ if (NOT LIBUSB_FOUND) #Handle FreeBSD libusb and Linux libusb-1.0 libraries find_library(LIBUSB_LIBRARIES NAMES usb-1.0 usb) + find_path(LIBUSB_INCLUDE_DIR libusb.h PATH_SUFFIXES libusb-1.0) else() set(LIBUSB_LIBRARIES ${LIBUSB_LINK_LIBRARIES}) + set(LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIRS}) endif() endif() - find_path(LIBUSB_INCLUDE_DIR libusb.h PATH_SUFFIXES libusb-1.0) if (NOT LIBUSB_LIBRARIES OR NOT LIBUSB_INCLUDE_DIR) message(SEND_ERROR "Unable to find libusb-1.0 dependency.\n" "If you want to disable the USB backend, set WITH_USB_BACKEND=OFF.") @@ -184,13 +178,14 @@ # make sure all check_symbol_exists are before this point, otherwise they fail # on some versions of compilers +option(COMPILE_WARNING_AS_ERROR "Make all warnings into errors" OFF) if (MSVC) # why can't different CIs use the same flags? # Travis CI : CI=True & TRAVIS=True # Appveyor : CI=True & APPVEYOR=True # Azure Pipelines: TF_BUILD=True - if(DEFINED ENV{TF_BUILD} OR (DEFINED ENV{CI} AND DEFINED ENV{APPVEYOR})) - message(STATUS "Running in an Azure or AppVeyor environment, setting -Werror") + if(COMPILE_WARNING_AS_ERROR) + message(STATUS "Setting -Werror") add_compile_options(/WX) endif() elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") @@ -200,8 +195,8 @@ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") endif() - if(DEFINED ENV{TF_BUILD} OR (DEFINED ENV{CI} AND (DEFINED ENV{TRAVIS} OR DEFINED ENV{APPVEYOR}))) - message(STATUS "Running in CI environment (Azure, Travis or AppVeyor), setting -Werror") + if(COMPILE_WARNING_AS_ERROR) + message(STATUS "Setting -Werror") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") endif() else() @@ -224,6 +219,17 @@ set(LIBIIO_CFILES backend.c channel.c device.c context.c buffer.c utilities.c scan.c sort.c) set(LIBIIO_HEADERS iio.h) +set(DOXYGEN_INPUT "${CMAKE_SOURCE_DIR}") +set(DOXYGEN_STRIP_FROM_PATH "${CMAKE_SOURCE_DIR}") + +if (CPP_BINDINGS) + list(APPEND LIBIIO_HEADERS bindings/cpp/iiopp.h) + set(DOXYGEN_ENABLED_SECTIONS CPP_BINDINGS) + set(DOXYGEN_INPUT "${DOXYGEN_INPUT} ${CMAKE_SOURCE_DIR}/bindings/cpp/") + set(DOXYGEN_STRIP_FROM_PATH "${CMAKE_SOURCE_DIR}/bindings/cpp/") + set(DOXYGEN_CPP_EXAMPLE_PATH "${CMAKE_SOURCE_DIR}/bindings/cpp/examples") +endif() + if(WITH_USB_BACKEND) list(APPEND LIBIIO_CFILES usb.c) list(APPEND LIBS_TO_LINK ${LIBUSB_LIBRARIES}) @@ -272,7 +278,7 @@ endif() option(WITH_LOCAL_MMAP_API "Use the mmap API provided in Analog Devices' kernel (not upstream)" ON) - option(WITH_HWMON "Add compatibility with the hardware monitoring (hwmon) subsystem" OFF) + option(WITH_HWMON "Add compatibility with the hardware monitoring (hwmon) subsystem" ON) list(APPEND LIBIIO_SCAN_BACKENDS local) endif() @@ -402,7 +408,7 @@ # So, try first to find the CMake module provided by libxml2 package, then fallback # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially # in static build case). - find_package(LibXml2 QUIET NO_MODULE) + find_package(LibXml2 QUIET NO_MODULE NO_SYSTEM_ENVIRONMENT_PATH) if(DEFINED LIBXML2_VERSION_STRING) set(LIBXML2_FOUND ON) set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) @@ -458,6 +464,14 @@ install(FILES ${LIBIIO_PC} DESTINATION "${INSTALL_PKGCONFIG_DIR}") endif() +macro(toggle_iio_feature opt str) + if (${opt}) + list(APPEND IIO_FEATURES_ON ${str}) + else() + list(APPEND IIO_FEATURES_OFF ${str}) + endif() +endmacro() + if(WITH_TESTS) add_subdirectory(tests) endif() @@ -476,7 +490,7 @@ VERSION ${VERSION} SOVERSION ${LIBIIO_VERSION_MAJOR} FRAMEWORK ${OSX_FRAMEWORK} - PUBLIC_HEADER ${LIBIIO_HEADERS} + PUBLIC_HEADER "${LIBIIO_HEADERS}" C_STANDARD 99 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF @@ -528,6 +542,10 @@ DESTINATION ${CMAKE_HTML_DEST_DIR}/${CMAKE_API_DEST_DIR} FILES_MATCHING PATTERN "*.svg") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/doc/html/ DESTINATION ${CMAKE_HTML_DEST_DIR}) + set(IIO_TESTS_MAN_PAGES_HTML "") + foreach(_page ${IIO_TESTS_TARGETS}) + set(IIO_TESTS_MAN_PAGES_HTML "${IIO_TESTS_MAN_PAGES_HTML}
  • ${_page}
  • ") + endforeach() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/doc/index.html.in ${CMAKE_HTML_DEST_DIR}/index.html @ONLY) @@ -547,6 +565,7 @@ endif() endif() +option(CPP_BINDINGS "Install C++ bindings" OFF) option(CSHARP_BINDINGS "Install C# bindings" OFF) option(PYTHON_BINDINGS "Install Python bindings" OFF) add_subdirectory(bindings) @@ -644,29 +663,43 @@ endif() endif() +# Add uninstall target +if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY + ) + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() + string(REPLACE ";" "," LIBIIO_SCAN_BACKENDS "${LIBIIO_SCAN_BACKENDS}") configure_file(iio-config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/iio-config.h @ONLY) -list(APPEND IIO_FEATURES_${WITH_XML_BACKEND} xml) -list(APPEND IIO_FEATURES_${WITH_ZSTD} zstd) -list(APPEND IIO_FEATURES_${WITH_NETWORK_BACKEND} network) -list(APPEND IIO_FEATURES_${HAVE_DNS_SD} dns-sd) -list(APPEND IIO_FEATURES_${HAVE_AVAHI} avahi) -list(APPEND IIO_FEATURES_${HAVE_BONJOUR} bonjour) -list(APPEND IIO_FEATURES_${ENABLE_IPV6} ipv6) -list(APPEND IIO_FEATURES_${WITH_SERIAL_BACKEND} serial) -list(APPEND IIO_FEATURES_${WITH_LOCAL_BACKEND} local) -list(APPEND IIO_FEATURES_${WITH_LOCAL_MMAP_API} local-mmap) -list(APPEND IIO_FEATURES_${WITH_HWMON} hwmon) -list(APPEND IIO_FEATURES_${WITH_USB_BACKEND} usb) -list(APPEND IIO_FEATURES_${WITH_TESTS} utils) -list(APPEND IIO_FEATURES_${WITH_EXAMPLES} examples) -list(APPEND IIO_FEATURES_${WITH_IIOD} iiod) +toggle_iio_feature("${WITH_XML_BACKEND}" xml) +toggle_iio_feature("${WITH_ZSTD}" zstd) +toggle_iio_feature("${WITH_NETWORK_BACKEND}" network) +toggle_iio_feature("${HAVE_DNS_SD}" dns-sd) +toggle_iio_feature("${HAVE_AVAHI}" avahi) +toggle_iio_feature("${HAVE_BONJOUR}" bonjour) +toggle_iio_feature("${ENABLE_IPV6}" ipv6) +toggle_iio_feature("${WITH_SERIAL_BACKEND}" serial) +toggle_iio_feature("${WITH_LOCAL_BACKEND}" local) +toggle_iio_feature("${WITH_LOCAL_MMAP_API}" local-mmap) +toggle_iio_feature("${WITH_HWMON}" hwmon) +toggle_iio_feature("${WITH_USB_BACKEND}" usb) +toggle_iio_feature("${WITH_TESTS}" utils) +toggle_iio_feature("${WITH_EXAMPLES}" examples) +toggle_iio_feature("${WITH_IIOD}" iiod) +toggle_iio_feature("${INSTALL_UDEV_RULE}" udev-rule) +toggle_iio_feature("${CPP_BINDINGS}" "c++-bindings") #add iiod settings list(APPEND IIO_FEATURES_ON ${IIOD_FEATURES_ON}) list(APPEND IIO_FEATURES_OFF ${IIOD_FEATURES_OFF}) -list(APPEND IIO_FEATURES_${WITH_DOC} doc) +toggle_iio_feature("${WITH_DOC}" doc) #add man page settings list(APPEND IIO_FEATURES_ON ${IIOM_FEATURES_ON}) list(APPEND IIO_FEATURES_OFF ${IIOM_FEATURES_OFF}) @@ -679,3 +712,4 @@ message(STATUS "Features enabled : ${IIO_FEATURES_ON}") message(STATUS "Features disabled: ${IIO_FEATURES_OFF}") +message(STATUS "LOG_LEVEL set to \"${LOG_LEVEL}\"") diff -Nru libiio-0.24/.codespell-ignore.txt libiio-0.25/.codespell-ignore.txt --- libiio-0.24/.codespell-ignore.txt 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/.codespell-ignore.txt 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,9 @@ +SOM +som +mitre +mis +tread +elease +tREAD +tRead +tRead diff -Nru libiio-0.24/.codespell-whitelist libiio-0.25/.codespell-whitelist --- libiio-0.24/.codespell-whitelist 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/.codespell-whitelist 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -SOM -som -mitre diff -Nru libiio-0.24/Contributors.md libiio-0.25/Contributors.md --- libiio-0.24/Contributors.md 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/Contributors.md 2023-08-09 15:58:07.000000000 +0000 @@ -1,9 +1,9 @@ # Contributors Since it's first commit on 17 Feb 2014, the libIIO has seen many improvements by many contributors. -Regular releases every 6 months delivers stable updates to users and developers, +Regular releases every ~6 months delivers stable updates to users and developers, each with new features, new examples, added device support, and improved performance. -Each of these releases contains the work of over 45 developers representing over 25 corporations. +Each of these releases contains the work of over 55+ developers representing over 30+ organizations. Although the libIIO would not exist without the initial support of Analog Devices, it is an open source source project, and relies on the contributions of many people. @@ -19,80 +19,102 @@ | Author | Lines of Code | --------------------- | ------------- -| Paul Cercueil | 17904 -| Robin Getz | 7932 -| Lars-Peter Clausen | 3785 -| Tim Harder | 2259 -| Michael Hennerich | 1175 -| Matt Fornero | 987 -| Travis F. Collins | 602 -| Alexandru Ardelean | 555 -| Cristi Iacob | 437 -| Lucas Magasweran | 358 -| Matej Kenda | 273 -| Alexandra Trifan | 257 -| Romain Roffé | 225 -| Geert Uytterhoeven | 35 -| Andrea Galbusera | 32 -| JaredD | 31 -| Adrian Freihofer | 31 -| Dan Nechita | 29 -| Adrian Suciu | 23 -| Petr Å tetiar | 20 -| Edward Kigwana | 19 -| Andreas Brauchli | 18 -| fpagliughi | 16 -| Samuel Martin | 12 -| Rémi Lefèvre | 12 -| Michael Heimpold | 12 -| SrikanthPagadarai | 11 -| Dimas Abreu Archanjo Dutra | 9 -| Marc Titinger | 8 -| Jonas Hansen | 4 -| Jeremy Trimble | 4 -| David Frey | 4 -| Ryo Hashimoto | 3 -| Markus Gnadl | 2 -| Julien Malik | 2 -| Jorik Jonker | 2 -| Pierre-Jean Texier | 1 -| Nicholas Pillitteri | 1 -| Morten Fyhn Amundsen | 1 -| Johnny Vestergaard | 1 -| Gwendal Grignou | 1 -| Ben Acland | 1 +| Paul Cercueil | 24510 +| Robin Getz | 12624 +| Lars-Peter Clausen | 3003 +| Raluca Chis | 1233 +| Cristi Iacob | 1055 +| Michael Hennerich | 878 +| Alexandru Ardelean | 835 +| Matt Fornero | 768 +| Iacob | 588 +| Travis F. Collins | 577 +| Nuno Sá | 531 +| Lucas Magasweran | 347 +| Romain Roffé | 202 +| Matej Kenda | 193 +| Adrian Suciu | 140 +| Mihail Chindris | 91 +| AlexandraTrifan | 85 +| Dan Nechita | 52 +| Geert Uytterhoeven | 36 +| Adrian Freihofer | 30 +| JaredD | 28 +| RChis1 | 25 +| Andrea Galbusera | 25 +| Petr Å tetiar | 20 +| Andreas Brauchli | 18 +| fpagliughi | 15 +| Fabrice Fontaine | 14 +| Rémi Lefèvre | 12 +| Edward Kigwana | 12 +| Samuel Martin | 11 +| SrikanthPagadarai | 10 +| Max Lehuraux | 9 +| Julien Malik | 9 +| Dimas Abreu Archanjo Dutra | 9 +| Marc Titinger | 8 +| Marvin Schmidt | 7 +| Kathy Camenzind | 6 +| Chris Lamb | 6 +| Tim Harder | 5 +| Misko | 4 +| Michael Heimpold | 4 +| Jeremy Trimble | 4 +| f4exb | 4 +| David Frey | 4 +| DanielGuramulta | 4 +| Gwendal Grignou | 3 +| Matt Thomas | 2 +| Markus Gnadl | 2 +| Jan Tojnar | 2 +| Cormier, Jonathan | 2 +| Virgil Litan | 1 +| Pierre-Jean Texier | 1 +| Nicholas Pillitteri | 1 +| Morten Fyhn Amundsen | 1 +| Marc Sporcich | 1 +| Jonas Hansen | 1 +| Johnny Vestergaard | 1 ## Domains (or companies) contributing to the libIIO In order of most contributions to least (counted by lines of code). -| Company | Lines of code -| ---------------- | ------------- -| analog.com | 31153 -| metafoo.de | 3785 -| mathworks.com | 987 -| gmail.com | 382 -| daqri.com | 358 -| parrot.com | 237 -| linux-m68k.org | 35 -| scs.ch | 22 -| true.cz | 20 -| sensirion.com | 18 -| mindspring.com | 16 -| heimpold.de | 12 -| ufmg.br | 9 -| baylibre.com | 8 -| sierrawireless.com | 4 -| azuresummit.com | 4 -| google.com | 3 -| paraiso.me | 2 -| kippendief.biz | 2 -| iabg.de | 2 -| unixcluster.dk | 1 -| koncepto.io | 1 -| crapouillou.net | 1 -| chromium.org | 1 +| Company | Lines of code +| ------------------- | ------------- +| analog.com | 33846 +| crapouillou.net | 9205 +| metafoo.de | 3003 +| mathworks.com | 824 +| gmail.com | 413 +| daqri.com | 347 +| parrot.com | 214 +| linux-m68k.org | 36 +| scs.ch | 22 +| true.cz | 20 +| sensirion.com | 18 +| mindspring.com | 15 +| ufmg.br | 9 +| baylibre.com | 8 +| unseenlabs.fr | 7 +| exherbo.org | 7 +| tulip.co | 6 +| chris-lamb.co.uk | 6 +| sierrawireless.com | 4 +| heimpold.de | 4 +| cs.toronto.edu | 4 +| azuresummit.com | 4 +| chromium.org | 3 +| users.github.com | 2 +| paraiso.me | 2 +| iabg.de | 2 +| criticallink.com | 2 +| unixcluster.dk | 1 +| scires.com | 1 +| koncepto.io | 1 +| epiqsolutions.com | 1 ## scripts scripts were based on a [gist](https://gist.github.com/amitchhajer/4461043) from Amit Chhajer. diff -Nru libiio-0.24/debian/changelog libiio-0.25/debian/changelog --- libiio-0.24/debian/changelog 2023-01-24 02:16:11.000000000 +0000 +++ libiio-0.25/debian/changelog 2023-08-10 23:28:57.000000000 +0000 @@ -1,3 +1,9 @@ +libiio (0.25-1) unstable; urgency=medium + + * New upstream release + + -- A. Maitland Bottoms Thu, 10 Aug 2023 19:28:57 -0400 + libiio (0.24-4) unstable; urgency=medium [ A. Maitland Bottoms ] diff -Nru libiio-0.24/debian/control libiio-0.25/debian/control --- libiio-0.24/debian/control 2023-01-23 16:30:43.000000000 +0000 +++ libiio-0.25/debian/control 2023-08-10 19:52:40.000000000 +0000 @@ -19,6 +19,7 @@ libusb2-dev [kfreebsd-any], libxml2-dev, man2html, + python3-all-dev, python3-dev, python3-setuptools, python3-sphinx, diff -Nru libiio-0.24/debian/iiod.manpages libiio-0.25/debian/iiod.manpages --- libiio-0.24/debian/iiod.manpages 2022-07-10 16:20:01.000000000 +0000 +++ libiio-0.25/debian/iiod.manpages 2023-08-10 18:18:53.000000000 +0000 @@ -1 +1,2 @@ debian/iiod.8 +usr/share/man/man1/man/iiod.1 diff -Nru libiio-0.24/debian/libiio0-doc.doc-base libiio-0.25/debian/libiio0-doc.doc-base --- libiio-0.24/debian/libiio0-doc.doc-base 2022-09-21 15:59:39.000000000 +0000 +++ libiio-0.25/debian/libiio0-doc.doc-base 2023-08-10 18:28:14.000000000 +0000 @@ -4,5 +4,5 @@ Section: Programming Format: HTML -Index: /usr/share/doc/libiio0-doc/v0.24/libiio/index.html -Files: /usr/share/doc/libiio0-doc/v0.24/libiio/* +Index: /usr/share/doc/libiio0-doc/v0.25/libiio/index.html +Files: /usr/share/doc/libiio0-doc/v0.25/libiio/* diff -Nru libiio-0.24/debian/libiio-utils.manpages libiio-0.25/debian/libiio-utils.manpages --- libiio-0.24/debian/libiio-utils.manpages 2022-07-10 16:20:01.000000000 +0000 +++ libiio-0.25/debian/libiio-utils.manpages 2023-08-10 18:37:15.000000000 +0000 @@ -4,6 +4,5 @@ usr/share/man/man1/man/iio_attr.1 usr/share/man/man1/man/iio_info.1 usr/share/man/man3/man/libiio.3 -debian/iio_adi_xflow_check.1 -debian/iio_genxml.1 -debian/iio_stresstest.1 +usr/share/man/man1/man/iio_genxml.1 +usr/share/man/man1/man/iio_stresstest.1 diff -Nru libiio-0.24/debian/patches/available libiio-0.25/debian/patches/available --- libiio-0.24/debian/patches/available 2022-08-29 01:35:00.000000000 +0000 +++ libiio-0.25/debian/patches/available 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -From f1f93012768e27723ebaaadd7a3339530420196f Mon Sep 17 00:00:00 2001 -From: "A. Maitland Bottoms" -Date: Sun, 28 Aug 2022 20:26:53 -0400 -Subject: [PATCH] available - -spelling fix - -Signed-off-by: A. Maitland Bottoms ---- - man/iio_attr.1.in | 2 +- - man/iio_info.1.in | 2 +- - man/iio_readdev.1.in | 2 +- - man/iio_writedev.1.in | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/man/iio_attr.1.in b/man/iio_attr.1.in -index aa497513..0b30e85a 100644 ---- a/man/iio_attr.1.in -+++ b/man/iio_attr.1.in -@@ -87,7 +87,7 @@ Read and Write IIO Debug attributes - Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. - Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. - vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) --If no argument is given, it checks all that are availble. -+If no argument is given, it checks all that are available. - .TP - .B \-h, \-\-help - Tells -diff --git a/man/iio_info.1.in b/man/iio_info.1.in -index 9fb15aed..2fa6ce24 100644 ---- a/man/iio_info.1.in -+++ b/man/iio_info.1.in -@@ -82,7 +82,7 @@ with no address part - Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. - Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. - vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) --If no argument is given, it checks all that are availble. -+If no argument is given, it checks all that are available. - .TP - .B \-a, \-\-auto - Scan for available contexts and if only one is available use it. -diff --git a/man/iio_readdev.1.in b/man/iio_readdev.1.in -index 6d0f0c26..a312c20d 100644 ---- a/man/iio_readdev.1.in -+++ b/man/iio_readdev.1.in -@@ -81,7 +81,7 @@ Scan for available contexts and if only one is available use it. - Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. - Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. - vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) --If no argument is given, it checks all that are availble. -+If no argument is given, it checks all that are available. - .SH RETURN VALUE - If the specified device is not found, a non-zero exit code is returned. - -diff --git a/man/iio_writedev.1.in b/man/iio_writedev.1.in -index 723d5b6e..7d95f706 100644 ---- a/man/iio_writedev.1.in -+++ b/man/iio_writedev.1.in -@@ -65,7 +65,7 @@ with no address part - Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. - Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. - vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) --If no argument is given, it checks all that are availble. -+If no argument is given, it checks all that are available. - .RE - .TP - .B \-t \-\-trigger --- -2.35.1 - diff -Nru libiio-0.24/debian/patches/bump-cmake-minimum libiio-0.25/debian/patches/bump-cmake-minimum --- libiio-0.24/debian/patches/bump-cmake-minimum 2022-07-10 16:20:01.000000000 +0000 +++ libiio-0.25/debian/patches/bump-cmake-minimum 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -Description: modern CMake needs > 2.8.12 -Author: "A. Maitland Bottoms" - ---- a/examples/CMakeLists.txt -+++ b/examples/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - - project(ad9361-iiostream C) - project(ad9371-iiostream C) ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,5 +1,5 @@ - message(STATUS "cmake version: ${CMAKE_VERSION}") --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - project(libiio C) - - if (MINGW) ---- a/bindings/python/CMakeLists.txt -+++ b/bindings/python/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - project(libiio-py NONE) - - if(${CMAKE_VERSION} VERSION_LESS "3.12.0") ---- a/bindings/csharp/CMakeLists.txt -+++ b/bindings/csharp/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - project(libiio-sharp NONE) - - if (WIN32) ---- a/iiod/CMakeLists.txt -+++ b/iiod/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - project(iiod C) - - include(FindBISON) ---- a/tests/CMakeLists.txt -+++ b/tests/CMakeLists.txt -@@ -1,4 +1,4 @@ --cmake_minimum_required(VERSION 2.8.7) -+cmake_minimum_required(VERSION 3.10.2) - - project(iio_genxml C) - project(iio_info C) diff -Nru libiio-0.24/debian/patches/debian-soversion-udev-rules libiio-0.25/debian/patches/debian-soversion-udev-rules --- libiio-0.24/debian/patches/debian-soversion-udev-rules 2022-07-10 16:24:28.000000000 +0000 +++ libiio-0.25/debian/patches/debian-soversion-udev-rules 2023-08-10 23:28:57.000000000 +0000 @@ -1,10 +1,18 @@ -Description: Having SOVERSION in rules file name eases Debian upgrades -Author: "A. Maitland Bottoms" -Last-Update: 2020-09-12 +From 16af8091c5c71d70088c41a7631365d0175fd8bf Mon Sep 17 00:00:00 2001 +From: "A. Maitland Bottoms" +Date: Thu, 10 Aug 2023 19:40:11 -0400 +Subject: [PATCH 3/5] debian soversion udev rules +Having SOVERSION in rules file name eases Debian upgrades. +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 858cb239..7043dbac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -639,8 +639,8 @@ +@@ -658,8 +658,8 @@ if (WITH_USB_BACKEND AND CMAKE_SYSTEM_NAME MATCHES "^Linux") if (INSTALL_UDEV_RULE) set(UDEV_RULES_INSTALL_DIR /lib/udev/rules.d CACHE PATH "default install path for udev rules") @@ -15,3 +23,6 @@ endif() endif() +-- +2.39.2 + diff -Nru libiio-0.24/debian/patches/man-no-WC libiio-0.25/debian/patches/man-no-WC --- libiio-0.24/debian/patches/man-no-WC 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/debian/patches/man-no-WC 2023-08-10 23:28:57.000000000 +0000 @@ -0,0 +1,25 @@ +From bb0cfe9e83ee3071c2f8ca6b9fcc79cdcaf5e001 Mon Sep 17 00:00:00 2001 +From: "A. Maitland Bottoms" +Date: Thu, 10 Aug 2023 19:42:52 -0400 +Subject: [PATCH 5/5] man no WC + +Fix man page syntax: using CW rather than WC +--- + man/iio_readdev.1.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/iio_readdev.1.in b/man/iio_readdev.1.in +index eb00e567..5ba0d148 100644 +--- a/man/iio_readdev.1.in ++++ b/man/iio_readdev.1.in +@@ -86,6 +86,6 @@ stores it (as raw binary) into the file samples.dat + .PP + And plots the data with gnuplot. + .RS +-.B \f(WCgnuplot \-e \(dq\&set term png; set output 'sample.png'; plot 'sample.dat' binary format='%short%short' using 1 with lines, 'sample.dat' binary format='%short%short' using 2 with lines;\(dq\&\fP ++.B \f(CWgnuplot \-e \(dq\&set term png; set output 'sample.png'; plot 'sample.dat' binary format='%short%short' using 1 with lines, 'sample.dat' binary format='%short%short' using 2 with lines;\(dq\&\fP + .RE + +-- +2.39.2 + diff -Nru libiio-0.24/debian/patches/python-setup-libiio libiio-0.25/debian/patches/python-setup-libiio --- libiio-0.24/debian/patches/python-setup-libiio 2022-07-10 16:20:01.000000000 +0000 +++ libiio-0.25/debian/patches/python-setup-libiio 2023-08-10 23:28:57.000000000 +0000 @@ -1,9 +1,19 @@ -Description: Avoid failing check while building Debian packages -Author: "A. Maitland Bottoms" +From 0f763af9206828aff587a11cf0cb8d830a3f4ca4 Mon Sep 17 00:00:00 2001 +From: "A. Maitland Bottoms" +Date: Thu, 10 Aug 2023 19:36:28 -0400 +Subject: [PATCH 2/5] python setup libiio +Forwarded: not-needed +Avoid failing check while building Debian packages. +--- + bindings/python/setup.py.cmakein | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein +index 33a4eb91..3b6bb1d3 100644 --- a/bindings/python/setup.py.cmakein +++ b/bindings/python/setup.py.cmakein -@@ -40,7 +40,7 @@ +@@ -40,7 +40,7 @@ class InstallWrapper(install): libiio library is actually installed""" def run(self): @@ -12,3 +22,6 @@ # Run the standard PyPi copy install.run(self) +-- +2.39.2 + diff -Nru libiio-0.24/debian/patches/reproducible-build.patch libiio-0.25/debian/patches/reproducible-build.patch --- libiio-0.24/debian/patches/reproducible-build.patch 2022-07-10 16:20:01.000000000 +0000 +++ libiio-0.25/debian/patches/reproducible-build.patch 2023-08-10 23:28:57.000000000 +0000 @@ -1,10 +1,19 @@ -Description: Make the build reproducible -Author: Chris Lamb -Last-Update: 2019-02-17 +From 421d73552585f898b1e2cc9c4394e9dd3c17dfed Mon Sep 17 00:00:00 2001 +From: "A. Maitland Bottoms" +Date: Thu, 10 Aug 2023 19:32:56 -0400 +Subject: [PATCH 1/5] reproducible build +Origin: Chris Lamb +Use Doxygen settings to keep build path out of generated files. +--- + Doxyfile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Doxyfile.in b/Doxyfile.in +index 7b038038..e5d19112 100644 --- a/Doxyfile.in +++ b/Doxyfile.in -@@ -71,7 +71,7 @@ +@@ -148,7 +148,7 @@ INLINE_INHERITED_MEMB = NO # shortest path that makes the file name unique will be used # The default value is: YES. @@ -13,12 +22,15 @@ # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand -@@ -1001,7 +1001,7 @@ - # The default value is: YES. +@@ -1287,7 +1287,7 @@ HTML_COLORSTYLE_GAMMA = 80 + # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = NO - # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML - # documentation will contain sections that can be hidden and shown after the + # If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML + # documentation will contain a main index with vertical navigation menus that +-- +2.39.2 + diff -Nru libiio-0.24/debian/patches/series libiio-0.25/debian/patches/series --- libiio-0.24/debian/patches/series 2022-09-21 16:02:38.000000000 +0000 +++ libiio-0.25/debian/patches/series 2023-08-10 19:21:21.000000000 +0000 @@ -1,6 +1,5 @@ -bump-cmake-minimum reproducible-build.patch python-setup-libiio debian-soversion-udev-rules service-documentation -available +man-no-WC diff -Nru libiio-0.24/debian/patches/service-documentation libiio-0.25/debian/patches/service-documentation --- libiio-0.24/debian/patches/service-documentation 2022-07-10 16:27:49.000000000 +0000 +++ libiio-0.25/debian/patches/service-documentation 2023-08-10 23:28:57.000000000 +0000 @@ -1,6 +1,18 @@ +From 624f5222fa128249fdb1235a7c284b758052c629 Mon Sep 17 00:00:00 2001 +From: "A. Maitland Bottoms" +Date: Thu, 10 Aug 2023 19:41:52 -0400 +Subject: [PATCH 4/5] service documentation + +Add Documentation to iiod.service file. +--- + iiod/init/iiod.service.cmakein | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/iiod/init/iiod.service.cmakein b/iiod/init/iiod.service.cmakein +index 0f762474..5e846cc7 100644 --- a/iiod/init/iiod.service.cmakein +++ b/iiod/init/iiod.service.cmakein -@@ -9,6 +9,7 @@ +@@ -9,6 +9,7 @@ Description=IIO Daemon Requires=systemd-udev-settle.service After=network.target systemd-udev-settle.service ConditionPathExists=/sys/bus/iio @@ -8,3 +20,6 @@ [Service] EnvironmentFile=-/etc/default/iiod +-- +2.39.2 + diff -Nru libiio-0.24/debian/python3-libiio.install libiio-0.25/debian/python3-libiio.install --- libiio-0.24/debian/python3-libiio.install 2022-10-01 21:36:24.000000000 +0000 +++ libiio-0.25/debian/python3-libiio.install 2023-08-10 19:55:28.000000000 +0000 @@ -1 +1 @@ -usr/local/lib/python3*/dist-packages usr/lib/python3.10/ +usr/local/lib/python3*/dist-packages usr/lib/python3/ diff -Nru libiio-0.24/debian/rules libiio-0.25/debian/rules --- libiio-0.24/debian/rules 2023-01-24 02:06:33.000000000 +0000 +++ libiio-0.25/debian/rules 2023-08-10 19:39:04.000000000 +0000 @@ -13,14 +13,18 @@ override_dh_auto_install: dh_auto_install - - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/.nojekyll - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/doctools.js - cd debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/doctools.js doctools.js - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/language_data.js - cd debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/language_data.js language_data.js - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/searchtools.js - cd debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/searchtools.js searchtools.js - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/jquery.js - cd debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/ && ln -s /usr/share/javascript/jquery/jquery.js jquery.js - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/underscore.js - cd debian/tmp/usr/share/doc/libiio0-doc/v0.24/python/_static/ && ln -s /usr/share/javascript/underscore/underscore.js underscore.js + - rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/.nojekyll + rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/doctools.js + cd debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/doctools.js doctools.js + rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/language_data.js + cd debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/language_data.js language_data.js + rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/searchtools.js + cd debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/ && ln -s /usr/share/javascript/sphinxdoc/1.0/searchtools.js searchtools.js + rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/jquery.js + cd debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/ && ln -s /usr/share/javascript/jquery/jquery.js jquery.js + rm -f debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/underscore.js + cd debian/tmp/usr/share/doc/libiio0-doc/v0.25/python/_static/ && ln -s /usr/share/javascript/underscore/underscore.js underscore.js + rmdir debian/tmp/usr/share/doc/libiio0-doc/v0.25/libiio/doc/html/img + rmdir debian/tmp/usr/share/doc/libiio0-doc/v0.25/libiio/doc/html + rmdir debian/tmp/usr/share/doc/libiio0-doc/v0.25/libiio/doc/template + rmdir debian/tmp/usr/share/doc/libiio0-doc/v0.25/man1 diff -Nru libiio-0.24/debug.h libiio-0.25/debug.h --- libiio-0.24/debug.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/debug.h 2023-08-09 15:58:07.000000000 +0000 @@ -21,20 +21,6 @@ /* -------------------- */ -#ifdef WITH_COLOR_DEBUG -#ifndef COLOR_DEBUG -#define COLOR_DEBUG "\e[0;32m" -#endif -#ifndef COLOR_WARNING -#define COLOR_WARNING "\e[01;35m" -#endif -#ifndef COLOR_ERROR -#define COLOR_ERROR "\e[01;31m" -#endif - -#define COLOR_END "\e[0m" -#endif - /* Many of these debug printf include a Flawfinder: ignore, this is because, * according to https://cwe.mitre.org/data/definitions/134.html which describes * functions that accepts a format string as an argument, but the format @@ -42,52 +28,28 @@ * IIO_WARNING, and IIO_ERRRO functions are called internally from the * library, have fixed format strings and can not be modified externally. */ -#if (LOG_LEVEL >= Debug_L) -# ifdef COLOR_DEBUG -# define IIO_DEBUG(str, ...) \ - fprintf(stdout, COLOR_DEBUG "DEBUG: " str COLOR_END, ##__VA_ARGS__) /* Flawfinder: ignore */ -# else -# define IIO_DEBUG(...) \ - fprintf(stdout, "DEBUG: " __VA_ARGS__) /* Flawfinder: ignore */ -# endif -#else -#define IIO_DEBUG(...) do { } while (0) -#endif - -#if (LOG_LEVEL >= Info_L) -# ifdef COLOR_INFO -# define IIO_INFO(str, ...) \ - fprintf(stdout, COLOR_INFO str COLOR_END, ##__VA_ARGS__) /* Flawfinder: ignore */ -# else -# define IIO_INFO(...) \ - fprintf(stdout, __VA_ARGS__) /* Flawfinder: ignore */ -# endif -#else -#define IIO_INFO(...) do { } while (0) -#endif - -#if (LOG_LEVEL >= Warning_L) -# ifdef COLOR_WARNING -# define IIO_WARNING(str, ...) \ - fprintf(stderr, COLOR_WARNING "WARNING: " str COLOR_END, ##__VA_ARGS__) /* Flawfinder: ignore */ -# else -# define IIO_WARNING(...) \ - fprintf(stderr, "WARNING: " __VA_ARGS__) /* Flawfinder: ignore */ -# endif -#else -#define IIO_WARNING(...) do { } while (0) -#endif - -#if (LOG_LEVEL >= Error_L) -# ifdef COLOR_ERROR -# define IIO_ERROR(str, ...) \ - fprintf(stderr, COLOR_ERROR "ERROR: " str COLOR_END, ##__VA_ARGS__) /* Flawfinder: ignore */ -# else -# define IIO_ERROR(...) \ - fprintf(stderr, "ERROR: " __VA_ARGS__) /* Flawfinder: ignore */ -# endif -#else -#define IIO_ERROR(...) do { } while (0) -#endif +#define IIO_DEBUG(...) \ + do { \ + if (LOG_LEVEL >= Debug_L) \ + fprintf(stdout, "DEBUG: " __VA_ARGS__); /* Flawfinder: ignore */ \ + } while (0) + +#define IIO_INFO(...) \ + do { \ + if (LOG_LEVEL >= Info_L) \ + fprintf(stdout, __VA_ARGS__); /* Flawfinder: ignore */ \ + } while (0) + +#define IIO_WARNING(...) \ + do { \ + if (LOG_LEVEL >= Warning_L) \ + fprintf(stderr, "WARNING: " __VA_ARGS__); /* Flawfinder: ignore */ \ + } while (0) + +#define IIO_ERROR(...) \ + do { \ + if (LOG_LEVEL >= Error_L) \ + fprintf(stderr, "ERROR: " __VA_ARGS__); /* Flawfinder: ignore */ \ + } while (0) #endif diff -Nru libiio-0.24/device.c libiio-0.25/device.c --- libiio-0.24/device.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/device.c 2023-08-09 15:58:07.000000000 +0000 @@ -442,7 +442,7 @@ const uint32_t *mask, size_t words) { ssize_t size = 0; - unsigned int i; + unsigned int i, largest = 1; const struct iio_channel *prev = NULL; if (words != (dev->nb_channels + 31) / 32) @@ -463,6 +463,9 @@ continue; } + if (length > largest) + largest = length; + if (size % length) size += 2 * length - (size % length); else @@ -470,6 +473,10 @@ prev = chn; } + + if (size % largest) + size += largest - (size % largest); + return size; } diff -Nru libiio-0.24/Distribution.xml.cmakein libiio-0.25/Distribution.xml.cmakein --- libiio-0.24/Distribution.xml.cmakein 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/Distribution.xml.cmakein 2023-08-09 15:58:07.000000000 +0000 @@ -1,7 +1,7 @@ Libiio - + diff -Nru libiio-0.24/dns_sd_avahi.c libiio-0.25/dns_sd_avahi.c --- libiio-0.24/dns_sd_avahi.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/dns_sd_avahi.c 2023-08-09 15:58:07.000000000 +0000 @@ -51,10 +51,13 @@ } static void avahi_process_resolved(struct dns_sd_discovery_data *ddata, + AvahiIfIndex iface, const AvahiAddress *addr, const char *host_name, const uint16_t port) { + char *ptr; + /* Avahi is multi-threaded, so lock the list */ iio_mutex_lock(ddata->lock); ddata->resolved++; @@ -83,6 +86,16 @@ } iio_mutex_unlock(ddata->lock); + ptr = ddata->addr_str + strnlen(ddata->addr_str, DNS_SD_ADDRESS_STR_MAX); + + if (addr->proto == AVAHI_PROTO_INET6 + && addr->data.ipv6.address[0] == 0xfe + && addr->data.ipv6.address[1] == 0x80 + && iface != AVAHI_IF_UNSPEC + && if_indextoname((unsigned int)iface, ptr + 1)) { + *ptr = '%'; + } + IIO_DEBUG("\t\t%s:%u (%s)\n", host_name, port, ddata->addr_str); } @@ -126,7 +139,7 @@ avahi_strerror(err)); break; case AVAHI_RESOLVER_FOUND: { - avahi_process_resolved(ddata, address, host_name, port); + avahi_process_resolved(ddata, iface, address, host_name, port); IIO_DEBUG("Avahi Resolver : service '%s' of type '%s' in domain '%s':\n", name, type, domain); break; @@ -157,7 +170,7 @@ host_name, avahi_strerror(err)); break; case AVAHI_RESOLVER_FOUND: - avahi_process_resolved(ddata, address, host_name, IIOD_PORT); + avahi_process_resolved(ddata, iface, address, host_name, IIOD_PORT); break; } @@ -280,8 +293,8 @@ avahi_simple_poll_loop(d->poll); if (d->resolved) { - port_knock_discovery_data(&d); remove_dup_discovery_data(&d); + port_knock_discovery_data(&d); } else ret = -ENXIO; @@ -365,8 +378,8 @@ #endif if (d->resolved) { - port_knock_discovery_data(&d); remove_dup_discovery_data(&d); + port_knock_discovery_data(&d); } else { ret = -ENXIO; goto err_mutex_destroy; diff -Nru libiio-0.24/dns_sd_bonjour.c libiio-0.25/dns_sd_bonjour.c --- libiio-0.24/dns_sd_bonjour.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/dns_sd_bonjour.c 2023-08-09 15:58:07.000000000 +0000 @@ -28,12 +28,10 @@ { const CFNetServiceRef netService = (CFNetServiceRef)domainOrService; struct dns_sd_discovery_data *dd = info; - char address_v4[DNS_SD_ADDRESS_STR_MAX+1] = ""; - char address_v6[DNS_SD_ADDRESS_STR_MAX+1] = ""; + char address[DNS_SD_ADDRESS_STR_MAX+1] = ""; char hostname[FQDN_LEN]; char name[FQDN_LEN]; - bool have_v4 = false; - bool have_v6 = false; + struct sockaddr_in6 *sa6; struct sockaddr_in *sa; CFStreamError anError; CFStringRef targetHost; @@ -41,6 +39,7 @@ CFArrayRef addrArr; CFDataRef data; SInt32 port; + char *ptr; if ((flags & kCFNetServiceFlagIsDomain) != 0) { IIO_ERROR("DNS SD: FATAL! Callback called for domain, not service.\n"); @@ -97,45 +96,44 @@ goto exit; } + /* Set properties on the last element on the list. */ + while (dd->next) + dd = dd->next; + for (CFIndex i = 0; i < CFArrayGetCount(addrArr); i++) { data = CFArrayGetValueAtIndex(addrArr, i); sa = (struct sockaddr_in *) CFDataGetBytePtr(data); + sa6 = (struct sockaddr_in6 *) sa; switch(sa->sin_family) { case AF_INET: if (inet_ntop(sa->sin_family, &sa->sin_addr, - address_v4, sizeof(address_v4))) { - have_v4 = true; - } + address, sizeof(address))) + break; + continue; case AF_INET6: - if (inet_ntop(sa->sin_family, &sa->sin_addr, - address_v6, sizeof(address_v6))) { - have_v6 = true; - } + if (inet_ntop(sa->sin_family, &sa6->sin6_addr, + address, sizeof(address))) + break; + continue; + default: + continue; } - } - - if (!have_v4 && !have_v6) { - IIO_WARNING("DNS SD: Can't resolve valid address for " - "service %s.\n", name); - goto exit; - } - /* Set properties on the last element on the list. */ - while (dd->next) - dd = dd->next; + dd->port = port; + dd->hostname = strdup(hostname); - dd->port = port; - dd->hostname = strdup(hostname); + iio_strlcpy(dd->addr_str, address, sizeof(dd->addr_str)); - if (have_v4) - iio_strlcpy(dd->addr_str, address_v4, sizeof(dd->addr_str)); - else if(have_v6) - iio_strlcpy(dd->addr_str, address_v6, sizeof(dd->addr_str)); + ptr = dd->addr_str + strnlen(dd->addr_str, DNS_SD_ADDRESS_STR_MAX); - IIO_DEBUG("DNS SD: added %s (%s:%d)\n", hostname, dd->addr_str, port); + if (sa->sin_family == AF_INET6 + && sa6->sin6_addr.s6_addr[0] == 0xfe + && sa6->sin6_addr.s6_addr[1] == 0x80 + && if_indextoname((unsigned int)sa6->sin6_scope_id, ptr + 1)) { + *ptr = '%'; + } - if (have_v4 || have_v6) { /* A list entry was filled, prepare new item on the list. */ dd->next = zalloc(sizeof(*dd->next)); if (dd->next) { @@ -144,6 +142,10 @@ } else { IIO_ERROR("DNS SD Bonjour Resolver : memory failure\n"); } + + IIO_DEBUG("DNS SD: added %s (%s:%d)\n", hostname, dd->addr_str, port); + + dd = dd->next; } verify_flags: @@ -236,8 +238,8 @@ } } - port_knock_discovery_data(&d); remove_dup_discovery_data(&d); + port_knock_discovery_data(&d); *ddata = d; } diff -Nru libiio-0.24/dns_sd.c libiio-0.25/dns_sd.c --- libiio-0.24/dns_sd.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/dns_sd.c 2023-08-09 15:58:07.000000000 +0000 @@ -123,7 +123,7 @@ } else { iio_snprintf(description, sizeof(description), "%s (", addr_str); p = description + strlen(description); - for (i = 0; i < iio_context_get_devices_count(ctx) - 1; i++) { + for (i = 0; i < iio_context_get_devices_count(ctx); i++) { const struct iio_device *dev = iio_context_get_device(ctx, i); const char *name = iio_device_get_name(dev); if (name) { diff -Nru libiio-0.24/dns_sd.h libiio-0.25/dns_sd.h --- libiio-0.24/dns_sd.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/dns_sd.h 2023-08-09 15:58:07.000000000 +0000 @@ -15,11 +15,15 @@ #ifdef _WIN32 #include +#include +#include #else +#include #include #endif -#define DNS_SD_ADDRESS_STR_MAX (40) /* IPv6 Max = 4*8 + 7 + 1 for NUL */ +/* IPv6 Max = 4*8 + 7 + 1 for '%' + interface length */ +#define DNS_SD_ADDRESS_STR_MAX (40 + IF_NAMESIZE) #define FQDN_LEN (255) /* RFC 1035 */ /* MacOS doesn't include ENOMEDIUM (No medium found) like Linux does */ @@ -44,7 +48,7 @@ uint16_t found, resolved; char addr_str[DNS_SD_ADDRESS_STR_MAX]; char *hostname; - uint16_t port; + uint16_t port, iface; struct dns_sd_discovery_data *next; }; diff -Nru libiio-0.24/dns_sd_windows.c libiio-0.25/dns_sd_windows.c --- libiio-0.24/dns_sd_windows.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/dns_sd_windows.c 2023-08-09 15:58:07.000000000 +0000 @@ -24,6 +24,9 @@ #define STRINGIFY(x) _STRINGIFY(x) #define MDNS_PORT_STR STRINGIFY(MDNS_PORT) +static uint64_t lasttime; +#define TIMEOUT 2 + #ifdef HAVE_IPV6 static const unsigned char localhost[] = { 0, 0, 0, 0, 0, 0, 0, 0, @@ -68,6 +71,8 @@ static mdns_string_t ip_address_to_string(char *buffer, size_t capacity, const struct sockaddr *addr, size_t addrlen) { + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; + struct sockaddr_in *addr4 = (struct sockaddr_in *)addr; char host[NI_MAXHOST] = { 0 }; char service[NI_MAXSERV] = { 0 }; int ret, len = 0; @@ -77,15 +82,19 @@ NI_MAXHOST, service, NI_MAXSERV, NI_NUMERICSERV | NI_NUMERICHOST); if (ret == 0) { - if (addr->sa_family == AF_INET6 && - ((struct sockaddr_in6 *)addr)->sin6_port != 0 && - strncmp(service, MDNS_PORT_STR, sizeof(MDNS_PORT_STR))) - len = snprintf(buffer, capacity, "[%s]:%s", host, service); - else if (((struct sockaddr_in *)addr)->sin_port != 0 && - strncmp(service, MDNS_PORT_STR, sizeof(MDNS_PORT_STR))) + if (addr->sa_family == AF_INET6) { + if (addr6->sin6_port != 0 + && strncmp(service, MDNS_PORT_STR, sizeof(MDNS_PORT_STR))) { + len = snprintf(buffer, capacity, "[%s]:%s", host, service); + } else { + len = snprintf(buffer, capacity, "%s", host); + } + } else if (addr4->sin_port != 0 + && strncmp(service, MDNS_PORT_STR, sizeof(MDNS_PORT_STR))) { len = snprintf(buffer, capacity, "%s:%s", host, service); - else + } else { len = snprintf(buffer, capacity, "%s", host); + } } if (len >= (int)capacity) @@ -187,7 +196,7 @@ * - IPv4 "address" record (A) specifying IPv4 address of a given host * - IPv6 "address" record (AAAA) specifying IPv6 address of a given host * It's this routine that gets called, and needs to stitch things together - * The DNS host doesn't necessary need to be the acutal host (but for + * The DNS host doesn't necessary need to be the actual host (but for * mdns - it usually is. */ static int query_callback(int sock, const struct sockaddr *from, size_t addrlen, @@ -203,18 +212,22 @@ char entrybuffer[256]; char namebuffer[256]; mdns_record_srv_t srv; - bool found = false; - mdns_string_t entrystr, fromaddrstr, addrstr; - unsigned short port = 0; + mdns_string_t entrystr, fromaddrstr; if (!dd) { IIO_ERROR("DNS SD: Missing info structure. Stop browsing.\n"); goto quit; } - if (rtype != MDNS_RECORDTYPE_SRV && rtype != MDNS_RECORDTYPE_A && - rtype != MDNS_RECORDTYPE_AAAA) + switch (rtype) { + case MDNS_RECORDTYPE_SRV: +#ifdef HAVE_IPV6 + case MDNS_RECORDTYPE_AAAA: +#endif + break; + default: goto quit; + } if (entry != MDNS_ENTRYTYPE_ANSWER) goto quit; @@ -225,128 +238,84 @@ if (!strstr(entrystr.str, "_iio._tcp.local")) goto quit; - fromaddrstr = ip_address_to_string(addrbuffer, sizeof(addrbuffer), - from, addrlen); - iio_mutex_lock(dd->lock); + if (rtype == MDNS_RECORDTYPE_SRV) { srv = mdns_record_parse_srv(data, size, record_offset, record_length, namebuffer, sizeof(namebuffer)); + + fromaddrstr = ip_address_to_string(addrbuffer, sizeof(addrbuffer), + from, addrlen); + IIO_DEBUG("%.*s : %.*s SRV %.*s priority %d weight %d port %d\n", MDNS_STRING_FORMAT(fromaddrstr), MDNS_STRING_FORMAT(entrystr), MDNS_STRING_FORMAT(srv.name), srv.priority, srv.weight, srv.port); - - /* find a match based on name/port/ipv[46] & update it, otherwise add it */ - while (dd->next) { - if (dd->hostname && - !strncmp(dd->hostname, srv.name.str, srv.name.length - 1) && - (!dd->port || dd->port == srv.port) && - dd->found == (from->sa_family != AF_INET)) { - dd->port = srv.port; - IIO_DEBUG("DNS SD: updated SRV %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - found = true; - } - dd = dd->next; - } - if (!found) { - /* new hostname and port */ - if (srv.name.length > 1) { - dd->hostname = iio_strndup(srv.name.str, - srv.name.length - 1); - if (!dd->hostname) - goto mem_fail; - } - - iio_strlcpy(dd->addr_str, fromaddrstr.str, fromaddrstr.length + 1); - dd->port = srv.port; - dd->found = (from->sa_family != AF_INET); - IIO_DEBUG("DNS SD: added SRV %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - - /* A list entry was filled, prepare new item on the list */ - dd->next = new_discovery_data(dd); - if (!dd->next) - goto mem_fail; - } - } else if (rtype == MDNS_RECORDTYPE_A) { - struct sockaddr_in addr; - - mdns_record_parse_a(data, size, record_offset, record_length, &addr); - addrstr = ip_address_to_string(namebuffer, sizeof(namebuffer), - (struct sockaddr *) &addr, sizeof(addr)); - IIO_DEBUG("%.*s : %.*s A %.*s\n", MDNS_STRING_FORMAT(fromaddrstr), - MDNS_STRING_FORMAT(entrystr), MDNS_STRING_FORMAT(addrstr)); - - /* find a match based on name/ipv4 or 6 & update it, otherwise add it */ - while (dd->next) { - if (dd->hostname && - !strncmp(dd->hostname, entrystr.str, entrystr.length - 1) && - !dd->found) { - iio_strlcpy(dd->addr_str, addrstr.str, addrstr.length + 1); - IIO_DEBUG("DNS SD: updated A %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - found = true; - } - dd = dd->next; - } - if (!found) { - dd->hostname = iio_strndup(entrystr.str, entrystr.length - 1); - if (!dd->hostname) - goto mem_fail; - iio_strlcpy(dd->addr_str, addrstr.str, addrstr.length + 1); - dd->found = 0; - IIO_DEBUG("DNS SD: Added A %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - /* A list entry was filled, prepare new item on the list */ - dd->next = new_discovery_data(dd); - if (!dd->next) - goto mem_fail; - } } #ifdef HAVE_IPV6 - else if (rtype == MDNS_RECORDTYPE_AAAA) { + else { struct sockaddr_in6 addr; mdns_record_parse_aaaa(data, size, record_offset, record_length, &addr); - addrstr = ip_address_to_string(namebuffer, sizeof(namebuffer), - (struct sockaddr *) &addr, sizeof(addr)); - IIO_DEBUG("%.*s : %.*s AAAA %.*s\n", MDNS_STRING_FORMAT(fromaddrstr), - MDNS_STRING_FORMAT(entrystr), MDNS_STRING_FORMAT(addrstr)); - - /* find a match based on name/port/ipv[46] & update it, otherwise add it */ - while (dd->next) { - if (dd->hostname && - !strncmp(dd->hostname, entrystr.str, entrystr.length - 1) && - dd->found) { - iio_strlcpy(dd->addr_str, addrstr.str, addrstr.length + 1); - IIO_DEBUG("DNS SD: updated AAAA %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - found = true; - } - else if (dd->hostname && - !strncmp(dd->hostname, entrystr.str, entrystr.length - 1)) { - port = dd->port; - } - dd = dd->next; + + /* Find a match based on hostname */ + for (; dd->next; dd = dd->next) { + if (dd->hostname + && dd->found + && !strncmp(dd->hostname, entrystr.str, entrystr.length - 1)) + break; } - if (!found) { - dd->hostname = iio_strndup(entrystr.str, entrystr.length - 1); - if (!dd->hostname) - goto mem_fail; - iio_strlcpy(dd->addr_str, addrstr.str, addrstr.length + 1); - dd->found = 1; - if (port) - dd->port = port; - IIO_DEBUG("DNS SD: added AAAA %s (%s port: %hu)\n", - dd->hostname, dd->addr_str, dd->port); - /* A list entry was filled, prepare new item on the list */ - dd->next = new_discovery_data(dd); - if (!dd->next) - goto mem_fail; + + if (!dd->next) { + IIO_DEBUG("No SRV found for hostname %.*s\n", + MDNS_STRING_FORMAT(entrystr)); + iio_mutex_unlock(dd->lock); + goto quit; } + + srv.name.str = dd->hostname; + srv.name.length = strlen(dd->hostname) + 1; + srv.port = dd->port; + + if (IN6_IS_ADDR_LINKLOCAL(&addr.sin6_addr)) + addr.sin6_scope_id = dd->iface; + else + addr.sin6_scope_id = 0; + + fromaddrstr = ip_address_to_string(addrbuffer, sizeof(addrbuffer), + (struct sockaddr *)&addr, sizeof(addr)); + + IIO_DEBUG("Found IPv6 address %.*s for hostname %s\n", + MDNS_STRING_FORMAT(fromaddrstr), dd->hostname); } -#endif /* HAVE_IPV6 */ +#endif + + while (dd->next) + dd = dd->next; + + /* new hostname and port */ + if (srv.name.length > 1) { + dd->hostname = iio_strndup(srv.name.str, + srv.name.length - 1); + if (!dd->hostname) + goto mem_fail; + } + + iio_strlcpy(dd->addr_str, fromaddrstr.str, fromaddrstr.length + 1); + dd->port = srv.port; + dd->found = (from->sa_family != AF_INET); +#ifdef HAVE_IPV6 + if (dd->found) + dd->iface = (uint16_t)((struct sockaddr_in6 *)from)->sin6_scope_id; +#endif + IIO_DEBUG("DNS SD: added SRV %s (%s port: %hu)\n", + dd->hostname, dd->addr_str, dd->port); + + /* A list entry was filled, prepare new item on the list */ + dd->next = new_discovery_data(dd); + if (!dd->next) + goto mem_fail; + + lasttime = iio_read_counter_us(); iio_mutex_unlock(dd->lock); quit: return 0; @@ -370,6 +339,8 @@ int transaction_id[32]; int nfds, res, ret = -ENOMEM; struct timeval timeout; + uint64_t nowtime; + int64_t diff; if (WSAStartup(versionWanted, &wsaData)) { IIO_ERROR("Failed to initialize WinSock\n"); @@ -422,9 +393,11 @@ IIO_DEBUG("Reading mDNS query replies\n"); records = 0; + lasttime = iio_read_counter_us(); + do { nfds = 0; - timeout.tv_sec = 2; + timeout.tv_sec = TIMEOUT; timeout.tv_usec = 0; fd_set readfs; @@ -448,17 +421,27 @@ FD_SET(sockets[isock], &readfs); } } + + /* res > 0 even if we didn't process anything :( + * timeout from the last time we successfully added a proper mdns record + */ + nowtime = iio_read_counter_us(); + + /* convert to ms */ + diff = (nowtime - lasttime) / 1000ull; + if (diff > (TIMEOUT * 1000)) + res = 0; } while (res > 0); for (isock = 0; isock < num_sockets; ++isock) mdns_socket_close(sockets[isock]); - IIO_DEBUG("Closed %i socket%s, processed %i record%s\n", + IIO_DEBUG("Closed %i socket%s, processed %zu record%s\n", num_sockets, (num_sockets > 1) ? "s" : "", records, (records > 1) ? "s" : "" ); - port_knock_discovery_data(&d); remove_dup_discovery_data(&d); + port_knock_discovery_data(&d); /* since d may have changed, make sure we pass back the start */ *ddata = d; diff -Nru libiio-0.24/doc/index.html.in libiio-0.25/doc/index.html.in --- libiio-0.24/doc/index.html.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/doc/index.html.in 2023-08-09 15:58:07.000000000 +0000 @@ -130,21 +130,7 @@
  • libiio
  • -
  • - iio_attr -
  • -
  • - iio_info -
  • -
  • - iio_readdev -
  • -
  • - iio_reg -
  • -
  • - iio_writedev -
  • + @IIO_TESTS_MAN_PAGES_HTML@ @@ -213,7 +199,7 @@ devices. IIO started as a Linux kernel subsystem to support for devices that included - analog-to-digital convertors (ADCs) and/or digital-to-analog convertors + analog-to-digital converters (ADCs) and/or digital-to-analog converters (DACs). While the libIIO continues to provide an easy interface to the Linux kernel IIO subsystem, it has also expanded beyond that, and is now just as common to see this used inside an embedded system or hypervisor as @@ -289,8 +275,8 @@

    Once you have secured your access to the library and its header, please check the libIIO API or the libIIO examples.

    Where is (insert my favourite language) support?

    -

    The mainline library is written in C, can be used in C++, and has built in - bindings for Python and C# (C-Sharp). The mainline library is written in C, and has built in + bindings for C++, Python and C# (C-Sharp). Node.js and Rust are maintained outside the main repo. If you are interested in creating more language diff -Nru libiio-0.24/Doxyfile.in libiio-0.25/Doxyfile.in --- libiio-0.24/Doxyfile.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/Doxyfile.in 2023-08-09 15:58:07.000000000 +0000 @@ -1,5 +1,43 @@ +# Doxyfile 1.9.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "libiio" + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = libiio + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + PROJECT_NUMBER = @LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@ # Using the PROJECT_BRIEF tag one can provide an optional one line description @@ -8,10 +46,10 @@ PROJECT_BRIEF = "Library for interfacing with IIO devices" -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -21,17 +59,56 @@ # left blank the current directory will be used. OUTPUT_DIRECTORY = @CMAKE_HTML_DEST_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -66,7 +143,7 @@ INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -83,7 +160,7 @@ # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = @DOXYGEN_STRIP_FROM_PATH@ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -110,6 +187,16 @@ JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -130,15 +217,23 @@ MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -157,16 +252,15 @@ # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -175,25 +269,60 @@ OPTIMIZE_OUTPUT_FOR_C = YES +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -201,22 +330,72 @@ MARKDOWN_SUPPORT = YES +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -271,11 +450,24 @@ LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -285,35 +477,41 @@ EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -328,6 +526,13 @@ EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -338,21 +543,21 @@ # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = YES # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -365,22 +570,36 @@ INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. # The default value is: system dependent. CASE_SENSE_NAMES = @CMAKE_CASE_SENSITIVE_FILESYSTEM@ # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -408,14 +627,14 @@ # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -460,27 +679,25 @@ STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -491,7 +708,7 @@ # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = @DOXYGEN_ENABLED_SECTIONS@ # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -505,8 +722,8 @@ MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -551,11 +768,10 @@ # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -571,7 +787,7 @@ QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -579,7 +795,7 @@ WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -596,12 +812,22 @@ # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = NO +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -625,30 +851,41 @@ # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @CMAKE_SOURCE_DIR@ +INPUT = @DOXYGEN_INPUT@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.c *.h *.dox +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, *.vhdl, +# *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.h \ + *.dox # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -663,7 +900,12 @@ # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = @CMAKE_SOURCE_DIR@/iio-private.h @CMAKE_SOURCE_DIR@/debug.h @CMAKE_SOURCE_DIR@/iio-lock.h @CMAKE_SOURCE_DIR@/iiod-client.h @CMAKE_SOURCE_DIR@/sort.h @CMAKE_SOURCE_DIR@/network.h +EXCLUDE = @CMAKE_SOURCE_DIR@/iio-private.h \ + @CMAKE_SOURCE_DIR@/debug.h \ + @CMAKE_SOURCE_DIR@/iio-lock.h \ + @CMAKE_SOURCE_DIR@/iiod-client.h \ + @CMAKE_SOURCE_DIR@/sort.h \ + @CMAKE_SOURCE_DIR@/network.h # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -696,7 +938,9 @@ # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/tests @CMAKE_SOURCE_DIR@/examples +EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/tests \ + @CMAKE_SOURCE_DIR@/examples \ + @DOXYGEN_CPP_EXAMPLE_PATH@ # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -732,6 +976,10 @@ # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -741,11 +989,15 @@ # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -793,7 +1045,7 @@ STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -805,7 +1057,7 @@ REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -825,12 +1077,12 @@ # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -852,6 +1104,44 @@ VERBATIM_HEADERS = YES +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: +# http://clang.llvm.org/) for more accurate parsing at the cost of reduced +# performance. This can be particularly helpful with template rich C++ code for +# which doxygen's built-in parser lacks the necessary type information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled and the CLANG_ADD_INC_PATHS tag is set to +# YES then doxygen will add the directory of each input to the include path. +# The default value is: YES. + +CLANG_ADD_INC_PATHS = YES + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the directory containing a file called compile_commands.json. This +# file is the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) containing the +# options used when the source files were built. This is equivalent to +# specifying the -p option to a clang tool, such as clang-check. These options +# will then be passed to the parser. Any options specified with CLANG_OPTIONS +# will be added as well. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -863,13 +1153,6 @@ ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -882,7 +1165,7 @@ # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -944,13 +1227,15 @@ HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -966,9 +1251,9 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -997,12 +1282,24 @@ # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1026,13 +1323,14 @@ # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1071,8 +1369,8 @@ # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# (see: +# https://www.microsoft.com/en-us/download/details.aspx?id=21138) on Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1094,28 +1392,29 @@ CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1146,7 +1445,8 @@ # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1154,8 +1454,8 @@ # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1163,30 +1463,30 @@ # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1228,7 +1528,7 @@ # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1256,13 +1556,24 @@ TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1272,7 +1583,7 @@ FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1283,9 +1594,15 @@ FORMULA_TRANSPARENT = YES +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1296,7 +1613,7 @@ # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. @@ -1311,8 +1628,8 @@ # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest @@ -1326,7 +1643,8 @@ # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1354,12 +1672,12 @@ SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There -# are two flavours of web server based searching depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. See -# the section "External Indexing and Searching" for details. +# implemented using a web server instead of a web client using JavaScript. There +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1371,9 +1689,10 @@ # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1384,10 +1703,11 @@ # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1422,24 +1742,428 @@ # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = makeindex + +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the +# generated LaTeX document. The header should contain everything until the first +# chapter. If it is left blank doxygen will generate a standard header. See +# section "Doxygen usage" for information on how to let doxygen write the +# default header to a separate file. +# +# Note: Only use a user-defined header if you know what you are doing! The +# following commands have a special meaning inside the header: $title, +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the +# generated LaTeX document. The footer should contain everything after the last +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. +# +# Note: Only use a user-defined footer if you know what you are doing! +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_FOOTER = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode +# command to the generated LaTeX files. This will instruct LaTeX to keep running +# if errors occur, instead of asking the user for help. This option is also used +# when generating formulas in HTML. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = NO + +# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source +# code with syntax highlighting in the LaTeX output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. See +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BIB_STYLE = plain + +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + GENERATE_MAN = NO +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1455,7 +2179,7 @@ EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1485,7 +2209,7 @@ # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = DOXYGEN # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1497,9 +2221,9 @@ EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all refrences to function-like macros that are alone on a line, have an -# all uppercase name, and do not end with a semicolon. Such function macros are -# typically used for boiler-plate code, and will confuse the parser if not +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not # removed. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1519,7 +2243,7 @@ # where loc1 and loc2 can be relative or absolute paths or URLs. See the # section "Linking to external documentation" for more information about the use # of tag files. -# Note: Each tag file must have an unique name (where the name does NOT include +# Note: Each tag file must have a unique name (where the name does NOT include # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. @@ -1531,37 +2255,32 @@ GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -1570,15 +2289,6 @@ CLASS_DIAGRAMS = YES -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -1586,7 +2296,7 @@ DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -1597,7 +2307,7 @@ # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent # Bell Labs. The other options in this section have no effect if this option is # set to NO -# The default value is: NO. +# The default value is: YES. HAVE_DOT = @DOXYGEN_DOT_FOUND@ @@ -1611,7 +2321,7 @@ DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen +# When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -1659,7 +2369,7 @@ GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -1676,10 +2386,32 @@ # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -1711,7 +2443,8 @@ # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1722,7 +2455,8 @@ # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1745,11 +2479,17 @@ DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, png:cairo, png:cairo:cairo, png:cairo:gd, png:gd, +# png:gd:gd, jpg, jpg:cairo, jpg:cairo:gd, jpg:gd, jpg:gd:gd, gif, gif:cairo, +# gif:cairo:gd, gif:gd, gif:gd:gd, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -1771,7 +2511,7 @@ # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = "@DOXYGEN_DOT_PATH@" +DOT_PATH = @DOXYGEN_DOT_PATH@ # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile @@ -1792,6 +2532,24 @@ DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -1828,7 +2586,7 @@ DOT_TRANSPARENT = YES -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -1845,9 +2603,11 @@ GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc and +# plantuml temporary files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff -Nru libiio-0.24/examples/ad9361-iiostream.c libiio-0.25/examples/ad9361-iiostream.c --- libiio-0.24/examples/ad9361-iiostream.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/ad9361-iiostream.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - AD9361 IIO streaming example * @@ -50,7 +50,7 @@ static bool stop; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying buffers\n"); if (rxbuf) { iio_buffer_destroy(rxbuf); } diff -Nru libiio-0.24/examples/ad9371-iiostream.c libiio-0.25/examples/ad9371-iiostream.c --- libiio-0.24/examples/ad9371-iiostream.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/ad9371-iiostream.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - AD9371 IIO streaming example * @@ -48,7 +48,7 @@ static bool stop; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying buffers\n"); if (rxbuf) { iio_buffer_destroy(rxbuf); } diff -Nru libiio-0.24/examples/adrv9002-iiostream.c libiio-0.25/examples/adrv9002-iiostream.c --- libiio-0.24/examples/adrv9002-iiostream.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/adrv9002-iiostream.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - Library for interfacing industrial I/O (IIO) devices * diff -Nru libiio-0.24/examples/adrv9009-iiostream.c libiio-0.25/examples/adrv9009-iiostream.c --- libiio-0.24/examples/adrv9009-iiostream.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/adrv9009-iiostream.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - ADRV9009 IIO streaming example * @@ -48,7 +48,7 @@ static bool stop; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying buffers\n"); if (rxbuf) { iio_buffer_destroy(rxbuf); } diff -Nru libiio-0.24/examples/CMakeLists.txt libiio-0.25/examples/CMakeLists.txt --- libiio-0.24/examples/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(ad9361-iiostream C) project(ad9371-iiostream C) @@ -89,6 +89,13 @@ message(STATUS "Curses Development Kit (CDK) missing or too old, skipping iio-monitor") endif () +if (PTHREAD_LIBRARIES OR ANDROID) + project(iio_adi_xflow_check C) + add_executable(iio_adi_xflow_check iio_adi_xflow_check.c) + target_link_libraries(iio_adi_xflow_check iio iio_tests_helper ${PTHREAD_LIBRARIES}) + set(IIO_TESTS_TARGETS ${IIO_TESTS_TARGETS} iio_adi_xflow_check) +endif() + set_target_properties( ${IIO_TESTS_TARGETS} PROPERTIES C_STANDARD 99 C_STANDARD_REQUIRED ON C_EXTENSIONS OFF diff -Nru libiio-0.24/examples/dummy-iiostream.c libiio-0.25/examples/dummy-iiostream.c --- libiio-0.24/examples/dummy-iiostream.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/dummy-iiostream.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - Dummy IIO streaming example * @@ -109,7 +109,7 @@ static bool has_repeat; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { int ret; diff -Nru libiio-0.24/examples/iio_adi_xflow_check.c libiio-0.25/examples/iio_adi_xflow_check.c --- libiio-0.24/examples/iio_adi_xflow_check.c 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/examples/iio_adi_xflow_check.c 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,294 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * iio_adi_dac_overflow_test - part of the IIO utilities + * + * Copyright (C) 2015 Analog Devices, Inc. + * */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../tests/iio_common.h" + + +#define MY_NAME "iio_adi_xflow_check" + +struct xflow_pthread_data { + struct iio_context *ctx; + const char *device_name; +}; + +static const struct option options[] = { + {"buffer-size", required_argument, 0, 's'}, + {"auto", no_argument, 0, 'a'}, + {0, 0, 0, 0}, +}; + +static const char *options_descriptions[] = { + "[-n ] [-u ] [-a ] [-s ] ", + "Size of the buffer in sample sets. Default is 1Msample", + "Scan for available contexts and if only one is available use it.", +}; + +static bool app_running = true; +static bool device_is_tx; + +static void quit_all(int sig) +{ + app_running = false; +} + +static void set_handler(int signal_nb, void (*handler)(int)) +{ +#ifdef _WIN32 + signal(signal_nb, handler); +#else + struct sigaction sig; + sigaction(signal_nb, NULL, &sig); + sig.sa_handler = handler; + sigaction(signal_nb, &sig, NULL); +#endif +} + +static struct iio_device *get_device(const struct iio_context *ctx, + const char *id) +{ + + unsigned int i, nb_devices = iio_context_get_devices_count(ctx); + struct iio_device *device; + + for (i = 0; i < nb_devices; i++) { + const char *name; + device = iio_context_get_device(ctx, i); + name = iio_device_get_name(device); + if (name && !strcmp(name, id)) + break; + if (!strcmp(id, iio_device_get_id(device))) + break; + } + + if (i < nb_devices) + return device; + + fprintf(stderr, "Device %s not found\n", id); + return NULL; +} + + +static void *monitor_thread_fn(void *data) +{ + struct xflow_pthread_data *xflow_pthread_data = data; + struct iio_context *ctx; + struct iio_device *dev; + uint32_t val; + int ret; + + ctx = xflow_pthread_data->ctx; + + dev = get_device(ctx, xflow_pthread_data->device_name); + if (!dev) { + fprintf(stderr, "Unable to find IIO device\n"); + return (void *)-1; + } + + /* Give the main thread a moment to start the DMA */ + sleep(1); + + /* Clear all status bits */ + ret = iio_device_reg_write(dev, 0x80000088, 0x6); + if (ret) { + fprintf(stderr, "Failed to clearn DMA status register: %s\n", + strerror(-ret)); + } + + while (app_running) { + ret = iio_device_reg_read(dev, 0x80000088, &val); + if (ret) { + fprintf(stderr, "Failed to read status register: %s\n", + strerror(-ret)); + continue; + } + + if (device_is_tx) { + if (val & 1) + fprintf(stderr, "Underflow detected\n"); + } else { + if (val & 4) + fprintf(stderr, "Overflow detected\n"); + } + + /* Clear bits */ + if (val) { + ret = iio_device_reg_write(dev, 0x80000088, val); + if (ret) + fprintf(stderr, "Failed to clearn DMA status register: %s\n", + strerror(-ret)); + } + sleep(1); + } + + return (void *)0; +} + +#define MY_OPTS "s:a" + +int main(int argc, char **argv) +{ + char **argw; + unsigned int buffer_size = 1024 * 1024; + int c; + unsigned int n_tx = 0, n_rx = 0; + static struct iio_context *ctx; + static struct xflow_pthread_data xflow_pthread_data; + unsigned int i, nb_channels; + struct iio_buffer *buffer; + pthread_t monitor_thread; + const char *device_name; + struct iio_device *dev; + char unit; + int ret = EXIT_FAILURE; + struct option *opts; + + argw = dup_argv(MY_NAME, argc, argv); + + ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, + options, options_descriptions, &ret); + opts = add_common_options(options); + if (!opts) { + fprintf(stderr, "Failed to add common options\n"); + return EXIT_FAILURE; + } + while ((c = getopt_long(argc, argw, "+" COMMON_OPTIONS MY_OPTS, /* Flawfinder: ignore */ + opts, NULL)) != -1) { + switch (c) { + /* All these are handled in the common */ + case 'h': + case 'V': + case 'n': + case 'x': + case 'u': + case 'T': + break; + case 'S': + case 'a': + if (!optarg && argc > optind && argv[optind] != NULL + && argv[optind][0] != '-') + optind++; + break; + + case 's': + if (!optarg) { + fprintf(stderr, "Samples options requires a value.\n\n"); + return EXIT_FAILURE; + } + ret = sscanf(optarg, "%u%c", &buffer_size, &unit); + if (ret == 0) + return EXIT_FAILURE; + if (ret == 2) { + if (unit == 'k') + buffer_size *= 1024; + else if (unit == 'M') + buffer_size *= 1024 * 1024; + } + break; + case '?': + return EXIT_FAILURE; + } + } + free(opts); + + if (optind + 1 != argc) { + fprintf(stderr, "Incorrect number of arguments.\n\n"); + usage(MY_NAME, options, options_descriptions); + return EXIT_FAILURE; + } + + if (!ctx) + return ret; + +#ifndef _WIN32 + set_handler(SIGHUP, &quit_all); +#endif + set_handler(SIGINT, &quit_all); + set_handler(SIGSEGV, &quit_all); + set_handler(SIGTERM, &quit_all); + + device_name = argw[optind]; + + dev = get_device(ctx, device_name); + if (!dev) { + iio_context_destroy(ctx); + return EXIT_FAILURE; + } + + nb_channels = iio_device_get_channels_count(dev); + for (i = 0; i < nb_channels; i++) { + struct iio_channel *ch = iio_device_get_channel(dev, i); + if (!iio_channel_is_scan_element(ch)) + continue; + iio_channel_enable(ch); + if (iio_channel_is_output(ch)) + n_tx++; + else + n_rx++; + } + + if (n_tx >= n_rx) + device_is_tx = true; + else + device_is_tx = false; + + printf("Monitoring %s for underflows/overflows\n", + iio_device_get_name(dev)); + + buffer = iio_device_create_buffer(dev, buffer_size, false); + if (!buffer) { + fprintf(stderr, "Unable to allocate buffer\n"); + iio_context_destroy(ctx); + return EXIT_FAILURE; + } + + xflow_pthread_data.ctx = ctx; + xflow_pthread_data.device_name = device_name; + + ret = pthread_create(&monitor_thread, NULL, monitor_thread_fn, + (void *)&xflow_pthread_data); + if (ret) { + fprintf(stderr, "Failed to create monitor thread: %s\n", + strerror(-ret)); + } + + while (app_running) { + if (device_is_tx) { + ret = iio_buffer_push(buffer); + if (ret < 0) { + fprintf(stderr, "Unable to push buffer: %s\n", + strerror(-ret)); + app_running = false; + break; + } + } else { + ret = iio_buffer_refill(buffer); + if (ret < 0) { + fprintf(stderr, "Unable to refill buffer: %s\n", + strerror(-ret)); + app_running = false; + break; + } + } + } + + pthread_join(monitor_thread, NULL); + + iio_buffer_destroy(buffer); + iio_context_destroy(ctx); + free_argw(argc, argw); + return 0; +} diff -Nru libiio-0.24/examples/iio-monitor.c libiio-0.25/examples/iio-monitor.c --- libiio-0.24/examples/iio-monitor.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/iio-monitor.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - Library for interfacing industrial I/O (IIO) devices * diff -Nru libiio-0.24/examples/README.md libiio-0.25/examples/README.md --- libiio-0.24/examples/README.md 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/examples/README.md 2023-08-09 15:58:07.000000000 +0000 @@ -41,3 +41,8 @@ * Requirements : Curses Development Kit (libcdk5-dev); pthreads; ncurses; libiio A Curses based application which implements real time monitoring of IIO non-buffer samples. + +## iopp-enum + * Language : C++ + +Demonstrates the usage of the C++ API. diff -Nru libiio-0.24/.github/workflows/codespell.yml libiio-0.25/.github/workflows/codespell.yml --- libiio-0.24/.github/workflows/codespell.yml 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/.github/workflows/codespell.yml 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,27 @@ +# GitHub Action to automate the identification of common misspellings in text files. +# https://github.com/codespell-project/actions-codespell +# https://github.com/codespell-project/codespell +name: codespell +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +permissions: + contents: read # to fetch code (actions/checkout) +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: codespell-project/actions-codespell@v1 # v1.0 + with: + check_filenames: true + skip: .git,deps + ignore_words_file: .codespell-ignore.txt diff -Nru libiio-0.24/iiod/CMakeLists.txt libiio-0.25/iiod/CMakeLists.txt --- libiio-0.24/iiod/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(iiod C) include(FindBISON) @@ -106,12 +106,12 @@ install(FILES ${PROJECT_BINARY_DIR}/init/iiod.conf DESTINATION ${UPSTART_CONF_INSTALL_DIR}) endif() -list(APPEND IIOD_FEATURES_${WITH_IIOD_SERIAL} iiod-serial) -list(APPEND IIOD_FEATURES_${WITH_AIO} iiod-aio) -list(APPEND IIOD_FEATURES_${WITH_IIOD_USBD} iiod-usb) -list(APPEND IIOD_FEATURES_${WITH_SYSTEMD} iiod-systemd) -list(APPEND IIOD_FEATURES_${WITH_SYSVINIT} iiod-sysvinit) -list(APPEND IIOD_FEATURES_${WITH_UPSTART} iiod-upstart) +toggle_iio_feature("${WITH_IIOD_SERIAL}" iiod-serial) +toggle_iio_feature("${WITH_AIO}" iiod-aio) +toggle_iio_feature("${WITH_IIOD_USBD}" iiod-usb) +toggle_iio_feature("${WITH_SYSTEMD}" iiod-systemd) +toggle_iio_feature("${WITH_SYSVINIT}" iiod-sysvinit) +toggle_iio_feature("${WITH_UPSTART}" iiod-upstart) -set(IIOD_FEATURES_ON "${IIOD_FEATURES_ON}" PARENT_SCOPE) -set(IIOD_FEATURES_OFF "${IIOD_FEATURES_OFF}" PARENT_SCOPE) +set(IIOD_FEATURES_ON "${IIO_FEATURES_ON}" PARENT_SCOPE) +set(IIOD_FEATURES_OFF "${IIO_FEATURES_OFF}" PARENT_SCOPE) diff -Nru libiio-0.24/iiod/dns-sd.c libiio-0.25/iiod/dns-sd.c --- libiio-0.24/iiod/dns-sd.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/dns-sd.c 2023-08-09 15:58:07.000000000 +0000 @@ -256,7 +256,6 @@ while(true) { ret = gethostname(host, sizeof(host)); - IIO_ERROR("host %s\n", host); if (ret || !strcmp(host, "none")) goto again; @@ -310,7 +309,7 @@ avahi.name = NULL; avahi.port = port; - /* In case dbus, or avahi deamon are not started, we create a thread + /* In case dbus, or avahi daemon are not started, we create a thread * that tries a few times to attach, if it can't within the first * minute, it gives up. */ diff -Nru libiio-0.24/iiod/iiod.c libiio-0.25/iiod/iiod.c --- libiio-0.24/iiod/iiod.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/iiod.c 2023-08-09 15:58:07.000000000 +0000 @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,17 @@ #define _STRINGIFY(x) #x #define STRINGIFY(x) _STRINGIFY(x) +#ifdef HAVE_IPV6 +#define IP_ADDR_LEN (INET6_ADDRSTRLEN + 1 + IF_NAMESIZE) +#else +#define IP_ADDR_LEN (INET_ADDRSTRLEN + 1 + IF_NAMESIZE) +#endif + +static int start_iiod(const char *uri, const char *ffs_mountpoint, + const char *uart_params, bool debug, bool interactive, + bool use_aio, uint16_t port, unsigned int nb_pipes, + int ep0_fd); + struct client_data { int fd; bool debug; @@ -131,6 +143,14 @@ thread_pool_stop(main_thread_pool); } +static bool restart_usr1; + +static void sig_handler_usr1(int sig) +{ + restart_usr1 = true; + thread_pool_stop(main_thread_pool); +} + static int main_interactive(struct iio_context *ctx, bool verbose, bool use_aio, const void *xml_zstd, size_t xml_zstd_len) { @@ -252,7 +272,12 @@ while (true) { struct client_data *cdata; +#ifdef HAVE_IPV6 + struct sockaddr_in6 caddr; +#else struct sockaddr_in caddr; +#endif + socklen_t addr_len = sizeof(caddr); int new; @@ -317,8 +342,43 @@ cdata->xml_zstd = xml_zstd; cdata->xml_zstd_len = xml_zstd_len; - IIO_INFO("New client connected from %s\n", - inet_ntoa(caddr.sin_addr)); + if (LOG_LEVEL >= Info_L) { + struct sockaddr_in *caddr4 = (struct sockaddr_in *)&caddr; + char ipaddr[IP_ADDR_LEN]; + int zone = 0; + void *addr; + char *ptr; + + if (!ipv6 || caddr4->sin_family == AF_INET) { + addr = &caddr4->sin_addr; +#ifdef HAVE_IPV6 + } else { + addr = &caddr.sin6_addr; + zone = caddr.sin6_scope_id; +#endif + } + + if (!inet_ntop(caddr4->sin_family, addr, ipaddr, sizeof(ipaddr) - 1)) { + iio_strerror(errno, err_str, sizeof(err_str)); + IIO_ERROR("Error during inet_ntop: %s\n", err_str); + } else { + ipaddr[IP_ADDR_LEN - 1] = '\0'; + + if (zone) { + ptr = &ipaddr[strnlen(ipaddr, IP_ADDR_LEN)]; + + if (if_indextoname(zone, ptr + 1)) + *ptr = '%'; + } + + if (!strncmp(ipaddr, "::ffff:", sizeof("::ffff:") - 1)) + ptr = &ipaddr[sizeof("::ffff:") - 1]; + else + ptr = ipaddr; + + IIO_INFO("New client connected from %s\n", ptr); + } + } ret = thread_pool_add_thread(main_thread_pool, client_thd, cdata, "net_client_thd"); if (ret) { @@ -376,15 +436,12 @@ long nb_pipes = 3, val; char *end; const char *arg = "local:"; - struct iio_context *ctx; int c, option_index = 0; char *ffs_mountpoint = NULL; char *uart_params = NULL; char err_str[1024]; - void *xml_zstd; - size_t xml_zstd_len = 0; uint16_t port = IIOD_PORT; - int ret; + int ret, ep0_fd = 0; while ((c = getopt_long(argc, argv, "+hVdDiaF:n:s:p:u:", options, &option_index)) != -1) { @@ -459,40 +516,79 @@ } } - ctx = iio_create_context_from_uri(arg); - - if (!ctx) { + main_thread_pool = thread_pool_new(); + if (!main_thread_pool) { iio_strerror(errno, err_str, sizeof(err_str)); - IIO_ERROR("Unable to create local context: %s\n", err_str); + IIO_ERROR("Unable to create thread pool: %s\n", err_str); return EXIT_FAILURE; } - xml_zstd = get_xml_zstd_data(ctx, &xml_zstd_len); + if (WITH_IIOD_USBD && ffs_mountpoint) { + ret = init_usb_daemon(ffs_mountpoint, nb_pipes); + if (ret < 0) { + iio_strerror(errno, err_str, sizeof(err_str)); + IIO_ERROR("Unable to init USB: %s\n", err_str); - main_thread_pool = thread_pool_new(); - if (!main_thread_pool) { - iio_strerror(errno, err_str, sizeof(err_str)); - IIO_ERROR("Unable to create thread pool: %s\n", err_str); - ret = EXIT_FAILURE; - goto out_destroy_context; + thread_pool_destroy(main_thread_pool); + return EXIT_FAILURE; + } + + ep0_fd = ret; } set_handler(SIGHUP, sig_handler); set_handler(SIGPIPE, sig_handler); set_handler(SIGINT, sig_handler); set_handler(SIGTERM, sig_handler); + set_handler(SIGUSR1, sig_handler_usr1); + + do { + thread_pool_restart(main_thread_pool); + restart_usr1 = false; + + ret = start_iiod(arg, ffs_mountpoint, uart_params, debug, + interactive, use_aio, port, nb_pipes, ep0_fd); + } while (!ret && restart_usr1); + + thread_pool_destroy(main_thread_pool); + + if (WITH_IIOD_USBD && ffs_mountpoint) + close(ep0_fd); + + return ret; +} + +static int start_iiod(const char *uri, const char *ffs_mountpoint, + const char *uart_params, bool debug, bool interactive, + bool use_aio, uint16_t port, unsigned int nb_pipes, + int ep0_fd) +{ + struct iio_context *ctx; + char err_str[1024]; + void *xml_zstd; + size_t xml_zstd_len = 0; + int ret; + + ctx = iio_create_context_from_uri(uri); + if (!ctx) { + iio_strerror(errno, err_str, sizeof(err_str)); + IIO_ERROR("Unable to create local context: %s\n", err_str); + return EXIT_FAILURE; + } + + xml_zstd = get_xml_zstd_data(ctx, &xml_zstd_len); if (WITH_IIOD_USBD && ffs_mountpoint) { /* We pass use_aio == true directly, this is ensured to be true * by the CMake script. */ ret = start_usb_daemon(ctx, ffs_mountpoint, - debug, true, (unsigned int) nb_pipes, + debug, true, (unsigned int) nb_pipes, ep0_fd, main_thread_pool, xml_zstd, xml_zstd_len); if (ret) { iio_strerror(-ret, err_str, sizeof(err_str)); IIO_ERROR("Unable to start USB daemon: %s\n", err_str); ret = EXIT_FAILURE; - goto out_destroy_thread_pool; + goto out_free_xml_data; } } @@ -504,7 +600,7 @@ iio_strerror(-ret, err_str, sizeof(err_str)); IIO_ERROR("Unable to start serial daemon: %s\n", err_str); ret = EXIT_FAILURE; - goto out_destroy_thread_pool; + goto out_thread_pool_stop; } } @@ -513,16 +609,13 @@ else ret = main_server(ctx, debug, xml_zstd, xml_zstd_len, port); +out_thread_pool_stop: /* * In case we got here through an error in the main thread make sure all * the worker threads are signaled to shutdown. */ - -out_destroy_thread_pool: thread_pool_stop_and_wait(main_thread_pool); - thread_pool_destroy(main_thread_pool); - -out_destroy_context: +out_free_xml_data: free(xml_zstd); iio_context_destroy(ctx); diff -Nru libiio-0.24/iiod/init/iiod.service.cmakein libiio-0.25/iiod/init/iiod.service.cmakein --- libiio-0.24/iiod/init/iiod.service.cmakein 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/init/iiod.service.cmakein 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: LGPL-2.1+ +# SPDX-License-Identifier: LGPL-2.1-or-later # # iiod - Systemd init script # diff -Nru libiio-0.24/iiod/ops.c libiio-0.25/iiod/ops.c --- libiio-0.24/iiod/ops.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/ops.c 2023-08-09 15:58:07.000000000 +0000 @@ -678,9 +678,22 @@ } if (ret < 0) { - IIO_ERROR("Reading from device failed: %i\n", - (int) ret); - break; + /* Reading from the device failed - signal the + * error to all connected clients. */ + + /* Don't use SLIST_FOREACH - see comment below */ + for (thd = SLIST_FIRST(&entry->thdlist_head); + thd; thd = next_thd) { + next_thd = SLIST_NEXT(thd, dev_list_entry); + + if (!thd->active || thd->is_writer) + continue; + + signal_thread(thd, ret); + } + + pthread_mutex_unlock(&entry->thdlist_lock); + continue; } nb_bytes = ret; @@ -750,18 +763,18 @@ pthread_mutex_unlock(&entry->thdlist_lock); continue; } - if (ret < 0) { - IIO_ERROR("Writing to device failed: %i\n", - (int) ret); - break; - } /* Signal threads which completed their RW command */ for (thd = SLIST_FIRST(&entry->thdlist_head); thd; thd = next_thd) { next_thd = SLIST_NEXT(thd, dev_list_entry); - if (thd->active && thd->is_writer && - thd->nb < sample_size) + + if (!thd->active || !thd->is_writer) + continue; + + if (ret < 0) + signal_thread(thd, ret); + else if (thd->nb < sample_size) signal_thread(thd, thd->nb); } diff -Nru libiio-0.24/iiod/ops.h libiio-0.25/iiod/ops.h --- libiio-0.24/iiod/ops.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/ops.h 2023-08-09 15:58:07.000000000 +0000 @@ -92,9 +92,10 @@ bool is_socket, bool is_usb, bool use_aio, struct thread_pool *pool, const void *xml_zstd, size_t xml_zstd_len); +int init_usb_daemon(const char *ffs, unsigned int nb_pipes); int start_usb_daemon(struct iio_context *ctx, const char *ffs, bool debug, bool use_aio, unsigned int nb_pipes, - struct thread_pool *pool, + int ep0_fd, struct thread_pool *pool, const void *xml_zstd, size_t xml_zstd_len); int start_serial_daemon(struct iio_context *ctx, const char *uart_params, bool debug, struct thread_pool *pool, diff -Nru libiio-0.24/iiod/serial.c libiio-0.25/iiod/serial.c --- libiio-0.24/iiod/serial.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/serial.c 2023-08-09 15:58:07.000000000 +0000 @@ -124,10 +124,18 @@ CASE_BPS(1152000, &tty_attrs); CASE_BPS(1500000, &tty_attrs); CASE_BPS(2000000, &tty_attrs); +#ifdef B2500000 /* Not available on all architectures, i.e. sparc */ CASE_BPS(2500000, &tty_attrs); +#endif +#ifdef B3000000 /* Not available on all architectures, i.e. sparc */ CASE_BPS(3000000, &tty_attrs); +#endif +#ifdef B3500000 /* Not available on all architectures, i.e. sparc */ CASE_BPS(3500000, &tty_attrs); +#endif +#ifdef B4000000 /* Not available on all architectures, i.e. sparc */ CASE_BPS(4000000, &tty_attrs); +#endif default: IIO_ERROR("Invalid baud rate\n"); return -EINVAL; diff -Nru libiio-0.24/iiod/thread-pool.c libiio-0.25/iiod/thread-pool.c --- libiio-0.24/iiod/thread-pool.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/thread-pool.c 2023-08-09 15:58:07.000000000 +0000 @@ -157,11 +157,18 @@ } while (ret == -1 && errno == EINTR); } -void thread_pool_stop_and_wait(struct thread_pool *pool) +static void thread_pool_purge_events(struct thread_pool *pool) { uint64_t e; int ret; + do { + ret = read(pool->stop_fd, &e, sizeof(e)); + } while (ret != -1 || errno == EINTR); +} + +void thread_pool_stop_and_wait(struct thread_pool *pool) +{ thread_pool_stop(pool); pthread_mutex_lock(&pool->thread_count_lock); @@ -170,9 +177,7 @@ &pool->thread_count_lock); pthread_mutex_unlock(&pool->thread_count_lock); - do { - ret = read(pool->stop_fd, &e, sizeof(e)); - } while (ret != -1 || errno == EINTR); + thread_pool_purge_events(pool); } bool thread_pool_is_stopped(const struct thread_pool *pool) @@ -180,6 +185,14 @@ return pool->stop; } +void thread_pool_restart(struct thread_pool *pool) +{ + if (pool->stop) { + thread_pool_purge_events(pool); + pool->stop = false; + } +} + void thread_pool_destroy(struct thread_pool *pool) { pthread_mutex_destroy(&pool->thread_count_lock); diff -Nru libiio-0.24/iiod/thread-pool.h libiio-0.25/iiod/thread-pool.h --- libiio-0.24/iiod/thread-pool.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/thread-pool.h 2023-08-09 15:58:07.000000000 +0000 @@ -19,6 +19,7 @@ void thread_pool_stop(struct thread_pool *pool); void thread_pool_stop_and_wait(struct thread_pool *pool); bool thread_pool_is_stopped(const struct thread_pool *pool); +void thread_pool_restart(struct thread_pool *pool); void thread_pool_destroy(struct thread_pool *pool); diff -Nru libiio-0.24/iiod/usbd.c libiio-0.25/iiod/usbd.c --- libiio-0.24/iiod/usbd.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iiod/usbd.c 2023-08-09 15:58:07.000000000 +0000 @@ -217,7 +217,6 @@ thread_pool_destroy(pdata->pool[i]); } - close(pdata->ep0_fd); free(pdata->ffs); free(pdata->pool); free(pdata); @@ -328,14 +327,34 @@ return 0; } +int init_usb_daemon(const char *ffs, unsigned int nb_pipes) +{ + char buf[256]; + int ep0_fd, ret; + + snprintf(buf, sizeof(buf), "%s/ep0", ffs); + + ep0_fd = open(buf, O_RDWR); + if (ep0_fd < 0) { + return -errno; + } + + ret = write_header(ep0_fd, nb_pipes); + if (ret < 0) { + close(ep0_fd); + return ret; + } + + return ep0_fd; +} + int start_usb_daemon(struct iio_context *ctx, const char *ffs, bool debug, bool use_aio, unsigned int nb_pipes, - struct thread_pool *pool, + int ep0_fd, struct thread_pool *pool, const void *xml_zstd, size_t xml_zstd_len) { struct usbd_pdata *pdata; unsigned int i; - char buf[256]; int ret; pdata = zalloc(sizeof(*pdata)); @@ -356,18 +375,6 @@ goto err_free_pdata_pool; } - snprintf(buf, sizeof(buf), "%s/ep0", ffs); - - pdata->ep0_fd = open(buf, O_RDWR); - if (pdata->ep0_fd < 0) { - ret = -errno; - goto err_free_ffs; - } - - ret = write_header(pdata->ep0_fd, nb_pipes); - if (ret < 0) - goto err_close_ep0; - for (i = 0; i < nb_pipes; i++) { pdata->pool[i] = thread_pool_new(); if (!pdata->pool[i]) { @@ -381,6 +388,7 @@ pdata->use_aio = use_aio; pdata->xml_zstd = xml_zstd; pdata->xml_zstd_len = xml_zstd_len; + pdata->ep0_fd = ep0_fd; ret = thread_pool_add_thread(pool, usbd_main, pdata, "usbd_main_thd"); if (!ret) @@ -393,9 +401,6 @@ if (pdata->pool[i]) thread_pool_destroy(pdata->pool[i]); } -err_close_ep0: - close(pdata->ep0_fd); -err_free_ffs: free(pdata->ffs); err_free_pdata_pool: free(pdata->pool); diff -Nru libiio-0.24/iio.h libiio-0.25/iio.h --- libiio-0.24/iio.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iio.h 2023-08-09 15:58:07.000000000 +0000 @@ -190,6 +190,12 @@ IIO_MOD_ETHANOL, IIO_MOD_H2, IIO_MOD_O2, + IIO_MOD_LINEAR_X, + IIO_MOD_LINEAR_Y, + IIO_MOD_LINEAR_Z, + IIO_MOD_PITCH, + IIO_MOD_YAW, + IIO_MOD_ROLL, }; /** @@ -206,6 +212,8 @@ IIO_EV_TYPE_THRESH_ADAPTIVE, IIO_EV_TYPE_MAG_ADAPTIVE, IIO_EV_TYPE_CHANGE, + IIO_EV_TYPE_MAG_REFERENCED, + IIO_EV_TYPE_GESTURE, }; /** @@ -219,6 +227,8 @@ IIO_EV_DIR_RISING, IIO_EV_DIR_FALLING, IIO_EV_DIR_NONE, + IIO_EV_DIR_SINGLETAP, + IIO_EV_DIR_DOUBLETAP, }; #endif /* _IIO_TYPES_H_ */ @@ -465,6 +475,8 @@ * - ip:192.168.1.119:40000 Port 40000 * - ip:2601:190:400:da:47b3:55ab:3914:bff1 Default Port * - ip:[2601:190:400:da:9a90:96ff:feb5:acaa]:40000 Port 40000 + * - ip:fe80::f14d:3728:501e:1f94%eth0 Link-local through eth0, default port + * - ip:[fe80::f14d:3728:501e:1f94%eth0]:40000 Link-local through eth0, port 40000 * - USB backend, "usb:"\n When more than one usb device is attached, requires * bus, address, and interface parts separated with a dot. For example * "usb:3.32.5". Where there is only one USB device attached, the shorthand diff -Nru libiio-0.24/iio-private.h libiio-0.25/iio-private.h --- libiio-0.24/iio-private.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/iio-private.h 2023-08-09 15:58:07.000000000 +0000 @@ -264,6 +264,7 @@ char *iio_strtok_r(char *str, const char *delim, char **saveptr); size_t iio_strlcpy(char * __restrict dst, const char * __restrict src, size_t dsize); char * iio_getenv (char * envvar); +uint64_t iio_read_counter_us(void); int iio_context_add_device(struct iio_context *ctx, struct iio_device *dev); diff -Nru libiio-0.24/local.c libiio-0.25/local.c --- libiio-0.24/local.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/local.c 2023-08-09 15:58:07.000000000 +0000 @@ -96,7 +96,7 @@ unsigned int nb_protected_attrs; }; -static const char * const device_attrs_blacklist[] = { +static const char * const device_attrs_denylist[] = { "dev", "uevent", }; @@ -926,7 +926,7 @@ /* * Set watermark to the buffer size; the driver will adjust to its - * maximum if it's too high without issueing an error. + * maximum if it's too high without issuing an error. */ ret = local_write_dev_attr(dev, "buffer/watermark", buf, strlen(buf) + 1, false); @@ -1265,8 +1265,8 @@ { unsigned int i; - for (i = 0; i < ARRAY_SIZE(device_attrs_blacklist); i++) - if (!strcmp(device_attrs_blacklist[i], attr)) + for (i = 0; i < ARRAY_SIZE(device_attrs_denylist); i++) + if (!strcmp(device_attrs_denylist[i], attr)) return 0; if (!strcmp(attr, "name")) @@ -2170,14 +2170,14 @@ char *names = (char *)d; size_t len; - if (!strstr(path, "iio:device")) + if (!strstr(path, "iio:device") && !(WITH_HWMON && strstr(path, "class/hwmon"))) return 0; iio_snprintf(buf, sizeof(buf), "%s/name", path); dst = cat_file(buf); if (dst) { len = strnlen(names, sizeof(buf)); - iio_snprintf(&names[len], BUF_SIZE - len - 1, "%s, ", dst); + iio_snprintf(&names[len], BUF_SIZE - len - 1, "%s,", dst); free(dst); } return 0; @@ -2195,15 +2195,32 @@ bool exists = false; char *desc, *uri, *machine, buf[2 * BUF_SIZE], names[BUF_SIZE]; int ret; + bool no_iio; ret = foreach_in_dir(&exists, "/sys/bus/iio", true, check_device); - if (ret < 0 || !exists) + no_iio = ret == -ENOENT; + if (WITH_HWMON && no_iio) + ret = 0; /* Not an error, unless we also have no hwmon devices */ + if (ret < 0) return 0; names[0] = '\0'; - ret = foreach_in_dir(&names, "/sys/bus/iio/devices", true, build_names); - if (ret < 0) - return 0; + if (!no_iio) { + ret = foreach_in_dir(&names, "/sys/bus/iio/devices", true, build_names); + if (ret < 0) + return 0; + } + + if (WITH_HWMON) { + ret = foreach_in_dir(&exists, "/sys/class/hwmon", true, check_device); + if (ret == -ENOENT && !no_iio) + ret = 0; /* IIO devices but no hwmon devices - not an error */ + if (ret < 0) + return 0; + ret = foreach_in_dir(&names, "/sys/class/hwmon", true, build_names); + if (ret < 0) + return 0; + } machine = cat_file("/sys/firmware/devicetree/base/model"); if (!machine) @@ -2212,7 +2229,7 @@ if (machine) { if (names[0]) { ret = strnlen(names, sizeof(names)); - names[ret - 2] = '\0'; + names[ret - 1] = '\0'; iio_snprintf(buf, sizeof(buf), "(%s on %s)", names, machine); } else iio_snprintf(buf, sizeof(buf), "(Local IIO devices on %s)", machine); diff -Nru libiio-0.24/mainpage.dox libiio-0.25/mainpage.dox --- libiio-0.24/mainpage.dox 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/mainpage.dox 2023-08-09 15:58:07.000000000 +0000 @@ -11,7 +11,7 @@ This open-source license allows anyone to use the library for proprietary or open-source, commercial or non-commercial applications. -Seperately, the IIO Library also includes a set of test examples and utilities, (collectively known as iio-utils) which are developed and released under the terms of the GNU General Public License, version 2 or (at your option) any later version. +Separately, the IIO Library also includes a set of test examples and utilities, (collectively known as iio-utils) which are developed and released under the terms of the GNU General Public License, version 2 or (at your option) any later version. The full terms of the library license can be found at: http://opensource.org/licenses/LGPL-2.1 and the iio-utils license can be found at: https://opensource.org/licenses/GPL-2.0 @@ -26,8 +26,12 @@ - A iio_device object may contain zero or more iio_channel objects. A iio_channel object is associated with only one iio_device. - A iio_device object may be associated with one iio_buffer object, and a iio_buffer object is associated with only one iio_device. +@if CPP_BINDINGS +A C++ API is provided in @ref iiopp.h +@endif + @section scan_contexts Scanning for IIO contexts -The first step when dealing with a collection of IIO devices (known as a context) is to find the context. This can be connected via usb, network, serial or local. Having these different connectivity options could prove to be problematic, but libiio abstracts the low level communications away, and allows you just to find contexts, and talk to devices without being interested in the low level aspects. Many find this convinent to develop applications and algorithms on a host, and quickly move to an embedded Linux system without having to change any code. +The first step when dealing with a collection of IIO devices (known as a context) is to find the context. This can be connected via usb, network, serial or local. Having these different connectivity options could prove to be problematic, but libiio abstracts the low level communications away, and allows you just to find contexts, and talk to devices without being interested in the low level aspects. Many find this convenient to develop applications and algorithms on a host, and quickly move to an embedded Linux system without having to change any code. To find what IIO contexts are available, use the following: - iio_create_scan_context(): Create a iio_scan_context object. Depending on what backends were enabled with compiling the library, some of them may not be available. The first argument to this function is a string which is used as a filter ("usb:", "ip:", "local:", "usb:ip", where the default (NULL) means any backend that is compiled in). @@ -274,4 +278,7 @@ \example adrv9009-iiostream.c This example libiio program is meant to exercise the features of IIO functionality on the ADRV9009. \example dummy-iiostream.c This example libiio program is meant to exercise the features of IIO present in the sample dummy IIO device in the linux kernel. \example iio-monitor.c A Curses based application which implements real time monitoring of IIO non-buffer samples. +@if CPP_BINDINGS +\example iiopp-enum.cpp This example demonstrates usage of the C++ API to enumerate devices, channels and attributes. +@endif */ diff -Nru libiio-0.24/man/CMakeLists.txt libiio-0.25/man/CMakeLists.txt --- libiio-0.24/man/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,5 +1,7 @@ +# it doesn't make sense to create man pages on windows, so we don't really +# worry about that. + if (WITH_MAN) - find_program(BASH_EXECUTABLE bash) find_program(DATE_EXECUTABLE date) if (DEFINED ENV{SOURCE_DATE_EPOCH}) execute_process( @@ -14,10 +16,12 @@ ${CMAKE_CURRENT_SOURCE_DIR}/make_man.sh.in ${CMAKE_CURRENT_BINARY_DIR}/make_man.sh @ONLY) execute_process( - COMMAND ${BASH_EXECUTABLE} "-c" "${CMAKE_CURRENT_BINARY_DIR}/make_man.sh > ${CMAKE_BINARY_DIR}/libiio.3.in" - ) + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/make_man.sh + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/libiio.3.in + ) + configure_file( - ${CMAKE_BINARY_DIR}/libiio.3.in + ${CMAKE_CURRENT_BINARY_DIR}/libiio.3.in ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/libiio.3 @ONLY) if (WITH_DOC) @@ -26,7 +30,7 @@ message(FATAL_ERROR "Can not build html DOC from man without man2html") endif() message(STATUS "Building html doc pages with man2html") - file(MAKE_DIRECTORY ${CMAKE_HTML_DEST_DIR}/man3) + file(MAKE_DIRECTORY ${CMAKE_HTML_DEST_DIR}/man1 ${CMAKE_HTML_DEST_DIR}/man3) execute_process( COMMAND ${MAN2HTML} -r INPUT_FILE ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/libiio.3 @@ -34,22 +38,33 @@ ) endif() if (WITH_TESTS) - list(APPEND MAN1 iio_attr.1 iio_info.1 iio_readdev.1 iio_reg.1 iio_writedev.1) - foreach(_page ${MAN1}) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/${_page}.in - ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/${_page} @ONLY) - endforeach() - if (WITH_DOC) - file(MAKE_DIRECTORY ${CMAKE_HTML_DEST_DIR}/man1) - foreach(_page ${MAN1}) + foreach(_page ${IIO_TESTS_TARGETS}) + execute_process( + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/make_util_pages.sh + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_page}.1.in + OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_page}.1.in + ) + configure_file( + ${CMAKE_CURRENT_BINARY_DIR}/${_page}.1.in + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/${_page}.1 @ONLY + ) + + if (WITH_DOC) execute_process( COMMAND ${MAN2HTML} -r INPUT_FILE ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/${_page} OUTPUT_FILE ${CMAKE_HTML_DEST_DIR}/man1/${_page}.html ) - endforeach() - endif() + endif() + endforeach() endif() + + if (WITH_IIOD) + configure_file(iiod.1.in + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR}/iiod.1 @ONLY + ) + endif() + # install man files into the BINARY directories, # section 3 = library functions install(DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_MANDIR} @@ -61,8 +76,8 @@ COMPONENT doc FILES_MATCHING PATTERN "*.1*") endif() -list(APPEND IIOM_FEATURES_${WITH_MAN} man) -list(APPEND IIOM_FEATURES_${WITH_TESTS} man-utils) +toggle_iio_feature("${WITH_MAN}" man) +toggle_iio_feature("${WITH_TESTS}" man-utils) -set(IIOM_FEATURES_ON "${IIOM_FEATURES_ON}" PARENT_SCOPE) -set(IIOM_FEATURES_OFF "${IIOM_FEATURES_OFF}" PARENT_SCOPE) +set(IIOM_FEATURES_ON "${IIO_FEATURES_ON}" PARENT_SCOPE) +set(IIOM_FEATURES_OFF "${IIO_FEATURES_OFF}" PARENT_SCOPE) diff -Nru libiio-0.24/man/iio_attr.1.in libiio-0.25/man/iio_attr.1.in --- libiio-0.24/man/iio_attr.1.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/iio_attr.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -82,45 +82,11 @@ .TP .B \-D \-\-debug-attr Read and Write IIO Debug attributes -.TP -.B \-S, \-\-scan -Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. -Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. -vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) -If no argument is given, it checks all that are availble. -.TP -.B \-h, \-\-help -Tells -.I iio_attr -to display some help, and then quit. - +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## .SH OPTIONS -.TP -.B \-a, \-\-auto -Look around for devices (locally, ip, and usb), and if there is only one device -found, connect to it. -.TP -.B \-u, \-\-uri -The Uniform Resource Identifier -.I (uri) -for connecting to devices, can be one of: -.RS -.IP ip:[address] -network address, either numeric (192.168.0.1) or network hostname (pluto.local) -.IP ip: -blank, if compiled with zeroconf support, will find an IIO device on network -.IP usb:[device:port:instance] -normally returned from -.B iio_info -s -or -.B iio_attr -S -.IP usb: -blank, if there is only one IIO device plugged into USB, find it, and attach to it. -.IP serial:[port],[baud],[config] -serial configuration, serial:/dev/ttyUSB0,115200,8n1 115200 baud, 8 data bits, no partity, one stop bit -.IP local: -with no address part -.RE +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## .TP .B \-i, \-\-input-channel Filters channels by input channels only @@ -140,23 +106,3 @@ .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. -.SH "SEE ALSO" -.ad l -.BR iio_attr (1), -.BR iio_info (1), -.BR iio_readdev (1), -.BR iio_reg (1), -.BR iio_writedev (1), -.BR libiio (3) -.PP -libiio home page: -.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio -.PP -libiio code: -.BR \%https://github.com/analogdevicesinc/libiio -.PP -Doxygen for libiio -.BR \%https://analogdevicesinc.github.io/libiio/ -.SH BUGS -All bugs are tracked at: -.BR \%https://github.com/analogdevicesinc/libiio/issues diff -Nru libiio-0.24/man/iio_common_cmds.1 libiio-0.25/man/iio_common_cmds.1 --- libiio-0.24/man/iio_common_cmds.1 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iio_common_cmds.1 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,18 @@ +.TP +.B \-h, \-\-help +Tells +.I ##APP_NAME## +to display some help, and then quit. +.TP +.B \-V, \-\-version +Prints the version information for this particular copy of +.I ##APP_NAME## +and the version of the libiio library it is using. This is useful for knowing if the version of the library and +.I ##APP_NAME## +on your system are up to date. This is also useful when reporting bugs. +.TP +.B \-S, \-\-scan [backends] +Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip:usb'. +Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456,b673'. +vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) +If no argument is given, it checks all that are available. diff -Nru libiio-0.24/man/iio_common_footer.1 libiio-0.25/man/iio_common_footer.1 --- libiio-0.24/man/iio_common_footer.1 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iio_common_footer.1 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,20 @@ +.SH "SEE ALSO" +.ad l +.BR iio_attr (1), +.BR iio_info (1), +.BR iio_readdev (1), +.BR iio_reg (1), +.BR iio_writedev (1), +.BR libiio (3) +.PP +libiio home page: +.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio +.PP +libiio code: +.BR \%https://github.com/analogdevicesinc/libiio +.PP +Doxygen for libiio +.BR \%https://analogdevicesinc.github.io/libiio/ +.SH BUGS +All bugs are tracked at: +.BR \%https://github.com/analogdevicesinc/libiio/issues diff -Nru libiio-0.24/man/iio_common_opts.1 libiio-0.25/man/iio_common_opts.1 --- libiio-0.24/man/iio_common_opts.1 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iio_common_opts.1 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,36 @@ +.TP +.B \-u, \-\-uri +The Uniform Resource Identifier +.I (uri) +for connecting to devices, can be one of: +.RS +.IP ip:[address] +network address, either numeric (192.168.0.1) or network hostname +.IP ip: +blank, if compiled with zeroconf support, will find an IIO device on network +.IP usb:[device:port:instance] +normally returned from +.B ##APP_NAME## -S +.IP serial:[port],[baud],[settings] +which are controlled, and need to match the iiod (or tinyiiod) on the other end of the serial port. +.RS +.IP [port] +is something like '/dev/ttyUSB0' on Linux, and 'COM4' on Windows. +.IP [baud] +is is normally one of 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200 [default], 128000 or 256000, but can vary system to system. +.IP [settings] +would normally be configured as '8n1' this is controlled by: +.RS +.IP data_bits: +(5, 6, 7, 8 [default], or 9) +.IP parity_bits: +('n' none [default], 'o' odd, 'e' even, 'm' mark, or 's' space) +.IP stop_bits: +(1 [default, or 2) +.IP flow_control: +('0' none [default], 'x' Xon Xoff, 'r' RTSCTS, or 'd' DTRDSR) +.RE +.RE +.IP local: +with no address part. +.RE diff -Nru libiio-0.24/man/iiod.1.in libiio-0.25/man/iiod.1.in --- libiio-0.24/man/iiod.1.in 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iiod.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,108 @@ +.\" Copyright (c) 2018-2020 Robin Getz +.\" Copyright (c) 2018-2020 Analog Devices Inc. +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.TH iiod 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" +.IX iiod +.SH NAME +iiod \- IIO Daemon +.SH SYNOPSIS +.B iiod +[ +.I options +] + +.SH DESCRIPTION +.B iiod +is a server built on top of Libiio which can share a Libiio context across the +network, USB, or a UART link. + +.SH COMMANDS +.TP +.B \-V, \-\-version +Display the version of this program. +.TP +.B \-d, \-\-debug +Use alternative (incompatible) debug interface. +.TP +.B \-D, \-\-demux +Demux channels directly on the server. +.TP +.B \-i, \-\-interactive +Run iiod in the controlling terminal. +.TP +.B \-a, \-\-aio +Use asynchronous I/O. +.TP +.B \-F, \-\-ffs +Use the given FunctionFS mountpoint to serve over USB. +.TP +.B \-n, \-\-nb\-pipes +Specify the number of USB pipes (ep couples) to use. +.TP +.B \-s, \-\-serial +Run iiod on the specified UART. +.TP +.B \-p, \-\-port +Port to listen on (default = 30431). +Using --port 0 will pick an ephemeral port (dynamic / unused in the range between 32768–60999). +.TP +.B \-u, \-\-uri +The Uniform Resource Identifier +.I (uri) +for connecting to devices, can be one of: +.RS +.IP ip:[address] +network address, either numeric (192.168.0.1) or network hostname +.IP ip: +blank, if compiled with zeroconf support, will find an IIO device on network +.IP usb:[device:port:instance] +normally returned from +.B iio_info -S +.IP serial:[port],[baud],[settings] +which are controlled, and need to match the iiod (or tinyiiod) on the other end of the serial port. +.RS +.IP [port] +is something like '/dev/ttyUSB0' on Linux, and 'COM4' on Windows. +.IP [baud] +is is normally one of 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200 [default], 128000 or 256000, but can vary system to system. +.IP [settings] +would normally be configured as '8n1' this is controlled by: +.RS +.IP data_bits: +(5, 6, 7, 8 [default], or 9) +.IP parity_bits: +('n' none [default], 'o' odd, 'e' even, 'm' mark, or 's' space) +.IP stop_bits: +(1 [default, or 2) +.IP flow_control: +('0' none [default], 'x' Xon Xoff, 'r' RTSCTS, or 'd' DTRDSR) +.RE +.RE +.IP local: +with no address part. This is the default. +.RE +.TP + +.SH RETURN VALUE +If the specified device is not found, a non-zero exit code is returned. diff -Nru libiio-0.24/man/iio_genxml.1.in libiio-0.25/man/iio_genxml.1.in --- libiio-0.24/man/iio_genxml.1.in 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iio_genxml.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,46 @@ +.\" Copyright (c) 2018-2020 Robin Getz +.\" Copyright (c) 2018-2020 Analog Devices Inc. +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.TH iio_genxml 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" +.IX iio_genxml +.SH NAME +iio_genxml \- Generate XML representation of a Libiio context +.SH SYNOPSIS +.B iio_genxml +[ +.I options +] + +.SH DESCRIPTION +.B iio_genxml +is a utility for generating a XML representation of a Libiio context. + +.SH OPTIONS +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## + +.SH RETURN VALUE +If the specified device is not found, a non-zero exit code is returned. diff -Nru libiio-0.24/man/iio_info.1.in libiio-0.25/man/iio_info.1.in --- libiio-0.24/man/iio_info.1.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/iio_info.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -31,58 +31,16 @@ [ .I options ] --x -.br -.B iio_info -[ -.I options -] --n -.br -.B iio_info -[ -.I options -] -u .SH DESCRIPTION .B iio_info is a utility for displaying information about local or remote IIO devices .SH OPTIONS -.TP -.B \-h, \-\-help -Tells -.I iio_info -to display some help, and then quit. -.TP -.B \-x, \-\-xml -Use the XML backend with the provided XML file -.TP -.B \-n, \-\-network -Use the network backend with the provided hostname -.TP -.B \-u, \-\-uri -The Uniform Resource Identifier -.I (uri) -for connecting to devices, can be one of: -.RS -.IP ip:[address] -network address, either numeric (192.168.0.1) or network hostname -.IP ip: -blank, if compiled with zeroconf support, will find an IIO device on network -.IP usb:[device:port:instance] -normally returned from -.B iio_info -s -.IP serial:[port] -.IP local -with no address part -.RE -.TP -.B \-S, \-\-scan -Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. -Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. -vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) -If no argument is given, it checks all that are availble. +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## .TP .B \-a, \-\-auto Scan for available contexts and if only one is available use it. @@ -90,23 +48,3 @@ .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. -.SH "SEE ALSO" -.ad l -.BR iio_attr (1), -.BR iio_info (1), -.BR iio_readdev (1), -.BR iio_reg (1), -.BR iio_writedev (1), -.BR libiio (3) -.PP -libiio home page: -.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio -.PP -libiio code: -.BR \%https://github.com/analogdevicesinc/libiio -.PP -Doxygen for libiio -.BR \%https://analogdevicesinc.github.io/libiio/ -.SH BUGS -All bugs are tracked at: -.BR \%https://github.com/analogdevicesinc/libiio/issues diff -Nru libiio-0.24/man/iio_readdev.1.in libiio-0.25/man/iio_readdev.1.in --- libiio-0.24/man/iio_readdev.1.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/iio_readdev.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -37,30 +37,8 @@ is a utility for reading buffers from connected IIO devices, and sending resutls to standard out. .SH OPTIONS -.TP -.B \-h, \-\-help -Tells -.I iio_readdev -to display some help, and then quit. -.B \-n, \-\-network -Use the network backend with the provided hostname -.TP -.B \-u, \-\-uri -The Uniform Resource Identifier -.I (uri) -for connecting to devices, can be one of: -.RS -.IP ip:[address] -network address, either numeric (192.168.0.1) or network hostname -.IP ip: -blank, if compiled with zeroconf support, will find an IIO device on network -.IP usb:[device:port:instance] -normally returned from -.B iio_info -s -.IP serial:[port] -.IP local -with no address part -.RE +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## .TP .B \-t \-\-trigger Use the specified trigger, if needed on the specified channel @@ -73,35 +51,31 @@ .TP .B \-T \-\-timeout Buffer timeout in milliseconds. 0 = no timeout. Default is 0. -.TP -.B \-a, \-\-auto -Scan for available contexts and if only one is available use it. -.TP -.B \-S, \-\-scan -Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. -Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. -vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) -If no argument is given, it checks all that are availble. +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. .SH "USAGE" .PP You use iio_readdev in the same way you use many of the other libiio utilities. -You must specify a IIO device, and the specific channel to read. Since this is a read, channels must be input. -It is easy to use -.B iio_attr -to find out what the channels are called. -.PP -This identifies the device, and channel that can be used. +You should specify a IIO device, and the specific channel to read. Since this is a read, channels must be input. +If no channel is provided, iio_readdev will read from all input channels. +If no device is provided, iio_readdev will print a few examples: .RS -.B \f(CWiio_attr \-a \-i \-c .\fP +.B \f(CWiio_readdev -a\fP .br -\f(CWUsing auto-detected IIO context at URI "usb:3.10.5"\fP +Using auto-detected IIO context at URI "usb:3.10.5" .br -dev 'cf-ad9361-lpc', channel 'voltage0' (input, index: 0, format: le:S12/16>>0) +Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage0 .br -dev 'cf-ad9361-lpc', channel 'voltage1' (input, index: 1, format: le:S12/16>>0) +Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage1 +.br +Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage2 +.br +Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage3 +.br +Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc .RE .PP This captures 1024 samples of I and Q data from the USB attached AD9361, and @@ -115,23 +89,3 @@ .B \f(WCgnuplot \-e \(dq\&set term png; set output 'sample.png'; plot 'sample.dat' binary format='%short%short' using 1 with lines, 'sample.dat' binary format='%short%short' using 2 with lines;\(dq\&\fP .RE -.SH "SEE ALSO" -.ad l -.BR iio_attr (1), -.BR iio_info (1), -.BR iio_readdev (1), -.BR iio_reg (1), -.BR iio_writedev (1), -.BR libiio (3) -.PP -libiio home page: -.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio -.PP -libiio code: -.BR \%https://github.com/analogdevicesinc/libiio -.PP -Doxygen for libiio -.BR \%https://analogdevicesinc.github.io/libiio/ -.SH BUGS -All bugs are tracked at: -.BR \%https://github.com/analogdevicesinc/libiio/issues diff -Nru libiio-0.24/man/iio_reg.1.in libiio-0.25/man/iio_reg.1.in --- libiio-0.24/man/iio_reg.1.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/iio_reg.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -34,7 +34,7 @@ [] .SH DESCRIPTION .B iio_reg -is a utility for debugging local IIO devices. +is a utility for debugging local or remote IIO devices. It should not be used by normal users, and is normally used by driver developers during development, or by end users debugging a driver, or sending in a feature request. @@ -42,33 +42,11 @@ This can be useful when troubleshooting IIO devices, and understanding how the Linux IIO subsystem is managing the device. -This IIO utility does not work across a network or USB context. .SH OPTIONS -.TP -.B \-h, \-\-help -Tells -.I iio_reg -to display some help, and then quit. +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. -.SH "SEE ALSO" -.ad l -.BR iio_attr (1), -.BR iio_info (1), -.BR iio_readdev (1), -.BR iio_reg (1), -.BR iio_writedev (1), -.BR libiio (3) -.PP -libiio home page: -.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio -.PP -libiio code: -.BR \%https://github.com/analogdevicesinc/libiio -.PP -Doxygen for libiio -.BR \%https://analogdevicesinc.github.io/libiio/ -.SH BUGS -All bugs are tracked at: -.BR \%https://github.com/analogdevicesinc/libiio/issues diff -Nru libiio-0.24/man/iio_stresstest.1.in libiio-0.25/man/iio_stresstest.1.in --- libiio-0.24/man/iio_stresstest.1.in 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/iio_stresstest.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,69 @@ +.\" Copyright (c) 2018-2020 Robin Getz +.\" Copyright (c) 2018-2020 Analog Devices Inc. +.\" +.\" %%%LICENSE_START(GPLv2+_DOC_FULL) +.\" This is free documentation; you can redistribute it and/or +.\" modify it under the terms of the GNU General Public License as +.\" published by the Free Software Foundation; either version 2 of +.\" the License, or (at your option) any later version. +.\" +.\" The GNU General Public License's references to "object code" +.\" and "executables" are to be interpreted as the output of any +.\" document formatting or typesetting system, including +.\" intermediate and printed output. +.\" +.\" This manual is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public +.\" License along with this manual; if not, see +.\" . +.\" %%%LICENSE_END +.\" +.TH iio_stresstest 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" +.IX iio_stresstest +.SH NAME +iio_stresstest \- Stress test program for Libiio +.SH SYNOPSIS +.B iio_stresstest +[ +.I options +] +-u +.SH DESCRIPTION +.B iio_stresstest +is a stress-testing program that can be used to find bugs in Libiio or in the Libiio daemon (IIOD). + + +.SH OPTIONS +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## +.TP +.B \-a, \-\-auto +Scan for available contexts and if only one is available use it. +.TP +.B \-T, \-\-timeout +Context timeout in milliseconds. 0 = no timeout (wait forever) +.TP +.B \-b, \-\-buffer\-size +Size of the capture buffer. Default is 256. +.TP +.B \-s, \-\-samples +Number of samples to capture, 0 = infinite. Default is 0. +.TP +.B \-d, \-\-duration +Time to wait (in seconds) before stopping all threads +.TP +.B \-t, \-\-threads +Number of threads to use +.TP +.B \-v, \-\-verbose +Increase verbosity (-vv and -vvv for more) + +.SH RETURN VALUE +If the specified device is not found, a non-zero exit code is returned. + diff -Nru libiio-0.24/man/iio_writedev.1.in libiio-0.25/man/iio_writedev.1.in --- libiio-0.24/man/iio_writedev.1.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/iio_writedev.1.in 2023-08-09 15:58:07.000000000 +0000 @@ -31,42 +31,14 @@ [ .I options ] -[-n ] [-t ] [-T ] [-b ] [-s ] [ ...] +[-t ] [-T ] [-b ] [-s ] [ ...] .SH DESCRIPTION .B iio_reg is a utility for writing buffers from connected IIO devices. .SH OPTIONS -.TP -.B \-h, \-\-help -Tells -.I iio_readdev -to display some help, and then quit. -.B \-n, \-\-network -Use the network backend with the provided hostname -.TP -.B \-u, \-\-uri -The Uniform Resource Identifier -.I (uri) -for connecting to devices, can be one of: -.RS -.IP ip:[address] -network address, either numeric (192.168.0.1) or network hostname -.IP ip: -blank, if compiled with zeroconf support, will find an IIO device on network -.IP usb:[device:port:instance] -normally returned from -.B iio_info -s -.IP serial:[port] -.IP local -with no address part -.TP -.B \-S, \-\-scan -Scan for available IIO contexts, optional arg of specific backend(s) 'ip', 'usb' or 'ip,usb'. -Specific options for USB include Vendor ID, Product ID to limit scanning to specific devices 'usb=0456:b673'. -vid,pid are hexadecimal numbers (no prefix needed), "*" (match any for pid only) -If no argument is given, it checks all that are availble. -.RE +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## .TP .B \-t \-\-trigger Use the specified trigger, if needed on the specified channel @@ -80,32 +52,34 @@ .B \-T \-\-timeout Buffer timeout in milliseconds. 0 = no timeout. Default is 0. .TP -.B \-a, \-\-auto -Scan for available contexts and if only one is available use it. -.TP .B \-c \-\-cyclic Use cyclic buffer mode. +##COMMON_OPTION_START## +##COMMON_OPTION_STOP## .SH RETURN VALUE If the specified device is not found, a non-zero exit code is returned. .SH "USAGE" .PP -You use iio_readdev in the same way you use many of the other libiio utilities. -You must specify a IIO device, and the specific channel to read. Since this is a write, channels must be output. -It is easy to use -.B iio_attr -to find out what the channels are called. -.PP -This identifies the device, and channel that can be used. +You use iio_writedev in the same way you use many of the other libiio utilities. +You should specify a IIO device, and the specific channel to write. Since this is a write, channels must be output. +If no channel is provided, iio_writedev will write to all output channels. +If no device is provided, iio_writedev will print a few examples: .RS -.B \f(CWiio_attr \-a \-o \-c .\fP +.B \f(CWiio_writedev -a\fP .br -\f(CWUsing auto-detected IIO context at URI "usb:3.10.5"\fP +Using auto-detected IIO context at URI "usb:3.10.5" .br -dev 'cf-ad9361-dds-core-lpc', channel 'voltage0' (output, index: 0, format: le:S16/16>>0) +Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage0 .br -dev 'cf-ad9361-dds-core-lpc', channel 'voltage1' (output, index: 1, format: le:S16/16>>0) +Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage1 +.br +Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage2 +.br +Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc voltage3 +.br +Example : iio_writedev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-dds-core-lpc .RE .PP This sends 1024 samples of I and Q data to the USB attached AD9361. data is taking from standard in, in a binary format. @@ -113,23 +87,4 @@ .B \f(CWiio_writedev \-a \-s 1024 cf-ad9361-dds-core-lpc voltage0 voltage1 < ./samples.dat\fP .RE -.SH "SEE ALSO" -.ad l -.BR iio_attr (1), -.BR iio_info (1), -.BR iio_readdev (1), -.BR iio_reg (1), -.BR iio_writedev (1), -.BR libiio (3) -.PP -libiio home page: -.BR \%https://wiki.analog.com/resources/tools-software/linux-software/libiio -.PP -libiio code: -.BR \%https://github.com/analogdevicesinc/libiio -.PP -Doxygen for libiio -.BR \%https://analogdevicesinc.github.io/libiio/ -.SH BUGS -All bugs are tracked at: -.BR \%https://github.com/analogdevicesinc/libiio/issues + diff -Nru libiio-0.24/man/make_man.sh.in libiio-0.25/man/make_man.sh.in --- libiio-0.24/man/make_man.sh.in 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/man/make_man.sh.in 2023-08-09 15:58:07.000000000 +0000 @@ -32,7 +32,7 @@ .\" . .\" %%%LICENSE_END .\" -.\" This file is autogenerated, and should not be editted +.\" This file is autogenerated, and should not be edited .\" .if n .po 0 .TH INTRO 3LIBIIO "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" diff -Nru libiio-0.24/man/make_util_pages.sh libiio-0.25/man/make_util_pages.sh --- libiio-0.24/man/make_util_pages.sh 1970-01-01 00:00:00.000000000 +0000 +++ libiio-0.25/man/make_util_pages.sh 2023-08-09 15:58:07.000000000 +0000 @@ -0,0 +1,21 @@ +#!/bin/sh + +dir=$1 +if [ -z "${dir}" -o ! -f "${dir}/iio_common_cmds.1" -o ! -f "${dir}/iio_common_opts.1" -o ! -f "${dir}/iio_common_footer.1" ] ; then + echo "not pointing to src directory ${dir}" 1>&2 + exit +fi +file=$2 +if [ -z "${file}" -o ! -f "${file}" ] ; then + echo "missing 2nd argument file to manipulate ${file}" 1>&2 + exit +fi + +app=$(grep "^.TH" "${file}" | head -1 | awk '{print $2}') + +sed '/##COMMON_COMMANDS_START##/Q' "${file}" +sed "s/##APP_NAME##/${app}/g" "${dir}/iio_common_cmds.1" +sed -n '/^##COMMON_COMMANDS_STOP##/,${p;/^##COMMON_OPTION_START##/q}' "${file}" | grep -v "##COMMON_" +sed "s/##APP_NAME##/${app}/g" "${dir}/iio_common_opts.1" +sed -ne '/^##COMMON_OPTION_STOP#/,$ p' "${file}" | grep -v "##COMMON_OPTION_STOP##" +sed "s/##APP_NAME##/${app}/g" "${dir}/iio_common_footer.1" diff -Nru libiio-0.24/network.c libiio-0.25/network.c --- libiio-0.24/network.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/network.c 2023-08-09 15:58:07.000000000 +0000 @@ -320,7 +320,7 @@ if (errno == 0) { /* Windows uses numerical interface identifiers */ ptr = description + strnlen(description, len) + 1; - iio_snprintf(ptr, IF_NAMESIZE, "%u", in->sin6_scope_id); + iio_snprintf(ptr, IF_NAMESIZE, "%u", (unsigned int)in->sin6_scope_id); } else #endif { @@ -1060,7 +1060,7 @@ } #endif -struct iio_context * network_create_context(const char *host) +struct iio_context * network_create_context(const char *hostname) { struct addrinfo hints, *res; struct iio_context *ctx; @@ -1072,6 +1072,10 @@ char *description, *uri, *end, *port = NULL; char port_str[6]; uint16_t port_num = IIOD_PORT; + char host_buf[FQDN_LEN + sizeof(":65535") + 1]; + char *host = hostname ? host_buf : NULL; + + iio_strlcpy(host_buf, hostname, sizeof(host_buf)); #ifdef _WIN32 WSADATA wsaData; @@ -1126,8 +1130,10 @@ } if (port) { unsigned long int tmp; + + errno = 0; tmp = strtoul(port, &end, 0); - if (port == end || tmp > 0xFFFF) { + if (port == end || tmp > 0xFFFF || errno == ERANGE) { errno = ENOENT; return NULL; } diff -Nru libiio-0.24/README_BUILD.md libiio-0.25/README_BUILD.md --- libiio-0.24/README_BUILD.md 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/README_BUILD.md 2023-08-09 15:58:07.000000000 +0000 @@ -34,24 +34,29 @@ ## Configure & Build when configuring libiio with cmake, there are a few optional settings that you can use to control the build. +The recommendation is to leave things to the default. -Cmake Options | Default | Description | -------------------- | ------- | ---------------------------------------------- | -`BUILD_SHARED_LIBS` | ON | Build shared libraries | -`CMAKE_INSTALL_PREFIX` | `/usr` | default install path | -`ENABLE_PACKAGING` | OFF | Create .deb/.rpm or .tar.gz packages via 'make package' | -`CSHARP_BINDINGS` | OFF | Install C# bindings | -`PYTHON_BINDINGS` | OFF | Install PYTHON bindings | -`WITH_DOC` | OFF | Generate documentation with Doxygen and Sphinx | -`WITH_MAN` | OFF | Generate and install man pages | -`WITH_TESTS` | ON | Build the test programs (iio-utils) | -`INSTALL_UDEV_RULE` | ON | Install a Linux udev rule for detection of USB devices | -`UDEV_RULES_INSTALL_DIR` | /lib/udev/rules.d | default install path for udev rules | -`WITH_EXAMPLES` | OFF | Build the example programs | -`WITH_LOCAL_CONFIG` | ON | Read local context attributes from /etc/libiio.ini | -`WITH_HWMON` | OFF | Add compatibility with the hwmon subsystem | -`NO_THREADS` | OFF | Disable multi-threading support | -`WITH_GCOV` | OFF | Build with gcov profiling flags | +Cmake Options | Default | Target | Description | +---------------------- | ------- | -------| ---------------------------------------------- | +`BUILD_SHARED_LIBS` | ON | All | Build shared libraries | +'COMPILE_WARNING_AS_ERROR' | OFF | All | Make all C warnings into errors | +`CPP_BINDINGS` | OFF | All | Install C++ bindings (C++17 required for examples) | +`PYTHON_BINDINGS` | OFF | All | Install PYTHON bindings | +`WITH_TESTS` | ON | All | Build the test programs (iio-utils) | +`WITH_EXAMPLES` | OFF | All | Build the example programs | +`NO_THREADS` | OFF | All | Disable multi-threading support | +`CSHARP_BINDINGS` | OFF | Windows | Install C# bindings | +`CMAKE_INSTALL_PREFIX` | `/usr` | Linux | default install path | +`ENABLE_PACKAGING` | OFF | Linux, MaC | Create .deb/.rpm or .tar.gz packages via 'make package' | +`WITH_DOC` | OFF | Linux | Generate documentation with Doxygen and Sphinx | +`WITH_MAN` | OFF | Linux | Generate and install man pages | +`INSTALL_UDEV_RULE` | ON | Linux | Install a Linux udev rule for detection of USB devices | +`UDEV_RULES_INSTALL_DIR` | /lib/udev/rules.d | Linux | default install path for udev rules | +`WITH_LOCAL_CONFIG` | ON | Linux | Read local context attributes from /etc/libiio.ini | +`WITH_HWMON` | ON | Linux | Add compatibility with the hwmon subsystem | +`WITH_GCOV` | OFF | Linux | Build with gcov profiling flags | +`OSX_FRAMEWORK` | ON | Mac | OS X frameworks provide the interfaces you need to write software for Mac. | +`OSX_PACKAGE` | ON | Mac | Create a OSX package for installation on local and other machines | Which backends the library supports is dependent on the build system, but can be overridden. (If cmake finds libusb, it will use it, unless turned off manually) @@ -76,8 +81,21 @@ `WITH_NETWORK_GET_BUFFER` | OFF | Enable experimental zero-copy transfers | `WITH_ZSTD` | OFF | Support for ZSTD compressed metadata | +Developer options, which either increases verbosity, or decreases size. It can +be useful to keep track of things when you are developing with libiio to print +out warnings, to better understand what is going on. Most users should leave it +at 'Error' and Embedded Developers are free to set it to 'NoLog' to save space. +this is invoked as "-DLOG_LEVEL=Debug". + +Cmake Options | Default | Description | +----------------- | ------- | ---------------------------------------------- | +| | | NoLog : Remove all warning/error messages | +|`LOG_LEVEL` | | Error : Print errors only | +| | | Warning : Print warnings and errors | +| | Info | Info : Print info, warnings and errors | +| | | Debug : Print debug/info/warnings/errors (very verbose) | -Options which effect iiod only. These are only avalible on Linux. +Options which effect iiod only. These are only available on Linux. Cmake Options | Default | Description | ------------------- | ------- | ---------------------------------------------- | @@ -97,7 +115,7 @@ ```shell analog@precision:~/libiio$ mkdir build analog@precision:~/libiio/build$ cd build -analog@precision:~/libiio/build$ cmake ../ -DPYTHON_BINDINGS=ON +analog@precision:~/libiio/build$ cmake ../ -DCPP_BINDINGS=ON -DPYTHON_BINDINGS=ON analog@precision:~/libiio/build$ make -j$(nproc) ``` diff -Nru libiio-0.24/README.md libiio-0.25/README.md --- libiio-0.24/README.md 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/README.md 2023-08-09 15:58:07.000000000 +0000 @@ -27,15 +27,23 @@ |:-----------------------:|:---------------------:|:-------:|:-------------------:|:--------------:| | Windows | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=WindowsBuilds&configuration=WindowsBuilds%20VS2019)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Windows-64 Server 2019 | [![Latest Windows installer](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/win_box.png)](https://swdownloads.analog.com/cse/azure_builds/libiio-setup.exe)
    [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=GenerateSetupExe)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | [![Latest Windows zip](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/win_box.png)](https://swdownloads.analog.com/cse/azure_builds/Windows-VS-2019-x64-latest_master_libiio.zip) | | | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=WindowsBuilds&configuration=WindowsBuilds%20VS2022)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Windows-64 Server 2022 | (libiio-setup.exe works for both Windows Server 2019 and Windows Server 2022) | [![Latest Windows zip](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/win_box.png)](https://swdownloads.analog.com/cse/azure_builds/Windows-VS-2022-x64-latest_master_libiio.zip) | -| OS X | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=macOSBuilds&configuration=macOSBuilds%20macOS_11)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | macOS Big Sur
    (v 11) | [![OS-X package 11](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-11_latest_master_libiio.pkg) | [![OS-X tarball 11](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-11_latest_master_libiio.tar.gz) | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=macOSBuilds&configuration=macOSBuilds%20macOS_10_15)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | macOS Catalina
    (v 10.15) | [![OS-X package 10.15](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-10.15_latest_master_libiio.pkg) | [![OS-X tarball 10.15](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-10.15_latest_master_libiio.tar.gz) | -| Linux | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20ubuntu_20_04)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu Focal Fossa
    (v 20.04)1 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-20.04_latest_master_libiio.deb) | | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20ubuntu_18_04)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu Bionic Beaver
    (v 18.04)1 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-18.04_latest_master_libiio.deb) | | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20fedora34)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Fedora 34 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-34_latest_master_libiio.deb) | [![RPM File](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/rpm.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-34_latest_master_libiio.rpm) | -| ARM | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-ppc64le)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-ppc64le | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-ppc64le_latest_master_libiio.deb) | | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-x390x)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-x390x | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-x390x_latest_master_libiio.deb) | | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-arm64v8)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-arm64v8 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm64v8_latest_master_libiio.deb) | | -| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-arm32v7)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-arm32v7 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm32v7_latest_master_libiio.deb) | | +| OS X | | macOS Ventura
    (v 13 x64) | [![OS-X package 13-x64](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-13-x64_latest_master_libiio.pkg) | [![OS-X tarball 13-x64](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-13-x64_latest_master_libiio.tar.gz) | +| | | macOS Ventura
    (v 13 arm64) | [![OS-X package 13-arm64](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-13-arm64_latest_master_libiio.pkg) | [![OS-X tarball 13-arm64](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-13-arm64_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=macOSBuilds&configuration=macOSBuilds%20macOS_12)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | macOS Monterey
    (v 12) | [![OS-X package 12](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-12_latest_master_libiio.pkg) | [![OS-X tarball 12](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-12_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=macOSBuilds&configuration=macOSBuilds%20macOS_11)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | macOS Big Sur
    (v 11) | [![OS-X package 11](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-11_latest_master_libiio.pkg) | [![OS-X tarball 11](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-11_latest_master_libiio.tar.gz) | +| | Unsupported. Last artifacts from Sept 6, 2022 | macOS Catalina
    (v 10.15) | [![OS-X package 10.15](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-10.15_latest_master_libiio.pkg) | [![OS-X tarball 10.15](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/osx_box.png)](https://swdownloads.analog.com/cse/azure_builds/macOS-10.15_latest_master_libiio.tar.gz) | +| Linux | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20ubuntu_22_04)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu Jammy Jellyfish
    (v 22.04)1 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-22.04_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-22.04_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20ubuntu_20_04)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu Focal Fossa
    (v 20.04)1 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-20.04_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-20.04_latest_master_libiio.tar.gz) | +| | Unsupported. Last artifact from Feb 22, 2023 | Ubuntu Bionic Beaver
    (v 18.04)1 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-18.04_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-18.04_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20fedora34)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Fedora 34 | [![RPM File](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/rpm.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-34_latest_master_libiio.rpm) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-34_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status%2Fanalogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20fedora28)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master)| Fedora 28 | [![RPM File](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/rpm.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-28_latest_master_libiio.rpm) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Fedora-28_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status%2Fanalogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20centos_7)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master)| CentOS 7 | [![RPM File](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/rpm.png)](https://swdownloads.analog.com/cse/azure_builds/CentOS-7_latest_master_libiio.rpm) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/CentOS-7_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status%2Fanalogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20debian_bullseye)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master)| Debian Bullseye | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Debian-11_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Debian-11_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status%2Fanalogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=LinuxBuilds&configuration=LinuxBuilds%20opensuse_15_4)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master)| openSUSE 15.4 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/openSUSE-15.4_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/openSUSE-15.4_latest_master_libiio.tar.gz) | +| ARM | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-ppc64le)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-ppc64le | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-ppc64le_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-ppc64le_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-x390x)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-x390x | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-x390x_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-x390x_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-arm64v8)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-arm64v8 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm64v8_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm64v8_latest_master_libiio.tar.gz) | +| | [![Build Status](https://dev.azure.com/AnalogDevices/OpenSource/_apis/build/status/analogdevicesinc.libiio?branchName=master&stageName=Builds&jobName=ARMBuilds&configuration=ARMBuilds%20ubuntu-arm32v7)](https://dev.azure.com/AnalogDevices/OpenSource/_build/latest?definitionId=9&branchName=master) | Ubuntu-arm32v7 | [![Debian](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/deb.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm32v7_latest_master_libiio.deb) | [![Linux tarball](https://raw.githubusercontent.com/wiki/analogdevicesinc/libiio/img/linux_box.png)](https://swdownloads.analog.com/cse/azure_builds/Ubuntu-arm32v7_latest_master_libiio.tar.gz) | If you use it, and like it - please let us know. If you use it, and hate it - please let us know that too. The goal of the project is to try to make Linux IIO devices easier to use on a variety of platforms. If we aren't doing that - we will try to make it better. diff -Nru libiio-0.24/serial.c libiio-0.25/serial.c --- libiio-0.24/serial.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/serial.c 2023-08-09 15:58:07.000000000 +0000 @@ -105,26 +105,6 @@ major, minor, git_tag); } -static char * serial_get_description(struct sp_port *port) -{ - char *description, *name, *desc; - size_t desc_len; - - name = sp_get_port_name(port); - desc = sp_get_port_description(port); - - desc_len = sizeof(": \0") + strlen(name) + strlen(desc); - description = malloc(desc_len); - if (!description) { - errno = ENOMEM; - return NULL; - } - - iio_snprintf(description, desc_len, "%s: %s", name, desc); - - return description; -} - static int serial_open(const struct iio_device *dev, size_t samples_count, bool cyclic) { @@ -421,11 +401,10 @@ struct sp_port *port; struct iio_context_pdata *pdata; struct iio_context *ctx; - char *description; + char *uri, buf[16]; size_t uri_len; unsigned int i; int ret; - char *uri; uri_len = sizeof("serial:,1000000,8n1n") + strnlen(port_name, PATH_MAX); uri = malloc(uri_len); @@ -452,17 +431,25 @@ goto err_close_port; } - /* Empty the buffers */ - sp_flush(port, SP_BUF_BOTH); + /* Empty the output buffer */ + ret = libserialport_to_errno(sp_flush(port, SP_BUF_OUTPUT)); + if (ret) + IIO_WARNING("Unable to flush output buffer\n"); - description = serial_get_description(port); - if (!description) - goto err_close_port; + /* Drain the input buffer */ + do { + ret = libserialport_to_errno(sp_blocking_read(port, buf, + sizeof(buf), 1)); + if (ret < 0) { + IIO_WARNING("Unable to drain input buffer\n"); + break; + } + } while (ret); pdata = zalloc(sizeof(*pdata)); if (!pdata) { errno = ENOMEM; - goto err_free_description; + goto err_close_port; } pdata->port = port; @@ -479,7 +466,6 @@ ctx->name = "serial"; ctx->ops = &serial_ops; ctx->pdata = pdata; - ctx->description = description; for (i = 0; i < iio_context_get_devices_count(ctx); i++) { struct iio_device *dev = iio_context_get_device(ctx, i); @@ -499,6 +485,15 @@ goto err_context_destroy; free(uri); + ret = iio_context_add_attr(ctx, "serial,port", sp_get_port_name(port)); + if (ret < 0) + goto err_context_destroy; + + ret = iio_context_add_attr(ctx, "serial,description", + sp_get_port_description(port)); + if (ret < 0) + goto err_context_destroy; + return ctx; err_context_destroy: @@ -511,8 +506,6 @@ iiod_client_destroy(pdata->iiod_client); err_free_pdata: free(pdata); -err_free_description: - free(description); err_close_port: sp_close(port); err_free_port: diff -Nru libiio-0.24/tests/CMakeLists.txt libiio-0.25/tests/CMakeLists.txt --- libiio-0.24/tests/CMakeLists.txt 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/CMakeLists.txt 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 3.10) project(iio_genxml C) project(iio_info C) @@ -57,13 +57,10 @@ set(IIO_TESTS_TARGETS iio_genxml iio_info iio_attr iio_readdev iio_reg iio_writedev) if(PTHREAD_LIBRARIES OR ANDROID) - project(iio_adi_xflow_check C) project(iio_stresstest C) - add_executable(iio_adi_xflow_check iio_adi_xflow_check.c) add_executable(iio_stresstest iio_stresstest.c) - target_link_libraries(iio_adi_xflow_check iio iio_tests_helper ${PTHREAD_LIBRARIES}) target_link_libraries(iio_stresstest iio iio_tests_helper ${PTHREAD_LIBRARIES}) - set(IIO_TESTS_TARGETS ${IIO_TESTS_TARGETS} iio_adi_xflow_check iio_stresstest) + set(IIO_TESTS_TARGETS ${IIO_TESTS_TARGETS} iio_stresstest) target_link_libraries(iio_readdev ${PTHREAD_LIBRARIES}) target_link_libraries(iio_writedev ${PTHREAD_LIBRARIES}) diff -Nru libiio-0.24/tests/gen_code.c libiio-0.25/tests/gen_code.c --- libiio-0.24/tests/gen_code.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/gen_code.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - Library for interfacing industrial I/O (IIO) devices * @@ -51,7 +51,7 @@ return false; last = strrchr(gen_file, '.'); - if (*last != '.') + if (!last) return false; last++; @@ -171,7 +171,7 @@ } } -void gen_context_destroy() +void gen_context_destroy(void) { if (!fd) return; diff -Nru libiio-0.24/tests/gen_code.h libiio-0.25/tests/gen_code.h --- libiio-0.24/tests/gen_code.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/gen_code.h 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * libiio - Library for interfacing industrial I/O (IIO) devices * @@ -13,7 +13,7 @@ void gen_start(const char *gen_file); bool gen_test_path(const char *gen_file); void gen_context (const char *uri); -void gen_context_destroy(); +void gen_context_destroy(void); void gen_context_attr(const char *key); void gen_dev(const struct iio_device *dev); void gen_ch(const struct iio_channel *ch); diff -Nru libiio-0.24/tests/iio_adi_xflow_check.c libiio-0.25/tests/iio_adi_xflow_check.c --- libiio-0.24/tests/iio_adi_xflow_check.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_adi_xflow_check.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,298 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later -/* - * iio_adi_dac_overflow_test - part of the IIO utilities - * - * Copyright (C) 2015 Analog Devices, Inc. - * */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "iio_common.h" - - -#define MY_NAME "iio_adi_xflow_check" - -struct xflow_pthread_data { - struct iio_context *ctx; - const char *device_name; -}; - -static const struct option options[] = { - {"buffer-size", required_argument, 0, 's'}, - {"auto", no_argument, 0, 'a'}, - {0, 0, 0, 0}, -}; - -static const char *options_descriptions[] = { - "[-n ] [-u ] [-a ] [-s ] ", - "Size of the buffer in sample sets. Default is 1Msample", - "Scan for available contexts and if only one is available use it.", -}; - -static bool app_running = true; -static bool device_is_tx; - -static void quit_all(int sig) -{ - app_running = false; -} - -static void set_handler(int signal_nb, void (*handler)(int)) -{ -#ifdef _WIN32 - signal(signal_nb, handler); -#else - struct sigaction sig; - sigaction(signal_nb, NULL, &sig); - sig.sa_handler = handler; - sigaction(signal_nb, &sig, NULL); -#endif -} - -static struct iio_device *get_device(const struct iio_context *ctx, - const char *id) -{ - - unsigned int i, nb_devices = iio_context_get_devices_count(ctx); - struct iio_device *device; - - for (i = 0; i < nb_devices; i++) { - const char *name; - device = iio_context_get_device(ctx, i); - name = iio_device_get_name(device); - if (name && !strcmp(name, id)) - break; - if (!strcmp(id, iio_device_get_id(device))) - break; - } - - if (i < nb_devices) - return device; - - fprintf(stderr, "Device %s not found\n", id); - return NULL; -} - - -static void *monitor_thread_fn(void *data) -{ - struct xflow_pthread_data *xflow_pthread_data = data; - struct iio_context *ctx; - struct iio_device *dev; - uint32_t val; - int ret; - - ctx = xflow_pthread_data->ctx; - - dev = get_device(ctx, xflow_pthread_data->device_name); - if (!dev) { - fprintf(stderr, "Unable to find IIO device\n"); - return (void *)-1; - } - - /* Give the main thread a moment to start the DMA */ - sleep(1); - - /* Clear all status bits */ - ret = iio_device_reg_write(dev, 0x80000088, 0x6); - if (ret) { - fprintf(stderr, "Failed to clearn DMA status register: %s\n", - strerror(-ret)); - } - - while (app_running) { - ret = iio_device_reg_read(dev, 0x80000088, &val); - if (ret) { - fprintf(stderr, "Failed to read status register: %s\n", - strerror(-ret)); - continue; - } - - if (device_is_tx) { - if (val & 1) - fprintf(stderr, "Underflow detected\n"); - } else { - if (val & 4) - fprintf(stderr, "Overflow detected\n"); - } - - /* Clear bits */ - if (val) { - ret = iio_device_reg_write(dev, 0x80000088, val); - if (ret) - fprintf(stderr, "Failed to clearn DMA status register: %s\n", - strerror(-ret)); - } - sleep(1); - } - - return (void *)0; -} - -#define MY_OPTS "s:a" - -int main(int argc, char **argv) -{ - char **argw; - unsigned int buffer_size = 1024 * 1024; - int c; - unsigned int n_tx = 0, n_rx = 0; - static struct iio_context *ctx; - static struct xflow_pthread_data xflow_pthread_data; - unsigned int i, nb_channels; - struct iio_buffer *buffer; - pthread_t monitor_thread; - const char *device_name; - struct iio_device *dev; - char unit; - int ret; - struct option *opts; - bool do_scan = false; - - argw = dup_argv(MY_NAME, argc, argv); - - ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, options, options_descriptions); - opts = add_common_options(options); - if (!opts) { - fprintf(stderr, "Failed to add common options\n"); - return EXIT_FAILURE; - } - while ((c = getopt_long(argc, argw, "+" COMMON_OPTIONS MY_OPTS, /* Flawfinder: ignore */ - opts, NULL)) != -1) { - switch (c) { - /* All these are handled in the common */ - case 'h': - case 'n': - case 'x': - case 'u': - case 'T': - break; - case 'S': - do_scan = true; - /* FALLTHROUGH */ - case 'a': - if (!optarg && argc > optind && argv[optind] != NULL - && argv[optind][0] != '-') - optind++; - break; - - case 's': - if (!optarg) { - fprintf(stderr, "Samples options requires a value.\n\n"); - return EXIT_FAILURE; - } - ret = sscanf(optarg, "%u%c", &buffer_size, &unit); - if (ret == 0) - return EXIT_FAILURE; - if (ret == 2) { - if (unit == 'k') - buffer_size *= 1024; - else if (unit == 'M') - buffer_size *= 1024 * 1024; - } - break; - case '?': - return EXIT_FAILURE; - } - } - free(opts); - - if (do_scan) - return EXIT_SUCCESS; - - if (optind + 1 != argc) { - fprintf(stderr, "Incorrect number of arguments.\n\n"); - usage(MY_NAME, options, options_descriptions); - return EXIT_FAILURE; - } - - if (!ctx) - return EXIT_FAILURE; - -#ifndef _WIN32 - set_handler(SIGHUP, &quit_all); -#endif - set_handler(SIGINT, &quit_all); - set_handler(SIGSEGV, &quit_all); - set_handler(SIGTERM, &quit_all); - - device_name = argw[optind]; - - dev = get_device(ctx, device_name); - if (!dev) { - iio_context_destroy(ctx); - return EXIT_FAILURE; - } - - nb_channels = iio_device_get_channels_count(dev); - for (i = 0; i < nb_channels; i++) { - struct iio_channel *ch = iio_device_get_channel(dev, i); - if (!iio_channel_is_scan_element(ch)) - continue; - iio_channel_enable(ch); - if (iio_channel_is_output(ch)) - n_tx++; - else - n_rx++; - } - - if (n_tx >= n_rx) - device_is_tx = true; - else - device_is_tx = false; - - printf("Monitoring %s for underflows/overflows\n", - iio_device_get_name(dev)); - - buffer = iio_device_create_buffer(dev, buffer_size, false); - if (!buffer) { - fprintf(stderr, "Unable to allocate buffer\n"); - iio_context_destroy(ctx); - return EXIT_FAILURE; - } - - xflow_pthread_data.ctx = ctx; - xflow_pthread_data.device_name = device_name; - - ret = pthread_create(&monitor_thread, NULL, monitor_thread_fn, - (void *)&xflow_pthread_data); - if (ret) { - fprintf(stderr, "Failed to create monitor thread: %s\n", - strerror(-ret)); - } - - while (app_running) { - if (device_is_tx) { - ret = iio_buffer_push(buffer); - if (ret < 0) { - fprintf(stderr, "Unable to push buffer: %s\n", - strerror(-ret)); - app_running = false; - break; - } - } else { - ret = iio_buffer_refill(buffer); - if (ret < 0) { - fprintf(stderr, "Unable to refill buffer: %s\n", - strerror(-ret)); - app_running = false; - break; - } - } - } - - pthread_join(monitor_thread, NULL); - - iio_buffer_destroy(buffer); - iio_context_destroy(ctx); - free_argw(argc, argw); - return 0; -} diff -Nru libiio-0.24/tests/iio_attr.c libiio-0.25/tests/iio_attr.c --- libiio-0.24/tests/iio_attr.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_attr.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_attr - part of the Industrial I/O (IIO) utilities * @@ -346,10 +346,10 @@ bool found_err = false, read_err = false, write_err = false, dev_found = false, attr_found = false, ctx_found = false, debug_found = false, channel_found = false ; - bool context_scan = false; unsigned int i; char *wbuf = NULL; struct option *opts; + int ret = EXIT_FAILURE; argw = dup_argv(MY_NAME, argc, argv); @@ -364,7 +364,8 @@ argd--; } - ctx = handle_common_opts(MY_NAME, argd, argw, MY_OPTS, options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argd, argw, MY_OPTS, + options, options_descriptions, &ret); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -375,14 +376,13 @@ switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': case 'T': break; case 'S': - context_scan = true; - /* FALLTHRU */ case 'a': if (!optarg && argc > optind && argv[optind] != NULL && argv[optind][0] != '-') @@ -442,11 +442,8 @@ free(opts); - if (context_scan) - return EXIT_SUCCESS; - if (!ctx) - return EXIT_FAILURE; + return ret; if (gen_code) { if (!gen_test_path(gen_file)) { @@ -599,7 +596,6 @@ ctx_found = true; for (i = 0; i < nb_ctx_attrs; i++) { const char *key, *value; - ssize_t ret; ret = iio_context_get_attr(ctx, i, &key, &value); if (!ret) { @@ -775,7 +771,6 @@ continue; for (k = 0; k < nb_attrs; k++) { - int ret; const char *attr = iio_channel_get_attr(ch, k); @@ -807,7 +802,6 @@ } if (search_device && device_index && nb_attrs) { - int ret; for (j = 0; j < nb_attrs; j++) { const char *attr = iio_device_get_attr(dev, j); @@ -840,7 +834,6 @@ if (search_buffer && device_index && nb_attrs) { for (j = 0; j < nb_attrs; j++) { - int ret; const char *attr = iio_device_get_buffer_attr(dev, j); if ((attr_index && str_match(attr, argw[attr_index], @@ -866,7 +859,6 @@ if (search_debug && device_index && nb_attrs) { for (j = 0; j < nb_attrs; j++) { - int ret; const char *attr = iio_device_get_debug_attr(dev, j); if ((attr_index && str_match(attr, argw[attr_index], diff -Nru libiio-0.24/tests/iio_common.c libiio-0.25/tests/iio_common.c --- libiio-0.24/tests/iio_common.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_common.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_common - Common functions used in the IIO utilities * @@ -58,7 +58,8 @@ #endif } -struct iio_context * autodetect_context(bool rtn, const char * name, const char * scan) +struct iio_context * autodetect_context(bool rtn, const char * name, + const char * scan, int *err_code) { struct iio_scan_context *scan_ctx; struct iio_context_info **info; @@ -66,6 +67,7 @@ unsigned int i; ssize_t ret; FILE *out; + int err = EXIT_FAILURE; scan_ctx = iio_create_scan_context(scan, 0); if (!scan_ctx) { @@ -97,6 +99,7 @@ } else { out = stdout; fprintf(out, "Available contexts:\n"); + err = EXIT_SUCCESS; } for (i = 0; i < (size_t) ret; i++) { fprintf(out, "\t%u: %s [%s]\n", @@ -110,6 +113,8 @@ err_free_ctx: iio_scan_context_destroy(scan_ctx); + if (err_code) + *err_code = err; return ctx; } @@ -192,6 +197,7 @@ static const struct option common_options[] = { {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, {"xml", required_argument, 0, 'x'}, {"uri", required_argument, 0, 'u'}, {"scan", optional_argument, 0, 'S'}, @@ -239,6 +245,7 @@ static const char *common_options_descriptions[] = { "Show this help and quit.", + "Display libiio version information.", "Use the XML backend with the provided XML file.", ("Use the context at the provided URI." "\n\t\t\teg: 'ip:192.168.2.1', 'ip:pluto.local', or 'ip:'" @@ -258,7 +265,8 @@ struct iio_context * handle_common_opts(char * name, int argc, char * const argv[], const char *optstring, - const struct option *options, const char *options_descriptions[]) + const struct option *options, const char *options_descriptions[], + int *err_code) { struct iio_context *ctx = NULL; int c; @@ -278,7 +286,7 @@ opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); - return NULL; + goto err_fail; } while ((c = getopt_long(argc, argv, buf, /* Flawfinder: ignore */ @@ -287,14 +295,18 @@ case 'h': usage(name, options, options_descriptions); break; + case 'V': + version(name); + exit(0); + break; case 'n': if (backend != IIO_LOCAL) { fprintf(stderr, "-a, -x, -n and -u are mutually exclusive\n"); - return NULL; + goto err_fail; } if (!optarg) { fprintf(stderr, "network options requires a uri\n"); - return NULL; + goto err_fail; } backend = IIO_NETWORK; arg = optarg; @@ -302,11 +314,11 @@ case 'x': if (backend != IIO_LOCAL) { fprintf(stderr, "-a, -x, -n and -u are mutually exclusive\n"); - return NULL; + goto err_fail; } if (!optarg) { fprintf(stderr, "xml options requires a uri\n"); - return NULL; + goto err_fail; } backend = IIO_XML; arg = optarg; @@ -314,11 +326,11 @@ case 'u': if (backend != IIO_LOCAL) { fprintf(stderr, "-a, -x, -n and -u are mutually exclusive\n"); - return NULL; + goto err_fail; } if (!optarg) { fprintf(stderr, "uri options requires a uri\n"); - return NULL; + goto err_fail; } backend = IIO_URI; arg = optarg; @@ -326,7 +338,7 @@ case 'a': if (backend != IIO_LOCAL) { fprintf(stderr, "-a, -x, -n and -u are mutually exclusive\n"); - return NULL; + goto err_fail; } backend = IIO_AUTO; detect_context = true; @@ -349,7 +361,7 @@ case 'T': if (!optarg) { fprintf(stderr, "Timeout requires an argument\n"); - return NULL; + goto err_fail; } timeout = sanitize_clamp("timeout", optarg, 0, INT_MAX); break; @@ -362,10 +374,10 @@ opterr = 1; if (do_scan) { - autodetect_context(false, name, arg); + autodetect_context(false, name, arg, err_code); return NULL; } else if (detect_context || backend == IIO_AUTO) - ctx = autodetect_context(true, name, arg); + ctx = autodetect_context(true, name, arg, err_code); else if (!arg && backend != IIO_LOCAL) fprintf(stderr, "argument parsing error\n"); else if (backend == IIO_XML) @@ -384,6 +396,7 @@ fprintf(stderr, "Unable to create IIO context %s: %s\n", arg, err_str); else fprintf(stderr, "Unable to create Local IIO context : %s\n", err_str); + goto err_fail; } if (ctx && timeout >= 0) { @@ -394,11 +407,16 @@ fprintf(stderr, "IIO contexts set timeout failed : %s\n", err_str); iio_context_destroy(ctx); - return NULL; + goto err_fail; } } return ctx; + +err_fail: + if (err_code) + *err_code = EXIT_FAILURE; + return NULL; } void usage(char *name, const struct option *options, @@ -434,6 +452,19 @@ exit(0); } +void version(char *name) +{ + unsigned int i, major, minor; + char git_tag[8]; + + printf("%s version: %u.%u (git tag:%s)\n", name, LIBIIO_VERSION_MAJOR, LIBIIO_VERSION_MINOR, LIBIIO_VERSION_GIT); + iio_library_get_version(&major, &minor, git_tag); + printf("Libiio version: %u.%u (git tag: %s) backends:", major, minor, git_tag); + for (i = 0; i < iio_get_backends_count(); i++) + printf(" %s", iio_get_backend(i)); + printf("\n"); +} + uint64_t get_time_us(void) { struct timespec tp; diff -Nru libiio-0.24/tests/iio_common.h libiio-0.25/tests/iio_common.h --- libiio-0.24/tests/iio_common.h 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_common.h 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * iio_common - Part of libIIO utilities * @@ -31,7 +31,8 @@ void * xmalloc(size_t n, const char *name); char *cmn_strndup(const char *str, size_t n); -struct iio_context * autodetect_context(bool rtn, const char *name, const char *scan); +struct iio_context * autodetect_context(bool rtn, const char *name, + const char *scan, int *err_code); unsigned long int sanitize_clamp(const char *name, const char *argv, uint64_t min, uint64_t max); int iio_device_enable_channel(const struct iio_device *dev, const char * channel, bool type); @@ -40,13 +41,15 @@ * If such a character is followed by a colon, the option requires an argument. * Two colons mean an option takes an optional argument. */ -#define COMMON_OPTIONS "hn:x:u:a::S::T:" +#define COMMON_OPTIONS "hVn:x:u:a::S::T:" struct iio_context * handle_common_opts(char * name, int argc, char * const argv[], const char *optstring, - const struct option *options, const char *options_descriptions[]); + const struct option *options, const char *options_descriptions[], + int *ret); struct option * add_common_options(const struct option * longopts); void usage(char *name, const struct option *options, const char *options_descriptions[]); +void version(char *name); char ** dup_argv(char * name, int argc, char * argv[]); void free_argw(int argc, char * argw[]); diff -Nru libiio-0.24/tests/iio_genxml.c libiio-0.25/tests/iio_genxml.c --- libiio-0.24/tests/iio_genxml.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_genxml.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_genxml - Part of the Industrial I/O (IIO) utilities * @@ -31,12 +31,13 @@ char *xml; const char *tmp; struct iio_context *ctx; - int c; size_t xml_len; struct option *opts; + int c, ret = EXIT_FAILURE; argw = dup_argv(MY_NAME, argc, argv); - ctx = handle_common_opts(MY_NAME, argc, argw, "", options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argc, argw, "", + options, options_descriptions, &ret); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -47,6 +48,7 @@ switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': @@ -72,7 +74,7 @@ } if (!ctx) - return EXIT_FAILURE; + return ret; tmp = iio_context_get_xml(ctx); if (!tmp) { diff -Nru libiio-0.24/tests/iio_info.c libiio-0.25/tests/iio_info.c --- libiio-0.24/tests/iio_info.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_info.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_info - Part of Industrial I/O (IIO) utilities * @@ -53,20 +53,13 @@ int c; unsigned int i, major, minor; char git_tag[8]; - int ret; struct option *opts; + int ret = EXIT_FAILURE; argw = dup_argv(MY_NAME, argc, argv); - iio_library_get_version(&major, &minor, git_tag); - printf("Library version: %u.%u (git tag: %s)\n", major, minor, git_tag); - - printf("Compiled with backends:"); - for (i = 0; i < iio_get_backends_count(); i++) - printf(" %s", iio_get_backend(i)); - printf("\n"); - - ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, + options, options_descriptions, &ret); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -77,6 +70,7 @@ switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': @@ -89,8 +83,8 @@ optind++; break; case 's': - autodetect_context(false, MY_NAME, NULL); - return EXIT_SUCCESS; + autodetect_context(false, MY_NAME, NULL, &ret); + return ret; case '?': printf("Unknown argument '%c'\n", c); return EXIT_FAILURE; @@ -105,8 +99,9 @@ } if (!ctx) - return EXIT_FAILURE; + return ret; + version(MY_NAME); printf("IIO context created with %s backend.\n", iio_context_get_name(ctx)); diff -Nru libiio-0.24/tests/iio_readdev.c libiio-0.25/tests/iio_readdev.c --- libiio-0.24/tests/iio_readdev.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_readdev.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_readdev - Part of the Industrial I/O (IIO) utilities * @@ -193,12 +193,14 @@ struct option *opts; bool mib, benchmark = false; uint64_t before = 0, after, rate, total; + int err_code = EXIT_FAILURE; argw = dup_argv(MY_NAME, argc, argv); setup_sig_handler(); - ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, + options, options_descriptions, &err_code); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -210,6 +212,7 @@ switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': @@ -259,7 +262,7 @@ } if (!ctx) - return EXIT_FAILURE; + return err_code; if (!argw[optind]) { unsigned int nb_devices = iio_context_get_devices_count(ctx); diff -Nru libiio-0.24/tests/iio_reg.c libiio-0.25/tests/iio_reg.c --- libiio-0.24/tests/iio_reg.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_reg.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_reg - Part of the industrial I/O (IIO) utilities * @@ -66,14 +66,14 @@ unsigned long addr; struct iio_context *ctx; struct iio_device *dev; - int c; + int c, ret = EXIT_FAILURE; char * name; struct option *opts; - bool do_scan = false; argw = dup_argv(MY_NAME, argc, argv); - ctx = handle_common_opts(MY_NAME, argc, argw, "", options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argc, argw, "", + options, options_descriptions, &ret); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -84,14 +84,13 @@ switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': case 'T': break; case 'S': - do_scan = true; - /* FALLTHRU */ case 'a': if (!optarg && argc > optind && argv[optind] != NULL && argv[optind][0] != '-') @@ -104,14 +103,14 @@ } free(opts); - if (do_scan) - return EXIT_SUCCESS; - if ((argc - optind) < 2 || (argc - optind) > 3) { usage(MY_NAME, options, options_descriptions); return EXIT_SUCCESS; } + if (!ctx) + return ret; + name = cmn_strndup(argw[optind], NAME_MAX); dev = iio_context_find_device(ctx, name); if (!dev) { diff -Nru libiio-0.24/tests/iio_stresstest.c libiio-0.25/tests/iio_stresstest.c --- libiio-0.24/tests/iio_stresstest.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_stresstest.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * libiio - Library for interfacing industrial I/O (IIO) devices * @@ -100,7 +100,7 @@ {"uri", required_argument, 0, 'u'}, {"buffer-size", required_argument, 0, 'b'}, {"samples", required_argument, 0, 's' }, - {"Timeout", required_argument, 0, 'T'}, + {"duration", required_argument, 0, 'd'}, {"threads", required_argument, 0, 't'}, {"verbose", no_argument, 0, 'v'}, {0, 0, 0, 0}, @@ -519,6 +519,12 @@ ret = (void *)calloc(info.num_threads, sizeof(void *)); + if (!ret || !info.start || !info.refills || !info.buffers || !info.starts || + !info.tid || !info.threads) { + fprintf(stderr, "Memory allocation failure\n"); + return 0; + } + for (i = 0; i < info.num_threads; i++) { info.start[i] = malloc(NUM_TIMESTAMPS * sizeof(struct timeval)); } @@ -658,6 +664,11 @@ /* gather and sort things, so we can print out a histogram */ struct timeval *sort; sort = calloc(info.num_threads * NUM_TIMESTAMPS, sizeof(struct timeval)); + if (!sort) { + app_running = 0; + fprintf(stderr, "Memory allocation failure\n"); + break; + } b = 0; /* gather */ for (i = 0; i < info.num_threads; i++) { diff -Nru libiio-0.24/tests/iio_writedev.c libiio-0.25/tests/iio_writedev.c --- libiio-0.24/tests/iio_writedev.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/tests/iio_writedev.c 2023-08-09 15:58:07.000000000 +0000 @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later +// SPDX-License-Identifier: GPL-2.0-or-later /* * iio_writedev - Part of the Industrial I/O (IIO) utilities * @@ -204,12 +204,14 @@ ssize_t ret; struct option *opts; uint64_t before = 0, after, rate, total; + int err_code = EXIT_FAILURE; argw = dup_argv(MY_NAME, argc, argv); setup_sig_handler(); - ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, options, options_descriptions); + ctx = handle_common_opts(MY_NAME, argc, argw, MY_OPTS, + options, options_descriptions, &err_code); opts = add_common_options(options); if (!opts) { fprintf(stderr, "Failed to add common options\n"); @@ -272,7 +274,7 @@ } if (!ctx) - return EXIT_FAILURE; + return err_code; if (!argw[optind]) { unsigned int nb_devices = iio_context_get_devices_count(ctx); diff -Nru libiio-0.24/usb.c libiio-0.25/usb.c --- libiio-0.24/usb.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/usb.c 2023-08-09 15:58:07.000000000 +0000 @@ -11,6 +11,9 @@ #include "iiod-client.h" #include +#ifdef __linux__ +#include +#endif #include #include #include @@ -1219,8 +1222,9 @@ if (!vid_pid) return 0; + errno = 0; val = strtoul(vid_pid, &ptr, 16); - if (ptr == vid_pid || val > 0xFFFF || *ptr != ':') + if (ptr == vid_pid || val > 0xFFFF || *ptr != ':' || errno == ERANGE) return -EINVAL; *vid = (uint16_t) val; @@ -1230,8 +1234,9 @@ if (*vid_pid == '*') return vid_pid[1] == '\0' ? 0 : -EINVAL; + errno = 0; val = strtoul(vid_pid, &ptr, 16); - if (ptr == vid_pid || val > 0xFFFF || *ptr != '\0') + if (ptr == vid_pid || val > 0xFFFF || *ptr != '\0' || errno == ERANGE) return -EINVAL; *pid = (uint16_t) val; @@ -1253,8 +1258,20 @@ return ret; ret = libusb_init(&ctx); - if (ret < 0) + if (ret < 0) { +#ifdef __linux__ + /* When Linux's OTG USB is in device mode, and there are no hosts, + * libusb_init() is expected to fail, but we shouldn't treat that + * as a hard failure - only that there are no devices. + */ + DIR* dir = opendir("/dev/bus/usb/"); + if (dir) + closedir(dir); + else if (errno == ENOENT) + return 0; +#endif return -(int) libusb_to_errno(ret); + } ret = (int) libusb_get_device_list(ctx, &device_list); if (ret < 0) { diff -Nru libiio-0.24/utilities.c libiio-0.25/utilities.c --- libiio-0.24/utilities.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/utilities.c 2023-08-09 15:58:07.000000000 +0000 @@ -20,6 +20,12 @@ #include #include +#ifdef _WIN32 +#include +#else +#include +#endif + #if defined(_WIN32) || \ (defined(__APPLE__) && defined(__MACH__)) || \ (defined(__USE_XOPEN2K8) && \ @@ -220,7 +226,7 @@ #elif defined(HAS_STRTOK_R) return strtok_r(str, delim, saveptr); #else -#error Need a implentation of strtok_r for this platform +#error Need a implementation of strtok_r for this platform #endif } @@ -359,3 +365,25 @@ return (ssize_t)ret; } + +uint64_t iio_read_counter_us(void) +{ + uint64_t value; + +#ifdef _WIN32 + LARGE_INTEGER freq, cnt; + + QueryPerformanceFrequency(&freq); + QueryPerformanceCounter(&cnt); + + value = (1000000 * cnt.QuadPart) / freq.QuadPart; +#else + struct timespec ts; + + clock_gettime(CLOCK_MONOTONIC, &ts); + + value = ts.tv_sec * 1000000ull + (uint64_t)ts.tv_nsec / 1000ull; +#endif + + return value; +} diff -Nru libiio-0.24/xml.c libiio-0.25/xml.c --- libiio-0.24/xml.c 2022-07-08 09:13:06.000000000 +0000 +++ libiio-0.25/xml.c 2023-08-09 15:58:07.000000000 +0000 @@ -428,12 +428,14 @@ if (!strcmp((char *) attr->name, "description")) { description = content; } else if (!strcmp((char *) attr->name, "version-major")) { + errno = 0; major = strtol(content, &end, 10); - if (*end != '\0') + if (*end != '\0' || errno == ERANGE) IIO_WARNING("invalid format for major version\n"); } else if (!strcmp((char *) attr->name, "version-minor")) { + errno = 0; minor = strtol(content, &end, 10); - if (*end != '\0') + if (*end != '\0' || errno == ERANGE) IIO_WARNING("invalid format for minor version\n"); } else if (!strcmp((char *) attr->name, "version-git")) { git_tag = content;