diff --git a/.codespell-ignore.txt b/.codespell-ignore.txt new file mode 100644 index 000000000..ce3d55bf9 --- /dev/null +++ b/.codespell-ignore.txt @@ -0,0 +1,9 @@ +SOM +som +mitre +mis +tread +elease +tREAD +tRead +tRead diff --git a/.codespell-whitelist b/.codespell-whitelist deleted file mode 100644 index dfb45f504..000000000 --- a/.codespell-whitelist +++ /dev/null @@ -1,3 +0,0 @@ -SOM -som -mitre diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 000000000..1d7471eea --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 --git a/CI/azure/zip.txt b/CI/azure/README.txt similarity index 86% rename from CI/azure/zip.txt rename to CI/azure/README.txt index 042735739..b67369afc 100644 --- a/CI/azure/zip.txt +++ b/CI/azure/README.txt @@ -7,17 +7,16 @@ 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 ./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 MS32\ or MS64\ and add 'libiio.lib' to + - 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 @@ -44,7 +43,7 @@ o WDK/DDK: SOURCES=your_app.c o MinGW/cygwin - - Copy libiio.h, from include/ to your default include directory, + - 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. diff --git a/CI/azure/check_README_BUILD.sh b/CI/azure/check_README_BUILD.sh new file mode 100755 index 000000000..1d680f433 --- /dev/null +++ b/CI/azure/check_README_BUILD.sh @@ -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 --git a/CI/azure/ci-ubuntu.sh b/CI/azure/ci-ubuntu.sh index 45c13bfb0..d7d933d9a 100644 --- a/CI/azure/ci-ubuntu.sh +++ b/CI/azure/ci-ubuntu.sh @@ -3,6 +3,7 @@ set -x 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 -DPYTHON_BINDINGS=ON -DENABLE_PACKAGING=ON -DCPACK_SYSTEM_NAME="${ARTIFACTNAME}" make make package +make required2tar diff --git a/CI/azure/generateDocumentationAndDeploy.sh.in b/CI/azure/generateDocumentationAndDeploy.sh.in index 37b0c2bf5..3428609d9 100644 --- a/CI/azure/generateDocumentationAndDeploy.sh.in +++ b/CI/azure/generateDocumentationAndDeploy.sh.in @@ -8,7 +8,7 @@ set -x # # 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 --git a/CI/azure/macos_tar_fixup.sh b/CI/azure/macos_tar_fixup.sh new file mode 100644 index 000000000..a500de951 --- /dev/null +++ b/CI/azure/macos_tar_fixup.sh @@ -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 --git a/CI/azure/prepare_assets.sh b/CI/azure/prepare_assets.sh index 8ea86c8d6..878b8bc5f 100755 --- a/CI/azure/prepare_assets.sh +++ b/CI/azure/prepare_assets.sh @@ -1,19 +1,20 @@ #!/bin/bash -e release_artifacts() { - local deb_linux_assets='Fedora-34 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-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 @@ release_artifacts() { 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 @@ release_artifacts() { } swdownloads_artifacts() { - local linux_dist='Fedora-34 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 @@ swdownloads_artifacts() { rm -r ../Linux-"${distribution}" done - local macOS_dist='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 @@ swdownloads_artifacts() { 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 --git a/CI/build_win.ps1 b/CI/build_win.ps1 index 2a385398d..765a6a09e 100644 --- a/CI/build_win.ps1 +++ b/CI/build_win.ps1 @@ -3,6 +3,7 @@ $ErrorActionPreference = "Stop" $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 @@ mkdir build-x64 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" -DLIBZSTD_INCLUDE_DIR="C:\\include" -DLIBZSTD_LIBRARIES="C:\\libs\\64\\libzstd.dll.a" .. +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" -DLIBZSTD_INCLUDE_DIR="C:\\include" -DLIBZSTD_LIBRARIES="C:\\libs\\64\\libzstd.dll.a" .. cmake --build . --config Release if ( $LASTEXITCODE -ne 0 ) { throw "[*] cmake build failure" diff --git a/CI/publish_deps.ps1 b/CI/publish_deps.ps1 index c7708f9f2..1f63f49eb 100644 --- a/CI/publish_deps.ps1 +++ b/CI/publish_deps.ps1 @@ -5,22 +5,34 @@ $ErrorView = "NormalView" $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-deps-20220517.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 --git a/CMakeLists.txt b/CMakeLists.txt index d9132dec3..72c121b20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,8 @@ if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|MSVC") set_target_properties(iio-compat PROPERTIES OUTPUT_NAME iio NO_SONAME ON + VERSION 0.99 + SOVERSION 0 ) if (NOT WIN32) set_target_properties(iio-compat PROPERTIES SUFFIX .so.0) @@ -214,11 +216,12 @@ if (WITH_USB_BACKEND) 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.") @@ -259,13 +262,14 @@ endif() # 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") target_compile_options(iio PRIVATE /WX) endif() elseif (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") @@ -277,8 +281,8 @@ elseif (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") 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") target_compile_options(iio PRIVATE -Werror) endif() else() @@ -295,6 +299,17 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif() endif() +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() + # Get the GIT hash of the latest commit include(FindGit OPTIONAL) if (GIT_FOUND) @@ -337,7 +352,7 @@ if(WITH_LOCAL_BACKEND) target_sources(iio PRIVATE deps/libini/libini.c) endif() - option(WITH_HWMON "Add compatibility with the hardware monitoring (hwmon) subsystem" OFF) + option(WITH_HWMON "Add compatibility with the hardware monitoring (hwmon) subsystem" ON) option(WITH_LOCAL_DMABUF_API "Add support for the DMABUF API" ON) if (WITH_LOCAL_DMABUF_API) @@ -595,6 +610,7 @@ endif() set(CMAKE_HTML_DEST_DIR "${CMAKE_CURRENT_BINARY_DIR}/html/v${VERSION}") +option(CPP_BINDINGS "Install C++ bindings" OFF) option(CSHARP_BINDINGS "Install C# bindings" OFF) option(PYTHON_BINDINGS "Install Python bindings" OFF) add_subdirectory(bindings) @@ -604,6 +620,18 @@ add_subdirectory(man) include(cmake/Install.cmake) +# 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) @@ -628,6 +656,7 @@ toggle_iio_feature("${WITH_MODULES}" modules) toggle_iio_feature("${WITH_USB_BACKEND_DYNAMIC}" usb-dynamic) toggle_iio_feature("${WITH_NETWORK_BACKEND_DYNAMIC}" network-dynamic) toggle_iio_feature("${WITH_SERIAL_BACKEND_DYNAMIC}" serial-dynamic) +toggle_iio_feature("${INSTALL_UDEV_RULE}" udev-rule) #add iiod settings list(APPEND IIO_FEATURES_ON ${IIOD_FEATURES_ON}) list(APPEND IIO_FEATURES_OFF ${IIOD_FEATURES_OFF}) @@ -644,3 +673,4 @@ string(REPLACE ";" " " IIO_FEATURES_OFF "${IIO_FEATURES_OFF}") message(STATUS "Features enabled : ${IIO_FEATURES_ON}") message(STATUS "Features disabled: ${IIO_FEATURES_OFF}") +message(STATUS "LOG_LEVEL set to \"${LOG_LEVEL}\"") diff --git a/Contributors.md b/Contributors.md index d320789de..63f935ccb 100644 --- a/Contributors.md +++ b/Contributors.md @@ -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 @@ or tiny-iiod the deeply embedded iio daemon. | 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 --git a/Distribution.xml.cmakein b/Distribution.xml.cmakein index 2bec89be2..741c65b82 100644 --- a/Distribution.xml.cmakein +++ b/Distribution.xml.cmakein @@ -1,7 +1,7 @@ Libiio - + diff --git a/Doxyfile.in b/Doxyfile.in index 53971ea8e..8b6eefdc4 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -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_NUMBER = @LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@ 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 @@ PROJECT_LOGO = # 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 @@ ALWAYS_DETAILED_SEC = NO 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 @@ FULL_PATH_NAMES = NO # 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 @@ -111,6 +188,16 @@ SHORT_NAMES = NO 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 @@ -131,15 +218,23 @@ QT_AUTOBRIEF = NO 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 @@ -158,16 +253,15 @@ TAB_SIZE = 4 # 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 @@ -176,25 +270,60 @@ TCL_SUBST = 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. @@ -202,22 +331,72 @@ EXTENSION_MAPPING = 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 @@ -272,11 +451,24 @@ TYPEDEF_HIDES_STRUCT = NO 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. @@ -286,35 +478,41 @@ LOOKUP_CACHE_SIZE = 0 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. @@ -329,6 +527,13 @@ EXTRACT_LOCAL_METHODS = NO 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 @@ -339,21 +544,21 @@ HIDE_UNDOC_MEMBERS = NO # 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. @@ -366,22 +571,36 @@ HIDE_IN_BODY_DOCS = NO 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. @@ -409,14 +628,14 @@ INLINE_INFO = YES # 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. @@ -461,27 +680,25 @@ SORT_BY_SCOPE_NAME = NO 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. @@ -492,7 +709,7 @@ GENERATE_DEPRECATEDLIST= YES # 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 @@ -506,8 +723,8 @@ ENABLED_SECTIONS = 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 @@ -552,11 +769,10 @@ LAYOUT_FILE = # 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 = @@ -572,7 +788,7 @@ CITE_BIB_FILES = 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. @@ -580,7 +796,7 @@ QUIET = YES 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. @@ -597,12 +813,22 @@ WARN_IF_DOC_ERROR = YES # 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 @@ -626,30 +852,41 @@ WARN_LOGFILE = @CMAKE_BINARY_DIR@/Dox_output_@PROJECT_NAME@ # 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. +# *.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 +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. @@ -664,7 +901,12 @@ RECURSIVE = NO # 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 @@ -697,7 +939,9 @@ EXCLUDE_SYMBOLS = # 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 @@ -733,6 +977,10 @@ IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc # 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 = @@ -742,11 +990,15 @@ INPUT_FILTER = # (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. @@ -794,7 +1046,7 @@ INLINE_SOURCES = NO 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 @@ -806,7 +1058,7 @@ REFERENCED_BY_RELATION = NO 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. @@ -826,12 +1078,12 @@ SOURCE_TOOLTIPS = YES # 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 # @@ -853,6 +1105,44 @@ USE_HTAGS = NO 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 #--------------------------------------------------------------------------- @@ -864,13 +1154,6 @@ VERBATIM_HEADERS = YES 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 @@ -883,7 +1166,7 @@ IGNORE_PREFIX = # 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 @@ -945,13 +1228,15 @@ HTML_FOOTER = @CMAKE_SOURCE_DIR@/doc/template/footer.html 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 = @@ -967,9 +1252,9 @@ HTML_EXTRA_STYLESHEET = 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. @@ -998,12 +1283,24 @@ HTML_COLORSTYLE_GAMMA = 80 # 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 = NO +# 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. @@ -1027,13 +1324,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # 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. @@ -1072,8 +1370,8 @@ DOCSET_PUBLISHER_NAME = Publisher # 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 @@ -1095,28 +1393,29 @@ GENERATE_HTMLHELP = NO 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. @@ -1147,7 +1446,8 @@ QCH_FILE = # 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. @@ -1155,8 +1455,8 @@ QHP_NAMESPACE = org.doxygen.Project # 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. @@ -1164,30 +1464,30 @@ QHP_VIRTUAL_FOLDER = doc # 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 = @@ -1229,7 +1529,7 @@ DISABLE_INDEX = NO # 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 @@ -1257,13 +1557,24 @@ ENUM_VALUES_PER_LINE = 4 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 @@ -1273,7 +1584,7 @@ EXT_LINKS_IN_WINDOW = NO 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. # @@ -1284,9 +1595,15 @@ FORMULA_FONTSIZE = 10 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. @@ -1297,7 +1614,7 @@ USE_MATHJAX = NO # 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. @@ -1312,8 +1629,8 @@ MATHJAX_FORMAT = HTML-CSS # 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 @@ -1327,7 +1644,8 @@ MATHJAX_EXTENSIONS = # 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. @@ -1355,12 +1673,12 @@ MATHJAX_CODEFILE = 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. @@ -1372,9 +1690,10 @@ SERVER_BASED_SEARCH = NO # 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. @@ -1385,10 +1704,11 @@ EXTERNAL_SEARCH = NO # 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 = @@ -1423,24 +1743,428 @@ EXTRA_SEARCH_MAPPINGS = # 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. @@ -1456,7 +2180,7 @@ MACRO_EXPANSION = NO 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. @@ -1498,9 +2222,9 @@ PREDEFINED = DOXYGEN 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. @@ -1520,7 +2244,7 @@ SKIP_FUNCTION_MACROS = YES # 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. @@ -1532,37 +2256,32 @@ TAGFILES = 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 @@ -1571,15 +2290,6 @@ PERL_PATH = /usr/bin/perl 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. @@ -1587,7 +2297,7 @@ MSCGEN_PATH = 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. @@ -1598,7 +2308,7 @@ HIDE_UNDOC_RELATIONS = YES # 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@ @@ -1612,7 +2322,7 @@ HAVE_DOT = @DOXYGEN_DOT_FOUND@ 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 @@ -1660,7 +2370,7 @@ COLLABORATION_GRAPH = YES 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. @@ -1677,10 +2387,32 @@ UML_LOOK = NO # 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. @@ -1712,7 +2444,8 @@ INCLUDED_BY_GRAPH = YES # # 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. @@ -1723,7 +2456,8 @@ CALL_GRAPH = YES # # 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. @@ -1746,11 +2480,17 @@ GRAPHICAL_HIERARCHY = YES 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. @@ -1772,7 +2512,7 @@ INTERACTIVE_SVG = NO # 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 @@ -1793,6 +2533,24 @@ MSCFILE_DIRS = 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 @@ -1829,7 +2587,7 @@ MAX_DOT_GRAPH_DEPTH = 10 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. @@ -1846,9 +2604,11 @@ DOT_MULTI_TARGETS = NO 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 --git a/README.md b/README.md index ea2309460..cbd91eb61 100644 --- a/README.md +++ b/README.md @@ -27,17 +27,23 @@ As with many open source packages, we use [GitHub](https://github.com/analogdevi |:-----------------------:|:---------------------:|:-------:|:-------------------:|:--------------:| | 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_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) | +| 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) | | -| | [![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) | | -| | 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) | | -| | [![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) | | +| 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 --git a/README_BUILD.md b/README_BUILD.md index 1c69ace2e..cdbe344df 100644 --- a/README_BUILD.md +++ b/README_BUILD.md @@ -34,24 +34,31 @@ analog@precision:~$ cd libiio ## Configure & Build when configuring libiio with cmake, there are a few optional settings that you can use to control the build. - -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 | +The recommendation is to leave things to the default. + +Cmake Options | Default | Target | Description | +---------------------- | ------- | -------| ---------------------------------------------- | +`BUILD_SHARED_LIBS` | ON | All | Build shared libraries | +`LIBIIO_COMPAT` | ON | All | Build Libiio v0.x compatiblity layer | +`WITH_MODULES` | OFF | All | Build modular backends | +'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) @@ -60,8 +67,11 @@ Cmake Options | Default | Depends on | Description ---------------------- | ------- | ------------- | ------------------------------- | `WITH_XML_BACKEND` | ON | libxml2 | Enable the XML backend, required when using network, serial, or USB backend | `WITH_USB_BACKEND` | ON | libusb | Enable the libusb backend | +`WITH_USB_BACKEND_DYNAMIC` | ON | Modules + USB backend | Compile the USB backend as a module | `WITH_SERIAL_BACKEND` | OFF | libserialport | Enable the Serial backend | +`WITH_SERIAL_BACKEND_DYNAMIC` | ON | Modules + serial backend | Compile the serial backend as a module | `WITH_NETWORK_BACKEND` | ON | | Supports TCP/IP | +`WITH_NETWORK_BACKEND_DYNAMIC` | ON | Modules + network backend | Compile the network backend as a module | `HAVE_DNS_SD` | ON | Networking | Enable DNS-SD (ZeroConf) support | `ENABLE_IPV6` | ON | Networking | Define if you want to enable IPv6 support | `WITH_LOCAL_BACKEND` | ON | Linux | Enables local support with iiod | @@ -73,11 +83,24 @@ There are a few options, which are experimental, which should be left to their d Cmake Options | Default | Description | ------------------- | ------- | ---------------------------------------------- | `WITH_LOCAL_MMAP_API` | ON | Use the mmap API provided in Analog Devices' kernel (not upstream) | -`WITH_NETWORK_GET_BUFFER` | OFF | Enable experimental zero-copy transfers | -`WITH_ZSTD` | OFF | Support for ZSTD compressed metadata | +`WITH_LOCAL_DMABUF_API` | ON | Use the experimental DMABUF interface (not upstream) | +`WITH_ZSTD` | ON | 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 +120,7 @@ Cmake Options | Default | Description | ```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 --git a/artifact_manifest.txt.cmakein b/artifact_manifest.txt.cmakein index a01f033d2..26ce54b1f 100644 --- a/artifact_manifest.txt.cmakein +++ b/artifact_manifest.txt.cmakein @@ -4,18 +4,42 @@ Linux-Fedora-34/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Fedora-34.deb 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 + Linux-Ubuntu-20.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-20.04.deb Linux-Ubuntu-20.04/libiio-@VERSION@.g@LIBIIO_VERSION_GIT@-Linux-Ubuntu-20.04.tar.gz 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 +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 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 @@ -65,3 +89,23 @@ Windows-VS-2022-x64/libusb-1.0.dll 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 --git a/azure-pipelines.yml b/azure-pipelines.yml index d4c082948..23b485277 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,7 @@ trigger: include: - main - master + - next_stable - dev - staging/* - 20* @@ -34,15 +35,30 @@ stages: # Docker Images strategy: matrix: + ubuntu_18_04: + image: 'tfcollins/libiio_ubuntu_18_04-ci:latest' + artifactName: 'Linux-Ubuntu-18.04' ubuntu_20_04: image: 'tfcollins/libiio_ubuntu_20_04-ci:latest' artifactName: 'Linux-Ubuntu-20.04' 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 @@ -52,9 +68,15 @@ stages: - script: | set -e mkdir build && cd build - cmake .. -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_MAN=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, nor stdatomics.h + 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 -DWITH_LOCAL_MMAP_API=OFF + fi make make package + make required2tar displayName: 'Build' - task: CopyFiles@2 inputs: @@ -69,6 +91,85 @@ stages: - 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-deps-20220517.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)' @@ -83,11 +184,13 @@ stages: 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'] ] @@ -180,33 +283,54 @@ stages: ############################################# - job: macOSBuilds # Host Box + workspace: + clean: all strategy: matrix: 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 sphinx-doc pkg-config + brew install doxygen libusb libxml2 ncurses cdk libserialport sphinx-doc pkg-config zstd 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=OFF + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=ON -DPYTHON_BINDINGS=ON -DWITH_EXAMPLES=ON -DWITH_SERIAL_BACKEND=ON make sudo make install cd .. @@ -214,15 +338,18 @@ stages: - 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=OFF -DCPACK_SYSTEM_NAME=${ARTIFACTNAME} + cmake .. -Werror=dev -DCOMPILE_WARNING_AS_ERROR=ON -DOSX_PACKAGE=OFF -DENABLE_PACKAGING=ON -DPYTHON_BINDINGS=ON -DWITH_SERIAL_BACKEND=ON -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 -DPYTHON_BINDINGS=ON -DWITH_DOC=ON -DWITH_SERIAL_BACKEND=ON make cd .. displayName: 'Build With Doc' diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index c3e8fb6b1..df2c5799e 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -1,3 +1,7 @@ +if (CPP_BINDINGS) + add_subdirectory(cpp) +endif() + if (CSHARP_BINDINGS) add_subdirectory(csharp) endif() @@ -8,6 +12,7 @@ endif() toggle_iio_feature("${PYTHON_BINDINGS}" python-bindings) toggle_iio_feature("${CSHARP_BINDINGS}" "c#-bindings") +toggle_iio_feature("${CPP_BINDINGS}" "c++-bindings") set(IIOB_FEATURES_ON "${IIO_FEATURES_ON}" PARENT_SCOPE) set(IIOB_FEATURES_OFF "${IIO_FEATURES_OFF}" PARENT_SCOPE) diff --git a/bindings/cpp/CMakeLists.txt b/bindings/cpp/CMakeLists.txt new file mode 100644 index 000000000..b417fce14 --- /dev/null +++ b/bindings/cpp/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) + +project(iiopp-enum LANGUAGES 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 --git a/bindings/cpp/examples/iiopp-enum.cpp b/bindings/cpp/examples/iiopp-enum.cpp new file mode 100644 index 000000000..254f7a495 --- /dev/null +++ b/bindings/cpp/examples/iiopp-enum.cpp @@ -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 --git a/bindings/cpp/iiopp.h b/bindings/cpp/iiopp.h new file mode 100644 index 000000000..4a1e3c134 --- /dev/null +++ b/bindings/cpp/iiopp.h @@ -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 --git a/bindings/csharp/Doxyfile.in b/bindings/csharp/Doxyfile.in index bb96e9186..4b9dd886a 100644 --- a/bindings/csharp/Doxyfile.in +++ b/bindings/csharp/Doxyfile.in @@ -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_NUMBER = @LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@ 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 @@ PROJECT_LOGO = # 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 @@ ALWAYS_DETAILED_SEC = NO 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. @@ -111,6 +188,16 @@ SHORT_NAMES = NO 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 @@ -131,15 +218,23 @@ QT_AUTOBRIEF = NO 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 @@ -158,16 +253,15 @@ TAB_SIZE = 4 # 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 @@ -176,25 +270,60 @@ TCL_SUBST = 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. @@ -202,22 +331,72 @@ EXTENSION_MAPPING = 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 @@ -272,11 +451,24 @@ TYPEDEF_HIDES_STRUCT = NO 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. @@ -286,35 +478,41 @@ LOOKUP_CACHE_SIZE = 0 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. @@ -329,6 +527,13 @@ EXTRACT_LOCAL_METHODS = NO 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 @@ -339,21 +544,21 @@ HIDE_UNDOC_MEMBERS = NO # 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. @@ -366,22 +571,36 @@ HIDE_IN_BODY_DOCS = NO 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. @@ -409,14 +628,14 @@ INLINE_INFO = YES # 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. @@ -461,27 +680,25 @@ SORT_BY_SCOPE_NAME = NO 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. @@ -506,8 +723,8 @@ ENABLED_SECTIONS = 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 @@ -552,11 +769,10 @@ LAYOUT_FILE = # 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 = @@ -572,7 +788,7 @@ CITE_BIB_FILES = 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. @@ -580,7 +796,7 @@ QUIET = YES 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. @@ -597,12 +813,22 @@ WARN_IF_DOC_ERROR = YES # 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 @@ -626,7 +852,7 @@ WARN_LOGFILE = @CMAKE_BINARY_DIR@/Dox_output_csharp # 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/ @@ -634,22 +860,32 @@ INPUT = @CMAKE_SOURCE_DIR@/bindings/csharp/ # 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. @@ -664,7 +900,7 @@ RECURSIVE = NO # 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 @@ -733,6 +969,10 @@ IMAGE_PATH = @CMAKE_SOURCE_DIR@/doc # 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 = @@ -742,11 +982,15 @@ INPUT_FILTER = # (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. @@ -794,7 +1038,7 @@ INLINE_SOURCES = NO 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 @@ -806,7 +1050,7 @@ REFERENCED_BY_RELATION = NO 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. @@ -826,12 +1070,12 @@ SOURCE_TOOLTIPS = YES # 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 # @@ -853,6 +1097,44 @@ USE_HTAGS = NO 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 #--------------------------------------------------------------------------- @@ -864,13 +1146,6 @@ VERBATIM_HEADERS = YES 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 @@ -883,7 +1158,7 @@ IGNORE_PREFIX = # 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 @@ -945,13 +1220,15 @@ HTML_FOOTER = @CMAKE_SOURCE_DIR@/doc/template/footer.html 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 = @@ -967,9 +1244,9 @@ HTML_EXTRA_STYLESHEET = 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. @@ -998,12 +1275,24 @@ HTML_COLORSTYLE_GAMMA = 80 # 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. @@ -1027,13 +1316,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # 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. @@ -1072,8 +1362,8 @@ DOCSET_PUBLISHER_NAME = Publisher # 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 @@ -1095,28 +1385,29 @@ GENERATE_HTMLHELP = NO 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. @@ -1147,7 +1438,8 @@ QCH_FILE = # 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. @@ -1155,8 +1447,8 @@ QHP_NAMESPACE = org.doxygen.Project # 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. @@ -1164,30 +1456,30 @@ QHP_VIRTUAL_FOLDER = doc # 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 = @@ -1229,7 +1521,7 @@ DISABLE_INDEX = NO # 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 @@ -1257,13 +1549,24 @@ ENUM_VALUES_PER_LINE = 4 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 @@ -1273,7 +1576,7 @@ EXT_LINKS_IN_WINDOW = NO 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. # @@ -1284,9 +1587,15 @@ FORMULA_FONTSIZE = 10 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. @@ -1297,7 +1606,7 @@ USE_MATHJAX = NO # 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. @@ -1312,8 +1621,8 @@ MATHJAX_FORMAT = HTML-CSS # 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 @@ -1327,7 +1636,8 @@ MATHJAX_EXTENSIONS = # 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. @@ -1355,12 +1665,12 @@ MATHJAX_CODEFILE = 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. @@ -1372,9 +1682,10 @@ SERVER_BASED_SEARCH = NO # 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. @@ -1385,10 +1696,11 @@ EXTERNAL_SEARCH = NO # 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 = @@ -1423,24 +1735,428 @@ EXTRA_SEARCH_MAPPINGS = # 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. @@ -1456,7 +2172,7 @@ MACRO_EXPANSION = NO 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. @@ -1498,9 +2214,9 @@ PREDEFINED = 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. @@ -1520,7 +2236,7 @@ SKIP_FUNCTION_MACROS = YES # 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. @@ -1532,37 +2248,32 @@ TAGFILES = 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 @@ -1571,15 +2282,6 @@ PERL_PATH = /usr/bin/perl 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. @@ -1587,7 +2289,7 @@ MSCGEN_PATH = 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. @@ -1598,7 +2300,7 @@ HIDE_UNDOC_RELATIONS = YES # 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@ @@ -1612,7 +2314,7 @@ HAVE_DOT = @DOXYGEN_DOT_FOUND@ 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 @@ -1660,7 +2362,7 @@ COLLABORATION_GRAPH = YES 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. @@ -1677,10 +2379,32 @@ UML_LOOK = NO # 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. @@ -1712,7 +2436,8 @@ INCLUDED_BY_GRAPH = YES # # 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. @@ -1723,7 +2448,8 @@ CALL_GRAPH = YES # # 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. @@ -1746,11 +2472,17 @@ GRAPHICAL_HIERARCHY = YES 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. @@ -1772,7 +2504,7 @@ INTERACTIVE_SVG = NO # 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 @@ -1793,6 +2525,24 @@ MSCFILE_DIRS = 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 @@ -1829,7 +2579,7 @@ MAX_DOT_GRAPH_DEPTH = 10 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. @@ -1846,9 +2596,11 @@ DOT_MULTI_TARGETS = NO 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 --git a/bindings/csharp/mainpage.dox b/bindings/csharp/mainpage.dox index ac1f6f752..d21bbd9f2 100644 --- a/bindings/csharp/mainpage.dox +++ b/bindings/csharp/mainpage.dox @@ -15,7 +15,7 @@ open-source, commercial or non-commercial applications. 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 --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 4c5bcb36f..e12d93c9f 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -42,10 +42,6 @@ else() 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 --git a/bindings/python/doc/iio_attr.rst b/bindings/python/doc/iio_attr.rst index 13e703474..3e2c18ca6 100644 --- a/bindings/python/doc/iio_attr.rst +++ b/bindings/python/doc/iio_attr.rst @@ -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 --git a/bindings/python/doc/iio_info.rst b/bindings/python/doc/iio_info.rst index 025a4e0c7..2f2e6dc81 100644 --- a/bindings/python/doc/iio_info.rst +++ b/bindings/python/doc/iio_info.rst @@ -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 --git a/bindings/python/doc/iio_readdev.rst b/bindings/python/doc/iio_readdev.rst index 013618b83..50e156555 100644 --- a/bindings/python/doc/iio_readdev.rst +++ b/bindings/python/doc/iio_readdev.rst @@ -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 --git a/bindings/python/doc/iio_writedev.rst b/bindings/python/doc/iio_writedev.rst index 4f069e0d7..f19258c11 100644 --- a/bindings/python/doc/iio_writedev.rst +++ b/bindings/python/doc/iio_writedev.rst @@ -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 --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein index c5d12e8ba..33a4eb91a 100644 --- a/bindings/python/setup.py.cmakein +++ b/bindings/python/setup.py.cmakein @@ -55,22 +55,18 @@ class InstallWrapper(install): 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 --git a/cmake/Install.cmake b/cmake/Install.cmake index 5c37178eb..41263b025 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -22,6 +22,12 @@ endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND OSX_FRAMEWORK) set(IIO_TESTS_INSTALL_DIR ${OSX_INSTALL_FRAMEWORKSDIR}/iio.framework/Tools) + + add_custom_command(TARGET iio-compat POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove Current + COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_VERSION} Current + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/iio.framework/Versions + COMMENT "Fixup Current symbolic link" VERBATIM) else() set(IIO_TESTS_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) endif() @@ -52,7 +58,7 @@ if(NOT SKIP_INSTALL_ALL) foreach(_tool ${IIO_TESTS_TARGETS}) list(APPEND IIO_TEST_PROGRAMS $) endforeach() - install(PROGRAMS ${IIO_TEST_PROGRAMS} DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(PROGRAMS ${IIO_TEST_PROGRAMS} DESTINATION ${IIO_TESTS_INSTALL_DIR}) endif() endif() @@ -85,6 +91,10 @@ if(WITH_DOC) 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) diff --git a/cmake/LinuxPackaging.cmake b/cmake/LinuxPackaging.cmake index d4d6181ca..396b391f9 100644 --- a/cmake/LinuxPackaging.cmake +++ b/cmake/LinuxPackaging.cmake @@ -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 @@ if (RPMBUILD_CMD) ) 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") + 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() -message(STATUS "Package dependencies (.deb): " ${CPACK_DEBIAN_PACKAGE_DEPENDS}) -if (CPACK_RPM_PACKAGE_REQUIRES) - message(STATUS "Package 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") -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) -endif() include(CPack) diff --git a/cmake/add_requirements2tar.sh.in b/cmake/add_requirements2tar.sh.in new file mode 100644 index 000000000..848a13bed --- /dev/null +++ b/cmake/add_requirements2tar.sh.in @@ -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 --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in new file mode 100644 index 000000000..ca6864dac --- /dev/null +++ b/cmake/cmake_uninstall.cmake.in @@ -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 --git a/context.c b/context.c index edc8e0c67..6bec7a6c7 100644 --- a/context.c +++ b/context.c @@ -596,7 +596,7 @@ iio_create_context_from_xml(const struct iio_context_params *params, } } - if (ctx->description) { + if (description && ctx->description) { len = iio_snprintf(NULL, 0, "%s %s", ctx->description, description); if (len < 0) { @@ -614,17 +614,18 @@ iio_create_context_from_xml(const struct iio_context_params *params, iio_snprintf(new_description, len + 1, "%s %s", ctx->description, description); - } else { + } else if (description) { new_description = iio_strdup(description); if (!new_description) { ret = -ENOMEM; prm_err(params, "Unable to alloc memory\n"); goto err_context_destroy; } + + free(ctx->description); + ctx->description = new_description; } - free(ctx->description); - ctx->description = new_description; ctx->params = *params; return ctx; diff --git a/device.c b/device.c index d8d4d1169..c62bafa7d 100644 --- a/device.c +++ b/device.c @@ -389,7 +389,7 @@ ssize_t iio_device_get_sample_size(const struct iio_device *dev, const struct iio_channels_mask *mask) { ssize_t size = 0; - unsigned int i; + unsigned int i, largest = 1; const struct iio_channel *prev = NULL; if (mask->words != (dev->nb_channels + 31) / 32) @@ -410,6 +410,9 @@ ssize_t iio_device_get_sample_size(const struct iio_device *dev, continue; } + if (length > largest) + largest = length; + if (size % length) size += 2 * length - (size % length); else @@ -417,6 +420,10 @@ ssize_t iio_device_get_sample_size(const struct iio_device *dev, prev = chn; } + + if (size % largest) + size += largest - (size % largest); + return size; } diff --git a/dns_sd.c b/dns_sd.c index cb6d12bdf..a0d86d0fb 100644 --- a/dns_sd.c +++ b/dns_sd.c @@ -127,7 +127,7 @@ static int dnssd_add_scan_result(const struct iio_context_params *params, } 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 --git a/dns_sd.h b/dns_sd.h index 160c97882..c7a5f1314 100644 --- a/dns_sd.h +++ b/dns_sd.h @@ -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 */ @@ -46,7 +50,7 @@ struct dns_sd_discovery_data { 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 --git a/dns_sd_avahi.c b/dns_sd_avahi.c index b0f69c632..7e974669a 100644 --- a/dns_sd_avahi.c +++ b/dns_sd_avahi.c @@ -52,12 +52,14 @@ static struct dns_sd_discovery_data *new_discovery_data(void) } static void avahi_process_resolved(struct dns_sd_cb_data *adata, + AvahiIfIndex iface, const AvahiAddress *addr, const char *host_name, const uint16_t port) { struct dns_sd_discovery_data *ddata = adata->d; const struct iio_context_params *params = adata->params; + char *ptr; /* Avahi is multi-threaded, so lock the list */ iio_mutex_lock(ddata->lock); @@ -87,6 +89,16 @@ static void avahi_process_resolved(struct dns_sd_cb_data *adata, } 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 = '%'; + } + prm_dbg(params, "\t\t%s:%u (%s)\n", host_name, port, ddata->addr_str); } @@ -131,7 +143,7 @@ static void __avahi_resolver_cb(AvahiServiceResolver *resolver, avahi_strerror(err)); break; case AVAHI_RESOLVER_FOUND: { - avahi_process_resolved(adata, address, host_name, port); + avahi_process_resolved(adata, iface, address, host_name, port); prm_dbg(params, "Avahi Resolver : service '%s' of type '%s' in domain '%s':\n", name, type, domain); break; @@ -164,7 +176,7 @@ static void avahi_host_resolver(AvahiHostNameResolver *resolver, host_name, avahi_strerror(err)); break; case AVAHI_RESOLVER_FOUND: - avahi_process_resolved(adata, address, host_name, IIOD_PORT); + avahi_process_resolved(adata, iface, address, host_name, IIOD_PORT); break; } @@ -295,8 +307,8 @@ int dnssd_find_hosts(const struct iio_context_params *params, avahi_simple_poll_loop(d->poll); if (d->resolved) { - port_knock_discovery_data(params, &d); remove_dup_discovery_data(params, &d); + port_knock_discovery_data(params, &d); } else ret = -ENXIO; @@ -389,8 +401,8 @@ int dnssd_resolve_host(const struct iio_context_params *params, #endif if (d->resolved) { - port_knock_discovery_data(params, &d); remove_dup_discovery_data(params, &d); + port_knock_discovery_data(params, &d); } else { ret = -ENXIO; goto err_mutex_destroy; diff --git a/dns_sd_bonjour.c b/dns_sd_bonjour.c index c05f9e6bb..dacad17e6 100644 --- a/dns_sd_bonjour.c +++ b/dns_sd_bonjour.c @@ -31,12 +31,10 @@ static void __cfnet_browser_cb(CFNetServiceBrowserRef browser, struct dns_sd_cb_data *bdata = info; struct dns_sd_discovery_data *dd = bdata->d; const struct iio_context_params *params = bdata->params; - 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; @@ -44,6 +42,7 @@ static void __cfnet_browser_cb(CFNetServiceBrowserRef browser, CFArrayRef addrArr; CFDataRef data; SInt32 port; + char *ptr; if ((flags & kCFNetServiceFlagIsDomain) != 0) { prm_err(params, "DNS SD: FATAL! Callback called for domain, not service.\n"); @@ -100,46 +99,44 @@ static void __cfnet_browser_cb(CFNetServiceBrowserRef browser, 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) { - prm_warn(params, "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); - prm_dbg(params, "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) { @@ -148,6 +145,11 @@ static void __cfnet_browser_cb(CFNetServiceBrowserRef browser, } else { prm_err(params, "DNS SD Bonjour Resolver : memory failure\n"); } + + prm_dbg(params, "DNS SD: added %s (%s:%d)\n", + hostname, dd->addr_str, port); + + dd = dd->next; } verify_flags: @@ -246,8 +248,8 @@ int dnssd_find_hosts(const struct iio_context_params *params, } } - port_knock_discovery_data(params, &d); remove_dup_discovery_data(params, &d); + port_knock_discovery_data(params, &d); *ddata = d; } diff --git a/dns_sd_windows.c b/dns_sd_windows.c index 913314ef0..4bbd13436 100644 --- a/dns_sd_windows.c +++ b/dns_sd_windows.c @@ -26,6 +26,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, @@ -70,6 +73,8 @@ static struct dns_sd_discovery_data *new_discovery_data(struct dns_sd_discovery_ 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; @@ -79,15 +84,19 @@ static mdns_string_t ip_address_to_string(char *buffer, size_t capacity, 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) @@ -190,7 +199,7 @@ static int open_client_sockets(const struct iio_context_params *params, * - 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, @@ -208,17 +217,22 @@ static int query_callback(int sock, const struct sockaddr *from, size_t addrlen, char entrybuffer[256]; char namebuffer[256]; mdns_record_srv_t srv; - bool found = false; - mdns_string_t entrystr, fromaddrstr, addrstr; + mdns_string_t entrystr, fromaddrstr; if (!dd) { prm_err(params, "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; @@ -229,130 +243,84 @@ static int query_callback(int sock, const struct sockaddr *from, size_t addrlen, 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); + prm_dbg(params, "%.*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; - prm_dbg(params, "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); - prm_dbg(params, "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)); - prm_dbg(params, "%.*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); - prm_dbg(params, "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; - prm_dbg(params, "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) { - unsigned short port = 0; + 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)); - prm_dbg(params, "%.*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); - prm_dbg(params, "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; - prm_dbg(params, "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) { + prm_dbg(params, "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)); + + prm_dbg(params, "Found IPv6 address %.*s for hostname %s\n", + MDNS_STRING_FORMAT(fromaddrstr), dd->hostname); + } +#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; } -#endif /* HAVE_IPV6 */ + + 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 + prm_dbg(params, "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; @@ -377,6 +345,8 @@ int dnssd_find_hosts(const struct iio_context_params *params, int transaction_id[32]; int nfds, res, ret = -ENOMEM; struct timeval timeout; + uint64_t nowtime; + int64_t diff; if (WSAStartup(versionWanted, &wsaData)) { prm_err(params, "Failed to initialize WinSock\n"); @@ -430,9 +400,11 @@ int dnssd_find_hosts(const struct iio_context_params *params, prm_dbg(params, "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; @@ -456,17 +428,27 @@ int dnssd_find_hosts(const struct iio_context_params *params, 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]); - prm_dbg(params, "Closed %i socket%s, processed %i record%s\n", + prm_dbg(params, "Closed %i socket%s, processed %zu record%s\n", num_sockets, (num_sockets > 1) ? "s" : "", records, (records > 1) ? "s" : "" ); - port_knock_discovery_data(params, &d); remove_dup_discovery_data(params, &d); + port_knock_discovery_data(params, &d); /* since d may have changed, make sure we pass back the start */ *ddata = d; diff --git a/doc/index.html.in b/doc/index.html.in index 5baefbb2b..5223d7eb4 100644 --- a/doc/index.html.in +++ b/doc/index.html.in @@ -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 --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 958e4ee14..8d1568e58 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -92,6 +92,13 @@ else() 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 --git a/examples/README.md b/examples/README.md index 9ddb99fe6..abffb8613 100644 --- a/examples/README.md +++ b/examples/README.md @@ -41,3 +41,8 @@ No hardware should be required to run this program. * 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 --git a/examples/ad9361-iiostream.c b/examples/ad9361-iiostream.c index ab55e4e90..c2d7697e5 100644 --- a/examples/ad9361-iiostream.c +++ b/examples/ad9361-iiostream.c @@ -58,7 +58,7 @@ static struct iio_channels_mask *rxmask = NULL; static struct iio_channels_mask *txmask = NULL; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying streams\n"); if (rxstream) {iio_stream_destroy(rxstream); } diff --git a/examples/ad9371-iiostream.c b/examples/ad9371-iiostream.c index ad9cf3754..a6610452b 100644 --- a/examples/ad9371-iiostream.c +++ b/examples/ad9371-iiostream.c @@ -55,7 +55,7 @@ static struct iio_channels_mask *rxmask = NULL; static struct iio_channels_mask *txmask = NULL; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying streams\n"); if (rxstream) {iio_stream_destroy(rxstream); } diff --git a/examples/adrv9009-iiostream.c b/examples/adrv9009-iiostream.c index 7348a040f..6902f3880 100644 --- a/examples/adrv9009-iiostream.c +++ b/examples/adrv9009-iiostream.c @@ -51,7 +51,7 @@ static struct iio_channels_mask *rxmask = NULL; static struct iio_channels_mask *txmask = NULL; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { printf("* Destroying streams\n"); diff --git a/examples/dummy-iiostream.c b/examples/dummy-iiostream.c index ea917a89a..92f67eb88 100644 --- a/examples/dummy-iiostream.c +++ b/examples/dummy-iiostream.c @@ -112,7 +112,7 @@ static bool stop; static bool has_repeat; /* cleanup and exit */ -static void shutdown() +static void shutdown(void) { int ret; diff --git a/tests/iio_adi_xflow_check.c b/examples/iio_adi_xflow_check.c similarity index 99% rename from tests/iio_adi_xflow_check.c rename to examples/iio_adi_xflow_check.c index 575e318da..cd166d2ba 100644 --- a/tests/iio_adi_xflow_check.c +++ b/examples/iio_adi_xflow_check.c @@ -16,7 +16,7 @@ #include #include -#include "iio_common.h" +#include "../tests/iio_common.h" #define MY_NAME "iio_adi_xflow_check" @@ -147,6 +147,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': diff --git a/iio-private.h b/iio-private.h index 4838b7406..79b23fbbc 100644 --- a/iio-private.h +++ b/iio-private.h @@ -228,6 +228,7 @@ unsigned int find_channel_modifier(const char *s, size_t *len_p); char *iio_strndup(const char *str, size_t n); char *iio_strtok_r(char *str, const char *delim, char **saveptr); 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 --git a/iiod/debug.h b/iiod/debug.h index 6a2ddf84e..cfe2339c3 100644 --- a/iiod/debug.h +++ b/iiod/debug.h @@ -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 /* __IIOD_DEBUG_H__ */ diff --git a/iiod/dns-sd.c b/iiod/dns-sd.c index 8955da6b9..75bb27d04 100644 --- a/iiod/dns-sd.c +++ b/iiod/dns-sd.c @@ -256,7 +256,6 @@ static void start_avahi_thd(struct thread_pool *pool, void *d) while(true) { ret = gethostname(host, sizeof(host)); - IIO_ERROR("host %s\n", host); if (ret || !strcmp(host, "none")) goto again; @@ -310,7 +309,7 @@ void start_avahi(struct thread_pool *pool, uint16_t port) 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 --git a/iiod/iiod.c b/iiod/iiod.c index 67c0ad26c..79fdf2002 100644 --- a/iiod/iiod.c +++ b/iiod/iiod.c @@ -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 @@ static void sig_handler(int sig) 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 @@ static int main_server(struct iio_context *ctx, bool debug, 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 @@ static int main_server(struct iio_context *ctx, bool debug, 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) { @@ -414,15 +474,12 @@ int main(int argc, char **argv) long nb_pipes = 3, val; char *end; const char *uri = "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) { @@ -497,6 +554,59 @@ int main(int argc, char **argv) } } + 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); + return EXIT_FAILURE; + } + + 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); + + 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(uri, 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(NULL, uri); if (iio_err(ctx)) { iio_strerror(-iio_err(ctx), err_str, sizeof(err_str)); @@ -512,30 +622,17 @@ int main(int argc, char **argv) xml_zstd = get_xml_zstd_data(ctx, &xml_zstd_len); - 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_free_device_pdata; - } - - set_handler(SIGHUP, sig_handler); - set_handler(SIGPIPE, sig_handler); - set_handler(SIGINT, sig_handler); - set_handler(SIGTERM, sig_handler); - 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; } } @@ -547,7 +644,7 @@ int main(int argc, char **argv) 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; } } @@ -556,20 +653,15 @@ int main(int argc, char **argv) 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_free_device_pdata: - free_device_pdata(ctx); - -out_destroy_context: +out_free_xml_data: free(xml_zstd); +out_destroy_context: iio_context_destroy(ctx); return ret; diff --git a/iiod/ops.c b/iiod/ops.c index af18c554a..4c741c218 100644 --- a/iiod/ops.c +++ b/iiod/ops.c @@ -758,8 +758,22 @@ static void rw_thd(struct thread_pool *pool, void *d) pthread_mutex_lock(&entry->thdlist_lock); if (ret < 0) { - IIO_ERROR("Unable to dequeue block: %d\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; } /* @@ -842,18 +856,18 @@ static void rw_thd(struct thread_pool *pool, void *d) continue; } - if (ret < 0) { - IIO_ERROR("Unable to enqueue block: %d\n", (int) ret); - break; - } - if (has_writers) { /* 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 --git a/iiod/ops.h b/iiod/ops.h index 3fde11e6e..837361f3b 100644 --- a/iiod/ops.h +++ b/iiod/ops.h @@ -123,9 +123,10 @@ void interpreter(struct iio_context *ctx, int fd_in, int fd_out, bool verbose, 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 --git a/iiod/thread-pool.c b/iiod/thread-pool.c index 2fd30825f..3b00a54ef 100644 --- a/iiod/thread-pool.c +++ b/iiod/thread-pool.c @@ -157,11 +157,18 @@ void thread_pool_stop(struct thread_pool *pool) } 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 @@ void thread_pool_stop_and_wait(struct thread_pool *pool) &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 @@ bool thread_pool_is_stopped(const struct thread_pool *pool) 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 --git a/iiod/thread-pool.h b/iiod/thread-pool.h index b4e8bf0bb..42d428598 100644 --- a/iiod/thread-pool.h +++ b/iiod/thread-pool.h @@ -19,6 +19,7 @@ int thread_pool_get_poll_fd(const struct thread_pool *pool); 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 --git a/iiod/usbd.c b/iiod/usbd.c index c4cc3a73e..0479ed386 100644 --- a/iiod/usbd.c +++ b/iiod/usbd.c @@ -217,7 +217,6 @@ static void usbd_main(struct thread_pool *pool, void *d) thread_pool_destroy(pdata->pool[i]); } - close(pdata->ep0_fd); free(pdata->ffs); free(pdata->pool); free(pdata); @@ -328,14 +327,34 @@ static int write_header(int fd, unsigned int nb_pipes) 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 @@ int start_usb_daemon(struct iio_context *ctx, const char *ffs, 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 @@ int start_usb_daemon(struct iio_context *ctx, const char *ffs, 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 @@ int start_usb_daemon(struct iio_context *ctx, const char *ffs, 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 --git a/include/iio/iio.h b/include/iio/iio.h index cce2a2fe0..914950d2f 100644 --- a/include/iio/iio.h +++ b/include/iio/iio.h @@ -459,6 +459,8 @@ __api __check_ret __cnst const char * iio_get_backend(unsigned int index); * - 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 --git a/local.c b/local.c index 33c3c4f8c..1ce9f3526 100644 --- a/local.c +++ b/local.c @@ -56,7 +56,7 @@ struct iio_channel_pdata { unsigned int nb_protected_attrs; }; -static const char * const device_attrs_blacklist[] = { +static const char * const device_attrs_denylist[] = { "dev", "uevent", }; @@ -748,8 +748,8 @@ static int add_attr_to_device(struct iio_device *dev, const char *attr) { 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")) @@ -1799,14 +1799,14 @@ static int build_names(void *d, const char *path) 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; @@ -1822,19 +1822,39 @@ static int local_context_scan(const struct iio_context_params *params, struct iio_scan *ctx, const char *args) { char *machine, buf[2 * BUF_SIZE], names[BUF_SIZE]; - bool exists = false; + bool no_iio, exists = false; const char *desc; int ret; ret = foreach_in_dir(NULL, &exists, "/sys/bus/iio", true, check_device); - if (ret < 0 || !exists) + no_iio = !exists; + 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(NULL, &names, "/sys/bus/iio/devices", - true, build_names); - if (ret < 0) - return 0; + if (exists) { + ret = foreach_in_dir(NULL, &names, "/sys/bus/iio/devices", + true, build_names); + if (ret < 0) + return 0; + } + + if (WITH_HWMON) { + exists = false; + ret = foreach_in_dir(NULL, &exists, "/sys/class/hwmon", + true, check_device); + if (!exists && !no_iio) + ret = 0; /* IIO devices but no hwmon devices - not an error */ + if (ret < 0) + return 0; + + ret = foreach_in_dir(NULL, &names, "/sys/class/hwmon", + true, build_names); + if (ret < 0) + return 0; + } machine = cat_file("/sys/firmware/devicetree/base/model"); if (!machine) @@ -1843,7 +1863,7 @@ static int local_context_scan(const struct iio_context_params *params, 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 --git a/mainpage.dox b/mainpage.dox index 84b561aed..6c4904903 100644 --- a/mainpage.dox +++ b/mainpage.dox @@ -11,7 +11,7 @@ License, version 2 or (at your option) any later version. 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 @@ The basic bricks of the libiio API are the iio_context, iio_device, iio_channel - 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 @@ This means applications compiled against an older version will work fine with a \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 --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 04ee6ed1e..b3a7a6fc4 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -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 @@ if (WITH_MAN) ${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 @@ if (WITH_MAN) 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 @@ if (WITH_MAN) ) 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} diff --git a/man/iio_attr.1.in b/man/iio_attr.1.in index 0b30e85a9..eb26d0a3b 100644 --- a/man/iio_attr.1.in +++ b/man/iio_attr.1.in @@ -82,45 +82,11 @@ Read and Write IIO Context attributes .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 available. -.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 @@ Generate small C or python snippets that emulate what you are doing on the comma .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 --git a/man/iio_common_cmds.1 b/man/iio_common_cmds.1 new file mode 100644 index 000000000..ce5ccc9d7 --- /dev/null +++ b/man/iio_common_cmds.1 @@ -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 --git a/man/iio_common_footer.1 b/man/iio_common_footer.1 new file mode 100644 index 000000000..e7dc7979d --- /dev/null +++ b/man/iio_common_footer.1 @@ -0,0 +1,19 @@ +.SH "SEE ALSO" +.ad l +.BR iio_attr (1), +.BR iio_info (1), +.BR iio_rwdev (1), +.BR iio_reg (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 --git a/man/iio_common_opts.1 b/man/iio_common_opts.1 new file mode 100644 index 000000000..cb8530af3 --- /dev/null +++ b/man/iio_common_opts.1 @@ -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 --git a/man/iio_genxml.1.in b/man/iio_genxml.1.in new file mode 100644 index 000000000..47fa05a77 --- /dev/null +++ b/man/iio_genxml.1.in @@ -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 --git a/man/iio_info.1.in b/man/iio_info.1.in index 2fa6ce24d..e39065f25 100644 --- a/man/iio_info.1.in +++ b/man/iio_info.1.in @@ -31,58 +31,16 @@ iio_info \- list IIO devices and device attributes [ .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 available. +##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 @@ Scan for available contexts and if only one is available use it. .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 --git a/man/iio_readdev.1.in b/man/iio_readdev.1.in deleted file mode 100644 index a312c20d8..000000000 --- a/man/iio_readdev.1.in +++ /dev/null @@ -1,137 +0,0 @@ -.\" 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_readdev 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" -.IX iio_readdev_ -.SH NAME -iio_readdev \- read buffers from an IIO device -.SH SYNOPSIS -.B iio_readdev -[ -.I options -] -[-n ] [-t ] [-T ] [-b ] [-s ] [ ...] -.SH DESCRIPTION -.B iio_reg -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 -.TP -.B \-t \-\-trigger -Use the specified trigger, if needed on the specified channel -.TP -.B \-b \-\-buffer-size -Size of the capture buffer. Default is 256. -.TP -.B \-s \-\-samples -Number of samples (not bytes) to capture, 0 = infinite. Default is 0. -.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 available. -.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. -.RS -.B \f(CWiio_attr \-a \-i \-c .\fP -.br -\f(CWUsing auto-detected IIO context at URI "usb:3.10.5"\fP -.br -dev 'cf-ad9361-lpc', channel 'voltage0' (input, index: 0, format: le:S12/16>>0) -.br -dev 'cf-ad9361-lpc', channel 'voltage1' (input, index: 1, format: le:S12/16>>0) -.RE -.PP -This captures 1024 samples of I and Q data from the USB attached AD9361, and -stores it (as raw binary) into the file samples.dat -.RS -.B \f(CWiio_readdev \-a \-s 1024 cf-ad9361-lpc voltage0 voltage1 > samples.dat\fP -.RE -.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 -.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 --git a/man/iio_reg.1.in b/man/iio_reg.1.in index 4518a469e..524df4b4f 100644 --- a/man/iio_reg.1.in +++ b/man/iio_reg.1.in @@ -34,7 +34,7 @@ iio_reg \- do a low level read or write to SPI or I2C register [] .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 @@ It provides a mechanism to read or write SPI or I2C registers for IIO devices. 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 --git a/man/iio_rwdev.1.in b/man/iio_rwdev.1.in new file mode 100644 index 000000000..8944e0160 --- /dev/null +++ b/man/iio_rwdev.1.in @@ -0,0 +1,96 @@ +.\" 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_rwdev 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" +.IX iio_rwdev_ +.SH NAME +iio_rwdev \- read/write buffers from/to an IIO device +.SH SYNOPSIS +.B iio_rwdev +[ +.I options +] +[-n ] [-t ] [-T ] [-b ] [-s ] [-w] [ ...] +.SH DESCRIPTION +.B iio_reg +is a utility for reading buffers from connected IIO devices, and sending resutls to standard out. + +.SH OPTIONS +##COMMON_COMMANDS_START## +##COMMON_COMMANDS_STOP## +.TP +.B \-w \-\-write +Write sample data to the IIO device. The default is to read samples from it. +.TP +.B \-t \-\-trigger +Use the specified trigger, if needed on the specified channel +.TP +.B \-b \-\-buffer-size +Size of the capture buffer. Default is 256. +.TP +.B \-s \-\-samples +Number of samples (not bytes) to capture, 0 = infinite. Default is 0. +.TP +.B \-T \-\-timeout +Buffer timeout in milliseconds. 0 = no timeout. Default is 0. +##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_rwdev in the same way you use many of the other libiio utilities. +You should specify a IIO device, and the specific channel to read or write. +When reading, channels must be input; when writing they must be output. +If no channel is provided, iio_rwdev will read from all input channels or write +to all output channels. +If no device is provided, iio_rwdev will print a few examples: +.RS +.B \f(CWiio_rwdev -a\fP +.br +Using auto-detected IIO context at URI "usb:3.10.5" +.br +Example : iio_rwdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage0 +.br +Example : iio_rwdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage1 +.br +Example : iio_rwdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage2 +.br +Example : iio_rwdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage3 +.br +Example : iio_rwdev -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 +stores it (as raw binary) into the file samples.dat +.RS +.B \f(CWiio_rwdev \-a \-s 1024 cf-ad9361-lpc voltage0 voltage1 > samples.dat\fP +.RE +.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 +.RE + diff --git a/man/iio_stresstest.1.in b/man/iio_stresstest.1.in new file mode 100644 index 000000000..64a28b320 --- /dev/null +++ b/man/iio_stresstest.1.in @@ -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 --git a/man/iio_writedev.1.in b/man/iio_writedev.1.in deleted file mode 100644 index 7d95f7068..000000000 --- a/man/iio_writedev.1.in +++ /dev/null @@ -1,135 +0,0 @@ -.\" 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_writedev 1 "@CMAKE_DATE@" "libiio-@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@" "LibIIO Utilities" -.IX iio_writedev_ -.SH NAME -iio_writedev \- write buffers on an IIO device -.SH SYNOPSIS -.B iio_writedev -[ -.I options -] -[-n ] [-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 available. -.RE -.TP -.B \-t \-\-trigger -Use the specified trigger, if needed on the specified channel -.TP -.B \-b \-\-buffer-size -Size of the capture buffer. Default is 256. -.TP -.B \-s \-\-samples -Number of samples (not bytes) to capture, 0 = infinite. Default is 0. -.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 \-c \-\-cyclic -Use cyclic buffer mode. - -.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. -.RS -.B \f(CWiio_attr \-a \-o \-c .\fP -.br -\f(CWUsing auto-detected IIO context at URI "usb:3.10.5"\fP -.br -dev 'cf-ad9361-dds-core-lpc', channel 'voltage0' (output, index: 0, format: le:S16/16>>0) -.br -dev 'cf-ad9361-dds-core-lpc', channel 'voltage1' (output, index: 1, format: le:S16/16>>0) -.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. -.RS -.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 --git a/man/iiod.1.in b/man/iiod.1.in new file mode 100644 index 000000000..fce7da40d --- /dev/null +++ b/man/iiod.1.in @@ -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 --git a/man/make_man.sh.in b/man/make_man.sh.in index 9dd31eb92..b05e3ab4f 100755 --- a/man/make_man.sh.in +++ b/man/make_man.sh.in @@ -32,7 +32,7 @@ cat <. .\" %%%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 --git a/man/make_util_pages.sh b/man/make_util_pages.sh new file mode 100755 index 000000000..61d4e2835 --- /dev/null +++ b/man/make_util_pages.sh @@ -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 --git a/network.c b/network.c index f3ea89ba1..4a77c17b7 100644 --- a/network.c +++ b/network.c @@ -277,7 +277,7 @@ static char * network_get_description(struct addrinfo *res, 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 { @@ -571,7 +571,7 @@ static ssize_t network_read_data(struct iiod_client_pdata *io_ctx, } static struct iio_context * network_create_context(const struct iio_context_params *params, - const char *host) + const char *hostname) { struct addrinfo hints, *res; struct iio_context *ctx; @@ -584,6 +584,10 @@ static struct iio_context * network_create_context(const struct iio_context_para char uri[FQDN_LEN + 3]; 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 unsigned int i; @@ -638,8 +642,10 @@ static struct iio_context * network_create_context(const struct iio_context_para } 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) return iio_ptr(-ENOENT); port_num = (uint16_t)tmp; diff --git a/serial.c b/serial.c index 656e588f5..c6fd347a8 100644 --- a/serial.c +++ b/serial.c @@ -100,24 +100,6 @@ static inline int libserialport_to_errno(enum sp_return ret) } } -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) - return iio_ptr(-ENOMEM); - - iio_snprintf(description, desc_len, "%s: %s", name, desc); - - return description; -} - static ssize_t serial_read_dev_attr(const struct iio_device *dev, unsigned int buf_id, const char *attr, char *dst, size_t len, @@ -347,8 +329,11 @@ static struct iio_context * serial_create_context( struct sp_port *port; struct iio_context_pdata *pdata; struct iio_context *ctx; - const char *ctx_uri = "uri"; - char *description, *uri, buf[16]; + const char *ctx_params[] = { + "uri", "serial,port", "serial,description", + }; + const char *ctx_params_values[ARRAY_SIZE(ctx_params)]; + char *uri, buf[16]; size_t uri_len; int ret; @@ -384,15 +369,10 @@ static struct iio_context * serial_create_context( } } while (ret); - description = serial_get_description(port); - ret = iio_err(description); - if (ret) - goto err_close_port; - pdata = zalloc(sizeof(*pdata)); if (!pdata) { ret = -ENOMEM; - goto err_free_description; + goto err_close_port; } pdata->port = port; @@ -409,9 +389,14 @@ static struct iio_context * serial_create_context( port_name, baud_rate, bits, parity_char(parity), stop, flow_char(flow)); + ctx_params_values[0] = uri; + ctx_params_values[1] = sp_get_port_name(port); + ctx_params_values[2] = sp_get_port_description(port); + ctx = iiod_client_create_context(pdata->iiod_client, - &iio_serial_backend, description, - &ctx_uri, (const char **)&uri, 1); + &iio_serial_backend, NULL, + ctx_params, ctx_params_values, + ARRAY_SIZE(ctx_params)); ret = iio_err(ctx); if (ret) goto err_destroy_iiod_client; @@ -425,8 +410,6 @@ static struct iio_context * serial_create_context( 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 --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 500a41317..9e548335e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10) set(IIO_TESTS_TARGETS iio_genxml iio_info iio_attr iio_rwdev iio_reg) if (PTHREAD_LIBRARIES OR ANDROID) - LIST(APPEND IIO_TESTS_TARGETS iio_adi_xflow_check iio_stresstest) + LIST(APPEND IIO_TESTS_TARGETS iio_stresstest) endif() if(APPLE) @@ -49,7 +49,7 @@ foreach (test ${IIO_TESTS_TARGETS}) endforeach() if(PTHREAD_LIBRARIES) - set(IIO_TESTS_NEED_PTHREAD iio_rwdev iio_adi_xflow_check iio_stresstest) + set(IIO_TESTS_NEED_PTHREAD iio_rwdev iio_stresstest) foreach(test ${IIO_TESTS_NEED_PTHREAD}) target_link_libraries(${test} LINK_PRIVATE ${PTHREAD_LIBRARIES}) diff --git a/tests/gen_code.c b/tests/gen_code.c index 65ffd42a9..117b68f05 100644 --- a/tests/gen_code.c +++ b/tests/gen_code.c @@ -51,7 +51,7 @@ bool gen_test_path(const char *gen_file) return false; last = strrchr(gen_file, '.'); - if (*last != '.') + if (!last) return false; last++; @@ -171,7 +171,7 @@ void gen_context (const char *uri_in) } } -void gen_context_destroy() +void gen_context_destroy(void) { if (!fd) return; diff --git a/tests/gen_code.h b/tests/gen_code.h index 125404cbc..0e1d5d41c 100644 --- a/tests/gen_code.h +++ b/tests/gen_code.h @@ -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 --git a/tests/iio_attr.c b/tests/iio_attr.c index eba42d56a..8c2efba62 100644 --- a/tests/iio_attr.c +++ b/tests/iio_attr.c @@ -367,6 +367,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': diff --git a/tests/iio_common.c b/tests/iio_common.c index 076faf8ca..90a7bc9ba 100644 --- a/tests/iio_common.c +++ b/tests/iio_common.c @@ -191,6 +191,7 @@ void free_argw(int argc, char * argw[]) 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'}, @@ -234,6 +235,7 @@ struct option * add_common_options(const struct option * longopts) 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:'" @@ -282,6 +284,10 @@ struct iio_context * handle_common_opts(char * name, int argc, 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"); @@ -433,6 +439,20 @@ void usage(char *name, const struct option *options, exit(0); } +void version(char *name) +{ + unsigned int i; + + printf("%s version: %u.%u (git tag:%s)\n", name, LIBIIO_VERSION_MAJOR, LIBIIO_VERSION_MINOR, LIBIIO_VERSION_GIT); + printf("Libiio version: %u.%u (git tag: %s) backends:", + iio_context_get_version_major(NULL), + iio_context_get_version_minor(NULL), + iio_context_get_version_tag(NULL)); + 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 --git a/tests/iio_common.h b/tests/iio_common.h index ab194081d..0886a68e6 100644 --- a/tests/iio_common.h +++ b/tests/iio_common.h @@ -46,13 +46,14 @@ int iio_device_enable_channel(const struct iio_device *dev, const char *channel, * 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[]); 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 --git a/tests/iio_genxml.c b/tests/iio_genxml.c index 41aa9382e..4aa94d71f 100644 --- a/tests/iio_genxml.c +++ b/tests/iio_genxml.c @@ -51,6 +51,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': diff --git a/tests/iio_info.c b/tests/iio_info.c index a23f40b27..1c73ffe52 100644 --- a/tests/iio_info.c +++ b/tests/iio_info.c @@ -63,16 +63,6 @@ int main(int argc, char **argv) argw = dup_argv(MY_NAME, argc, argv); - printf("Library version: %u.%u (git tag: %s)\n", - iio_context_get_version_major(NULL), - iio_context_get_version_minor(NULL), - iio_context_get_version_tag(NULL)); - - 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); opts = add_common_options(options); if (!opts) { @@ -84,6 +74,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': @@ -114,6 +105,7 @@ int main(int argc, char **argv) if (!ctx) return EXIT_FAILURE; + version(MY_NAME); printf("IIO context created with %s backend.\n", iio_context_get_name(ctx)); diff --git a/tests/iio_reg.c b/tests/iio_reg.c index e056c4349..36750329b 100644 --- a/tests/iio_reg.c +++ b/tests/iio_reg.c @@ -84,6 +84,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': diff --git a/tests/iio_rwdev.c b/tests/iio_rwdev.c index 0d3399b20..b7fc9fff9 100644 --- a/tests/iio_rwdev.c +++ b/tests/iio_rwdev.c @@ -234,6 +234,7 @@ int main(int argc, char **argv) switch (c) { /* All these are handled in the common */ case 'h': + case 'V': case 'n': case 'x': case 'u': diff --git a/tests/iio_stresstest.c b/tests/iio_stresstest.c index 84e459336..1c56f986f 100644 --- a/tests/iio_stresstest.c +++ b/tests/iio_stresstest.c @@ -101,7 +101,7 @@ static const struct option options[] = { {"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}, @@ -551,6 +551,12 @@ int main(int argc, char **argv) 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)); } @@ -690,6 +696,11 @@ int main(int argc, char **argv) /* 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 --git a/usb.c b/usb.c index 3f660c5a5..877abc994 100644 --- a/usb.c +++ b/usb.c @@ -1159,8 +1159,9 @@ static int parse_vid_pid(const char *vid_pid, uint16_t *vid, uint16_t *pid) 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; @@ -1170,8 +1171,9 @@ static int parse_vid_pid(const char *vid_pid, uint16_t *vid, uint16_t *pid) 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; diff --git a/utilities.c b/utilities.c index 53c2db80f..0a07cd395 100644 --- a/utilities.c +++ b/utilities.c @@ -21,6 +21,12 @@ #include #include +#ifdef _WIN32 +#include +#else +#include +#endif + #if defined(_WIN32) || \ (defined(__APPLE__) && defined(__MACH__)) || \ (defined(__USE_XOPEN2K8) && \ @@ -209,7 +215,7 @@ char *iio_strtok_r(char *str, const char *delim, char **saveptr) #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 } @@ -393,3 +399,25 @@ void iio_prm_printf(const struct iio_context_params *params, va_end(ap); } + +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 --git a/xml.c b/xml.c index f6c72a7bf..c0edea1ee 100644 --- a/xml.c +++ b/xml.c @@ -421,12 +421,14 @@ iio_create_xml_context_helper(const struct iio_context_params *params, 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) prm_warn(params, "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) prm_warn(params, "invalid format for minor version\n"); } else if (!strcmp((char *) attr->name, "version-git")) { git_tag = content;