diff --git a/.clang-format b/.clang-format index f0c16cd..b7a3938 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,7 @@ AllowAllConstructorInitializersOnNextLine: 'true' AllowAllParametersOfDeclarationOnNextLine: 'true' AllowShortBlocksOnASingleLine: 'true' AllowShortCaseLabelsOnASingleLine: 'true' -AllowShortFunctionsOnASingleLine: All +AllowShortFunctionsOnASingleLine: InlineOnly AllowShortIfStatementsOnASingleLine: Always AllowShortLambdasOnASingleLine: All AlwaysBreakAfterReturnType: None @@ -48,4 +48,4 @@ SpacesInAngles: 'false' SpacesInCStyleCastParentheses: 'false' Standard: Cpp11 TabWidth: '4' -UseTab: Never \ No newline at end of file +UseTab: Never diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..75cfebb --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,61 @@ +Checks: 'bugprone-*, + cert-dcl21-cpp, + cert-dcl58-cpp, + cert-err34-c, + cert-err52-cpp, + cert-err60-cpp, + cert-flp30-c, + cert-msc50-cpp, + cert-msc51-cpp, + cert-str34-c, + cppcoreguidelines-*, + clang-analyzer-*, + google-default-arguments, + google-explicit-constructor, + google-runtime-operator, + hicpp-exception-baseclass, + hicpp-multiway-paths-covered, + misc-misplaced-const, + misc-new-delete-overloads, + misc-no-recursion, + misc-non-copyable-objects, + misc-throw-by-value-catch-by-reference, + misc-unconventional-assign-operator, + misc-uniqueptr-reset-release, + modernize-*, + mpi-buffer-deref, + mpi-type-mismatch, + openmp-use-default-none, + portability-*, + performance-*, + readability-avoid-const-params-in-decls, + readability-const-return-type, + readability-container-size-empty, + readability-convert-member-functions-to-static, + readability-delete-null-pointer, + readability-deleted-default, + readability-inconsistent-declaration-parameter-name, + readability-make-member-function-const, + readability-misleading-indentation, + readability-misplaced-array-index, + readability-non-const-parameter, + readability-redundant-control-flow, + readability-redundant-declaration, + readability-redundant-function-ptr-dereference, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-redundant-string-init, + readability-simplify-subscript-expr, + readability-static-accessed-through-instance, + readability-static-definition-in-anonymous-namespace, + readability-string-compare, + readability-uniqueptr-delete-release, + readability-use-anyofallof + -modernize-use-trailing-return-type + -bugprone-exception-escape' +WarningsAsErrors: '*, + -modernize-*, + -readability-* + -cppcoreguidelines-avoid-magic-numbers, + -cppcoreguidelines-pro-type-vararg' +HeaderFilterRegex: '' diff --git a/.clang-tidy-noerrors b/.clang-tidy-noerrors new file mode 100644 index 0000000..7df421a --- /dev/null +++ b/.clang-tidy-noerrors @@ -0,0 +1,57 @@ +Checks: 'bugprone-*, + cert-dcl21-cpp, + cert-dcl58-cpp, + cert-err34-c, + cert-err52-cpp, + cert-err60-cpp, + cert-flp30-c, + cert-msc50-cpp, + cert-msc51-cpp, + cert-str34-c, + cppcoreguidelines-*, + clang-analyzer-*, + google-default-arguments, + google-explicit-constructor, + google-runtime-operator, + hicpp-exception-baseclass, + hicpp-multiway-paths-covered, + misc-misplaced-const, + misc-new-delete-overloads, + misc-no-recursion, + misc-non-copyable-objects, + misc-throw-by-value-catch-by-reference, + misc-unconventional-assign-operator, + misc-uniqueptr-reset-release, + modernize-*, + mpi-buffer-deref, + mpi-type-mismatch, + openmp-use-default-none, + portability-*, + performance-*, + readability-avoid-const-params-in-decls, + readability-const-return-type, + readability-container-size-empty, + readability-convert-member-functions-to-static, + readability-delete-null-pointer, + readability-deleted-default, + readability-inconsistent-declaration-parameter-name, + readability-make-member-function-const, + readability-misleading-indentation, + readability-misplaced-array-index, + readability-non-const-parameter, + readability-redundant-control-flow, + readability-redundant-declaration, + readability-redundant-function-ptr-dereference, + readability-redundant-smartptr-get, + readability-redundant-string-cstr, + readability-redundant-string-init, + readability-simplify-subscript-expr, + readability-static-accessed-through-instance, + readability-static-definition-in-anonymous-namespace, + readability-string-compare, + readability-uniqueptr-delete-release, + readability-use-anyofallof + -modernize-use-trailing-return-type + -bugprone-exception-escape' +WarningsAsErrors: '' +HeaderFilterRegex: '' diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml index 85986e1..9632562 100644 --- a/.github/workflows/clang-format.yml +++ b/.github/workflows/clang-format.yml @@ -4,11 +4,16 @@ jobs: formatting-check: name: Formatting Check runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'test' steps: - - uses: actions/checkout@v2 - - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.8.0 - with: - clang-format-version: '14' - check-path: 'src' - \ No newline at end of file + - uses: actions/checkout@v2 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.8.0 + with: + clang-format-version: '14' + check-path: ${{ matrix.path }} + diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c26ae5f..395d64d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,7 +1,6 @@ name: CMake -on: - [push, pull_request ] +on: [push, pull_request] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -23,10 +22,48 @@ jobs: - name: Update submodules run: git submodule update + - name: create tmp dir + run: mkdir tmp + + - name: update + run: | + sudo apt update + sudo apt upgrade -y + + - name: install cxxopts + run: | + git clone https://github.com/jarro2783/cxxopts.git tmp/cxxopts + cd tmp/cxxopts + git checkout $(git tag | grep -P '^v\d+\.\d+\.\d+$' | sort | tail -1) + cmake -B build . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF -DCLANG_TIDY=OFF + cmake --build build + sudo cmake --install build + cd - + + - name: install cxxshm + run: | + git clone https://github.com/NikolasK-source/cxxshm.git tmp/cxxshm + cd tmp/cxxshm + git checkout $(git tag | grep -P '^v\d+\.\d+\.\d+$' | sort | tail -1) + cmake -B build . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF -DCLANG_TIDY=OFF + cmake --build build + sudo cmake --install build + cd - + + - name: install cxxsemaphore + run: | + git clone https://github.com/NikolasK-source/cxxsemaphore.git tmp/cxxsemaphore + cd tmp/cxxsemaphore + git checkout $(git tag | grep -P '^v\d+\.\d+\.\d+$' | sort | tail -1) + cmake -B build . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF -DCLANG_TIDY=OFF + cmake --build build + sudo cmake --install build + cd - + - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF -DCLANG_TIDY=OFF -DBUILD_DOC=OFF - name: Build # Build your program with the given configuration diff --git a/.github/workflows/flatpak_test.yml b/.github/workflows/flatpak.yml similarity index 84% rename from .github/workflows/flatpak_test.yml rename to .github/workflows/flatpak.yml index 7702b8c..95ffaa3 100644 --- a/.github/workflows/flatpak_test.yml +++ b/.github/workflows/flatpak.yml @@ -1,14 +1,12 @@ on: - push: - branches: [ "main", "development" ] - pull_request: + [ push, pull_request ] name: Flatpak_test jobs: flatpak: name: "Flatpak" runs-on: ubuntu-latest container: - image: bilelmoussaoui/flatpak-github-actions:freedesktop-21.08 + image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 options: --privileged steps: - uses: actions/checkout@v2 @@ -22,9 +20,9 @@ jobs: - name: Update submodules run: git submodule update - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 name: "Build" with: bundle: test_stdin-to-modbus-shm.flatpak manifest-path: network.koesling.test-stdin-to-modbus-shm.yml - cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file + cache-key: flatpak-builder-${{ github.sha }} diff --git a/.github/workflows/flatpak_release.yml b/.github/workflows/flatpak_release.yml deleted file mode 100644 index 95ba186..0000000 --- a/.github/workflows/flatpak_release.yml +++ /dev/null @@ -1,20 +0,0 @@ -on: - push: - branches: [release] - pull_request: -name: Flatpak_release -jobs: - flatpak: - name: "Flatpak" - runs-on: ubuntu-latest - container: - image: bilelmoussaoui/flatpak-github-actions:freedesktop-21.08 - options: --privileged - steps: - - uses: actions/checkout@v2 - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 - name: "Build" - with: - bundle: stdin-to-modbus-shm.flatpak - manifest-path: network.koesling.stdin-to-modbus-shm.yml - cache-key: flatpak-builder-${{ github.sha }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index aa61eca..4cfb858 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # general build* docs/* +docs_doxy !docs/index.md !docs/_config.yml diff --git a/.gitmodules b/.gitmodules index 75d6f0d..9e03992 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,3 @@ -[submodule "libs/cxxopts"] - path = libs/cxxopts - url = https://github.com/NikolasK-source/cxxopts.git -[submodule "libs/cxxshm"] - path = libs/cxxshm - url = https://github.com/NikolasK-source/cxxshm.git [submodule "libs/cxxendian"] path = libs/cxxendian url = https://github.com/NikolasK-source/cxxendian.git -[submodule "libs/cxxsemaphore"] - path = libs/cxxsemaphore - url = https://github.com/NikolasK-source/cxxsemaphore.git diff --git a/CMakeLists.txt b/CMakeLists.txt index be89f89..483cfaf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,19 @@ -cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR) +# +# Copyright (C) 2020-2024 Nikolas Koesling . +# This template is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +cmake_minimum_required(VERSION 3.22.0 FATAL_ERROR) # ----------------------------------------------- User settings -------------------------------------------------------- # ====================================================================================================================== # project -project(stdin-to-modbus-shm LANGUAGES CXX VERSION 1.2.0) +project(stdin-to-modbus-shm LANGUAGES CXX VERSION 1.4.0) # settings set(Target "stdin-to-modbus-shm") # Executable name (without file extension!) -set(STANDARD 17) # C++ Standard +set(STANDARD 20) # C++ Standard set(ARCHITECTURE "native") # CPU architecture to optimize for (only relevant if OPTIMIZE_FOR_ARCHITECTURE is ON) # options @@ -19,12 +24,12 @@ option(MAKE_32_BIT_BINARY "Compile as 32 bit application. No effect on 32 bit Sy option(OPENMP "enable openmp" OFF) option(OPTIMIZE_DEBUG "apply optimizations also in debug mode" ON) option(CLANG_FORMAT "use clang-format" ON) -option(CLANG_TIDY "use clang-tidy" OFF) +option(CLANG_TIDY "use clang-tidy" ON) +option(CLANG_TIDY_NO_ERRORS "do not treat clang-tidy warnings as errors" ON) option(OPTIMIZE_FOR_ARCHITECTURE "enable optimizations for specified architecture" OFF) -option(LTO_ENABLED "enable interprocedural and link time optimizations" OFF) +option(LTO_ENABLED "enable interprocedural and link time optimizations" ON) option(COMPILER_EXTENSIONS "enable compiler specific C++ extensions" OFF) - - +option(ENABLE_TEST "enable test builds" OFF) # ====================================================================================================================== # ====================================================================================================================== @@ -32,257 +37,4 @@ option(COMPILER_EXTENSIONS "enable compiler specific C++ extensions" OFF) # ----------------------------------------------- Do not change -------------------------------------------------------- # ====================================================================================================================== - -# TODO select useful checks -if(CLANG_TIDY) - set(CMAKE_CXX_CLANG_TIDY - clang-tidy; - -checks=*; - ) -endif() - -# add executable -add_executable(${Target}) -install(TARGETS ${Target}) - -# set source and libraries directory -add_subdirectory("src") -add_subdirectory("libs") - -# force C++ Standard and disable/enable compiler specific extensions -set_target_properties(${Target} PROPERTIES - CXX_STANDARD ${STANDARD} - CXX_STANDARD_REQUIRED ON - CXX_EXTENSIONS ${COMPILER_EXTENSIONS} - ) - -# compiler definitions -target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\"") -target_compile_definitions(${Target} PUBLIC "PROJECT_NAME=\"${CMAKE_PROJECT_NAME}\"") -target_compile_definitions(${Target} PUBLIC "COMPILER_INFO=\"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\"") -target_compile_definitions(${Target} PUBLIC "SYSTEM_INFO=\"${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR}\"") - -# options that are valid for gcc and clang -function(commonopts) - # more debugging information - if(OPTIMIZE_DEBUG) - SET(CMAKE_CXX_FLAGS_DEBUG "-g3 -O3") - else() - SET(CMAKE_CXX_FLAGS_DEBUG "-g3") - endif() - - if(MAKE_32_BIT_BINARY) - message(STATUS "Compiling as 32 bit binary.") - target_compile_options(${Target} PUBLIC -m32) - endif() - - if(ENABLE_MULTITHREADING AND OPENMP) - message(STATUS "openmp enabled") - target_compile_options(${Target} PUBLIC -fopenmp) - endif() - - if(OPTIMIZE_FOR_ARCHITECTURE) - message(STATUS "using architecture specific code generator: ${ARCHITECTURE}") - target_compile_options(${Target} PUBLIC -march=${ARCHITECTURE}) - endif() -endfunction() - -# warnings that are valid for gcc and clang -function(commonwarn) - target_compile_options(${Target} PUBLIC -Wall -Wextra -Werror -pedantic -pedantic-errors) - - # see https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html for more details - - target_compile_options(${Target} PUBLIC -Wnull-dereference) - target_compile_options(${Target} PUBLIC -Wold-style-cast) - target_compile_options(${Target} PUBLIC -Wdouble-promotion) - target_compile_options(${Target} PUBLIC -Wformat=2) - target_compile_options(${Target} PUBLIC -Winit-self) - target_compile_options(${Target} PUBLIC -Wsequence-point) - target_compile_options(${Target} PUBLIC -Wswitch-default) - target_compile_options(${Target} PUBLIC -Wswitch-enum -Wno-error=switch-enum) - target_compile_options(${Target} PUBLIC -Wconversion) - target_compile_options(${Target} PUBLIC -Wcast-align) - target_compile_options(${Target} PUBLIC -Wfloat-equal) - target_compile_options(${Target} PUBLIC -Wundef) - target_compile_options(${Target} PUBLIC -Wcast-qual) -endfunction() - -# gcc specific warnings -function(gccwarn) - # see https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html for more details - - target_compile_options(${Target} PUBLIC -Wduplicated-cond) - target_compile_options(${Target} PUBLIC -Wduplicated-branches) - target_compile_options(${Target} PUBLIC -Wlogical-op) - target_compile_options(${Target} PUBLIC -Wrestrict) - target_compile_options(${Target} PUBLIC -Wuseless-cast -Wno-error=useless-cast) - target_compile_options(${Target} PUBLIC -Wshadow=local -Wno-error=shadow) - - target_compile_options(${Target} PUBLIC -Wno-error=switch-default) - target_compile_options(${Target} PUBLIC -Wno-error=attributes) -endfunction() - -# clang specific warnings -function(clangwarn) - # enable all - target_compile_options(${Target} PUBLIC -Weverything) - - # and remove "useless" ones - target_compile_options(${Target} PUBLIC -Wno-c++98-compat) - target_compile_options(${Target} PUBLIC -Wno-c++98-c++11-c++14-compat) - target_compile_options(${Target} PUBLIC -Wno-c++98-compat-pedantic) - target_compile_options(${Target} PUBLIC -Wno-error=covered-switch-default) - target_compile_options(${Target} PUBLIC -Wno-shadow-field-in-constructor) - target_compile_options(${Target} PUBLIC -Wno-padded) - target_compile_options(${Target} PUBLIC -Wno-shadow-field) - target_compile_options(${Target} PUBLIC -Wno-weak-vtables) - target_compile_options(${Target} PUBLIC -Wno-exit-time-destructors) - target_compile_options(${Target} PUBLIC -Wno-global-constructors) - target_compile_options(${Target} PUBLIC -Wno-error=unreachable-code-return) - target_compile_options(${Target} PUBLIC -Wno-error=unreachable-code) - target_compile_options(${Target} PUBLIC -Wno-error=documentation) - target_compile_options(${Target} PUBLIC -Wno-error=unused-exception-parameter) - target_compile_options(${Target} PUBLIC -Wno-nested-anon-types) - target_compile_options(${Target} PUBLIC -Wno-gnu-anonymous-struct) - -endfunction() - -if(COMPILER_WARNINGS) - message(STATUS "Compiler warnings enabled.") -else() - message(STATUS "Compiler warnings disabled.") -endif() - -# compiler settings -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - # compiler specific defines - target_compile_definitions(${Target} PUBLIC "COMPILER_GNU") - target_compile_definitions(${Target} PUBLIC "COMPILER_GNU_CLANG") - - commonopts() - - # enable warnings - if(COMPILER_WARNINGS) - commonwarn() - gccwarn() - else() - target_compile_options(${Target} PUBLIC -w) - endif() -elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # compiler specific defines - target_compile_definitions(${Target} PUBLIC "COMPILER_CLANG") - target_compile_definitions(${Target} PUBLIC "COMPILER_GNU_CLANG") - - commonopts() - - # enable warnings (general) - if(COMPILER_WARNINGS) - commonwarn() - clangwarn() - else() - target_compile_options(${Target} PUBLIC -w) - endif() - -elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - # compiler specific defines - target_compile_definitions(${Target} PUBLIC "COMPILER_MSVC") - - # more debugging information - SET(CMAKE_CXX_FLAGS_DEBUG "/Zi") - message(AUTHOR_WARNING - "You are using the MSVC compiler! Only gcc/clang are fully supported by this template.") - - if(COMPILER_WARNINGS) - target_compile_options(${Target} PUBLIC /Wall /WX) - endif() - - if(ENABLE_MULTITHREADING AND OPENMP) - target_compile_options(${Target} PUBLIC /OpenMP) - endif() -else() - message(AUTHOR_WARNING - "You are using a compiler other than gcc/clang. Only gcc/clang are fully supported by this template.") -endif() - -if(ENABLE_MULTITHREADING) - # required by threading lib (std::thread) - set(THREADS_PREFER_PTHREAD_FLAG ON) - find_package(Threads REQUIRED) - target_link_libraries(${Target} PRIVATE Threads::Threads) -endif() - -# lto -if(LTO_ENABLED) - include(CheckIPOSupported) - check_ipo_supported(RESULT ipo_supported OUTPUT error) - if( ipo_supported ) - message(STATUS "IPO / LTO enabled") - set_property(TARGET ${Target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) - else() - message(STATUS "IPO / LTO not supported: <${error}>") - endif() -endif() - -# os dependent defines -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - target_compile_definitions(${Target} PUBLIC "OS_LINUX") - target_compile_definitions(${Target} PUBLIC "OS_POSIX") -elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - target_compile_definitions(${Target} PUBLIC "OS_FREEBSD") - target_compile_definitions(${Target} PUBLIC "OS_POSIX") -elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") - target_compile_definitions(${Target} PUBLIC "OS_WINDOWS") - # TODO check options - target_compile_options(${Target} PUBLIC -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd) - SET(CMAKE_CXX_FLAGS_DEBUG "-g3 -D_DEBUG") -elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") - target_compile_definitions(${Target} PUBLIC "OS_DARWIN") - target_compile_definitions(${Target} PUBLIC "OS_POSIX") -endif() - -# architecture defines -target_compile_definitions(${Target} PUBLIC CPU_WORD_BYTES=${CMAKE_SIZEOF_VOID_P}) - - -if(BUILD_DOC) - # doxygen documentation (https://vicrucann.github.io/tutorials/quick-cmake-doxygen/) - # check if Doxygen is installed - find_package(Doxygen) - if (DOXYGEN_FOUND) - # set input and output files - set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) - set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - - if(EXISTS ${DOXYGEN_IN}) - # request to configure the file - configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) - message(STATUS "Doxygen configured") - - # note the option ALL which allows to build the docs together with the application - add_custom_target( doc_doxygen ALL - COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM ) - message(STATUS "Added target doc_doxygen") - else() - message(WARNING "doxygen documentation requested, but file ${DOXYGEN_IN} does not exist.") - endif() - else (DOXYGEN_FOUND) - message(WARNING "Doxygen need to be installed and accessible to generate the doxygen documentation.") - endif (DOXYGEN_FOUND) -endif() - -# add clang format target -if(CLANG_FORMAT) - set(CLANG_FORMAT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format) - - if(EXISTS ${CLANG_FORMAT_FILE}) - include(ClangFormat.cmake) - target_clangformat_setup(${Target}) - message(STATUS "Added clang format target(s)") - else() - message(WARNING "Clang format enabled, but file ${CLANG_FORMAT_FILE} does not exist") - endif() -endif() +include(cmake_files/setup.cmake) diff --git a/Doxyfile.in b/Doxyfile.in index b059178..8e0bf91 100644 --- a/Doxyfile.in +++ b/Doxyfile.in @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs +OUTPUT_DIRECTORY = docs_doxy # 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 diff --git a/LICENSE b/LICENSE index 2df420f..63c3050 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,674 @@ -MIT License - -Copyright (c) 2021-2022 Nikolas Koesling - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: 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 3 of the License, or + (at your option) any later version. + + This program 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 program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {{ project }} Copyright (C) {{ year }} {{ organization }} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ClangFormat.cmake b/cmake_files/ClangFormat.cmake similarity index 100% rename from ClangFormat.cmake rename to cmake_files/ClangFormat.cmake diff --git a/cmake_files/compileropts.cmake b/cmake_files/compileropts.cmake new file mode 100644 index 0000000..df3e8e5 --- /dev/null +++ b/cmake_files/compileropts.cmake @@ -0,0 +1,59 @@ +# +# Copyright (C) 2022 Nikolas Koesling . +# This template is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +# options that are valid for gcc and clang +function(commonopts target) + # more debugging information + if(OPTIMIZE_DEBUG) + SET(CMAKE_CXX_FLAGS_DEBUG "-g3 -O3") + else() + SET(CMAKE_CXX_FLAGS_DEBUG "-g3") + endif() + + if(MAKE_32_BIT_BINARY) + message(STATUS "Compiling as 32 bit binary.") + target_compile_options(${target} PUBLIC -m32) + endif() + + if(OPTIMIZE_FOR_ARCHITECTURE) + message(STATUS "using architecture specific code generator: ${ARCHITECTURE}") + target_compile_options(${target} PUBLIC -march=${ARCHITECTURE}) + endif() +endfunction() + +function(set_options target use_omp) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + commonopts(${target}) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + commonopts(${target}) + + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + # TODO check options + target_compile_options(${target} PUBLIC -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd) + SET(CMAKE_CXX_FLAGS_DEBUG "-g3 -D_DEBUG") + endif() + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + # more debugging information + SET(CMAKE_CXX_FLAGS_DEBUG "/Zi") + + if(ENABLE_MULTITHREADING AND OPENMP) + target_compile_options(${target} PUBLIC /OpenMP) + endif() + else() + message(AUTHOR_WARNING + "You are using a compiler other than gcc/clang. Only gcc/clang are fully supported by this template.") + endif() + + if(use_omp) + find_package(OpenMP) + if (OPENMP_FOUND) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") + target_link_libraries(${target} PRIVATE OpenMP::OpenMP_CXX) + message(STATUS "openmp enabled") + endif() + endif() +endfunction() diff --git a/cmake_files/define.cmake b/cmake_files/define.cmake new file mode 100644 index 0000000..84ab3f8 --- /dev/null +++ b/cmake_files/define.cmake @@ -0,0 +1,54 @@ +# +# Copyright (C) 2022 Nikolas Koesling . +# This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +function(set_definitions target) + # compiler + if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # compiler specific defines + target_compile_definitions(${target} PUBLIC "COMPILER_GNU") + target_compile_definitions(${target} PUBLIC "COMPILER_GNU_CLANG") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + # compiler specific defines + target_compile_definitions(${target} PUBLIC "COMPILER_CLANG") + target_compile_definitions(${target} PUBLIC "COMPILER_GNU_CLANG") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + target_compile_definitions(${target} PUBLIC "COMPILER_MSVC") + message(AUTHOR_WARNING + "You are using a compiler other than gcc/clang. Only gcc/clang are fully supported by this template.") + else () + target_compile_definitions(${target} PUBLIC "COMPILER_UNKNOWN") + message(AUTHOR_WARNING + "You are using a compiler other than gcc/clang. Only gcc/clang are fully supported by this template.") + endif () + + # project + target_compile_definitions(${target} PUBLIC "PROJECT_VERSION=\"${PROJECT_VERSION}\"") + target_compile_definitions(${target} PUBLIC "PROJECT_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}") + target_compile_definitions(${target} PUBLIC "PROJECT_VERSION_MINOR=${PROJECT_VERSION_MINOR}") + target_compile_definitions(${target} PUBLIC "PROJECT_VERSION_PATCH=${PROJECT_VERSION_PATCH}") + target_compile_definitions(${target} PUBLIC "PROJECT_NAME=\"${PROJECT_NAME}\"") + target_compile_definitions(${target} PUBLIC "COMPILER_INFO=\"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\"") + target_compile_definitions(${target} PUBLIC "SYSTEM_INFO=\"${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR}\"") + string(REPLACE "-" "_" project_name_rcs "${PROJECT_NAME}") + string(REPLACE " " "_" project_name_rcs "${project_name_rcs}") + target_compile_definitions(${target} PUBLIC "RCS_HASH=${project_name_rcs}\_version_info::GIT_HASH") + + # system + if (CMAKE_SYSTEM_NAME MATCHES "Linux") + target_compile_definitions(${target} PUBLIC "OS_LINUX") + target_compile_definitions(${target} PUBLIC "OS_POSIX") + elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + target_compile_definitions(${target} PUBLIC "OS_FREEBSD") + target_compile_definitions(${target} PUBLIC "OS_POSIX") + elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") + target_compile_definitions(${target} PUBLIC "OS_WINDOWS") + elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + target_compile_definitions(${target} PUBLIC "OS_DARWIN") + target_compile_definitions(${target} PUBLIC "OS_POSIX") + endif () + + # architecture defines + target_compile_definitions(${target} PUBLIC CPU_WORD_BYTES=${CMAKE_SIZEOF_VOID_P}) +endfunction() diff --git a/cmake_files/setup.cmake b/cmake_files/setup.cmake new file mode 100644 index 0000000..393f078 --- /dev/null +++ b/cmake_files/setup.cmake @@ -0,0 +1,157 @@ +# +# Copyright (C) 2024 Nikolas Koesling . +# This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +set(CMAKE_COMPILE_WARNING_AS_ERROR ON) + +if(CLANG_TIDY) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + if (${CLANG_TIDY_NO_ERRORS}) + set (CLANG_TIDY_CONFIG_FILE ${CMAKE_SOURCE_DIR}/.clang-tidy-noerrors) + else() + set (CLANG_TIDY_CONFIG_FILE ${CMAKE_SOURCE_DIR}/.clang-tidy) + endif() + + set(CMAKE_CXX_CLANG_TIDY + clang-tidy + -config-file=${CLANG_TIDY_CONFIG_FILE}) + message(STATUS "clang-tidy enabled: ${CLANG_TIDY_CONFIG_FILE}") + else() + message(WARNING "clang-tidy requested, but only available if clang is selected as compiler") + endif() +endif() + +# add executable +add_executable(${Target}) +install(TARGETS ${Target}) + +# set source and libraries directory +add_subdirectory("src") +add_subdirectory("libs") + +include(cmake_files/warnings.cmake) +include(cmake_files/define.cmake) +include(cmake_files/compileropts.cmake) + +# force C++ Standard and disable/enable compiler specific extensions +set_target_properties(${Target} PROPERTIES + CXX_STANDARD ${STANDARD} + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS ${COMPILER_EXTENSIONS} +) + +# compiler definitions and options +set_definitions(${Target}) +if (ENABLE_MULTITHREADING AND OPENMP) + set_options(${Target} ON) +else () + set_options(${Target} OFF) +endif () + +if (COMPILER_WARNINGS) + enable_warnings(${Target}) + message(STATUS "Compiler warnings enabled.") +else () + disable_warnings(${Target}) + message(STATUS "Compiler warnings disabled.") +endif () + +if (ENABLE_MULTITHREADING) + # required by threading lib (std::thread) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_package(Threads REQUIRED) + target_link_libraries(${Target} PRIVATE Threads::Threads) +endif () + +# lto +if(LTO_ENABLED) + include(CheckIPOSupported) + check_ipo_supported(RESULT ipo_supported OUTPUT error) + if( ipo_supported ) + message(STATUS "IPO / LTO enabled") + set_property(TARGET ${Target} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(STATUS "IPO / LTO not supported: <${error}>") + endif() +endif() + +# ----------------------------------------------- doxygen documentation ------------------------------------------------ +# ====================================================================================================================== +if (BUILD_DOC AND NOT STANDALONE_PROJECT) + # doxygen documentation (https://vicrucann.github.io/tutorials/quick-cmake-doxygen/) + # check if Doxygen is installed + find_package(Doxygen) + if (DOXYGEN_FOUND) + # set input and output files + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + + if (EXISTS ${DOXYGEN_IN}) + # request to configure the file + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) + message(STATUS "Doxygen configured") + + # note the option ALL which allows to build the docs together with the application + add_custom_target(doc_doxygen_${Target} ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) + message(STATUS "Added target doc_doxygen_${Target}") + + if (TARGET doc_doxygen) + add_dependencies(doc_doxygen doc_doxygen_${Target}) + else () + add_custom_target(doc_doxygen DEPENDS doc_doxygen_${Target}) + endif () + else () + message(WARNING "doxygen documentation requested, but file ${DOXYGEN_IN} does not exist.") + endif () + else (DOXYGEN_FOUND) + message(WARNING "Doxygen must be installed and accessible to generate the doxygen documentation.") + endif (DOXYGEN_FOUND) +endif () + +# add clang format target +if (CLANG_FORMAT) + set(CLANG_FORMAT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format) + + if (EXISTS ${CLANG_FORMAT_FILE}) + include(cmake_files/ClangFormat.cmake) + target_clangformat_setup(${Target}) + message(STATUS "Added clang format target(s)") + else () + message(WARNING "Clang format enabled, but file ${CLANG_FORMAT_FILE} does not exist") + endif() +endif () + +# add test targets +if(ENABLE_TEST) + enable_testing() + add_subdirectory("test") +endif() + +# generate version_info.cpp +# output is not the acutal generated file --> command is always executed +add_custom_command( + OUTPUT + ${CMAKE_SOURCE_DIR}/src/generated/version_info_cpp + + COMMAND + bash ${CMAKE_SOURCE_DIR}/scripts/gen_version_info_cpp.sh ${PROJECT_NAME} + + WORKING_DIRECTORY + ${CMAKE_SOURCE_DIR} +) + +execute_process( + COMMAND bash "${CMAKE_SOURCE_DIR}/scripts/gen_version_info_cpp.sh" ${PROJECT_NAME} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_custom_target(${Target}_generated_version_info + DEPENDS ${CMAKE_SOURCE_DIR}/src/generated/version_info_cpp +) + +add_dependencies(${Target} ${Target}_generated_version_info) diff --git a/cmake_files/warnings.cmake b/cmake_files/warnings.cmake new file mode 100644 index 0000000..8e48e8e --- /dev/null +++ b/cmake_files/warnings.cmake @@ -0,0 +1,84 @@ +# +# Copyright (C) 2022 Nikolas Koesling . +# This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +# warnings that are valid for gcc and clang +function(commonwarn target) + target_compile_options(${target} PUBLIC -Wall -Wextra -pedantic -pedantic-errors) + + # see https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html for more details + + target_compile_options(${target} PUBLIC -Wnull-dereference) + target_compile_options(${target} PUBLIC -Wold-style-cast) + target_compile_options(${target} PUBLIC -Wdouble-promotion) + target_compile_options(${target} PUBLIC -Wformat=2) + target_compile_options(${target} PUBLIC -Winit-self) + target_compile_options(${target} PUBLIC -Wsequence-point) + target_compile_options(${target} PUBLIC -Wswitch-default) + target_compile_options(${target} PUBLIC -Wswitch-enum -Wno-error=switch-enum) + target_compile_options(${target} PUBLIC -Wconversion) + target_compile_options(${target} PUBLIC -Wcast-align) + target_compile_options(${target} PUBLIC -Wfloat-equal) + target_compile_options(${target} PUBLIC -Wundef) + target_compile_options(${target} PUBLIC -Wcast-qual) +endfunction() + +# gcc specific warnings +function(gccwarn target) + # see https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Warning-Options.html for more details + + target_compile_options(${target} PUBLIC -Wduplicated-cond) + target_compile_options(${target} PUBLIC -Wduplicated-branches) + target_compile_options(${target} PUBLIC -Wlogical-op) + target_compile_options(${target} PUBLIC -Wrestrict) + target_compile_options(${target} PUBLIC -Wuseless-cast -Wno-error=useless-cast) + target_compile_options(${target} PUBLIC -Wshadow=local -Wno-error=shadow) + + target_compile_options(${target} PUBLIC -Wno-error=switch-default) + target_compile_options(${target} PUBLIC -Wno-error=attributes) +endfunction() + +# clang specific warnings +function(clangwarn target) + # enable all + target_compile_options(${target} PUBLIC -Weverything) + + # and remove "useless" ones + target_compile_options(${target} PUBLIC -Wno-c++98-compat) + target_compile_options(${target} PUBLIC -Wno-c++98-c++11-c++14-compat) + target_compile_options(${target} PUBLIC -Wno-c++98-compat-pedantic) + target_compile_options(${target} PUBLIC -Wno-error=covered-switch-default) + target_compile_options(${target} PUBLIC -Wno-shadow-field-in-constructor) + target_compile_options(${target} PUBLIC -Wno-padded) + target_compile_options(${target} PUBLIC -Wno-shadow-field) + target_compile_options(${target} PUBLIC -Wno-weak-vtables) + target_compile_options(${target} PUBLIC -Wno-exit-time-destructors) + target_compile_options(${target} PUBLIC -Wno-global-constructors) + target_compile_options(${target} PUBLIC -Wno-error=unreachable-code-return) + target_compile_options(${target} PUBLIC -Wno-error=unreachable-code) + target_compile_options(${target} PUBLIC -Wno-error=documentation) + target_compile_options(${target} PUBLIC -Wno-error=unused-exception-parameter) + target_compile_options(${target} PUBLIC -Wno-nested-anon-types) + target_compile_options(${target} PUBLIC -Wno-gnu-anonymous-struct) + target_compile_options(${target} PUBLIC -Wno-source-uses-openmp) + target_compile_options(${target} PUBLIC -Wno-disabled-macro-expansion) + target_compile_options(${target} PUBLIC -Wno-unsafe-buffer-usage) + +endfunction() + +function(enable_warnings target) + if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + commonwarn(${target}) + gccwarn(${target}) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + commonwarn(${target}) + clangwarn(${target}) + elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + target_compile_options(${target} PUBLIC /Wall /WX) + endif() +endfunction() + +function(disable_warnings target) + target_compile_options(${target} PUBLIC -w) +endfunction() diff --git a/code_generation_templates/version_info.cpp b/code_generation_templates/version_info.cpp new file mode 100644 index 0000000..ad05c42 --- /dev/null +++ b/code_generation_templates/version_info.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2024 Nikolas Koesling . + * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + */ + +// This file is automatically generated. DO NOT CHANGE! + +#include "version_info.hpp" + +const std::string XXXPROJECT_NAMEXXX_version_info::VERSION_STR(PROJECT_VERSION); +const std::string XXXPROJECT_NAMEXXX_version_info::NAME(PROJECT_NAME); +const std::string XXXPROJECT_NAMEXXX_version_info::COMPILER(COMPILER_INFO); +const std::string XXXPROJECT_NAMEXXX_version_info::SYSTEM(SYSTEM_INFO); +const std::string XXXPROJECT_NAMEXXX_version_info::GIT_HASH("XXXGIT_HASHXXX"); diff --git a/code_generation_templates/version_info.hpp b/code_generation_templates/version_info.hpp new file mode 100644 index 0000000..eef142f --- /dev/null +++ b/code_generation_templates/version_info.hpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Nikolas Koesling . + * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + */ + +// This file is automatically generated. DO NOT CHANGE! + +#include + +/** + * @brief struct that contains version information + * @details contains only static members --> no instance can be created + */ +struct XXXPROJECT_NAMEXXX_version_info { + //* Mayor version number + static constexpr int MAYOR = PROJECT_VERSION_MAJOR; + + //* Minor version number + static constexpr int MINOR = PROJECT_VERSION_MINOR; + + //* Patchlevel + static constexpr int PATCH = PROJECT_VERSION_PATCH; + + //* Complete version as string + static const std::string VERSION_STR; + + //* cmake project name + static const std::string NAME; + + //* compiler info + static const std::string COMPILER; + + //* host system info + static const std::string SYSTEM; + + /** + * @brief git hash + * @details + * Contains the complete git hash. + * If there are uncommitted changes in the repository, + * the suffix '-dirty' is appended + */ + static const std::string GIT_HASH; + +private: + XXXPROJECT_NAMEXXX_version_info() = default; +}; diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index bce327b..3c8be86 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,23 +1,27 @@ +# ---------------------------------------- packages -------------------------------------------------------------------- +# ====================================================================================================================== -# ---------------------------------------- subdirectories -------------------------------------------------------------- +find_package(cxxshm REQUIRED) +find_package(cxxsemaphore REQUIRED) +find_package(cxxopts REQUIRED) + +# ---------------------------------------- external libs --------------------------------------------------------------- # ====================================================================================================================== +find_library(readline_library readline) +# ---------------------------------------- subdirectories -------------------------------------------------------------- +# ====================================================================================================================== +set(CLANG_FORMAT_TMP ${CLANG_FORMAT}) +set(CLANG_FORMAT OFF) +add_subdirectory(cxxendian) +set(CLANG_FORMAT ${CLANG_FORMAT_TMP}) # ---------------------------------------- link libraries -------------------------------------------------------------- # ====================================================================================================================== target_link_libraries(${Target} PRIVATE rt) - -add_subdirectory(cxxopts EXCLUDE_FROM_ALL) -target_link_libraries(${Target} PRIVATE cxxopts) - -add_subdirectory(cxxshm EXCLUDE_FROM_ALL) +target_link_libraries(${Target} PRIVATE INTERFACE cxxopts) target_link_libraries(${Target} PRIVATE cxxshm) - -add_subdirectory(cxxendian) target_link_libraries(${Target} PRIVATE cxxendian) - -target_link_libraries(${Target} PRIVATE readline) - -add_subdirectory(cxxsemaphore EXCLUDE_FROM_ALL) +target_link_libraries(${Target} PRIVATE ${readline_library}) target_link_libraries(${Target} PRIVATE cxxsemaphore) diff --git a/libs/cxxopts b/libs/cxxopts deleted file mode 160000 index 97ce703..0000000 --- a/libs/cxxopts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 97ce7031473dccdc1bc1cd63fc6f739039772ed6 diff --git a/libs/cxxsemaphore b/libs/cxxsemaphore deleted file mode 160000 index 9e7ea69..0000000 --- a/libs/cxxsemaphore +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9e7ea69d238c931f5e53dd88aa0896738a5ee95b diff --git a/libs/cxxshm b/libs/cxxshm deleted file mode 160000 index dfed3b0..0000000 --- a/libs/cxxshm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dfed3b0358b1605344cec15dadf8e99e7c9dbab1 diff --git a/network.koesling.stdin-to-modbus-shm.yml b/network.koesling.stdin-to-modbus-shm.yml deleted file mode 100644 index e63a18a..0000000 --- a/network.koesling.stdin-to-modbus-shm.yml +++ /dev/null @@ -1,23 +0,0 @@ -id: network.koesling.stdin-to-modbus-shm -runtime: org.freedesktop.Platform -runtime-version: '23.08' -sdk: org.freedesktop.Sdk -command: stdin-to-modbus-shm -finish-args: - - --device=shm -modules: - - name: stdin-to-modbus-shm - buildsystem: simple - build-commands: - # build - - mkdir build - - cmake -B build . -DCMAKE_BUILD_TYPE=Release -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF - - cmake --build build - - # install - - mkdir -p "${FLATPAK_DEST}/bin" - - cp build/stdin-to-modbus-shm ${FLATPAK_DEST}/bin - sources: - - type: git - branch: release - url: https://github.com/NikolasK-source/stdin_to_modbus_shm.git diff --git a/network.koesling.test-stdin-to-modbus-shm.yml b/network.koesling.test-stdin-to-modbus-shm.yml index b702ba2..5284d85 100644 --- a/network.koesling.test-stdin-to-modbus-shm.yml +++ b/network.koesling.test-stdin-to-modbus-shm.yml @@ -6,17 +6,52 @@ command: stdin-to-modbus-shm finish-args: - --device=shm modules: - - name: stdin-to-modbus-shm - buildsystem: simple - build-commands: - # build - - mkdir build - - cmake -B build . -DCMAKE_BUILD_TYPE=Release -DCLANG_FORMAT=OFF -DCOMPILER_WARNINGS=OFF - - cmake --build build + - name: cxxopts + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCXXOPTS_BUILD_EXAMPLES=OFF + - -DCXXOPTS_BUILD_TESTS=OFF + sources: + - type: git + tag: v3.2.0 + url: https://github.com/jarro2783/cxxopts.git + + - name: cxxshm + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCLANG_FORMAT=OFF + - -DCOMPILER_WARNINGS=OFF + - -DCLANG_TIDY=OFF + - -DBUILD_DOC=OFF + sources: + - type: git + tag: v2.0.2 + url: https://github.com/NikolasK-source/cxxshm.git - # install - - mkdir -p "${FLATPAK_DEST}/bin" - - cp build/stdin-to-modbus-shm ${FLATPAK_DEST}/bin + - name: cxxsemaphore + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCLANG_FORMAT=OFF + - -DCOMPILER_WARNINGS=OFF + - -DCLANG_TIDY=OFF + - -DBUILD_DOC=OFF + sources: + - type: git + tag: v2.0.2 + url: https://github.com/NikolasK-source/cxxsemaphore.git + + - name: stdin-to-modbus-shm + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + - -DCLANG_FORMAT=OFF + - -DCOMPILER_WARNINGS=OFF + - -DCLANG_TIDY=OFF + - -DBUILD_DOC=OFF sources: - type: dir path: . + diff --git a/scripts/gen_version_info_cpp.sh b/scripts/gen_version_info_cpp.sh new file mode 100755 index 0000000..d5e0970 --- /dev/null +++ b/scripts/gen_version_info_cpp.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +cd $SCRIPTPATH/.. + +if [ $# -ne 1 ]; then + >&2 echo "usage: $0 project_name" +fi + +project_name=$(echo "$1" | sed -e "s/\\s/_/g" -e "s/-/_/g") + +# "$(git rev-parse HEAD)$(test $(git status --porcelain | wc -l) -gt 0 && printf -- -dirty)" +GIT_HASH=$(git rev-parse HEAD) +GIT_DIRTY=$(git status --porcelain | wc -l) + +if [ $GIT_DIRTY -ne 0 ]; then + GIT_HASH="${GIT_HASH}-dirty" +fi + +sed \ + -e "s/XXXPROJECT_NAMEXXX/$project_name/g" \ + -e "s/XXXGIT_HASHXXX/$GIT_HASH/g" \ + code_generation_templates/version_info.hpp > src/generated/version_info.hpp + +sed \ + -e "s/XXXPROJECT_NAMEXXX/$project_name/g" \ + -e "s/XXXGIT_HASHXXX/$GIT_HASH/g" \ + code_generation_templates/version_info.cpp > src/generated/version_info.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e6fc70..07ca562 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,3 +20,4 @@ target_sources(${Target} PRIVATE readline.hpp) # ---------------------------------------- subdirectories -------------------------------------------------------------- # ====================================================================================================================== +add_subdirectory(generated) diff --git a/src/InputParser.cpp b/src/InputParser.cpp index 9238dc6..399b92c 100644 --- a/src/InputParser.cpp +++ b/src/InputParser.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #include "InputParser.hpp" @@ -206,7 +206,7 @@ std::vector parse(std::string line, int base_addr, int base_value, } // get register type - Instruction::register_type_t type; + Instruction::register_type_t type {}; auto &type_str = split_input.at(0); for (auto &c : type_str) c = static_cast(std::tolower(c)); diff --git a/src/InputParser.hpp b/src/InputParser.hpp index d4386c7..02334f9 100644 --- a/src/InputParser.hpp +++ b/src/InputParser.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once diff --git a/src/InputParser_float.hpp b/src/InputParser_float.hpp index a8a2798..645eaa1 100644 --- a/src/InputParser_float.hpp +++ b/src/InputParser_float.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once diff --git a/src/InputParser_int.hpp b/src/InputParser_int.hpp index 554617b..862ffb1 100644 --- a/src/InputParser_int.hpp +++ b/src/InputParser_int.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once diff --git a/src/generated/CMakeLists.txt b/src/generated/CMakeLists.txt new file mode 100644 index 0000000..eea53b9 --- /dev/null +++ b/src/generated/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020-2022 Nikolas Koesling . +# This template is free software. You can redistribute it and/or modify it under the terms of the MIT License. +# + +# ---------------------------------------- source files (*.cpp, *.cc, ...) --------------------------------------------- +# ====================================================================================================================== + +target_sources(${Target} PRIVATE version_info.cpp) + + +# ---------------------------------------- header files (*.hpp, *.h, ...) ---------------------------------------------- +# ====================================================================================================================== + +target_sources(${Target} PRIVATE version_info.hpp) + + +# ---------------------------------------- subdirectories -------------------------------------------------------------- +# ====================================================================================================================== + diff --git a/src/generated/version_info.cpp b/src/generated/version_info.cpp new file mode 100644 index 0000000..8cda9f1 --- /dev/null +++ b/src/generated/version_info.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2024 Nikolas Koesling . + * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + */ + +// This file is automatically generated. DO NOT CHANGE! + +#include "version_info.hpp" + +const std::string stdin_to_modbus_shm_version_info::VERSION_STR(PROJECT_VERSION); +const std::string stdin_to_modbus_shm_version_info::NAME(PROJECT_NAME); +const std::string stdin_to_modbus_shm_version_info::COMPILER(COMPILER_INFO); +const std::string stdin_to_modbus_shm_version_info::SYSTEM(SYSTEM_INFO); +const std::string stdin_to_modbus_shm_version_info::GIT_HASH("920708ae1f4add3ee443228eb0ca0966a059ab8b-dirty"); diff --git a/src/generated/version_info.hpp b/src/generated/version_info.hpp new file mode 100644 index 0000000..8c57c82 --- /dev/null +++ b/src/generated/version_info.hpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2024 Nikolas Koesling . + * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + */ + +// This file is automatically generated. DO NOT CHANGE! + +#include + +/** + * @brief struct that contains version information + * @details contains only static members --> no instance can be created + */ +struct stdin_to_modbus_shm_version_info { + //* Mayor version number + static constexpr int MAYOR = PROJECT_VERSION_MAJOR; + + //* Minor version number + static constexpr int MINOR = PROJECT_VERSION_MINOR; + + //* Patchlevel + static constexpr int PATCH = PROJECT_VERSION_PATCH; + + //* Complete version as string + static const std::string VERSION_STR; + + //* cmake project name + static const std::string NAME; + + //* compiler info + static const std::string COMPILER; + + //* host system info + static const std::string SYSTEM; + + /** + * @brief git hash + * @details + * Contains the complete git hash. + * If there are uncommitted changes in the repository, + * the suffix '-dirty' is appended + */ + static const std::string GIT_HASH; + +private: + stdin_to_modbus_shm_version_info() = default; +}; diff --git a/src/input_parse.hpp b/src/input_parse.hpp index 736919d..33594c9 100644 --- a/src/input_parse.hpp +++ b/src/input_parse.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2021-2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once diff --git a/src/license.cpp b/src/license.cpp index a277b6a..87a3f09 100644 --- a/src/license.cpp +++ b/src/license.cpp @@ -1,785 +1,1456 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #include "license.hpp" -void print_licenses(std::ostream &o) { - o << "This Application (" << PROJECT_NAME << ' ' << PROJECT_VERSION "): " << std::endl; - o << std::endl; - o << " MIT License" << std::endl; - o << std::endl; - o << " Copyright (c) 2021-2022 Nikolas Koesling" << std::endl; - o << std::endl; - o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl; - o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl; - o << " in the Software without restriction, including without limitation the rights" << std::endl; - o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl; - o << " copies of the Software, and to permit persons to whom the Software is" << std::endl; - o << " furnished to do so, subject to the following conditions:" << std::endl; - o << std::endl; - o << " The above copyright notice and this permission notice shall be included in all" << std::endl; - o << " copies or substantial portions of the Software." << std::endl; - o << std::endl; - o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl; - o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl; - o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl; - o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl; - o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl; - o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl; - o << " SOFTWARE." << std::endl; - o << std::endl; - o << std::endl; - o << "cxxopts Library (https://github.com/jarro2783/cxxopts)" << std::endl; - o << std::endl; - o << " MIT License" << std::endl; - o << std::endl; - o << " Copyright (c) 2014 Jarryd Beck" << std::endl; - o << std::endl; - o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl; - o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl; - o << " in the Software without restriction, including without limitation the rights" << std::endl; - o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl; - o << " copies of the Software, and to permit persons to whom the Software is" << std::endl; - o << " furnished to do so, subject to the following conditions:" << std::endl; - o << std::endl; - o << " The above copyright notice and this permission notice shall be included in" << std::endl; - o << " all copies or substantial portions of the Software." << std::endl; - o << std::endl; - o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl; - o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl; - o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl; - o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl; - o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl; - o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << std::endl; - o << " THE SOFTWARE." << std::endl; - o << std::endl; - o << std::endl; - o << "cxxshm Library (https://github.com/NikolasK-source/cxxshm)" << std::endl; - o << std::endl; - o << " MIT License" << std::endl; - o << std::endl; - o << " Copyright (c) 2022 Nikolas Koesling" << std::endl; - o << std::endl; - o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl; - o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl; - o << " in the Software without restriction, including without limitation the rights" << std::endl; - o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl; - o << " copies of the Software, and to permit persons to whom the Software is" << std::endl; - o << " furnished to do so, subject to the following conditions:" << std::endl; - o << std::endl; - o << " The above copyright notice and this permission notice shall be included in all" << std::endl; - o << " copies or substantial portions of the Software." << std::endl; - o << std::endl; - o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl; - o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl; - o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl; - o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl; - o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl; - o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl; - o << " SOFTWARE." << std::endl; - o << std::endl; - o << std::endl; - o << "cxxendian Library (https://github.com/NikolasK-source/cxxendian)" << std::endl; - o << std::endl; - o << " MIT License" << std::endl; - o << std::endl; - o << " Copyright (c) 2022 Nikolas Koesling" << std::endl; - o << std::endl; - o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl; - o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl; - o << " in the Software without restriction, including without limitation the rights" << std::endl; - o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl; - o << " copies of the Software, and to permit persons to whom the Software is" << std::endl; - o << " furnished to do so, subject to the following conditions:" << std::endl; - o << std::endl; - o << " The above copyright notice and this permission notice shall be included in all" << std::endl; - o << " copies or substantial portions of the Software." << std::endl; - o << std::endl; - o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl; - o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl; - o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl; - o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl; - o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl; - o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl; - o << " SOFTWARE." << std::endl; - o << std::endl; - o << std::endl; +void print_licenses(std::ostream &o, bool full) { + // ################################################################################################################# + // ################################################################################################################# + // This App + // ################################################################################################################# + // ################################################################################################################# + o << "This Application (" << PROJECT_NAME << ' ' << PROJECT_VERSION "): \n"; + o << "\n"; + o << " GPLv3\n"; + if (full) { + o << "\n"; + o << " GNU GENERAL PUBLIC LICENSE\n"; + o << " Version 3, 29 June 2007\n"; + o << "\n"; + o << " Copyright (C) 2007 Free Software Foundation, Inc. \n"; + o << " Everyone is permitted to copy and distribute verbatim copies\n"; + o << " of this license document, but changing it is not allowed.\n"; + o << "\n"; + o << " Preamble\n"; + o << "\n"; + o << " The GNU General Public License is a free, copyleft license for\n"; + o << " software and other kinds of works.\n"; + o << "\n"; + o << " The licenses for most software and other practical works are designed\n"; + o << " to take away your freedom to share and change the works. By contrast,\n"; + o << " the GNU General Public License is intended to guarantee your freedom to\n"; + o << " share and change all versions of a program--to make sure it remains free\n"; + o << " software for all its users. We, the Free Software Foundation, use the\n"; + o << " GNU General Public License for most of our software; it applies also to\n"; + o << " any other work released this way by its authors. You can apply it to\n"; + o << " your programs, too.\n"; + o << "\n"; + o << " When we speak of free software, we are referring to freedom, not\n"; + o << " price. Our General Public Licenses are designed to make sure that you\n"; + o << " have the freedom to distribute copies of free software (and charge for\n"; + o << " them if you wish), that you receive source code or can get it if you\n"; + o << " want it, that you can change the software or use pieces of it in new\n"; + o << " free programs, and that you know you can do these things.\n"; + o << "\n"; + o << " To protect your rights, we need to prevent others from denying you\n"; + o << " these rights or asking you to surrender the rights. Therefore, you have\n"; + o << " certain responsibilities if you distribute copies of the software, or if\n"; + o << " you modify it: responsibilities to respect the freedom of others.\n"; + o << "\n"; + o << " For example, if you distribute copies of such a program, whether\n"; + o << " gratis or for a fee, you must pass on to the recipients the same\n"; + o << " freedoms that you received. You must make sure that they, too, receive\n"; + o << " or can get the source code. And you must show them these terms so they\n"; + o << " know their rights.\n"; + o << "\n"; + o << " Developers that use the GNU GPL protect your rights with two steps:\n"; + o << " (1) assert copyright on the software, and (2) offer you this License\n"; + o << " giving you legal permission to copy, distribute and/or modify it.\n"; + o << "\n"; + o << " For the developers' and authors' protection, the GPL clearly explains\n"; + o << " that there is no warranty for this free software. For both users' and\n"; + o << " authors' sake, the GPL requires that modified versions be marked as\n"; + o << " changed, so that their problems will not be attributed erroneously to\n"; + o << " authors of previous versions.\n"; + o << "\n"; + o << " Some devices are designed to deny users access to install or run\n"; + o << " modified versions of the software inside them, although the manufacturer\n"; + o << " can do so. This is fundamentally incompatible with the aim of\n"; + o << " protecting users' freedom to change the software. The systematic\n"; + o << " pattern of such abuse occurs in the area of products for individuals to\n"; + o << " use, which is precisely where it is most unacceptable. Therefore, we\n"; + o << " have designed this version of the GPL to prohibit the practice for those\n"; + o << " products. If such problems arise substantially in other domains, we\n"; + o << " stand ready to extend this provision to those domains in future versions\n"; + o << " of the GPL, as needed to protect the freedom of users.\n"; + o << "\n"; + o << " Finally, every program is threatened constantly by software patents.\n"; + o << " States should not allow patents to restrict development and use of\n"; + o << " software on general-purpose computers, but in those that do, we wish to\n"; + o << " avoid the special danger that patents applied to a free program could\n"; + o << " make it effectively proprietary. To prevent this, the GPL assures that\n"; + o << " patents cannot be used to render the program non-free.\n"; + o << "\n"; + o << " The precise terms and conditions for copying, distribution and\n"; + o << " modification follow.\n"; + o << "\n"; + o << " TERMS AND CONDITIONS\n"; + o << "\n"; + o << " 0. Definitions.\n"; + o << "\n"; + o << " \"This License\" refers to version 3 of the GNU General Public License.\n"; + o << "\n"; + o << " \"Copyright\" also means copyright-like laws that apply to other kinds of\n"; + o << " works, such as semiconductor masks.\n"; + o << "\n"; + o << " \"The Program\" refers to any copyrightable work licensed under this\n"; + o << " License. Each licensee is addressed as \"you\". \"Licensees\" and\n"; + o << " \"recipients\" may be individuals or organizations.\n"; + o << "\n"; + o << " To \"modify\" a work means to copy from or adapt all or part of the work\n"; + o << " in a fashion requiring copyright permission, other than the making of an\n"; + o << " exact copy. The resulting work is called a \"modified version\" of the\n"; + o << " earlier work or a work \"based on\" the earlier work.\n"; + o << "\n"; + o << " A \"covered work\" means either the unmodified Program or a work based\n"; + o << " on the Program.\n"; + o << "\n"; + o << " To \"propagate\" a work means to do anything with it that, without\n"; + o << " permission, would make you directly or secondarily liable for\n"; + o << " infringement under applicable copyright law, except executing it on a\n"; + o << " computer or modifying a private copy. Propagation includes copying,\n"; + o << " distribution (with or without modification), making available to the\n"; + o << " public, and in some countries other activities as well.\n"; + o << "\n"; + o << " To \"convey\" a work means any kind of propagation that enables other\n"; + o << " parties to make or receive copies. Mere interaction with a user through\n"; + o << " a computer network, with no transfer of a copy, is not conveying.\n"; + o << "\n"; + o << " An interactive user interface displays \"Appropriate Legal Notices\"\n"; + o << " to the extent that it includes a convenient and prominently visible\n"; + o << " feature that (1) displays an appropriate copyright notice, and (2)\n"; + o << " tells the user that there is no warranty for the work (except to the\n"; + o << " extent that warranties are provided), that licensees may convey the\n"; + o << " work under this License, and how to view a copy of this License. If\n"; + o << " the interface presents a list of user commands or options, such as a\n"; + o << " menu, a prominent item in the list meets this criterion.\n"; + o << "\n"; + o << " 1. Source Code.\n"; + o << "\n"; + o << " The \"source code\" for a work means the preferred form of the work\n"; + o << " for making modifications to it. \"Object code\" means any non-source\n"; + o << " form of a work.\n"; + o << "\n"; + o << " A \"Standard Interface\" means an interface that either is an official\n"; + o << " standard defined by a recognized standards body, or, in the case of\n"; + o << " interfaces specified for a particular programming language, one that\n"; + o << " is widely used among developers working in that language.\n"; + o << "\n"; + o << " The \"System Libraries\" of an executable work include anything, other\n"; + o << " than the work as a whole, that (a) is included in the normal form of\n"; + o << " packaging a Major Component, but which is not part of that Major\n"; + o << " Component, and (b) serves only to enable use of the work with that\n"; + o << " Major Component, or to implement a Standard Interface for which an\n"; + o << " implementation is available to the public in source code form. A\n"; + o << " \"Major Component\", in this context, means a major essential component\n"; + o << " (kernel, window system, and so on) of the specific operating system\n"; + o << " (if any) on which the executable work runs, or a compiler used to\n"; + o << " produce the work, or an object code interpreter used to run it.\n"; + o << "\n"; + o << " The \"Corresponding Source\" for a work in object code form means all\n"; + o << " the source code needed to generate, install, and (for an executable\n"; + o << " work) run the object code and to modify the work, including scripts to\n"; + o << " control those activities. However, it does not include the work's\n"; + o << " System Libraries, or general-purpose tools or generally available free\n"; + o << " programs which are used unmodified in performing those activities but\n"; + o << " which are not part of the work. For example, Corresponding Source\n"; + o << " includes interface definition files associated with source files for\n"; + o << " the work, and the source code for shared libraries and dynamically\n"; + o << " linked subprograms that the work is specifically designed to require,\n"; + o << " such as by intimate data communication or control flow between those\n"; + o << " subprograms and other parts of the work.\n"; + o << "\n"; + o << " The Corresponding Source need not include anything that users\n"; + o << " can regenerate automatically from other parts of the Corresponding\n"; + o << " Source.\n"; + o << "\n"; + o << " The Corresponding Source for a work in source code form is that\n"; + o << " same work.\n"; + o << "\n"; + o << " 2. Basic Permissions.\n"; + o << "\n"; + o << " All rights granted under this License are granted for the term of\n"; + o << " copyright on the Program, and are irrevocable provided the stated\n"; + o << " conditions are met. This License explicitly affirms your unlimited\n"; + o << " permission to run the unmodified Program. The output from running a\n"; + o << " covered work is covered by this License only if the output, given its\n"; + o << " content, constitutes a covered work. This License acknowledges your\n"; + o << " rights of fair use or other equivalent, as provided by copyright law.\n"; + o << "\n"; + o << " You may make, run and propagate covered works that you do not\n"; + o << " convey, without conditions so long as your license otherwise remains\n"; + o << " in force. You may convey covered works to others for the sole purpose\n"; + o << " of having them make modifications exclusively for you, or provide you\n"; + o << " with facilities for running those works, provided that you comply with\n"; + o << " the terms of this License in conveying all material for which you do\n"; + o << " not control copyright. Those thus making or running the covered works\n"; + o << " for you must do so exclusively on your behalf, under your direction\n"; + o << " and control, on terms that prohibit them from making any copies of\n"; + o << " your copyrighted material outside their relationship with you.\n"; + o << "\n"; + o << " Conveying under any other circumstances is permitted solely under\n"; + o << " the conditions stated below. Sublicensing is not allowed; section 10\n"; + o << " makes it unnecessary.\n"; + o << "\n"; + o << " 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n"; + o << "\n"; + o << " No covered work shall be deemed part of an effective technological\n"; + o << " measure under any applicable law fulfilling obligations under article\n"; + o << " 11 of the WIPO copyright treaty adopted on 20 December 1996, or\n"; + o << " similar laws prohibiting or restricting circumvention of such\n"; + o << " measures.\n"; + o << "\n"; + o << " When you convey a covered work, you waive any legal power to forbid\n"; + o << " circumvention of technological measures to the extent such circumvention\n"; + o << " is effected by exercising rights under this License with respect to\n"; + o << " the covered work, and you disclaim any intention to limit operation or\n"; + o << " modification of the work as a means of enforcing, against the work's\n"; + o << " users, your or third parties' legal rights to forbid circumvention of\n"; + o << " technological measures.\n"; + o << "\n"; + o << " 4. Conveying Verbatim Copies.\n"; + o << "\n"; + o << " You may convey verbatim copies of the Program's source code as you\n"; + o << " receive it, in any medium, provided that you conspicuously and\n"; + o << " appropriately publish on each copy an appropriate copyright notice;\n"; + o << " keep intact all notices stating that this License and any\n"; + o << " non-permissive terms added in accord with section 7 apply to the code;\n"; + o << " keep intact all notices of the absence of any warranty; and give all\n"; + o << " recipients a copy of this License along with the Program.\n"; + o << "\n"; + o << " You may charge any price or no price for each copy that you convey,\n"; + o << " and you may offer support or warranty protection for a fee.\n"; + o << "\n"; + o << " 5. Conveying Modified Source Versions.\n"; + o << "\n"; + o << " You may convey a work based on the Program, or the modifications to\n"; + o << " produce it from the Program, in the form of source code under the\n"; + o << " terms of section 4, provided that you also meet all of these conditions:\n"; + o << "\n"; + o << " a) The work must carry prominent notices stating that you modified\n"; + o << " it, and giving a relevant date.\n"; + o << "\n"; + o << " b) The work must carry prominent notices stating that it is\n"; + o << " released under this License and any conditions added under section\n"; + o << " 7. This requirement modifies the requirement in section 4 to\n"; + o << " \"keep intact all notices\".\n"; + o << "\n"; + o << " c) You must license the entire work, as a whole, under this\n"; + o << " License to anyone who comes into possession of a copy. This\n"; + o << " License will therefore apply, along with any applicable section 7\n"; + o << " additional terms, to the whole of the work, and all its parts,\n"; + o << " regardless of how they are packaged. This License gives no\n"; + o << " permission to license the work in any other way, but it does not\n"; + o << " invalidate such permission if you have separately received it.\n"; + o << "\n"; + o << " d) If the work has interactive user interfaces, each must display\n"; + o << " Appropriate Legal Notices; however, if the Program has interactive\n"; + o << " interfaces that do not display Appropriate Legal Notices, your\n"; + o << " work need not make them do so.\n"; + o << "\n"; + o << " A compilation of a covered work with other separate and independent\n"; + o << " works, which are not by their nature extensions of the covered work,\n"; + o << " and which are not combined with it such as to form a larger program,\n"; + o << " in or on a volume of a storage or distribution medium, is called an\n"; + o << " \"aggregate\" if the compilation and its resulting copyright are not\n"; + o << " used to limit the access or legal rights of the compilation's users\n"; + o << " beyond what the individual works permit. Inclusion of a covered work\n"; + o << " in an aggregate does not cause this License to apply to the other\n"; + o << " parts of the aggregate.\n"; + o << "\n"; + o << " 6. Conveying Non-Source Forms.\n"; + o << "\n"; + o << " You may convey a covered work in object code form under the terms\n"; + o << " of sections 4 and 5, provided that you also convey the\n"; + o << " machine-readable Corresponding Source under the terms of this License,\n"; + o << " in one of these ways:\n"; + o << "\n"; + o << " a) Convey the object code in, or embodied in, a physical product\n"; + o << " (including a physical distribution medium), accompanied by the\n"; + o << " Corresponding Source fixed on a durable physical medium\n"; + o << " customarily used for software interchange.\n"; + o << "\n"; + o << " b) Convey the object code in, or embodied in, a physical product\n"; + o << " (including a physical distribution medium), accompanied by a\n"; + o << " written offer, valid for at least three years and valid for as\n"; + o << " long as you offer spare parts or customer support for that product\n"; + o << " model, to give anyone who possesses the object code either (1) a\n"; + o << " copy of the Corresponding Source for all the software in the\n"; + o << " product that is covered by this License, on a durable physical\n"; + o << " medium customarily used for software interchange, for a price no\n"; + o << " more than your reasonable cost of physically performing this\n"; + o << " conveying of source, or (2) access to copy the\n"; + o << " Corresponding Source from a network server at no charge.\n"; + o << "\n"; + o << " c) Convey individual copies of the object code with a copy of the\n"; + o << " written offer to provide the Corresponding Source. This\n"; + o << " alternative is allowed only occasionally and noncommercially, and\n"; + o << " only if you received the object code with such an offer, in accord\n"; + o << " with subsection 6b.\n"; + o << "\n"; + o << " d) Convey the object code by offering access from a designated\n"; + o << " place (gratis or for a charge), and offer equivalent access to the\n"; + o << " Corresponding Source in the same way through the same place at no\n"; + o << " further charge. You need not require recipients to copy the\n"; + o << " Corresponding Source along with the object code. If the place to\n"; + o << " copy the object code is a network server, the Corresponding Source\n"; + o << " may be on a different server (operated by you or a third party)\n"; + o << " that supports equivalent copying facilities, provided you maintain\n"; + o << " clear directions next to the object code saying where to find the\n"; + o << " Corresponding Source. Regardless of what server hosts the\n"; + o << " Corresponding Source, you remain obligated to ensure that it is\n"; + o << " available for as long as needed to satisfy these requirements.\n"; + o << "\n"; + o << " e) Convey the object code using peer-to-peer transmission, provided\n"; + o << " you inform other peers where the object code and Corresponding\n"; + o << " Source of the work are being offered to the general public at no\n"; + o << " charge under subsection 6d.\n"; + o << "\n"; + o << " A separable portion of the object code, whose source code is excluded\n"; + o << " from the Corresponding Source as a System Library, need not be\n"; + o << " included in conveying the object code work.\n"; + o << "\n"; + o << " A \"User Product\" is either (1) a \"consumer product\", which means any\n"; + o << " tangible personal property which is normally used for personal, family,\n"; + o << " or household purposes, or (2) anything designed or sold for incorporation\n"; + o << " into a dwelling. In determining whether a product is a consumer product,\n"; + o << " doubtful cases shall be resolved in favor of coverage. For a particular\n"; + o << " product received by a particular user, \"normally used\" refers to a\n"; + o << " typical or common use of that class of product, regardless of the status\n"; + o << " of the particular user or of the way in which the particular user\n"; + o << " actually uses, or expects or is expected to use, the product. A product\n"; + o << " is a consumer product regardless of whether the product has substantial\n"; + o << " commercial, industrial or non-consumer uses, unless such uses represent\n"; + o << " the only significant mode of use of the product.\n"; + o << "\n"; + o << " \"Installation Information\" for a User Product means any methods,\n"; + o << " procedures, authorization keys, or other information required to install\n"; + o << " and execute modified versions of a covered work in that User Product from\n"; + o << " a modified version of its Corresponding Source. The information must\n"; + o << " suffice to ensure that the continued functioning of the modified object\n"; + o << " code is in no case prevented or interfered with solely because\n"; + o << " modification has been made.\n"; + o << "\n"; + o << " If you convey an object code work under this section in, or with, or\n"; + o << " specifically for use in, a User Product, and the conveying occurs as\n"; + o << " part of a transaction in which the right of possession and use of the\n"; + o << " User Product is transferred to the recipient in perpetuity or for a\n"; + o << " fixed term (regardless of how the transaction is characterized), the\n"; + o << " Corresponding Source conveyed under this section must be accompanied\n"; + o << " by the Installation Information. But this requirement does not apply\n"; + o << " if neither you nor any third party retains the ability to install\n"; + o << " modified object code on the User Product (for example, the work has\n"; + o << " been installed in ROM).\n"; + o << "\n"; + o << " The requirement to provide Installation Information does not include a\n"; + o << " requirement to continue to provide support service, warranty, or updates\n"; + o << " for a work that has been modified or installed by the recipient, or for\n"; + o << " the User Product in which it has been modified or installed. Access to a\n"; + o << " network may be denied when the modification itself materially and\n"; + o << " adversely affects the operation of the network or violates the rules and\n"; + o << " protocols for communication across the network.\n"; + o << "\n"; + o << " Corresponding Source conveyed, and Installation Information provided,\n"; + o << " in accord with this section must be in a format that is publicly\n"; + o << " documented (and with an implementation available to the public in\n"; + o << " source code form), and must require no special password or key for\n"; + o << " unpacking, reading or copying.\n"; + o << "\n"; + o << " 7. Additional Terms.\n"; + o << "\n"; + o << " \"Additional permissions\" are terms that supplement the terms of this\n"; + o << " License by making exceptions from one or more of its conditions.\n"; + o << " Additional permissions that are applicable to the entire Program shall\n"; + o << " be treated as though they were included in this License, to the extent\n"; + o << " that they are valid under applicable law. If additional permissions\n"; + o << " apply only to part of the Program, that part may be used separately\n"; + o << " under those permissions, but the entire Program remains governed by\n"; + o << " this License without regard to the additional permissions.\n"; + o << "\n"; + o << " When you convey a copy of a covered work, you may at your option\n"; + o << " remove any additional permissions from that copy, or from any part of\n"; + o << " it. (Additional permissions may be written to require their own\n"; + o << " removal in certain cases when you modify the work.) You may place\n"; + o << " additional permissions on material, added by you to a covered work,\n"; + o << " for which you have or can give appropriate copyright permission.\n"; + o << "\n"; + o << " Notwithstanding any other provision of this License, for material you\n"; + o << " add to a covered work, you may (if authorized by the copyright holders of\n"; + o << " that material) supplement the terms of this License with terms:\n"; + o << "\n"; + o << " a) Disclaiming warranty or limiting liability differently from the\n"; + o << " terms of sections 15 and 16 of this License; or\n"; + o << "\n"; + o << " b) Requiring preservation of specified reasonable legal notices or\n"; + o << " author attributions in that material or in the Appropriate Legal\n"; + o << " Notices displayed by works containing it; or\n"; + o << "\n"; + o << " c) Prohibiting misrepresentation of the origin of that material, or\n"; + o << " requiring that modified versions of such material be marked in\n"; + o << " reasonable ways as different from the original version; or\n"; + o << "\n"; + o << " d) Limiting the use for publicity purposes of names of licensors or\n"; + o << " authors of the material; or\n"; + o << "\n"; + o << " e) Declining to grant rights under trademark law for use of some\n"; + o << " trade names, trademarks, or service marks; or\n"; + o << "\n"; + o << " f) Requiring indemnification of licensors and authors of that\n"; + o << " material by anyone who conveys the material (or modified versions of\n"; + o << " it) with contractual assumptions of liability to the recipient, for\n"; + o << " any liability that these contractual assumptions directly impose on\n"; + o << " those licensors and authors.\n"; + o << "\n"; + o << " All other non-permissive additional terms are considered \"further\n"; + o << " restrictions\" within the meaning of section 10. If the Program as you\n"; + o << " received it, or any part of it, contains a notice stating that it is\n"; + o << " governed by this License along with a term that is a further\n"; + o << " restriction, you may remove that term. If a license document contains\n"; + o << " a further restriction but permits relicensing or conveying under this\n"; + o << " License, you may add to a covered work material governed by the terms\n"; + o << " of that license document, provided that the further restriction does\n"; + o << " not survive such relicensing or conveying.\n"; + o << "\n"; + o << " If you add terms to a covered work in accord with this section, you\n"; + o << " must place, in the relevant source files, a statement of the\n"; + o << " additional terms that apply to those files, or a notice indicating\n"; + o << " where to find the applicable terms.\n"; + o << "\n"; + o << " Additional terms, permissive or non-permissive, may be stated in the\n"; + o << " form of a separately written license, or stated as exceptions;\n"; + o << " the above requirements apply either way.\n"; + o << "\n"; + o << " 8. Termination.\n"; + o << "\n"; + o << " You may not propagate or modify a covered work except as expressly\n"; + o << " provided under this License. Any attempt otherwise to propagate or\n"; + o << " modify it is void, and will automatically terminate your rights under\n"; + o << " this License (including any patent licenses granted under the third\n"; + o << " paragraph of section 11).\n"; + o << "\n"; + o << " However, if you cease all violation of this License, then your\n"; + o << " license from a particular copyright holder is reinstated (a)\n"; + o << " provisionally, unless and until the copyright holder explicitly and\n"; + o << " finally terminates your license, and (b) permanently, if the copyright\n"; + o << " holder fails to notify you of the violation by some reasonable means\n"; + o << " prior to 60 days after the cessation.\n"; + o << "\n"; + o << " Moreover, your license from a particular copyright holder is\n"; + o << " reinstated permanently if the copyright holder notifies you of the\n"; + o << " violation by some reasonable means, this is the first time you have\n"; + o << " received notice of violation of this License (for any work) from that\n"; + o << " copyright holder, and you cure the violation prior to 30 days after\n"; + o << " your receipt of the notice.\n"; + o << "\n"; + o << " Termination of your rights under this section does not terminate the\n"; + o << " licenses of parties who have received copies or rights from you under\n"; + o << " this License. If your rights have been terminated and not permanently\n"; + o << " reinstated, you do not qualify to receive new licenses for the same\n"; + o << " material under section 10.\n"; + o << "\n"; + o << " 9. Acceptance Not Required for Having Copies.\n"; + o << "\n"; + o << " You are not required to accept this License in order to receive or\n"; + o << " run a copy of the Program. Ancillary propagation of a covered work\n"; + o << " occurring solely as a consequence of using peer-to-peer transmission\n"; + o << " to receive a copy likewise does not require acceptance. However,\n"; + o << " nothing other than this License grants you permission to propagate or\n"; + o << " modify any covered work. These actions infringe copyright if you do\n"; + o << " not accept this License. Therefore, by modifying or propagating a\n"; + o << " covered work, you indicate your acceptance of this License to do so.\n"; + o << "\n"; + o << " 10. Automatic Licensing of Downstream Recipients.\n"; + o << "\n"; + o << " Each time you convey a covered work, the recipient automatically\n"; + o << " receives a license from the original licensors, to run, modify and\n"; + o << " propagate that work, subject to this License. You are not responsible\n"; + o << " for enforcing compliance by third parties with this License.\n"; + o << "\n"; + o << " An \"entity transaction\" is a transaction transferring control of an\n"; + o << " organization, or substantially all assets of one, or subdividing an\n"; + o << " organization, or merging organizations. If propagation of a covered\n"; + o << " work results from an entity transaction, each party to that\n"; + o << " transaction who receives a copy of the work also receives whatever\n"; + o << " licenses to the work the party's predecessor in interest had or could\n"; + o << " give under the previous paragraph, plus a right to possession of the\n"; + o << " Corresponding Source of the work from the predecessor in interest, if\n"; + o << " the predecessor has it or can get it with reasonable efforts.\n"; + o << "\n"; + o << " You may not impose any further restrictions on the exercise of the\n"; + o << " rights granted or affirmed under this License. For example, you may\n"; + o << " not impose a license fee, royalty, or other charge for exercise of\n"; + o << " rights granted under this License, and you may not initiate litigation\n"; + o << " (including a cross-claim or counterclaim in a lawsuit) alleging that\n"; + o << " any patent claim is infringed by making, using, selling, offering for\n"; + o << " sale, or importing the Program or any portion of it.\n"; + o << "\n"; + o << " 11. Patents.\n"; + o << "\n"; + o << " A \"contributor\" is a copyright holder who authorizes use under this\n"; + o << " License of the Program or a work on which the Program is based. The\n"; + o << " work thus licensed is called the contributor's \"contributor version\".\n"; + o << "\n"; + o << " A contributor's \"essential patent claims\" are all patent claims\n"; + o << " owned or controlled by the contributor, whether already acquired or\n"; + o << " hereafter acquired, that would be infringed by some manner, permitted\n"; + o << " by this License, of making, using, or selling its contributor version,\n"; + o << " but do not include claims that would be infringed only as a\n"; + o << " consequence of further modification of the contributor version. For\n"; + o << " purposes of this definition, \"control\" includes the right to grant\n"; + o << " patent sublicenses in a manner consistent with the requirements of\n"; + o << " this License.\n"; + o << "\n"; + o << " Each contributor grants you a non-exclusive, worldwide, royalty-free\n"; + o << " patent license under the contributor's essential patent claims, to\n"; + o << " make, use, sell, offer for sale, import and otherwise run, modify and\n"; + o << " propagate the contents of its contributor version.\n"; + o << "\n"; + o << " In the following three paragraphs, a \"patent license\" is any express\n"; + o << " agreement or commitment, however denominated, not to enforce a patent\n"; + o << " (such as an express permission to practice a patent or covenant not to\n"; + o << " sue for patent infringement). To \"grant\" such a patent license to a\n"; + o << " party means to make such an agreement or commitment not to enforce a\n"; + o << " patent against the party.\n"; + o << "\n"; + o << " If you convey a covered work, knowingly relying on a patent license,\n"; + o << " and the Corresponding Source of the work is not available for anyone\n"; + o << " to copy, free of charge and under the terms of this License, through a\n"; + o << " publicly available network server or other readily accessible means,\n"; + o << " then you must either (1) cause the Corresponding Source to be so\n"; + o << " available, or (2) arrange to deprive yourself of the benefit of the\n"; + o << " patent license for this particular work, or (3) arrange, in a manner\n"; + o << " consistent with the requirements of this License, to extend the patent\n"; + o << " license to downstream recipients. \"Knowingly relying\" means you have\n"; + o << " actual knowledge that, but for the patent license, your conveying the\n"; + o << " covered work in a country, or your recipient's use of the covered work\n"; + o << " in a country, would infringe one or more identifiable patents in that\n"; + o << " country that you have reason to believe are valid.\n"; + o << "\n"; + o << " If, pursuant to or in connection with a single transaction or\n"; + o << " arrangement, you convey, or propagate by procuring conveyance of, a\n"; + o << " covered work, and grant a patent license to some of the parties\n"; + o << " receiving the covered work authorizing them to use, propagate, modify\n"; + o << " or convey a specific copy of the covered work, then the patent license\n"; + o << " you grant is automatically extended to all recipients of the covered\n"; + o << " work and works based on it.\n"; + o << "\n"; + o << " A patent license is \"discriminatory\" if it does not include within\n"; + o << " the scope of its coverage, prohibits the exercise of, or is\n"; + o << " conditioned on the non-exercise of one or more of the rights that are\n"; + o << " specifically granted under this License. You may not convey a covered\n"; + o << " work if you are a party to an arrangement with a third party that is\n"; + o << " in the business of distributing software, under which you make payment\n"; + o << " to the third party based on the extent of your activity of conveying\n"; + o << " the work, and under which the third party grants, to any of the\n"; + o << " parties who would receive the covered work from you, a discriminatory\n"; + o << " patent license (a) in connection with copies of the covered work\n"; + o << " conveyed by you (or copies made from those copies), or (b) primarily\n"; + o << " for and in connection with specific products or compilations that\n"; + o << " contain the covered work, unless you entered into that arrangement,\n"; + o << " or that patent license was granted, prior to 28 March 2007.\n"; + o << "\n"; + o << " Nothing in this License shall be construed as excluding or limiting\n"; + o << " any implied license or other defenses to infringement that may\n"; + o << " otherwise be available to you under applicable patent law.\n"; + o << "\n"; + o << " 12. No Surrender of Others' Freedom.\n"; + o << "\n"; + o << " If conditions are imposed on you (whether by court order, agreement or\n"; + o << " otherwise) that contradict the conditions of this License, they do not\n"; + o << " excuse you from the conditions of this License. If you cannot convey a\n"; + o << " covered work so as to satisfy simultaneously your obligations under this\n"; + o << " License and any other pertinent obligations, then as a consequence you may\n"; + o << " not convey it at all. For example, if you agree to terms that obligate you\n"; + o << " to collect a royalty for further conveying from those to whom you convey\n"; + o << " the Program, the only way you could satisfy both those terms and this\n"; + o << " License would be to refrain entirely from conveying the Program.\n"; + o << "\n"; + o << " 13. Use with the GNU Affero General Public License.\n"; + o << "\n"; + o << " Notwithstanding any other provision of this License, you have\n"; + o << " permission to link or combine any covered work with a work licensed\n"; + o << " under version 3 of the GNU Affero General Public License into a single\n"; + o << " combined work, and to convey the resulting work. The terms of this\n"; + o << " License will continue to apply to the part which is the covered work,\n"; + o << " but the special requirements of the GNU Affero General Public License,\n"; + o << " section 13, concerning interaction through a network will apply to the\n"; + o << " combination as such.\n"; + o << "\n"; + o << " 14. Revised Versions of this License.\n"; + o << "\n"; + o << " The Free Software Foundation may publish revised and/or new versions of\n"; + o << " the GNU General Public License from time to time. Such new versions will\n"; + o << " be similar in spirit to the present version, but may differ in detail to\n"; + o << " address new problems or concerns.\n"; + o << "\n"; + o << " Each version is given a distinguishing version number. If the\n"; + o << " Program specifies that a certain numbered version of the GNU General\n"; + o << " Public License \"or any later version\" applies to it, you have the\n"; + o << " option of following the terms and conditions either of that numbered\n"; + o << " version or of any later version published by the Free Software\n"; + o << " Foundation. If the Program does not specify a version number of the\n"; + o << " GNU General Public License, you may choose any version ever published\n"; + o << " by the Free Software Foundation.\n"; + o << "\n"; + o << " If the Program specifies that a proxy can decide which future\n"; + o << " versions of the GNU General Public License can be used, that proxy's\n"; + o << " public statement of acceptance of a version permanently authorizes you\n"; + o << " to choose that version for the Program.\n"; + o << "\n"; + o << " Later license versions may give you additional or different\n"; + o << " permissions. However, no additional obligations are imposed on any\n"; + o << " author or copyright holder as a result of your choosing to follow a\n"; + o << " later version.\n"; + o << "\n"; + o << " 15. Disclaimer of Warranty.\n"; + o << "\n"; + o << " THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\n"; + o << " APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\n"; + o << " HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\n"; + o << " OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\n"; + o << " THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n"; + o << " PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\n"; + o << " IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\n"; + o << " ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n"; + o << "\n"; + o << " 16. Limitation of Liability.\n"; + o << "\n"; + o << " IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n"; + o << " WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\n"; + o << " THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\n"; + o << " GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\n"; + o << " USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\n"; + o << " DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\n"; + o << " PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\n"; + o << " EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\n"; + o << " SUCH DAMAGES.\n"; + o << "\n"; + o << " 17. Interpretation of Sections 15 and 16.\n"; + o << "\n"; + o << " If the disclaimer of warranty and limitation of liability provided\n"; + o << " above cannot be given local legal effect according to their terms,\n"; + o << " reviewing courts shall apply local law that most closely approximates\n"; + o << " an absolute waiver of all civil liability in connection with the\n"; + o << " Program, unless a warranty or assumption of liability accompanies a\n"; + o << " copy of the Program in return for a fee.\n"; + o << "\n"; + o << " END OF TERMS AND CONDITIONS\n"; + o << "\n"; + o << " How to Apply These Terms to Your New Programs\n"; + o << "\n"; + o << " If you develop a new program, and you want it to be of the greatest\n"; + o << " possible use to the public, the best way to achieve this is to make it\n"; + o << " free software which everyone can redistribute and change under these terms.\n"; + o << "\n"; + o << " To do so, attach the following notices to the program. It is safest\n"; + o << " to attach them to the start of each source file to most effectively\n"; + o << " state the exclusion of warranty; and each file should have at least\n"; + o << " the \"copyright\" line and a pointer to where the full notice is found.\n"; + o << "\n"; + o << " \n"; + o << " Copyright (C) \n"; + o << "\n"; + o << " This program is free software: you can redistribute it and/or modify\n"; + o << " it under the terms of the GNU General Public License as published by\n"; + o << " the Free Software Foundation, either version 3 of the License, or\n"; + o << " (at your option) any later version.\n"; + o << "\n"; + o << " This program is distributed in the hope that it will be useful,\n"; + o << " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"; + o << " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"; + o << " GNU General Public License for more details.\n"; + o << "\n"; + o << " You should have received a copy of the GNU General Public License\n"; + o << " along with this program. If not, see .\n"; + o << "\n"; + o << " Also add information on how to contact you by electronic and paper mail.\n"; + o << "\n"; + o << " If the program does terminal interaction, make it output a short\n"; + o << " notice like this when it starts in an interactive mode:\n"; + o << "\n"; + o << " {{ project }} Copyright (C) {{ year }} {{ organization }}\n"; + o << " This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n"; + o << " This is free software, and you are welcome to redistribute it\n"; + o << " under certain conditions; type `show c' for details.\n"; + o << "\n"; + o << " The hypothetical commands `show w' and `show c' should show the appropriate\n"; + o << " parts of the General Public License. Of course, your program's commands\n"; + o << " might be different; for a GUI interface, you would use an \"about box\".\n"; + o << "\n"; + o << " You should also get your employer (if you work as a programmer) or school,\n"; + o << " if any, to sign a \"copyright disclaimer\" for the program, if necessary.\n"; + o << " For more information on this, and how to apply and follow the GNU GPL, see\n"; + o << " .\n"; + o << "\n"; + o << " The GNU General Public License does not permit incorporating your program\n"; + o << " into proprietary programs. If your program is a subroutine library, you\n"; + o << " may consider it more useful to permit linking proprietary applications with\n"; + o << " the library. If this is what you want to do, use the GNU Lesser General\n"; + o << " Public License instead of this License. But first, please read\n"; + o << " .\n"; + } + o << "\n"; + o << "\n"; + o << "cxxopts Library (https://github.com/jarro2783/cxxopts)" << '\n'; + o << '\n'; + o << " MIT License" << '\n'; + if (full) { + o << '\n'; + o << " Copyright (c) 2014 Jarryd Beck" << '\n'; + o << '\n'; + o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << '\n'; + o << " of this software and associated documentation files (the \"Software\"), to deal" << '\n'; + o << " in the Software without restriction, including without limitation the rights" << '\n'; + o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << '\n'; + o << " copies of the Software, and to permit persons to whom the Software is" << '\n'; + o << " furnished to do so, subject to the following conditions:" << '\n'; + o << '\n'; + o << " The above copyright notice and this permission notice shall be included in" << '\n'; + o << " all copies or substantial portions of the Software." << '\n'; + o << '\n'; + o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << '\n'; + o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << '\n'; + o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << '\n'; + o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << '\n'; + o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << '\n'; + o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << '\n'; + o << " THE SOFTWARE." << '\n'; + } + o << '\n'; + o << '\n'; + o << "cxxshm Library (https://github.com/NikolasK-source/cxxshm)" << '\n'; + o << '\n'; + o << " MIT License" << '\n'; + if (full) { + o << " Copyright (c) 2022 Nikolas Koesling" << '\n'; + o << '\n'; + o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << '\n'; + o << " of this software and associated documentation files (the \"Software\"), to deal" << '\n'; + o << " in the Software without restriction, including without limitation the rights" << '\n'; + o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << '\n'; + o << " copies of the Software, and to permit persons to whom the Software is" << '\n'; + o << " furnished to do so, subject to the following conditions:" << '\n'; + o << '\n'; + o << " The above copyright notice and this permission notice shall be included in all" << '\n'; + o << " copies or substantial portions of the Software." << '\n'; + o << '\n'; + o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << '\n'; + o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << '\n'; + o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << '\n'; + o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << '\n'; + o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << '\n'; + o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << '\n'; + o << " SOFTWARE." << '\n'; + } + o << '\n'; + o << '\n'; + o << "cxxendian Library (https://github.com/NikolasK-source/cxxendian)" << '\n'; + o << '\n'; + o << " MIT License" << '\n'; + if (full) { + o << '\n'; + o << " Copyright (c) 2022 Nikolas Koesling" << '\n'; + o << '\n'; + o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << '\n'; + o << " of this software and associated documentation files (the \"Software\"), to deal" << '\n'; + o << " in the Software without restriction, including without limitation the rights" << '\n'; + o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << '\n'; + o << " copies of the Software, and to permit persons to whom the Software is" << '\n'; + o << " furnished to do so, subject to the following conditions:" << '\n'; + o << '\n'; + o << " The above copyright notice and this permission notice shall be included in all" << '\n'; + o << " copies or substantial portions of the Software." << '\n'; + o << '\n'; + o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << '\n'; + o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << '\n'; + o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << '\n'; + o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << '\n'; + o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << '\n'; + o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << '\n'; + o << " SOFTWARE." << '\n'; + } + o << '\n'; + o << '\n'; o << "GNU Readline Library (http://git.savannah.gnu.org/cgit/readline.git/)"; - o << std::endl; - o << " GNU GENERAL PUBLIC LICENSE" << std::endl; - o << " Version 3, 29 June 2007" << std::endl; - o << std::endl; - o << " Copyright (C) 2007 Free Software Foundation, Inc. " << std::endl; - o << " Everyone is permitted to copy and distribute verbatim copies" << std::endl; - o << " of this license document, but changing it is not allowed." << std::endl; - o << std::endl; - o << " Preamble" << std::endl; - o << std::endl; - o << " The GNU General Public License is a free, copyleft license for" << std::endl; - o << " software and other kinds of works." << std::endl; - o << std::endl; - o << " The licenses for most software and other practical works are designed" << std::endl; - o << " to take away your freedom to share and change the works. By contrast," << std::endl; - o << " the GNU General Public License is intended to guarantee your freedom to" << std::endl; - o << " share and change all versions of a program--to make sure it remains free" << std::endl; - o << " software for all its users. We, the Free Software Foundation, use the" << std::endl; - o << " GNU General Public License for most of our software; it applies also to" << std::endl; - o << " any other work released this way by its authors. You can apply it to" << std::endl; - o << " your programs, too." << std::endl; - o << std::endl; - o << " When we speak of free software, we are referring to freedom, not" << std::endl; - o << " price. Our General Public Licenses are designed to make sure that you" << std::endl; - o << " have the freedom to distribute copies of free software (and charge for" << std::endl; - o << " them if you wish), that you receive source code or can get it if you" << std::endl; - o << " want it, that you can change the software or use pieces of it in new" << std::endl; - o << " free programs, and that you know you can do these things." << std::endl; - o << std::endl; - o << " To protect your rights, we need to prevent others from denying you" << std::endl; - o << " these rights or asking you to surrender the rights. Therefore, you have" << std::endl; - o << " certain responsibilities if you distribute copies of the software, or if" << std::endl; - o << " you modify it: responsibilities to respect the freedom of others." << std::endl; - o << std::endl; - o << " For example, if you distribute copies of such a program, whether" << std::endl; - o << " gratis or for a fee, you must pass on to the recipients the same" << std::endl; - o << " freedoms that you received. You must make sure that they, too, receive" << std::endl; - o << " or can get the source code. And you must show them these terms so they" << std::endl; - o << " know their rights." << std::endl; - o << std::endl; - o << " Developers that use the GNU GPL protect your rights with two steps:" << std::endl; - o << " (1) assert copyright on the software, and (2) offer you this License" << std::endl; - o << " giving you legal permission to copy, distribute and/or modify it." << std::endl; - o << std::endl; - o << " For the developers' and authors' protection, the GPL clearly explains" << std::endl; - o << " that there is no warranty for this free software. For both users' and" << std::endl; - o << " authors' sake, the GPL requires that modified versions be marked as" << std::endl; - o << " changed, so that their problems will not be attributed erroneously to" << std::endl; - o << " authors of previous versions." << std::endl; - o << std::endl; - o << " Some devices are designed to deny users access to install or run" << std::endl; - o << " modified versions of the software inside them, although the manufacturer" << std::endl; - o << " can do so. This is fundamentally incompatible with the aim of" << std::endl; - o << " protecting users' freedom to change the software. The systematic" << std::endl; - o << " pattern of such abuse occurs in the area of products for individuals to" << std::endl; - o << " use, which is precisely where it is most unacceptable. Therefore, we" << std::endl; - o << " have designed this version of the GPL to prohibit the practice for those" << std::endl; - o << " products. If such problems arise substantially in other domains, we" << std::endl; - o << " stand ready to extend this provision to those domains in future versions" << std::endl; - o << " of the GPL, as needed to protect the freedom of users." << std::endl; - o << std::endl; - o << " Finally, every program is threatened constantly by software patents." << std::endl; - o << " States should not allow patents to restrict development and use of" << std::endl; - o << " software on general-purpose computers, but in those that do, we wish to" << std::endl; - o << " avoid the special danger that patents applied to a free program could" << std::endl; - o << " make it effectively proprietary. To prevent this, the GPL assures that" << std::endl; - o << " patents cannot be used to render the program non-free." << std::endl; - o << std::endl; - o << " The precise terms and conditions for copying, distribution and" << std::endl; - o << " modification follow." << std::endl; - o << std::endl; - o << " TERMS AND CONDITIONS" << std::endl; - o << std::endl; - o << " 0. Definitions." << std::endl; - o << std::endl; - o << " \"This License\" refers to version 3 of the GNU General Public License." << std::endl; - o << std::endl; - o << " \"Copyright\" also means copyright-like laws that apply to other kinds of" << std::endl; - o << " works, such as semiconductor masks." << std::endl; - o << std::endl; - o << " \"The Program\" refers to any copyrightable work licensed under this" << std::endl; - o << " License. Each licensee is addressed as \"you\". \"Licensees\" and" << std::endl; - o << " \"recipients\" may be individuals or organizations." << std::endl; - o << std::endl; - o << " To \"modify\" a work means to copy from or adapt all or part of the work" << std::endl; - o << " in a fashion requiring copyright permission, other than the making of an" << std::endl; - o << " exact copy. The resulting work is called a \"modified version\" of the" << std::endl; - o << " earlier work or a work \"based on\" the earlier work." << std::endl; - o << std::endl; - o << " A \"covered work\" means either the unmodified Program or a work based" << std::endl; - o << " on the Program." << std::endl; - o << std::endl; - o << " To \"propagate\" a work means to do anything with it that, without" << std::endl; - o << " permission, would make you directly or secondarily liable for" << std::endl; - o << " infringement under applicable copyright law, except executing it on a" << std::endl; - o << " computer or modifying a private copy. Propagation includes copying," << std::endl; - o << " distribution (with or without modification), making available to the" << std::endl; - o << " public, and in some countries other activities as well." << std::endl; - o << std::endl; - o << " To \"convey\" a work means any kind of propagation that enables other" << std::endl; - o << " parties to make or receive copies. Mere interaction with a user through" << std::endl; - o << " a computer network, with no transfer of a copy, is not conveying." << std::endl; - o << std::endl; - o << " An interactive user interface displays \"Appropriate Legal Notices\"" << std::endl; - o << " to the extent that it includes a convenient and prominently visible" << std::endl; - o << " feature that (1) displays an appropriate copyright notice, and (2)" << std::endl; - o << " tells the user that there is no warranty for the work (except to the" << std::endl; - o << " extent that warranties are provided), that licensees may convey the" << std::endl; - o << " work under this License, and how to view a copy of this License. If" << std::endl; - o << " the interface presents a list of user commands or options, such as a" << std::endl; - o << " menu, a prominent item in the list meets this criterion." << std::endl; - o << std::endl; - o << " 1. Source Code." << std::endl; - o << std::endl; - o << " The \"source code\" for a work means the preferred form of the work" << std::endl; - o << " for making modifications to it. \"Object code\" means any non-source" << std::endl; - o << " form of a work." << std::endl; - o << std::endl; - o << " A \"Standard Interface\" means an interface that either is an official" << std::endl; - o << " standard defined by a recognized standards body, or, in the case of" << std::endl; - o << " interfaces specified for a particular programming language, one that" << std::endl; - o << " is widely used among developers working in that language." << std::endl; - o << std::endl; - o << " The \"System Libraries\" of an executable work include anything, other" << std::endl; - o << " than the work as a whole, that (a) is included in the normal form of" << std::endl; - o << " packaging a Major Component, but which is not part of that Major" << std::endl; - o << " Component, and (b) serves only to enable use of the work with that" << std::endl; - o << " Major Component, or to implement a Standard Interface for which an" << std::endl; - o << " implementation is available to the public in source code form. A" << std::endl; - o << " \"Major Component\", in this context, means a major essential component" << std::endl; - o << " (kernel, window system, and so on) of the specific operating system" << std::endl; - o << " (if any) on which the executable work runs, or a compiler used to" << std::endl; - o << " produce the work, or an object code interpreter used to run it." << std::endl; - o << std::endl; - o << " The \"Corresponding Source\" for a work in object code form means all" << std::endl; - o << " the source code needed to generate, install, and (for an executable" << std::endl; - o << " work) run the object code and to modify the work, including scripts to" << std::endl; - o << " control those activities. However, it does not include the work's" << std::endl; - o << " System Libraries, or general-purpose tools or generally available free" << std::endl; - o << " programs which are used unmodified in performing those activities but" << std::endl; - o << " which are not part of the work. For example, Corresponding Source" << std::endl; - o << " includes interface definition files associated with source files for" << std::endl; - o << " the work, and the source code for shared libraries and dynamically" << std::endl; - o << " linked subprograms that the work is specifically designed to require," << std::endl; - o << " such as by intimate data communication or control flow between those" << std::endl; - o << " subprograms and other parts of the work." << std::endl; - o << std::endl; - o << " The Corresponding Source need not include anything that users" << std::endl; - o << " can regenerate automatically from other parts of the Corresponding" << std::endl; - o << " Source." << std::endl; - o << std::endl; - o << " The Corresponding Source for a work in source code form is that" << std::endl; - o << " same work." << std::endl; - o << std::endl; - o << " 2. Basic Permissions." << std::endl; - o << std::endl; - o << " All rights granted under this License are granted for the term of" << std::endl; - o << " copyright on the Program, and are irrevocable provided the stated" << std::endl; - o << " conditions are met. This License explicitly affirms your unlimited" << std::endl; - o << " permission to run the unmodified Program. The output from running a" << std::endl; - o << " covered work is covered by this License only if the output, given its" << std::endl; - o << " content, constitutes a covered work. This License acknowledges your" << std::endl; - o << " rights of fair use or other equivalent, as provided by copyright law." << std::endl; - o << std::endl; - o << " You may make, run and propagate covered works that you do not" << std::endl; - o << " convey, without conditions so long as your license otherwise remains" << std::endl; - o << " in force. You may convey covered works to others for the sole purpose" << std::endl; - o << " of having them make modifications exclusively for you, or provide you" << std::endl; - o << " with facilities for running those works, provided that you comply with" << std::endl; - o << " the terms of this License in conveying all material for which you do" << std::endl; - o << " not control copyright. Those thus making or running the covered works" << std::endl; - o << " for you must do so exclusively on your behalf, under your direction" << std::endl; - o << " and control, on terms that prohibit them from making any copies of" << std::endl; - o << " your copyrighted material outside their relationship with you." << std::endl; - o << std::endl; - o << " Conveying under any other circumstances is permitted solely under" << std::endl; - o << " the conditions stated below. Sublicensing is not allowed; section 10" << std::endl; - o << " makes it unnecessary." << std::endl; - o << std::endl; - o << " 3. Protecting Users' Legal Rights From Anti-Circumvention Law." << std::endl; - o << std::endl; - o << " No covered work shall be deemed part of an effective technological" << std::endl; - o << " measure under any applicable law fulfilling obligations under article" << std::endl; - o << " 11 of the WIPO copyright treaty adopted on 20 December 1996, or" << std::endl; - o << " similar laws prohibiting or restricting circumvention of such" << std::endl; - o << " measures." << std::endl; - o << std::endl; - o << " When you convey a covered work, you waive any legal power to forbid" << std::endl; - o << " circumvention of technological measures to the extent such circumvention" << std::endl; - o << " is effected by exercising rights under this License with respect to" << std::endl; - o << " the covered work, and you disclaim any intention to limit operation or" << std::endl; - o << " modification of the work as a means of enforcing, against the work's" << std::endl; - o << " users, your or third parties' legal rights to forbid circumvention of" << std::endl; - o << " technological measures." << std::endl; - o << std::endl; - o << " 4. Conveying Verbatim Copies." << std::endl; - o << std::endl; - o << " You may convey verbatim copies of the Program's source code as you" << std::endl; - o << " receive it, in any medium, provided that you conspicuously and" << std::endl; - o << " appropriately publish on each copy an appropriate copyright notice;" << std::endl; - o << " keep intact all notices stating that this License and any" << std::endl; - o << " non-permissive terms added in accord with section 7 apply to the code;" << std::endl; - o << " keep intact all notices of the absence of any warranty; and give all" << std::endl; - o << " recipients a copy of this License along with the Program." << std::endl; - o << std::endl; - o << " You may charge any price or no price for each copy that you convey," << std::endl; - o << " and you may offer support or warranty protection for a fee." << std::endl; - o << std::endl; - o << " 5. Conveying Modified Source Versions." << std::endl; - o << std::endl; - o << " You may convey a work based on the Program, or the modifications to" << std::endl; - o << " produce it from the Program, in the form of source code under the" << std::endl; - o << " terms of section 4, provided that you also meet all of these conditions:" << std::endl; - o << std::endl; - o << " a) The work must carry prominent notices stating that you modified" << std::endl; - o << " it, and giving a relevant date." << std::endl; - o << std::endl; - o << " b) The work must carry prominent notices stating that it is" << std::endl; - o << " released under this License and any conditions added under section" << std::endl; - o << " 7. This requirement modifies the requirement in section 4 to" << std::endl; - o << " \"keep intact all notices\"." << std::endl; - o << std::endl; - o << " c) You must license the entire work, as a whole, under this" << std::endl; - o << " License to anyone who comes into possession of a copy. This" << std::endl; - o << " License will therefore apply, along with any applicable section 7" << std::endl; - o << " additional terms, to the whole of the work, and all its parts," << std::endl; - o << " regardless of how they are packaged. This License gives no" << std::endl; - o << " permission to license the work in any other way, but it does not" << std::endl; - o << " invalidate such permission if you have separately received it." << std::endl; - o << std::endl; - o << " d) If the work has interactive user interfaces, each must display" << std::endl; - o << " Appropriate Legal Notices; however, if the Program has interactive" << std::endl; - o << " interfaces that do not display Appropriate Legal Notices, your" << std::endl; - o << " work need not make them do so." << std::endl; - o << std::endl; - o << " A compilation of a covered work with other separate and independent" << std::endl; - o << " works, which are not by their nature extensions of the covered work," << std::endl; - o << " and which are not combined with it such as to form a larger program," << std::endl; - o << " in or on a volume of a storage or distribution medium, is called an" << std::endl; - o << " \"aggregate\" if the compilation and its resulting copyright are not" << std::endl; - o << " used to limit the access or legal rights of the compilation's users" << std::endl; - o << " beyond what the individual works permit. Inclusion of a covered work" << std::endl; - o << " in an aggregate does not cause this License to apply to the other" << std::endl; - o << " parts of the aggregate." << std::endl; - o << std::endl; - o << " 6. Conveying Non-Source Forms." << std::endl; - o << std::endl; - o << " You may convey a covered work in object code form under the terms" << std::endl; - o << " of sections 4 and 5, provided that you also convey the" << std::endl; - o << " machine-readable Corresponding Source under the terms of this License," << std::endl; - o << " in one of these ways:" << std::endl; - o << std::endl; - o << " a) Convey the object code in, or embodied in, a physical product" << std::endl; - o << " (including a physical distribution medium), accompanied by the" << std::endl; - o << " Corresponding Source fixed on a durable physical medium" << std::endl; - o << " customarily used for software interchange." << std::endl; - o << std::endl; - o << " b) Convey the object code in, or embodied in, a physical product" << std::endl; - o << " (including a physical distribution medium), accompanied by a" << std::endl; - o << " written offer, valid for at least three years and valid for as" << std::endl; - o << " long as you offer spare parts or customer support for that product" << std::endl; - o << " model, to give anyone who possesses the object code either (1) a" << std::endl; - o << " copy of the Corresponding Source for all the software in the" << std::endl; - o << " product that is covered by this License, on a durable physical" << std::endl; - o << " medium customarily used for software interchange, for a price no" << std::endl; - o << " more than your reasonable cost of physically performing this" << std::endl; - o << " conveying of source, or (2) access to copy the" << std::endl; - o << " Corresponding Source from a network server at no charge." << std::endl; - o << std::endl; - o << " c) Convey individual copies of the object code with a copy of the" << std::endl; - o << " written offer to provide the Corresponding Source. This" << std::endl; - o << " alternative is allowed only occasionally and noncommercially, and" << std::endl; - o << " only if you received the object code with such an offer, in accord" << std::endl; - o << " with subsection 6b." << std::endl; - o << std::endl; - o << " d) Convey the object code by offering access from a designated" << std::endl; - o << " place (gratis or for a charge), and offer equivalent access to the" << std::endl; - o << " Corresponding Source in the same way through the same place at no" << std::endl; - o << " further charge. You need not require recipients to copy the" << std::endl; - o << " Corresponding Source along with the object code. If the place to" << std::endl; - o << " copy the object code is a network server, the Corresponding Source" << std::endl; - o << " may be on a different server (operated by you or a third party)" << std::endl; - o << " that supports equivalent copying facilities, provided you maintain" << std::endl; - o << " clear directions next to the object code saying where to find the" << std::endl; - o << " Corresponding Source. Regardless of what server hosts the" << std::endl; - o << " Corresponding Source, you remain obligated to ensure that it is" << std::endl; - o << " available for as long as needed to satisfy these requirements." << std::endl; - o << std::endl; - o << " e) Convey the object code using peer-to-peer transmission, provided" << std::endl; - o << " you inform other peers where the object code and Corresponding" << std::endl; - o << " Source of the work are being offered to the general public at no" << std::endl; - o << " charge under subsection 6d." << std::endl; - o << std::endl; - o << " A separable portion of the object code, whose source code is excluded" << std::endl; - o << " from the Corresponding Source as a System Library, need not be" << std::endl; - o << " included in conveying the object code work." << std::endl; - o << std::endl; - o << " A \"User Product\" is either (1) a \"consumer product\", which means any" << std::endl; - o << " tangible personal property which is normally used for personal, family," << std::endl; - o << " or household purposes, or (2) anything designed or sold for incorporation" << std::endl; - o << " into a dwelling. In determining whether a product is a consumer product," << std::endl; - o << " doubtful cases shall be resolved in favor of coverage. For a particular" << std::endl; - o << " product received by a particular user, \"normally used\" refers to a" << std::endl; - o << " typical or common use of that class of product, regardless of the status" << std::endl; - o << " of the particular user or of the way in which the particular user" << std::endl; - o << " actually uses, or expects or is expected to use, the product. A product" << std::endl; - o << " is a consumer product regardless of whether the product has substantial" << std::endl; - o << " commercial, industrial or non-consumer uses, unless such uses represent" << std::endl; - o << " the only significant mode of use of the product." << std::endl; - o << std::endl; - o << " \"Installation Information\" for a User Product means any methods," << std::endl; - o << " procedures, authorization keys, or other information required to install" << std::endl; - o << " and execute modified versions of a covered work in that User Product from" << std::endl; - o << " a modified version of its Corresponding Source. The information must" << std::endl; - o << " suffice to ensure that the continued functioning of the modified object" << std::endl; - o << " code is in no case prevented or interfered with solely because" << std::endl; - o << " modification has been made." << std::endl; - o << std::endl; - o << " If you convey an object code work under this section in, or with, or" << std::endl; - o << " specifically for use in, a User Product, and the conveying occurs as" << std::endl; - o << " part of a transaction in which the right of possession and use of the" << std::endl; - o << " User Product is transferred to the recipient in perpetuity or for a" << std::endl; - o << " fixed term (regardless of how the transaction is characterized), the" << std::endl; - o << " Corresponding Source conveyed under this section must be accompanied" << std::endl; - o << " by the Installation Information. But this requirement does not apply" << std::endl; - o << " if neither you nor any third party retains the ability to install" << std::endl; - o << " modified object code on the User Product (for example, the work has" << std::endl; - o << " been installed in ROM)." << std::endl; - o << std::endl; - o << " The requirement to provide Installation Information does not include a" << std::endl; - o << " requirement to continue to provide support service, warranty, or updates" << std::endl; - o << " for a work that has been modified or installed by the recipient, or for" << std::endl; - o << " the User Product in which it has been modified or installed. Access to a" << std::endl; - o << " network may be denied when the modification itself materially and" << std::endl; - o << " adversely affects the operation of the network or violates the rules and" << std::endl; - o << " protocols for communication across the network." << std::endl; - o << std::endl; - o << " Corresponding Source conveyed, and Installation Information provided," << std::endl; - o << " in accord with this section must be in a format that is publicly" << std::endl; - o << " documented (and with an implementation available to the public in" << std::endl; - o << " source code form), and must require no special password or key for" << std::endl; - o << " unpacking, reading or copying." << std::endl; - o << std::endl; - o << " 7. Additional Terms." << std::endl; - o << std::endl; - o << " \"Additional permissions\" are terms that supplement the terms of this" << std::endl; - o << " License by making exceptions from one or more of its conditions." << std::endl; - o << " Additional permissions that are applicable to the entire Program shall" << std::endl; - o << " be treated as though they were included in this License, to the extent" << std::endl; - o << " that they are valid under applicable law. If additional permissions" << std::endl; - o << " apply only to part of the Program, that part may be used separately" << std::endl; - o << " under those permissions, but the entire Program remains governed by" << std::endl; - o << " this License without regard to the additional permissions." << std::endl; - o << std::endl; - o << " When you convey a copy of a covered work, you may at your option" << std::endl; - o << " remove any additional permissions from that copy, or from any part of" << std::endl; - o << " it. (Additional permissions may be written to require their own" << std::endl; - o << " removal in certain cases when you modify the work.) You may place" << std::endl; - o << " additional permissions on material, added by you to a covered work," << std::endl; - o << " for which you have or can give appropriate copyright permission." << std::endl; - o << std::endl; - o << " Notwithstanding any other provision of this License, for material you" << std::endl; - o << " add to a covered work, you may (if authorized by the copyright holders of" << std::endl; - o << " that material) supplement the terms of this License with terms:" << std::endl; - o << std::endl; - o << " a) Disclaiming warranty or limiting liability differently from the" << std::endl; - o << " terms of sections 15 and 16 of this License; or" << std::endl; - o << std::endl; - o << " b) Requiring preservation of specified reasonable legal notices or" << std::endl; - o << " author attributions in that material or in the Appropriate Legal" << std::endl; - o << " Notices displayed by works containing it; or" << std::endl; - o << std::endl; - o << " c) Prohibiting misrepresentation of the origin of that material, or" << std::endl; - o << " requiring that modified versions of such material be marked in" << std::endl; - o << " reasonable ways as different from the original version; or" << std::endl; - o << std::endl; - o << " d) Limiting the use for publicity purposes of names of licensors or" << std::endl; - o << " authors of the material; or" << std::endl; - o << std::endl; - o << " e) Declining to grant rights under trademark law for use of some" << std::endl; - o << " trade names, trademarks, or service marks; or" << std::endl; - o << std::endl; - o << " f) Requiring indemnification of licensors and authors of that" << std::endl; - o << " material by anyone who conveys the material (or modified versions of" << std::endl; - o << " it) with contractual assumptions of liability to the recipient, for" << std::endl; - o << " any liability that these contractual assumptions directly impose on" << std::endl; - o << " those licensors and authors." << std::endl; - o << std::endl; - o << " All other non-permissive additional terms are considered \"further" << std::endl; - o << " restrictions\" within the meaning of section 10. If the Program as you" << std::endl; - o << " received it, or any part of it, contains a notice stating that it is" << std::endl; - o << " governed by this License along with a term that is a further" << std::endl; - o << " restriction, you may remove that term. If a license document contains" << std::endl; - o << " a further restriction but permits relicensing or conveying under this" << std::endl; - o << " License, you may add to a covered work material governed by the terms" << std::endl; - o << " of that license document, provided that the further restriction does" << std::endl; - o << " not survive such relicensing or conveying." << std::endl; - o << std::endl; - o << " If you add terms to a covered work in accord with this section, you" << std::endl; - o << " must place, in the relevant source files, a statement of the" << std::endl; - o << " additional terms that apply to those files, or a notice indicating" << std::endl; - o << " where to find the applicable terms." << std::endl; - o << std::endl; - o << " Additional terms, permissive or non-permissive, may be stated in the" << std::endl; - o << " form of a separately written license, or stated as exceptions;" << std::endl; - o << " the above requirements apply either way." << std::endl; - o << std::endl; - o << " 8. Termination." << std::endl; - o << std::endl; - o << " You may not propagate or modify a covered work except as expressly" << std::endl; - o << " provided under this License. Any attempt otherwise to propagate or" << std::endl; - o << " modify it is void, and will automatically terminate your rights under" << std::endl; - o << " this License (including any patent licenses granted under the third" << std::endl; - o << " paragraph of section 11)." << std::endl; - o << std::endl; - o << " However, if you cease all violation of this License, then your" << std::endl; - o << " license from a particular copyright holder is reinstated (a)" << std::endl; - o << " provisionally, unless and until the copyright holder explicitly and" << std::endl; - o << " finally terminates your license, and (b) permanently, if the copyright" << std::endl; - o << " holder fails to notify you of the violation by some reasonable means" << std::endl; - o << " prior to 60 days after the cessation." << std::endl; - o << std::endl; - o << " Moreover, your license from a particular copyright holder is" << std::endl; - o << " reinstated permanently if the copyright holder notifies you of the" << std::endl; - o << " violation by some reasonable means, this is the first time you have" << std::endl; - o << " received notice of violation of this License (for any work) from that" << std::endl; - o << " copyright holder, and you cure the violation prior to 30 days after" << std::endl; - o << " your receipt of the notice." << std::endl; - o << std::endl; - o << " Termination of your rights under this section does not terminate the" << std::endl; - o << " licenses of parties who have received copies or rights from you under" << std::endl; - o << " this License. If your rights have been terminated and not permanently" << std::endl; - o << " reinstated, you do not qualify to receive new licenses for the same" << std::endl; - o << " material under section 10." << std::endl; - o << std::endl; - o << " 9. Acceptance Not Required for Having Copies." << std::endl; - o << std::endl; - o << " You are not required to accept this License in order to receive or" << std::endl; - o << " run a copy of the Program. Ancillary propagation of a covered work" << std::endl; - o << " occurring solely as a consequence of using peer-to-peer transmission" << std::endl; - o << " to receive a copy likewise does not require acceptance. However," << std::endl; - o << " nothing other than this License grants you permission to propagate or" << std::endl; - o << " modify any covered work. These actions infringe copyright if you do" << std::endl; - o << " not accept this License. Therefore, by modifying or propagating a" << std::endl; - o << " covered work, you indicate your acceptance of this License to do so." << std::endl; - o << std::endl; - o << " 10. Automatic Licensing of Downstream Recipients." << std::endl; - o << std::endl; - o << " Each time you convey a covered work, the recipient automatically" << std::endl; - o << " receives a license from the original licensors, to run, modify and" << std::endl; - o << " propagate that work, subject to this License. You are not responsible" << std::endl; - o << " for enforcing compliance by third parties with this License." << std::endl; - o << std::endl; - o << " An \"entity transaction\" is a transaction transferring control of an" << std::endl; - o << " organization, or substantially all assets of one, or subdividing an" << std::endl; - o << " organization, or merging organizations. If propagation of a covered" << std::endl; - o << " work results from an entity transaction, each party to that" << std::endl; - o << " transaction who receives a copy of the work also receives whatever" << std::endl; - o << " licenses to the work the party's predecessor in interest had or could" << std::endl; - o << " give under the previous paragraph, plus a right to possession of the" << std::endl; - o << " Corresponding Source of the work from the predecessor in interest, if" << std::endl; - o << " the predecessor has it or can get it with reasonable efforts." << std::endl; - o << std::endl; - o << " You may not impose any further restrictions on the exercise of the" << std::endl; - o << " rights granted or affirmed under this License. For example, you may" << std::endl; - o << " not impose a license fee, royalty, or other charge for exercise of" << std::endl; - o << " rights granted under this License, and you may not initiate litigation" << std::endl; - o << " (including a cross-claim or counterclaim in a lawsuit) alleging that" << std::endl; - o << " any patent claim is infringed by making, using, selling, offering for" << std::endl; - o << " sale, or importing the Program or any portion of it." << std::endl; - o << std::endl; - o << " 11. Patents." << std::endl; - o << std::endl; - o << " A \"contributor\" is a copyright holder who authorizes use under this" << std::endl; - o << " License of the Program or a work on which the Program is based. The" << std::endl; - o << " work thus licensed is called the contributor's \"contributor version\"." << std::endl; - o << std::endl; - o << " A contributor's \"essential patent claims\" are all patent claims" << std::endl; - o << " owned or controlled by the contributor, whether already acquired or" << std::endl; - o << " hereafter acquired, that would be infringed by some manner, permitted" << std::endl; - o << " by this License, of making, using, or selling its contributor version," << std::endl; - o << " but do not include claims that would be infringed only as a" << std::endl; - o << " consequence of further modification of the contributor version. For" << std::endl; - o << " purposes of this definition, \"control\" includes the right to grant" << std::endl; - o << " patent sublicenses in a manner consistent with the requirements of" << std::endl; - o << " this License." << std::endl; - o << std::endl; - o << " Each contributor grants you a non-exclusive, worldwide, royalty-free" << std::endl; - o << " patent license under the contributor's essential patent claims, to" << std::endl; - o << " make, use, sell, offer for sale, import and otherwise run, modify and" << std::endl; - o << " propagate the contents of its contributor version." << std::endl; - o << std::endl; - o << " In the following three paragraphs, a \"patent license\" is any express" << std::endl; - o << " agreement or commitment, however denominated, not to enforce a patent" << std::endl; - o << " (such as an express permission to practice a patent or covenant not to" << std::endl; - o << " sue for patent infringement). To \"grant\" such a patent license to a" << std::endl; - o << " party means to make such an agreement or commitment not to enforce a" << std::endl; - o << " patent against the party." << std::endl; - o << std::endl; - o << " If you convey a covered work, knowingly relying on a patent license," << std::endl; - o << " and the Corresponding Source of the work is not available for anyone" << std::endl; - o << " to copy, free of charge and under the terms of this License, through a" << std::endl; - o << " publicly available network server or other readily accessible means," << std::endl; - o << " then you must either (1) cause the Corresponding Source to be so" << std::endl; - o << " available, or (2) arrange to deprive yourself of the benefit of the" << std::endl; - o << " patent license for this particular work, or (3) arrange, in a manner" << std::endl; - o << " consistent with the requirements of this License, to extend the patent" << std::endl; - o << " license to downstream recipients. \"Knowingly relying\" means you have" << std::endl; - o << " actual knowledge that, but for the patent license, your conveying the" << std::endl; - o << " covered work in a country, or your recipient's use of the covered work" << std::endl; - o << " in a country, would infringe one or more identifiable patents in that" << std::endl; - o << " country that you have reason to believe are valid." << std::endl; - o << std::endl; - o << " If, pursuant to or in connection with a single transaction or" << std::endl; - o << " arrangement, you convey, or propagate by procuring conveyance of, a" << std::endl; - o << " covered work, and grant a patent license to some of the parties" << std::endl; - o << " receiving the covered work authorizing them to use, propagate, modify" << std::endl; - o << " or convey a specific copy of the covered work, then the patent license" << std::endl; - o << " you grant is automatically extended to all recipients of the covered" << std::endl; - o << " work and works based on it." << std::endl; - o << std::endl; - o << " A patent license is \"discriminatory\" if it does not include within" << std::endl; - o << " the scope of its coverage, prohibits the exercise of, or is" << std::endl; - o << " conditioned on the non-exercise of one or more of the rights that are" << std::endl; - o << " specifically granted under this License. You may not convey a covered" << std::endl; - o << " work if you are a party to an arrangement with a third party that is" << std::endl; - o << " in the business of distributing software, under which you make payment" << std::endl; - o << " to the third party based on the extent of your activity of conveying" << std::endl; - o << " the work, and under which the third party grants, to any of the" << std::endl; - o << " parties who would receive the covered work from you, a discriminatory" << std::endl; - o << " patent license (a) in connection with copies of the covered work" << std::endl; - o << " conveyed by you (or copies made from those copies), or (b) primarily" << std::endl; - o << " for and in connection with specific products or compilations that" << std::endl; - o << " contain the covered work, unless you entered into that arrangement," << std::endl; - o << " or that patent license was granted, prior to 28 March 2007." << std::endl; - o << std::endl; - o << " Nothing in this License shall be construed as excluding or limiting" << std::endl; - o << " any implied license or other defenses to infringement that may" << std::endl; - o << " otherwise be available to you under applicable patent law." << std::endl; - o << std::endl; - o << " 12. No Surrender of Others' Freedom." << std::endl; - o << std::endl; - o << " If conditions are imposed on you (whether by court order, agreement or" << std::endl; - o << " otherwise) that contradict the conditions of this License, they do not" << std::endl; - o << " excuse you from the conditions of this License. If you cannot convey a" << std::endl; - o << " covered work so as to satisfy simultaneously your obligations under this" << std::endl; - o << " License and any other pertinent obligations, then as a consequence you may" << std::endl; - o << " not convey it at all. For example, if you agree to terms that obligate you" << std::endl; - o << " to collect a royalty for further conveying from those to whom you convey" << std::endl; - o << " the Program, the only way you could satisfy both those terms and this" << std::endl; - o << " License would be to refrain entirely from conveying the Program." << std::endl; - o << std::endl; - o << " 13. Use with the GNU Affero General Public License." << std::endl; - o << std::endl; - o << " Notwithstanding any other provision of this License, you have" << std::endl; - o << " permission to link or combine any covered work with a work licensed" << std::endl; - o << " under version 3 of the GNU Affero General Public License into a single" << std::endl; - o << " combined work, and to convey the resulting work. The terms of this" << std::endl; - o << " License will continue to apply to the part which is the covered work," << std::endl; - o << " but the special requirements of the GNU Affero General Public License," << std::endl; - o << " section 13, concerning interaction through a network will apply to the" << std::endl; - o << " combination as such." << std::endl; - o << std::endl; - o << " 14. Revised Versions of this License." << std::endl; - o << std::endl; - o << " The Free Software Foundation may publish revised and/or new versions of" << std::endl; - o << " the GNU General Public License from time to time. Such new versions will" << std::endl; - o << " be similar in spirit to the present version, but may differ in detail to" << std::endl; - o << " address new problems or concerns." << std::endl; - o << std::endl; - o << " Each version is given a distinguishing version number. If the" << std::endl; - o << " Program specifies that a certain numbered version of the GNU General" << std::endl; - o << " Public License \"or any later version\" applies to it, you have the" << std::endl; - o << " option of following the terms and conditions either of that numbered" << std::endl; - o << " version or of any later version published by the Free Software" << std::endl; - o << " Foundation. If the Program does not specify a version number of the" << std::endl; - o << " GNU General Public License, you may choose any version ever published" << std::endl; - o << " by the Free Software Foundation." << std::endl; - o << std::endl; - o << " If the Program specifies that a proxy can decide which future" << std::endl; - o << " versions of the GNU General Public License can be used, that proxy's" << std::endl; - o << " public statement of acceptance of a version permanently authorizes you" << std::endl; - o << " to choose that version for the Program." << std::endl; - o << std::endl; - o << " Later license versions may give you additional or different" << std::endl; - o << " permissions. However, no additional obligations are imposed on any" << std::endl; - o << " author or copyright holder as a result of your choosing to follow a" << std::endl; - o << " later version." << std::endl; - o << std::endl; - o << " 15. Disclaimer of Warranty." << std::endl; - o << std::endl; - o << " THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY" << std::endl; - o << " APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT" << std::endl; - o << " HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY" << std::endl; - o << " OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO," << std::endl; - o << " THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR" << std::endl; - o << " PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM" << std::endl; - o << " IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF" << std::endl; - o << " ALL NECESSARY SERVICING, REPAIR OR CORRECTION." << std::endl; - o << std::endl; - o << " 16. Limitation of Liability." << std::endl; - o << std::endl; - o << " IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING" << std::endl; - o << " WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS" << std::endl; - o << " THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY" << std::endl; - o << " GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE" << std::endl; - o << " USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF" << std::endl; - o << " DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD" << std::endl; - o << " PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS)," << std::endl; - o << " EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF" << std::endl; - o << " SUCH DAMAGES." << std::endl; - o << std::endl; - o << " 17. Interpretation of Sections 15 and 16." << std::endl; - o << std::endl; - o << " If the disclaimer of warranty and limitation of liability provided" << std::endl; - o << " above cannot be given local legal effect according to their terms," << std::endl; - o << " reviewing courts shall apply local law that most closely approximates" << std::endl; - o << " an absolute waiver of all civil liability in connection with the" << std::endl; - o << " Program, unless a warranty or assumption of liability accompanies a" << std::endl; - o << " copy of the Program in return for a fee." << std::endl; - o << std::endl; - o << " END OF TERMS AND CONDITIONS" << std::endl; - o << std::endl; - o << " How to Apply These Terms to Your New Programs" << std::endl; - o << std::endl; - o << " If you develop a new program, and you want it to be of the greatest" << std::endl; - o << " possible use to the public, the best way to achieve this is to make it" << std::endl; - o << " free software which everyone can redistribute and change under these terms." << std::endl; - o << std::endl; - o << " To do so, attach the following notices to the program. It is safest" << std::endl; - o << " to attach them to the start of each source file to most effectively" << std::endl; - o << " state the exclusion of warranty; and each file should have at least" << std::endl; - o << " the \"copyright\" line and a pointer to where the full notice is found." << std::endl; - o << std::endl; - o << " " << std::endl; - o << " Copyright (C) " << std::endl; - o << std::endl; - o << " This program is free software: you can redistribute it and/or modify" << std::endl; - o << " it under the terms of the GNU General Public License as published by" << std::endl; - o << " the Free Software Foundation, either version 3 of the License, or" << std::endl; - o << " (at your option) any later version." << std::endl; - o << std::endl; - o << " This program is distributed in the hope that it will be useful," << std::endl; - o << " but WITHOUT ANY WARRANTY; without even the implied warranty of" << std::endl; - o << " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" << std::endl; - o << " GNU General Public License for more details." << std::endl; - o << std::endl; - o << " You should have received a copy of the GNU General Public License" << std::endl; - o << " along with this program. If not, see ." << std::endl; - o << std::endl; - o << " Also add information on how to contact you by electronic and paper mail." << std::endl; - o << std::endl; - o << " If the program does terminal interaction, make it output a short" << std::endl; - o << " notice like this when it starts in an interactive mode:" << std::endl; - o << std::endl; - o << " Copyright (C) " << std::endl; - o << " This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'." << std::endl; - o << " This is free software, and you are welcome to redistribute it" << std::endl; - o << " under certain conditions; type `show c' for details." << std::endl; - o << std::endl; - o << " The hypothetical commands `show w' and `show c' should show the appropriate" << std::endl; - o << " parts of the General Public License. Of course, your program's commands" << std::endl; - o << " might be different; for a GUI interface, you would use an \"about box\"." << std::endl; - o << std::endl; - o << " You should also get your employer (if you work as a programmer) or school," << std::endl; - o << " if any, to sign a \"copyright disclaimer\" for the program, if necessary." << std::endl; - o << " For more information on this, and how to apply and follow the GNU GPL, see" << std::endl; - o << " ." << std::endl; - o << std::endl; - o << " The GNU General Public License does not permit incorporating your program" << std::endl; - o << " into proprietary programs. If your program is a subroutine library, you" << std::endl; - o << " may consider it more useful to permit linking proprietary applications with" << std::endl; - o << " the library. If this is what you want to do, use the GNU Lesser General" << std::endl; - o << " Public License instead of this License. But first, please read" << std::endl; - o << " ." << std::endl; + o << '\n'; + o << " GPLv3\n"; + if (full) { + o << '\n'; + o << " GNU GENERAL PUBLIC LICENSE" << '\n'; + o << " Version 3, 29 June 2007" << '\n'; + o << '\n'; + o << " Copyright (C) 2007 Free Software Foundation, Inc. " << '\n'; + o << " Everyone is permitted to copy and distribute verbatim copies" << '\n'; + o << " of this license document, but changing it is not allowed." << '\n'; + o << '\n'; + o << " Preamble" << '\n'; + o << '\n'; + o << " The GNU General Public License is a free, copyleft license for" << '\n'; + o << " software and other kinds of works." << '\n'; + o << '\n'; + o << " The licenses for most software and other practical works are designed" << '\n'; + o << " to take away your freedom to share and change the works. By contrast," << '\n'; + o << " the GNU General Public License is intended to guarantee your freedom to" << '\n'; + o << " share and change all versions of a program--to make sure it remains free" << '\n'; + o << " software for all its users. We, the Free Software Foundation, use the" << '\n'; + o << " GNU General Public License for most of our software; it applies also to" << '\n'; + o << " any other work released this way by its authors. You can apply it to" << '\n'; + o << " your programs, too." << '\n'; + o << '\n'; + o << " When we speak of free software, we are referring to freedom, not" << '\n'; + o << " price. Our General Public Licenses are designed to make sure that you" << '\n'; + o << " have the freedom to distribute copies of free software (and charge for" << '\n'; + o << " them if you wish), that you receive source code or can get it if you" << '\n'; + o << " want it, that you can change the software or use pieces of it in new" << '\n'; + o << " free programs, and that you know you can do these things." << '\n'; + o << '\n'; + o << " To protect your rights, we need to prevent others from denying you" << '\n'; + o << " these rights or asking you to surrender the rights. Therefore, you have" << '\n'; + o << " certain responsibilities if you distribute copies of the software, or if" << '\n'; + o << " you modify it: responsibilities to respect the freedom of others." << '\n'; + o << '\n'; + o << " For example, if you distribute copies of such a program, whether" << '\n'; + o << " gratis or for a fee, you must pass on to the recipients the same" << '\n'; + o << " freedoms that you received. You must make sure that they, too, receive" << '\n'; + o << " or can get the source code. And you must show them these terms so they" << '\n'; + o << " know their rights." << '\n'; + o << '\n'; + o << " Developers that use the GNU GPL protect your rights with two steps:" << '\n'; + o << " (1) assert copyright on the software, and (2) offer you this License" << '\n'; + o << " giving you legal permission to copy, distribute and/or modify it." << '\n'; + o << '\n'; + o << " For the developers' and authors' protection, the GPL clearly explains" << '\n'; + o << " that there is no warranty for this free software. For both users' and" << '\n'; + o << " authors' sake, the GPL requires that modified versions be marked as" << '\n'; + o << " changed, so that their problems will not be attributed erroneously to" << '\n'; + o << " authors of previous versions." << '\n'; + o << '\n'; + o << " Some devices are designed to deny users access to install or run" << '\n'; + o << " modified versions of the software inside them, although the manufacturer" << '\n'; + o << " can do so. This is fundamentally incompatible with the aim of" << '\n'; + o << " protecting users' freedom to change the software. The systematic" << '\n'; + o << " pattern of such abuse occurs in the area of products for individuals to" << '\n'; + o << " use, which is precisely where it is most unacceptable. Therefore, we" << '\n'; + o << " have designed this version of the GPL to prohibit the practice for those" << '\n'; + o << " products. If such problems arise substantially in other domains, we" << '\n'; + o << " stand ready to extend this provision to those domains in future versions" << '\n'; + o << " of the GPL, as needed to protect the freedom of users." << '\n'; + o << '\n'; + o << " Finally, every program is threatened constantly by software patents." << '\n'; + o << " States should not allow patents to restrict development and use of" << '\n'; + o << " software on general-purpose computers, but in those that do, we wish to" << '\n'; + o << " avoid the special danger that patents applied to a free program could" << '\n'; + o << " make it effectively proprietary. To prevent this, the GPL assures that" << '\n'; + o << " patents cannot be used to render the program non-free." << '\n'; + o << '\n'; + o << " The precise terms and conditions for copying, distribution and" << '\n'; + o << " modification follow." << '\n'; + o << '\n'; + o << " TERMS AND CONDITIONS" << '\n'; + o << '\n'; + o << " 0. Definitions." << '\n'; + o << '\n'; + o << " \"This License\" refers to version 3 of the GNU General Public License." << '\n'; + o << '\n'; + o << " \"Copyright\" also means copyright-like laws that apply to other kinds of" << '\n'; + o << " works, such as semiconductor masks." << '\n'; + o << '\n'; + o << " \"The Program\" refers to any copyrightable work licensed under this" << '\n'; + o << " License. Each licensee is addressed as \"you\". \"Licensees\" and" << '\n'; + o << " \"recipients\" may be individuals or organizations." << '\n'; + o << '\n'; + o << " To \"modify\" a work means to copy from or adapt all or part of the work" << '\n'; + o << " in a fashion requiring copyright permission, other than the making of an" << '\n'; + o << " exact copy. The resulting work is called a \"modified version\" of the" << '\n'; + o << " earlier work or a work \"based on\" the earlier work." << '\n'; + o << '\n'; + o << " A \"covered work\" means either the unmodified Program or a work based" << '\n'; + o << " on the Program." << '\n'; + o << '\n'; + o << " To \"propagate\" a work means to do anything with it that, without" << '\n'; + o << " permission, would make you directly or secondarily liable for" << '\n'; + o << " infringement under applicable copyright law, except executing it on a" << '\n'; + o << " computer or modifying a private copy. Propagation includes copying," << '\n'; + o << " distribution (with or without modification), making available to the" << '\n'; + o << " public, and in some countries other activities as well." << '\n'; + o << '\n'; + o << " To \"convey\" a work means any kind of propagation that enables other" << '\n'; + o << " parties to make or receive copies. Mere interaction with a user through" << '\n'; + o << " a computer network, with no transfer of a copy, is not conveying." << '\n'; + o << '\n'; + o << " An interactive user interface displays \"Appropriate Legal Notices\"" << '\n'; + o << " to the extent that it includes a convenient and prominently visible" << '\n'; + o << " feature that (1) displays an appropriate copyright notice, and (2)" << '\n'; + o << " tells the user that there is no warranty for the work (except to the" << '\n'; + o << " extent that warranties are provided), that licensees may convey the" << '\n'; + o << " work under this License, and how to view a copy of this License. If" << '\n'; + o << " the interface presents a list of user commands or options, such as a" << '\n'; + o << " menu, a prominent item in the list meets this criterion." << '\n'; + o << '\n'; + o << " 1. Source Code." << '\n'; + o << '\n'; + o << " The \"source code\" for a work means the preferred form of the work" << '\n'; + o << " for making modifications to it. \"Object code\" means any non-source" << '\n'; + o << " form of a work." << '\n'; + o << '\n'; + o << " A \"Standard Interface\" means an interface that either is an official" << '\n'; + o << " standard defined by a recognized standards body, or, in the case of" << '\n'; + o << " interfaces specified for a particular programming language, one that" << '\n'; + o << " is widely used among developers working in that language." << '\n'; + o << '\n'; + o << " The \"System Libraries\" of an executable work include anything, other" << '\n'; + o << " than the work as a whole, that (a) is included in the normal form of" << '\n'; + o << " packaging a Major Component, but which is not part of that Major" << '\n'; + o << " Component, and (b) serves only to enable use of the work with that" << '\n'; + o << " Major Component, or to implement a Standard Interface for which an" << '\n'; + o << " implementation is available to the public in source code form. A" << '\n'; + o << " \"Major Component\", in this context, means a major essential component" << '\n'; + o << " (kernel, window system, and so on) of the specific operating system" << '\n'; + o << " (if any) on which the executable work runs, or a compiler used to" << '\n'; + o << " produce the work, or an object code interpreter used to run it." << '\n'; + o << '\n'; + o << " The \"Corresponding Source\" for a work in object code form means all" << '\n'; + o << " the source code needed to generate, install, and (for an executable" << '\n'; + o << " work) run the object code and to modify the work, including scripts to" << '\n'; + o << " control those activities. However, it does not include the work's" << '\n'; + o << " System Libraries, or general-purpose tools or generally available free" << '\n'; + o << " programs which are used unmodified in performing those activities but" << '\n'; + o << " which are not part of the work. For example, Corresponding Source" << '\n'; + o << " includes interface definition files associated with source files for" << '\n'; + o << " the work, and the source code for shared libraries and dynamically" << '\n'; + o << " linked subprograms that the work is specifically designed to require," << '\n'; + o << " such as by intimate data communication or control flow between those" << '\n'; + o << " subprograms and other parts of the work." << '\n'; + o << '\n'; + o << " The Corresponding Source need not include anything that users" << '\n'; + o << " can regenerate automatically from other parts of the Corresponding" << '\n'; + o << " Source." << '\n'; + o << '\n'; + o << " The Corresponding Source for a work in source code form is that" << '\n'; + o << " same work." << '\n'; + o << '\n'; + o << " 2. Basic Permissions." << '\n'; + o << '\n'; + o << " All rights granted under this License are granted for the term of" << '\n'; + o << " copyright on the Program, and are irrevocable provided the stated" << '\n'; + o << " conditions are met. This License explicitly affirms your unlimited" << '\n'; + o << " permission to run the unmodified Program. The output from running a" << '\n'; + o << " covered work is covered by this License only if the output, given its" << '\n'; + o << " content, constitutes a covered work. This License acknowledges your" << '\n'; + o << " rights of fair use or other equivalent, as provided by copyright law." << '\n'; + o << '\n'; + o << " You may make, run and propagate covered works that you do not" << '\n'; + o << " convey, without conditions so long as your license otherwise remains" << '\n'; + o << " in force. You may convey covered works to others for the sole purpose" << '\n'; + o << " of having them make modifications exclusively for you, or provide you" << '\n'; + o << " with facilities for running those works, provided that you comply with" << '\n'; + o << " the terms of this License in conveying all material for which you do" << '\n'; + o << " not control copyright. Those thus making or running the covered works" << '\n'; + o << " for you must do so exclusively on your behalf, under your direction" << '\n'; + o << " and control, on terms that prohibit them from making any copies of" << '\n'; + o << " your copyrighted material outside their relationship with you." << '\n'; + o << '\n'; + o << " Conveying under any other circumstances is permitted solely under" << '\n'; + o << " the conditions stated below. Sublicensing is not allowed; section 10" << '\n'; + o << " makes it unnecessary." << '\n'; + o << '\n'; + o << " 3. Protecting Users' Legal Rights From Anti-Circumvention Law." << '\n'; + o << '\n'; + o << " No covered work shall be deemed part of an effective technological" << '\n'; + o << " measure under any applicable law fulfilling obligations under article" << '\n'; + o << " 11 of the WIPO copyright treaty adopted on 20 December 1996, or" << '\n'; + o << " similar laws prohibiting or restricting circumvention of such" << '\n'; + o << " measures." << '\n'; + o << '\n'; + o << " When you convey a covered work, you waive any legal power to forbid" << '\n'; + o << " circumvention of technological measures to the extent such circumvention" << '\n'; + o << " is effected by exercising rights under this License with respect to" << '\n'; + o << " the covered work, and you disclaim any intention to limit operation or" << '\n'; + o << " modification of the work as a means of enforcing, against the work's" << '\n'; + o << " users, your or third parties' legal rights to forbid circumvention of" << '\n'; + o << " technological measures." << '\n'; + o << '\n'; + o << " 4. Conveying Verbatim Copies." << '\n'; + o << '\n'; + o << " You may convey verbatim copies of the Program's source code as you" << '\n'; + o << " receive it, in any medium, provided that you conspicuously and" << '\n'; + o << " appropriately publish on each copy an appropriate copyright notice;" << '\n'; + o << " keep intact all notices stating that this License and any" << '\n'; + o << " non-permissive terms added in accord with section 7 apply to the code;" << '\n'; + o << " keep intact all notices of the absence of any warranty; and give all" << '\n'; + o << " recipients a copy of this License along with the Program." << '\n'; + o << '\n'; + o << " You may charge any price or no price for each copy that you convey," << '\n'; + o << " and you may offer support or warranty protection for a fee." << '\n'; + o << '\n'; + o << " 5. Conveying Modified Source Versions." << '\n'; + o << '\n'; + o << " You may convey a work based on the Program, or the modifications to" << '\n'; + o << " produce it from the Program, in the form of source code under the" << '\n'; + o << " terms of section 4, provided that you also meet all of these conditions:" << '\n'; + o << '\n'; + o << " a) The work must carry prominent notices stating that you modified" << '\n'; + o << " it, and giving a relevant date." << '\n'; + o << '\n'; + o << " b) The work must carry prominent notices stating that it is" << '\n'; + o << " released under this License and any conditions added under section" << '\n'; + o << " 7. This requirement modifies the requirement in section 4 to" << '\n'; + o << " \"keep intact all notices\"." << '\n'; + o << '\n'; + o << " c) You must license the entire work, as a whole, under this" << '\n'; + o << " License to anyone who comes into possession of a copy. This" << '\n'; + o << " License will therefore apply, along with any applicable section 7" << '\n'; + o << " additional terms, to the whole of the work, and all its parts," << '\n'; + o << " regardless of how they are packaged. This License gives no" << '\n'; + o << " permission to license the work in any other way, but it does not" << '\n'; + o << " invalidate such permission if you have separately received it." << '\n'; + o << '\n'; + o << " d) If the work has interactive user interfaces, each must display" << '\n'; + o << " Appropriate Legal Notices; however, if the Program has interactive" << '\n'; + o << " interfaces that do not display Appropriate Legal Notices, your" << '\n'; + o << " work need not make them do so." << '\n'; + o << '\n'; + o << " A compilation of a covered work with other separate and independent" << '\n'; + o << " works, which are not by their nature extensions of the covered work," << '\n'; + o << " and which are not combined with it such as to form a larger program," << '\n'; + o << " in or on a volume of a storage or distribution medium, is called an" << '\n'; + o << " \"aggregate\" if the compilation and its resulting copyright are not" << '\n'; + o << " used to limit the access or legal rights of the compilation's users" << '\n'; + o << " beyond what the individual works permit. Inclusion of a covered work" << '\n'; + o << " in an aggregate does not cause this License to apply to the other" << '\n'; + o << " parts of the aggregate." << '\n'; + o << '\n'; + o << " 6. Conveying Non-Source Forms." << '\n'; + o << '\n'; + o << " You may convey a covered work in object code form under the terms" << '\n'; + o << " of sections 4 and 5, provided that you also convey the" << '\n'; + o << " machine-readable Corresponding Source under the terms of this License," << '\n'; + o << " in one of these ways:" << '\n'; + o << '\n'; + o << " a) Convey the object code in, or embodied in, a physical product" << '\n'; + o << " (including a physical distribution medium), accompanied by the" << '\n'; + o << " Corresponding Source fixed on a durable physical medium" << '\n'; + o << " customarily used for software interchange." << '\n'; + o << '\n'; + o << " b) Convey the object code in, or embodied in, a physical product" << '\n'; + o << " (including a physical distribution medium), accompanied by a" << '\n'; + o << " written offer, valid for at least three years and valid for as" << '\n'; + o << " long as you offer spare parts or customer support for that product" << '\n'; + o << " model, to give anyone who possesses the object code either (1) a" << '\n'; + o << " copy of the Corresponding Source for all the software in the" << '\n'; + o << " product that is covered by this License, on a durable physical" << '\n'; + o << " medium customarily used for software interchange, for a price no" << '\n'; + o << " more than your reasonable cost of physically performing this" << '\n'; + o << " conveying of source, or (2) access to copy the" << '\n'; + o << " Corresponding Source from a network server at no charge." << '\n'; + o << '\n'; + o << " c) Convey individual copies of the object code with a copy of the" << '\n'; + o << " written offer to provide the Corresponding Source. This" << '\n'; + o << " alternative is allowed only occasionally and noncommercially, and" << '\n'; + o << " only if you received the object code with such an offer, in accord" << '\n'; + o << " with subsection 6b." << '\n'; + o << '\n'; + o << " d) Convey the object code by offering access from a designated" << '\n'; + o << " place (gratis or for a charge), and offer equivalent access to the" << '\n'; + o << " Corresponding Source in the same way through the same place at no" << '\n'; + o << " further charge. You need not require recipients to copy the" << '\n'; + o << " Corresponding Source along with the object code. If the place to" << '\n'; + o << " copy the object code is a network server, the Corresponding Source" << '\n'; + o << " may be on a different server (operated by you or a third party)" << '\n'; + o << " that supports equivalent copying facilities, provided you maintain" << '\n'; + o << " clear directions next to the object code saying where to find the" << '\n'; + o << " Corresponding Source. Regardless of what server hosts the" << '\n'; + o << " Corresponding Source, you remain obligated to ensure that it is" << '\n'; + o << " available for as long as needed to satisfy these requirements." << '\n'; + o << '\n'; + o << " e) Convey the object code using peer-to-peer transmission, provided" << '\n'; + o << " you inform other peers where the object code and Corresponding" << '\n'; + o << " Source of the work are being offered to the general public at no" << '\n'; + o << " charge under subsection 6d." << '\n'; + o << '\n'; + o << " A separable portion of the object code, whose source code is excluded" << '\n'; + o << " from the Corresponding Source as a System Library, need not be" << '\n'; + o << " included in conveying the object code work." << '\n'; + o << '\n'; + o << " A \"User Product\" is either (1) a \"consumer product\", which means any" << '\n'; + o << " tangible personal property which is normally used for personal, family," << '\n'; + o << " or household purposes, or (2) anything designed or sold for incorporation" << '\n'; + o << " into a dwelling. In determining whether a product is a consumer product," << '\n'; + o << " doubtful cases shall be resolved in favor of coverage. For a particular" << '\n'; + o << " product received by a particular user, \"normally used\" refers to a" << '\n'; + o << " typical or common use of that class of product, regardless of the status" << '\n'; + o << " of the particular user or of the way in which the particular user" << '\n'; + o << " actually uses, or expects or is expected to use, the product. A product" << '\n'; + o << " is a consumer product regardless of whether the product has substantial" << '\n'; + o << " commercial, industrial or non-consumer uses, unless such uses represent" << '\n'; + o << " the only significant mode of use of the product." << '\n'; + o << '\n'; + o << " \"Installation Information\" for a User Product means any methods," << '\n'; + o << " procedures, authorization keys, or other information required to install" << '\n'; + o << " and execute modified versions of a covered work in that User Product from" << '\n'; + o << " a modified version of its Corresponding Source. The information must" << '\n'; + o << " suffice to ensure that the continued functioning of the modified object" << '\n'; + o << " code is in no case prevented or interfered with solely because" << '\n'; + o << " modification has been made." << '\n'; + o << '\n'; + o << " If you convey an object code work under this section in, or with, or" << '\n'; + o << " specifically for use in, a User Product, and the conveying occurs as" << '\n'; + o << " part of a transaction in which the right of possession and use of the" << '\n'; + o << " User Product is transferred to the recipient in perpetuity or for a" << '\n'; + o << " fixed term (regardless of how the transaction is characterized), the" << '\n'; + o << " Corresponding Source conveyed under this section must be accompanied" << '\n'; + o << " by the Installation Information. But this requirement does not apply" << '\n'; + o << " if neither you nor any third party retains the ability to install" << '\n'; + o << " modified object code on the User Product (for example, the work has" << '\n'; + o << " been installed in ROM)." << '\n'; + o << '\n'; + o << " The requirement to provide Installation Information does not include a" << '\n'; + o << " requirement to continue to provide support service, warranty, or updates" << '\n'; + o << " for a work that has been modified or installed by the recipient, or for" << '\n'; + o << " the User Product in which it has been modified or installed. Access to a" << '\n'; + o << " network may be denied when the modification itself materially and" << '\n'; + o << " adversely affects the operation of the network or violates the rules and" << '\n'; + o << " protocols for communication across the network." << '\n'; + o << '\n'; + o << " Corresponding Source conveyed, and Installation Information provided," << '\n'; + o << " in accord with this section must be in a format that is publicly" << '\n'; + o << " documented (and with an implementation available to the public in" << '\n'; + o << " source code form), and must require no special password or key for" << '\n'; + o << " unpacking, reading or copying." << '\n'; + o << '\n'; + o << " 7. Additional Terms." << '\n'; + o << '\n'; + o << " \"Additional permissions\" are terms that supplement the terms of this" << '\n'; + o << " License by making exceptions from one or more of its conditions." << '\n'; + o << " Additional permissions that are applicable to the entire Program shall" << '\n'; + o << " be treated as though they were included in this License, to the extent" << '\n'; + o << " that they are valid under applicable law. If additional permissions" << '\n'; + o << " apply only to part of the Program, that part may be used separately" << '\n'; + o << " under those permissions, but the entire Program remains governed by" << '\n'; + o << " this License without regard to the additional permissions." << '\n'; + o << '\n'; + o << " When you convey a copy of a covered work, you may at your option" << '\n'; + o << " remove any additional permissions from that copy, or from any part of" << '\n'; + o << " it. (Additional permissions may be written to require their own" << '\n'; + o << " removal in certain cases when you modify the work.) You may place" << '\n'; + o << " additional permissions on material, added by you to a covered work," << '\n'; + o << " for which you have or can give appropriate copyright permission." << '\n'; + o << '\n'; + o << " Notwithstanding any other provision of this License, for material you" << '\n'; + o << " add to a covered work, you may (if authorized by the copyright holders of" << '\n'; + o << " that material) supplement the terms of this License with terms:" << '\n'; + o << '\n'; + o << " a) Disclaiming warranty or limiting liability differently from the" << '\n'; + o << " terms of sections 15 and 16 of this License; or" << '\n'; + o << '\n'; + o << " b) Requiring preservation of specified reasonable legal notices or" << '\n'; + o << " author attributions in that material or in the Appropriate Legal" << '\n'; + o << " Notices displayed by works containing it; or" << '\n'; + o << '\n'; + o << " c) Prohibiting misrepresentation of the origin of that material, or" << '\n'; + o << " requiring that modified versions of such material be marked in" << '\n'; + o << " reasonable ways as different from the original version; or" << '\n'; + o << '\n'; + o << " d) Limiting the use for publicity purposes of names of licensors or" << '\n'; + o << " authors of the material; or" << '\n'; + o << '\n'; + o << " e) Declining to grant rights under trademark law for use of some" << '\n'; + o << " trade names, trademarks, or service marks; or" << '\n'; + o << '\n'; + o << " f) Requiring indemnification of licensors and authors of that" << '\n'; + o << " material by anyone who conveys the material (or modified versions of" << '\n'; + o << " it) with contractual assumptions of liability to the recipient, for" << '\n'; + o << " any liability that these contractual assumptions directly impose on" << '\n'; + o << " those licensors and authors." << '\n'; + o << '\n'; + o << " All other non-permissive additional terms are considered \"further" << '\n'; + o << " restrictions\" within the meaning of section 10. If the Program as you" << '\n'; + o << " received it, or any part of it, contains a notice stating that it is" << '\n'; + o << " governed by this License along with a term that is a further" << '\n'; + o << " restriction, you may remove that term. If a license document contains" << '\n'; + o << " a further restriction but permits relicensing or conveying under this" << '\n'; + o << " License, you may add to a covered work material governed by the terms" << '\n'; + o << " of that license document, provided that the further restriction does" << '\n'; + o << " not survive such relicensing or conveying." << '\n'; + o << '\n'; + o << " If you add terms to a covered work in accord with this section, you" << '\n'; + o << " must place, in the relevant source files, a statement of the" << '\n'; + o << " additional terms that apply to those files, or a notice indicating" << '\n'; + o << " where to find the applicable terms." << '\n'; + o << '\n'; + o << " Additional terms, permissive or non-permissive, may be stated in the" << '\n'; + o << " form of a separately written license, or stated as exceptions;" << '\n'; + o << " the above requirements apply either way." << '\n'; + o << '\n'; + o << " 8. Termination." << '\n'; + o << '\n'; + o << " You may not propagate or modify a covered work except as expressly" << '\n'; + o << " provided under this License. Any attempt otherwise to propagate or" << '\n'; + o << " modify it is void, and will automatically terminate your rights under" << '\n'; + o << " this License (including any patent licenses granted under the third" << '\n'; + o << " paragraph of section 11)." << '\n'; + o << '\n'; + o << " However, if you cease all violation of this License, then your" << '\n'; + o << " license from a particular copyright holder is reinstated (a)" << '\n'; + o << " provisionally, unless and until the copyright holder explicitly and" << '\n'; + o << " finally terminates your license, and (b) permanently, if the copyright" << '\n'; + o << " holder fails to notify you of the violation by some reasonable means" << '\n'; + o << " prior to 60 days after the cessation." << '\n'; + o << '\n'; + o << " Moreover, your license from a particular copyright holder is" << '\n'; + o << " reinstated permanently if the copyright holder notifies you of the" << '\n'; + o << " violation by some reasonable means, this is the first time you have" << '\n'; + o << " received notice of violation of this License (for any work) from that" << '\n'; + o << " copyright holder, and you cure the violation prior to 30 days after" << '\n'; + o << " your receipt of the notice." << '\n'; + o << '\n'; + o << " Termination of your rights under this section does not terminate the" << '\n'; + o << " licenses of parties who have received copies or rights from you under" << '\n'; + o << " this License. If your rights have been terminated and not permanently" << '\n'; + o << " reinstated, you do not qualify to receive new licenses for the same" << '\n'; + o << " material under section 10." << '\n'; + o << '\n'; + o << " 9. Acceptance Not Required for Having Copies." << '\n'; + o << '\n'; + o << " You are not required to accept this License in order to receive or" << '\n'; + o << " run a copy of the Program. Ancillary propagation of a covered work" << '\n'; + o << " occurring solely as a consequence of using peer-to-peer transmission" << '\n'; + o << " to receive a copy likewise does not require acceptance. However," << '\n'; + o << " nothing other than this License grants you permission to propagate or" << '\n'; + o << " modify any covered work. These actions infringe copyright if you do" << '\n'; + o << " not accept this License. Therefore, by modifying or propagating a" << '\n'; + o << " covered work, you indicate your acceptance of this License to do so." << '\n'; + o << '\n'; + o << " 10. Automatic Licensing of Downstream Recipients." << '\n'; + o << '\n'; + o << " Each time you convey a covered work, the recipient automatically" << '\n'; + o << " receives a license from the original licensors, to run, modify and" << '\n'; + o << " propagate that work, subject to this License. You are not responsible" << '\n'; + o << " for enforcing compliance by third parties with this License." << '\n'; + o << '\n'; + o << " An \"entity transaction\" is a transaction transferring control of an" << '\n'; + o << " organization, or substantially all assets of one, or subdividing an" << '\n'; + o << " organization, or merging organizations. If propagation of a covered" << '\n'; + o << " work results from an entity transaction, each party to that" << '\n'; + o << " transaction who receives a copy of the work also receives whatever" << '\n'; + o << " licenses to the work the party's predecessor in interest had or could" << '\n'; + o << " give under the previous paragraph, plus a right to possession of the" << '\n'; + o << " Corresponding Source of the work from the predecessor in interest, if" << '\n'; + o << " the predecessor has it or can get it with reasonable efforts." << '\n'; + o << '\n'; + o << " You may not impose any further restrictions on the exercise of the" << '\n'; + o << " rights granted or affirmed under this License. For example, you may" << '\n'; + o << " not impose a license fee, royalty, or other charge for exercise of" << '\n'; + o << " rights granted under this License, and you may not initiate litigation" << '\n'; + o << " (including a cross-claim or counterclaim in a lawsuit) alleging that" << '\n'; + o << " any patent claim is infringed by making, using, selling, offering for" << '\n'; + o << " sale, or importing the Program or any portion of it." << '\n'; + o << '\n'; + o << " 11. Patents." << '\n'; + o << '\n'; + o << " A \"contributor\" is a copyright holder who authorizes use under this" << '\n'; + o << " License of the Program or a work on which the Program is based. The" << '\n'; + o << " work thus licensed is called the contributor's \"contributor version\"." << '\n'; + o << '\n'; + o << " A contributor's \"essential patent claims\" are all patent claims" << '\n'; + o << " owned or controlled by the contributor, whether already acquired or" << '\n'; + o << " hereafter acquired, that would be infringed by some manner, permitted" << '\n'; + o << " by this License, of making, using, or selling its contributor version," << '\n'; + o << " but do not include claims that would be infringed only as a" << '\n'; + o << " consequence of further modification of the contributor version. For" << '\n'; + o << " purposes of this definition, \"control\" includes the right to grant" << '\n'; + o << " patent sublicenses in a manner consistent with the requirements of" << '\n'; + o << " this License." << '\n'; + o << '\n'; + o << " Each contributor grants you a non-exclusive, worldwide, royalty-free" << '\n'; + o << " patent license under the contributor's essential patent claims, to" << '\n'; + o << " make, use, sell, offer for sale, import and otherwise run, modify and" << '\n'; + o << " propagate the contents of its contributor version." << '\n'; + o << '\n'; + o << " In the following three paragraphs, a \"patent license\" is any express" << '\n'; + o << " agreement or commitment, however denominated, not to enforce a patent" << '\n'; + o << " (such as an express permission to practice a patent or covenant not to" << '\n'; + o << " sue for patent infringement). To \"grant\" such a patent license to a" << '\n'; + o << " party means to make such an agreement or commitment not to enforce a" << '\n'; + o << " patent against the party." << '\n'; + o << '\n'; + o << " If you convey a covered work, knowingly relying on a patent license," << '\n'; + o << " and the Corresponding Source of the work is not available for anyone" << '\n'; + o << " to copy, free of charge and under the terms of this License, through a" << '\n'; + o << " publicly available network server or other readily accessible means," << '\n'; + o << " then you must either (1) cause the Corresponding Source to be so" << '\n'; + o << " available, or (2) arrange to deprive yourself of the benefit of the" << '\n'; + o << " patent license for this particular work, or (3) arrange, in a manner" << '\n'; + o << " consistent with the requirements of this License, to extend the patent" << '\n'; + o << " license to downstream recipients. \"Knowingly relying\" means you have" << '\n'; + o << " actual knowledge that, but for the patent license, your conveying the" << '\n'; + o << " covered work in a country, or your recipient's use of the covered work" << '\n'; + o << " in a country, would infringe one or more identifiable patents in that" << '\n'; + o << " country that you have reason to believe are valid." << '\n'; + o << '\n'; + o << " If, pursuant to or in connection with a single transaction or" << '\n'; + o << " arrangement, you convey, or propagate by procuring conveyance of, a" << '\n'; + o << " covered work, and grant a patent license to some of the parties" << '\n'; + o << " receiving the covered work authorizing them to use, propagate, modify" << '\n'; + o << " or convey a specific copy of the covered work, then the patent license" << '\n'; + o << " you grant is automatically extended to all recipients of the covered" << '\n'; + o << " work and works based on it." << '\n'; + o << '\n'; + o << " A patent license is \"discriminatory\" if it does not include within" << '\n'; + o << " the scope of its coverage, prohibits the exercise of, or is" << '\n'; + o << " conditioned on the non-exercise of one or more of the rights that are" << '\n'; + o << " specifically granted under this License. You may not convey a covered" << '\n'; + o << " work if you are a party to an arrangement with a third party that is" << '\n'; + o << " in the business of distributing software, under which you make payment" << '\n'; + o << " to the third party based on the extent of your activity of conveying" << '\n'; + o << " the work, and under which the third party grants, to any of the" << '\n'; + o << " parties who would receive the covered work from you, a discriminatory" << '\n'; + o << " patent license (a) in connection with copies of the covered work" << '\n'; + o << " conveyed by you (or copies made from those copies), or (b) primarily" << '\n'; + o << " for and in connection with specific products or compilations that" << '\n'; + o << " contain the covered work, unless you entered into that arrangement," << '\n'; + o << " or that patent license was granted, prior to 28 March 2007." << '\n'; + o << '\n'; + o << " Nothing in this License shall be construed as excluding or limiting" << '\n'; + o << " any implied license or other defenses to infringement that may" << '\n'; + o << " otherwise be available to you under applicable patent law." << '\n'; + o << '\n'; + o << " 12. No Surrender of Others' Freedom." << '\n'; + o << '\n'; + o << " If conditions are imposed on you (whether by court order, agreement or" << '\n'; + o << " otherwise) that contradict the conditions of this License, they do not" << '\n'; + o << " excuse you from the conditions of this License. If you cannot convey a" << '\n'; + o << " covered work so as to satisfy simultaneously your obligations under this" << '\n'; + o << " License and any other pertinent obligations, then as a consequence you may" << '\n'; + o << " not convey it at all. For example, if you agree to terms that obligate you" << '\n'; + o << " to collect a royalty for further conveying from those to whom you convey" << '\n'; + o << " the Program, the only way you could satisfy both those terms and this" << '\n'; + o << " License would be to refrain entirely from conveying the Program." << '\n'; + o << '\n'; + o << " 13. Use with the GNU Affero General Public License." << '\n'; + o << '\n'; + o << " Notwithstanding any other provision of this License, you have" << '\n'; + o << " permission to link or combine any covered work with a work licensed" << '\n'; + o << " under version 3 of the GNU Affero General Public License into a single" << '\n'; + o << " combined work, and to convey the resulting work. The terms of this" << '\n'; + o << " License will continue to apply to the part which is the covered work," << '\n'; + o << " but the special requirements of the GNU Affero General Public License," << '\n'; + o << " section 13, concerning interaction through a network will apply to the" << '\n'; + o << " combination as such." << '\n'; + o << '\n'; + o << " 14. Revised Versions of this License." << '\n'; + o << '\n'; + o << " The Free Software Foundation may publish revised and/or new versions of" << '\n'; + o << " the GNU General Public License from time to time. Such new versions will" << '\n'; + o << " be similar in spirit to the present version, but may differ in detail to" << '\n'; + o << " address new problems or concerns." << '\n'; + o << '\n'; + o << " Each version is given a distinguishing version number. If the" << '\n'; + o << " Program specifies that a certain numbered version of the GNU General" << '\n'; + o << " Public License \"or any later version\" applies to it, you have the" << '\n'; + o << " option of following the terms and conditions either of that numbered" << '\n'; + o << " version or of any later version published by the Free Software" << '\n'; + o << " Foundation. If the Program does not specify a version number of the" << '\n'; + o << " GNU General Public License, you may choose any version ever published" << '\n'; + o << " by the Free Software Foundation." << '\n'; + o << '\n'; + o << " If the Program specifies that a proxy can decide which future" << '\n'; + o << " versions of the GNU General Public License can be used, that proxy's" << '\n'; + o << " public statement of acceptance of a version permanently authorizes you" << '\n'; + o << " to choose that version for the Program." << '\n'; + o << '\n'; + o << " Later license versions may give you additional or different" << '\n'; + o << " permissions. However, no additional obligations are imposed on any" << '\n'; + o << " author or copyright holder as a result of your choosing to follow a" << '\n'; + o << " later version." << '\n'; + o << '\n'; + o << " 15. Disclaimer of Warranty." << '\n'; + o << '\n'; + o << " THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY" << '\n'; + o << " APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT" << '\n'; + o << " HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY" << '\n'; + o << " OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO," << '\n'; + o << " THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR" << '\n'; + o << " PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM" << '\n'; + o << " IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF" << '\n'; + o << " ALL NECESSARY SERVICING, REPAIR OR CORRECTION." << '\n'; + o << '\n'; + o << " 16. Limitation of Liability." << '\n'; + o << '\n'; + o << " IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING" << '\n'; + o << " WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS" << '\n'; + o << " THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY" << '\n'; + o << " GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE" << '\n'; + o << " USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF" << '\n'; + o << " DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD" << '\n'; + o << " PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS)," << '\n'; + o << " EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF" << '\n'; + o << " SUCH DAMAGES." << '\n'; + o << '\n'; + o << " 17. Interpretation of Sections 15 and 16." << '\n'; + o << '\n'; + o << " If the disclaimer of warranty and limitation of liability provided" << '\n'; + o << " above cannot be given local legal effect according to their terms," << '\n'; + o << " reviewing courts shall apply local law that most closely approximates" << '\n'; + o << " an absolute waiver of all civil liability in connection with the" << '\n'; + o << " Program, unless a warranty or assumption of liability accompanies a" << '\n'; + o << " copy of the Program in return for a fee." << '\n'; + o << '\n'; + o << " END OF TERMS AND CONDITIONS" << '\n'; + o << '\n'; + o << " How to Apply These Terms to Your New Programs" << '\n'; + o << '\n'; + o << " If you develop a new program, and you want it to be of the greatest" << '\n'; + o << " possible use to the public, the best way to achieve this is to make it" << '\n'; + o << " free software which everyone can redistribute and change under these terms." << '\n'; + o << '\n'; + o << " To do so, attach the following notices to the program. It is safest" << '\n'; + o << " to attach them to the start of each source file to most effectively" << '\n'; + o << " state the exclusion of warranty; and each file should have at least" << '\n'; + o << " the \"copyright\" line and a pointer to where the full notice is found." << '\n'; + o << '\n'; + o << " " << '\n'; + o << " Copyright (C) " << '\n'; + o << '\n'; + o << " This program is free software: you can redistribute it and/or modify" << '\n'; + o << " it under the terms of the GNU General Public License as published by" << '\n'; + o << " the Free Software Foundation, either version 3 of the License, or" << '\n'; + o << " (at your option) any later version." << '\n'; + o << '\n'; + o << " This program is distributed in the hope that it will be useful," << '\n'; + o << " but WITHOUT ANY WARRANTY; without even the implied warranty of" << '\n'; + o << " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" << '\n'; + o << " GNU General Public License for more details." << '\n'; + o << '\n'; + o << " You should have received a copy of the GNU General Public License" << '\n'; + o << " along with this program. If not, see ." << '\n'; + o << '\n'; + o << " Also add information on how to contact you by electronic and paper mail." << '\n'; + o << '\n'; + o << " If the program does terminal interaction, make it output a short" << '\n'; + o << " notice like this when it starts in an interactive mode:" << '\n'; + o << '\n'; + o << " Copyright (C) " << '\n'; + o << " This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'." << '\n'; + o << " This is free software, and you are welcome to redistribute it" << '\n'; + o << " under certain conditions; type `show c' for details." << '\n'; + o << '\n'; + o << " The hypothetical commands `show w' and `show c' should show the appropriate" << '\n'; + o << " parts of the General Public License. Of course, your program's commands" << '\n'; + o << " might be different; for a GUI interface, you would use an \"about box\"." << '\n'; + o << '\n'; + o << " You should also get your employer (if you work as a programmer) or school," << '\n'; + o << " if any, to sign a \"copyright disclaimer\" for the program, if necessary." << '\n'; + o << " For more information on this, and how to apply and follow the GNU GPL, see" << '\n'; + o << " ." << '\n'; + o << '\n'; + o << " The GNU General Public License does not permit incorporating your program" << '\n'; + o << " into proprietary programs. If your program is a subroutine library, you" << '\n'; + o << " may consider it more useful to permit linking proprietary applications with" << '\n'; + o << " the library. If this is what you want to do, use the GNU Lesser General" << '\n'; + o << " Public License instead of this License. But first, please read" << '\n'; + o << " ." << '\n'; + } } diff --git a/src/license.hpp b/src/license.hpp index ab3da6b..c3e1b87 100644 --- a/src/license.hpp +++ b/src/license.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once @@ -11,4 +11,4 @@ * \brief print licences * @param o output stream used to print licenses */ -void print_licenses(std::ostream &o); +void print_licenses(std::ostream &o, bool full); diff --git a/src/main.cpp b/src/main.cpp index d29b1c2..71df39c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2021-2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #include "InputParser.hpp" @@ -9,6 +9,7 @@ #include "cxxsemaphore.hpp" #include "cxxshm.hpp" +#include "generated/version_info.hpp" #include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -59,11 +61,11 @@ constexpr std::array TERM_SIGNALS = {SIGINT, * @return exit code */ int main(int argc, char **argv) { - const std::string exe_name = std::filesystem::path(argv[0]).filename().string(); + const std::string exe_name = std::filesystem::path(*argv).filename().string(); cxxopts::Options options(exe_name, "Read instructions from stdin and write them to a modbus shared memory"); auto exit_usage = [&exe_name]() { - std::cerr << "Use '" << exe_name << " --help' for more information." << std::endl; + std::cerr << "Use '" << exe_name << " --help' for more information.\n"; exit(EX_USAGE); }; @@ -81,193 +83,219 @@ int main(int argc, char **argv) { } // all command line arguments - options.add_options()("n,name-prefix", - "name prefix of the shared memory objects", - cxxopts::value()->default_value("modbus_")); - options.add_options()("address-base", - "Numerical base (radix) that is used for the addresses (see " - "https://en.cppreference.com/w/cpp/string/basic_string/stoul)", - cxxopts::value()->default_value("0")); - options.add_options()("value-base", - "Numerical base (radix) that is used for the values (see " - "https://en.cppreference.com/w/cpp/string/basic_string/stoul)", - cxxopts::value()->default_value("0")); - options.add_options()("p,passthrough", "write passthrough all executed commands to stdout"); - options.add_options()("bash", "passthrough as bash script. No effect i '--passthrough' is not set"); - options.add_options()("valid-hist", "add only valid commands to command history"); - options.add_options()("h,help", "print usage"); - options.add_options()("v,verbose", "print what is written to the registers"); - options.add_options()("version", "print version information"); - options.add_options()("license", "show licenses"); - options.add_options()("data-types", "show list of supported data type identifiers"); - options.add_options()("constants", "list string constants that can be used as value"); - options.add_options()("semaphore", - "protect the shared memory with an existing named semaphore against simultaneous access", - cxxopts::value()); - options.add_options()("semaphore-timeout", - "maximum time (in seconds) to wait for semaphore (default: 0.1)", - cxxopts::value()->default_value("0.1")); + options.add_options("shared memory")("n,name-prefix", + "name prefix of the shared memory objects", + cxxopts::value()->default_value("modbus_")); + options.add_options("settings")("address-base", + "Numerical base (radix) that is used for the addresses (see " + "https://en.cppreference.com/w/cpp/string/basic_string/stoul)", + cxxopts::value()->default_value("0")); + options.add_options("settings")("value-base", + "Numerical base (radix) that is used for the values (see " + "https://en.cppreference.com/w/cpp/string/basic_string/stoul)", + cxxopts::value()->default_value("0")); + options.add_options("settings")("p,passthrough", "write passthrough all executed commands to stdout"); + options.add_options("settings")("bash", "passthrough as bash script. No effect i '--passthrough' is not set"); + options.add_options("settings")("valid-hist", "add only valid commands to command history"); + options.add_options("other")("h,help", "print usage"); + options.add_options("other")("v,verbose", "print what is written to the registers"); + options.add_options("version information")("version", "print version and exit"); + options.add_options("version information")("longversion", + "print version (including compiler and system info) and exit"); + options.add_options("version information")("shortversion", "print version (only version string) and exit"); + options.add_options("version information")("git-hash", "print git hash"); + options.add_options("other")("license", "show licenses"); + options.add_options("other")("license-full", "show licences (full license text)"); + options.add_options("other")("data-types", "show list of supported data type identifiers"); + options.add_options("other")("constants", "list string constants that can be used as value"); + options.add_options("shared memory")( + "semaphore", + "protect the shared memory with an existing named semaphore against simultaneous access", + cxxopts::value()); + options.add_options("shared memory")("semaphore-timeout", + "maximum time (in seconds) to wait for semaphore (default: 0.1)", + cxxopts::value()->default_value("0.1")); // parse arguments cxxopts::ParseResult args; try { args = options.parse(argc, argv); - } catch (cxxopts::OptionParseException &e) { - std::cerr << "Failed to parse arguments: " << e.what() << '.' << std::endl; + } catch (cxxopts::exceptions::parsing::exception &e) { + std::cerr << "Failed to parse arguments: " << e.what() << '.' << '\n'; exit_usage(); } auto print_format = [](bool help = false) { - std::cout << "Data input format: reg_type:address:value[:data_type]" << std::endl; - std::cout << " reg_type : modbus register type: [do|di|ao|ai]" << std::endl; - std::cout << " address : address of the target register: [0-" << MAX_MODBUS_REGS - 1 << "]" << std::endl; + std::cout << "Data input format: reg_type:address:value[:data_type]" << '\n'; + std::cout << " reg_type : modbus register type: [do|di|ao|ai]" << '\n'; + std::cout << " address : address of the target register: [0-" << MAX_MODBUS_REGS - 1 << "]" << '\n'; std::cout << " The actual maximum register depends on the size of the modbus shared memory." - << std::endl; - std::cout << " value : value that is written to the target register" << std::endl; + << '\n'; + std::cout << " value : value that is written to the target register" << '\n'; std::cout << " Some string constants are available. The input format depends on the type of " "register and data type." - << std::endl; + << '\n'; if (help) std::cout << " Use --constants for more details."; else std::cout << " Type 'help constants' for more details "; - std::cout << std::endl; + std::cout << '\n'; std::cout << " For the registers do and di all numerical values different from 0 are interpreted " "as 1." - << std::endl; - std::cout << " data_type: an optional data type specifier" << std::endl; + << '\n'; + std::cout << " data_type: an optional data type specifier" << '\n'; std::cout << " If no data type is specified, exactly one register is written in host byte order." - << std::endl; + << '\n'; if (help) - std::cout << " Use --data-types to get a list of supported data type identifiers." - << std::endl; + std::cout << " Use --data-types to get a list of supported data type identifiers." << '\n'; else - std::cout << " Type 'help types' to get a list of supported data type identifiers." - << std::endl; + std::cout << " Type 'help types' to get a list of supported data type identifiers." << '\n'; }; // print usage if (args.count("help")) { - options.set_width(120); - std::cout << options.help() << std::endl; - std::cout << std::endl; + static constexpr std::size_t MIN_HELP_SIZE = 80; + if (isatty(STDIN_FILENO)) { + struct winsize w {}; + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1) { // NOLINT + options.set_width(std::max(static_cast(MIN_HELP_SIZE), w.ws_col)); + } + } else { + options.set_width(MIN_HELP_SIZE); + } + std::cout << options.help() << '\n'; + std::cout << '\n'; print_format(true); - std::cout << std::endl; - std::cout << "This application uses the following libraries:" << std::endl; - std::cout << " - cxxopts by jarro2783 (https://github.com/jarro2783/cxxopts)" << std::endl; - std::cout << " - cxxshm (https://github.com/NikolasK-source/cxxshm)" << std::endl; - std::cout << " - cxxendian (https://github.com/NikolasK-source/cxxendian)" << std::endl; - std::cout << " - GNU Readline (http://git.savannah.gnu.org/cgit/readline.git/)" << std::endl; + std::cout << '\n'; + std::cout << "This application uses the following libraries:" << '\n'; + std::cout << " - cxxopts by jarro2783 (https://github.com/jarro2783/cxxopts)" << '\n'; + std::cout << " - cxxshm (https://github.com/NikolasK-source/cxxshm)" << '\n'; + std::cout << " - cxxendian (https://github.com/NikolasK-source/cxxendian)" << '\n'; + std::cout << " - GNU Readline (http://git.savannah.gnu.org/cgit/readline.git/)" << '\n'; return EX_OK; } // print version + if (args.count("shortversion")) { + std::cout << PROJECT_VERSION << '\n'; + return EX_OK; + } + if (args.count("version")) { - std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << " (compiled with " << COMPILER_INFO << " on " - << SYSTEM_INFO << ')' << std::endl; + std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << '\n'; + return EX_OK; + } + + if (args.count("longversion")) { + std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << '\n'; + std::cout << " compiled with " << COMPILER_INFO << '\n'; + std::cout << " on system " << SYSTEM_INFO << '\n'; + std::cout << " from git commit " << RCS_HASH << '\n'; + return EX_OK; + } + + if (args.count("git-hash")) { + std::cout << RCS_HASH << '\n'; return EX_OK; } // print licenses if (args.count("license")) { - print_licenses(std::cout); + print_licenses(std::cout, false); + return EX_OK; + } + + if (args.count("license-full")) { + print_licenses(std::cout, true); return EX_OK; } auto print_data_types = []() { - std::cout << "Supported data types:" << std::endl; - std::cout << " - Float:" << std::endl; - std::cout << " - 32 Bit:" << std::endl; - std::cout << " - f32_abcd, f32_big, f32b 32-Bit floating point in big endian" - << std::endl; + std::cout << "Supported data types:" << '\n'; + std::cout << " - Float:" << '\n'; + std::cout << " - 32 Bit:" << '\n'; + std::cout << " - f32_abcd, f32_big, f32b 32-Bit floating point in big endian" << '\n'; std::cout << " - f32_dcba, f32_little, f32l 32-Bit floating point in little endian" - << std::endl; + << '\n'; std::cout << " - f32_cdab, f32_big_rev, f32br 32-Bit floating point in big endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - f32_badc, f32_little_rev, f32lr 32-Bit floating point in little endian, - " "reversed register order" - << std::endl; - std::cout << " - 64 Bit:" << std::endl; - std::cout << " - f64_abcdefgh, f64_big, f64b 64-Bit floating point in big endian" - << std::endl; + << '\n'; + std::cout << " - 64 Bit:" << '\n'; + std::cout << " - f64_abcdefgh, f64_big, f64b 64-Bit floating point in big endian" << '\n'; std::cout << " - f64_ghefcdab, f64_little, f64l 64-Bit floating point in little endian" - << std::endl; + << '\n'; std::cout << " - f64_badcfehg, f64_big_rev, f64br 64-Bit floating point in big endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - f64_hgfedcba, f64_little_rev, f64lr 64-Bit floating point in little endian, - " "reversed register order" - << std::endl; - std::cout << " - Int:" << std::endl; - std::cout << " - 8 Bit:" << std::endl; + << '\n'; + std::cout << " - Int:" << '\n'; + std::cout << " - 8 Bit:" << '\n'; std::cout << " - u8_lo 8-Bit unsigned integer written to low byte " "of register" - << std::endl; + << '\n'; std::cout << " - u8_hi 8-Bit unsigned integer written to high byte " "of register" - << std::endl; + << '\n'; std::cout << " - i8_lo 8-Bit signed integer written to low byte " "of register" - << std::endl; + << '\n'; std::cout << " - i8_hi 8-Bit signed integer written to high byte " "of register" - << std::endl; - std::cout << " - 16 Bit" << std::endl; - std::cout << " - u16_ab, u16_big, u16b 16-Bit unsigned integer in big endian" - << std::endl; - std::cout << " - i16_ab, i16_big, i16b 16-Bit signed integer in big endian" - << std::endl; + << '\n'; + std::cout << " - 16 Bit" << '\n'; + std::cout << " - u16_ab, u16_big, u16b 16-Bit unsigned integer in big endian" << '\n'; + std::cout << " - i16_ab, i16_big, i16b 16-Bit signed integer in big endian" << '\n'; std::cout << " - u16_ba, u16_little, u16l 16-Bit unsigned integer in little endian" - << std::endl; + << '\n'; std::cout << " - i16_ba, i16_little, i16l 16-Bit signed integer in little endian" - << std::endl; - std::cout << " - 32 Bit:" << std::endl; - std::cout << " - u32_abcd, u32_big, u32b 32-Bit unsigned integer in big endian" - << std::endl; - std::cout << " - i32_abcd, i32_big, i32b 32-Bit signed integer in big endian" - << std::endl; + << '\n'; + std::cout << " - 32 Bit:" << '\n'; + std::cout << " - u32_abcd, u32_big, u32b 32-Bit unsigned integer in big endian" << '\n'; + std::cout << " - i32_abcd, i32_big, i32b 32-Bit signed integer in big endian" << '\n'; std::cout << " - u32_dcba, u32_little, u32l 32-Bit unsigned integer in little endian" - << std::endl; + << '\n'; std::cout << " - i32_dcba, i32_little, i32l 32-Bit signed integer in little endian" - << std::endl; + << '\n'; std::cout << " - u32_cdab, u32_big_rev, u32br 32-Bit unsigned integer in big endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - i32_cdab, i32_big_rev, i32br 32-Bit signed integer in big endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - u32_badc, u32_little_rev, u32lr 32-Bit unsigned integer in little endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - i32_badc, i32_little_rev, i32lr 32-Bit signed integer in little endian, - " "reversed register order" - << std::endl; - std::cout << " - 64 Bit:" << std::endl; - std::cout << " - u64_abcdefgh, u64_big, u64b 64-Bit unsigned integer in big endian" - << std::endl; - std::cout << " - i64_abcdefgh, i64_big, i64b 64-Bit signed integer in big endian" - << std::endl; + << '\n'; + std::cout << " - 64 Bit:" << '\n'; + std::cout << " - u64_abcdefgh, u64_big, u64b 64-Bit unsigned integer in big endian" << '\n'; + std::cout << " - i64_abcdefgh, i64_big, i64b 64-Bit signed integer in big endian" << '\n'; std::cout << " - u64_hgfedcba, u64_little, u64l 64-Bit unsigned integer in little endian" - << std::endl; + << '\n'; std::cout << " - i64_hgfedcba, i64_little, i64l 64-Bit signed integer in little endian" - << std::endl; + << '\n'; std::cout << " - u64_ghefcdab, u64_big_rev, u64br 64-Bit unsigned integer in big endian - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - i64_ghefcdab, i64_big_rev, i64br 64-Bit signed integer in big endian - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - u64_badcfehg, u64_little_rev, u64lr 64-Bit unsigned integer in little endian, - " "reversed register order" - << std::endl; + << '\n'; std::cout << " - i64_badcfehg, i64_little_rev, i64lr 64-Bit signed integer in little endian, - " "reversed register order" - << std::endl; - std::cout << std::endl; + << '\n'; + std::cout << '\n'; std::cout << "Note: The endianness refers to the layout of the data in the shared memory and may differ from " "the definition of the Modbus Server" - << std::endl; - std::cout << " definition of the endianness." << std::endl; + << '\n'; + std::cout << " definition of the endianness." << '\n'; }; // data type identifiers @@ -277,26 +305,26 @@ int main(int argc, char **argv) { } auto print_constants = []() { - std::cout << "Known string constants:" << std::endl; - std::cout << " true 1" << std::endl; - std::cout << " one 1" << std::endl; - std::cout << " high 1" << std::endl; - std::cout << " active 1" << std::endl; - std::cout << " on 1" << std::endl; - std::cout << " enabled 1" << std::endl; - std::cout << " false 0" << std::endl; - std::cout << " zero 0" << std::endl; - std::cout << " low 0" << std::endl; - std::cout << " inactive 0" << std::endl; - std::cout << " off 0" << std::endl; - std::cout << " off 0" << std::endl; - std::cout << " pi " << InputParser::PI << std::endl; - std::cout << " -pi " << InputParser::NPI << std::endl; - std::cout << " sqrt2 " << InputParser::SQRT2 << std::endl; - std::cout << " sqrt3 " << InputParser::SQRT3 << std::endl; - std::cout << " phi " << InputParser::PHI << std::endl; - std::cout << " ln2 " << InputParser::LN2 << std::endl; - std::cout << " e " << InputParser::E << std::endl; + std::cout << "Known string constants:" << '\n'; + std::cout << " true 1" << '\n'; + std::cout << " one 1" << '\n'; + std::cout << " high 1" << '\n'; + std::cout << " active 1" << '\n'; + std::cout << " on 1" << '\n'; + std::cout << " enabled 1" << '\n'; + std::cout << " false 0" << '\n'; + std::cout << " zero 0" << '\n'; + std::cout << " low 0" << '\n'; + std::cout << " inactive 0" << '\n'; + std::cout << " off 0" << '\n'; + std::cout << " off 0" << '\n'; + std::cout << " pi " << InputParser::PI << '\n'; + std::cout << " -pi " << InputParser::NPI << '\n'; + std::cout << " sqrt2 " << InputParser::SQRT2 << '\n'; + std::cout << " sqrt3 " << InputParser::SQRT3 << '\n'; + std::cout << " phi " << InputParser::PHI << '\n'; + std::cout << " ln2 " << InputParser::LN2 << '\n'; + std::cout << " e " << InputParser::E << '\n'; }; // print licenses @@ -330,51 +358,51 @@ int main(int argc, char **argv) { shm_ao = std::make_unique(name_prefix + "AO"); shm_ai = std::make_unique(name_prefix + "AI"); } catch (const std::system_error &e) { - std::cerr << e.what() << std::endl; + std::cerr << e.what() << '\n'; return EX_OSERR; } // check shared mem if (shm_do->get_size() > MAX_MODBUS_REGS) { std::cerr << "shared memory '" << shm_do->get_name() << "is to large to be a valid modbus shared memory." - << std::endl; + << '\n'; return EX_SOFTWARE; } if (shm_di->get_size() > MAX_MODBUS_REGS) { std::cerr << "shared memory '" << shm_di->get_name() << "' is to large to be a valid modbus shared memory." - << std::endl; + << '\n'; return EX_SOFTWARE; } if (shm_ao->get_size() / 2 > MAX_MODBUS_REGS) { std::cerr << "shared memory '" << shm_ao->get_name() << "' is to large to be a valid modbus shared memory." - << std::endl; + << '\n'; return EX_SOFTWARE; } if (shm_ai->get_size() / 2 > MAX_MODBUS_REGS) { std::cerr << "shared memory '" << shm_ai->get_name() << "' is to large to be a valid modbus shared memory." - << std::endl; + << '\n'; return EX_SOFTWARE; } if (VERBOSE) { - std::cerr << "DO registers: " << shm_do->get_size() << std::endl; - std::cerr << "DI registers: " << shm_di->get_size() << std::endl; - std::cerr << "AO registers: " << shm_ao->get_size() / 2 << std::endl; - std::cerr << "AI registers: " << shm_ai->get_size() / 2 << std::endl; + std::cerr << "DO registers: " << shm_do->get_size() << '\n'; + std::cerr << "DI registers: " << shm_di->get_size() << '\n'; + std::cerr << "AO registers: " << shm_ao->get_size() / 2 << '\n'; + std::cerr << "AI registers: " << shm_ai->get_size() / 2 << '\n'; } if (shm_ao->get_size() % 2) { std::cerr << "the size of shared memory '" << shm_ao->get_name() << "' is odd. It is not a valid modbus shm." - << std::endl; + << '\n'; return EX_SOFTWARE; } if (shm_ai->get_size() % 2) { std::cerr << "the size of shared memory '" << shm_ai->get_name() << "' is odd. It is not a valid modbus shm." - << std::endl; + << '\n'; return EX_SOFTWARE; } @@ -394,14 +422,14 @@ int main(int argc, char **argv) { try { semaphore = std::make_unique(args["semaphore"].as()); } catch (const std::exception &e) { - std::cerr << e.what() << std::endl; + std::cerr << e.what() << '\n'; return EX_SOFTWARE; } } const double SEMAPHORE_TIMEOUT_S = args["semaphore-timeout"].as(); if (SEMAPHORE_TIMEOUT_S < 0.000'001) { - std::cerr << "semaphore-timeout: invalid value" << std::endl; + std::cerr << "semaphore-timeout: invalid value" << '\n'; return EX_USAGE; } @@ -420,7 +448,7 @@ int main(int argc, char **argv) { auto sleep_time = static_cast(ms) / 1000.0; if (sleep_time > MIN_BASH_SLEEP) { last_time = this_time; - std::cout << "sleep " << std::setprecision(SLEEP_DIGITS) << sleep_time << std::endl; + std::cout << "sleep " << std::setprecision(SLEEP_DIGITS) << sleep_time << std::endl; // NOLINT } }; @@ -438,9 +466,9 @@ int main(int argc, char **argv) { if (line == "exit") break; if (line == "help") { - std::cout << "usage: help {format, constants, types}" << std::endl; - std::cout << std::endl; - std::cout << " Type 'exit' to exit the application." << std::endl; + std::cout << "usage: help {format, constants, types}" << '\n'; + std::cout << '\n'; + std::cout << " Type 'exit' to exit the application." << std::endl; // NOLINT continue; } @@ -473,7 +501,7 @@ int main(int argc, char **argv) { try { instructions = InputParser::parse(line, addr_base, value_base, VERBOSE); } catch (std::exception &e) { - std::cerr << "line '" << line << "' discarded: " << e.what() << std::endl; + std::cerr << "line '" << line << "' discarded: " << e.what() << std::endl; // NOLINT continue; } @@ -485,12 +513,12 @@ int main(int argc, char **argv) { if (semaphore) { while (!semaphore->wait(SEMAPHORE_MAX_TIME)) { std::cerr << " WARNING: Failed to acquire semaphore '" << semaphore->get_name() << "' within " - << SEMAPHORE_TIMEOUT_S << "s." << std::endl; + << SEMAPHORE_TIMEOUT_S << "s." << std::endl; // NOLINT semaphore_error_counter += SEMAPHORE_ERROR_INC; if (semaphore_error_counter >= SEMAPHORE_ERROR_MAX) { - std::cerr << "ERROR: Repeatedly failed to acquire the semaphore" << std::endl; + std::cerr << "ERROR: Repeatedly failed to acquire the semaphore\n"; return EX_SOFTWARE; } } @@ -503,14 +531,15 @@ int main(int argc, char **argv) { switch (input_data.register_type) { case InputParser::Instruction::register_type_t::DO: { if (input_data.address >= do_elements) { - std::cerr << "line '" << line << "' discarded: address out of range" << std::endl; + std::cerr << "line '" << line << "' discarded: address out of range" + << std::endl; // NOLINT break; } uint8_t value = input_data.value ? 1 : 0; shm_do->get_addr()[input_data.address] = value; if (VERBOSE) { std::cerr << "> write " << std::hex << "0x" << std::setw(2) << std::setfill('0') << value - << " to DO @0x" << std::setw(4) << input_data.address << std::endl; + << " to DO @0x" << std::setw(4) << input_data.address << std::endl; // NOLINT } if (PASSTHROUGH) { @@ -520,14 +549,15 @@ int main(int argc, char **argv) { } std::cout << "do:" << input_data.address << ':' << static_cast(value); if (PASSTHROUGH_BASH) std::cout << "'"; - std::cout << std::endl; + std::cout << std::endl; // NOLINT } break; } case InputParser::Instruction::register_type_t::DI: { if (input_data.address >= di_elements) { - std::cerr << "line '" << line << "' discarded: address out of range" << std::endl; + std::cerr << "line '" << line << "' discarded: address out of range" + << std::endl; // NOLINT break; } uint8_t value = input_data.value ? 1 : 0; @@ -535,7 +565,7 @@ int main(int argc, char **argv) { if (VERBOSE) { std::cerr << "> write " << std::hex << "0x" << std::setw(2) << std::setfill('0') << value - << " to DI @0x" << std::setw(4) << input_data.address << std::endl; + << " to DI @0x" << std::setw(4) << input_data.address << std::endl; // NOLINT } if (PASSTHROUGH) { @@ -545,14 +575,15 @@ int main(int argc, char **argv) { } std::cout << "di:" << input_data.address << ':' << static_cast(value); if (PASSTHROUGH_BASH) std::cout << "'"; - std::cout << std::endl; + std::cout << std::endl; // NOLINT } break; } case InputParser::Instruction::register_type_t::AO: if (input_data.address >= ao_elements) { - std::cerr << "line '" << line << "' discarded: address out of range" << std::endl; + std::cerr << "line '" << line << "' discarded: address out of range" + << std::endl; // NOLINT break; } shm_ao->get_addr()[input_data.address] = static_cast(input_data.value); @@ -560,7 +591,7 @@ int main(int argc, char **argv) { if (VERBOSE) { std::cerr << "> write " << std::hex << "0x" << std::setw(4) << std::setfill('0') << input_data.value << " to AO @0x" << std::setw(4) << input_data.address - << std::endl; + << std::endl; // NOLINT } if (PASSTHROUGH) { @@ -571,12 +602,13 @@ int main(int argc, char **argv) { std::cout << "ao:" << input_data.address << ':' << static_cast(input_data.value) << ':' << REGISTER_ENDIAN; if (PASSTHROUGH_BASH) std::cout << "'"; - std::cout << std::endl; + std::cout << std::endl; // NOLINT } break; case InputParser::Instruction::register_type_t::AI: if (input_data.address >= ai_elements) { - std::cerr << "line '" << line << "' discarded: address out of range" << std::endl; + std::cerr << "line '" << line << "' discarded: address out of range" + << std::endl; // NOLINT break; } shm_ai->get_addr()[input_data.address] = static_cast(input_data.value); @@ -584,7 +616,7 @@ int main(int argc, char **argv) { if (VERBOSE) { std::cerr << "> write " << std::hex << "0x" << std::setw(4) << std::setfill('0') << input_data.value << " to AI @0x" << std::setw(4) << input_data.address - << std::endl; + << std::endl; // NOLINT } if (PASSTHROUGH) { @@ -595,7 +627,7 @@ int main(int argc, char **argv) { std::cout << "ai:" << input_data.address << ':' << static_cast(input_data.value) << ':' << REGISTER_ENDIAN; if (PASSTHROUGH_BASH) std::cout << "'"; - std::cout << std::endl; + std::cout << std::endl; // NOLINT } break; } @@ -606,6 +638,7 @@ int main(int argc, char **argv) { rl_clear_history(); terminate = true; + return EX_OK; }; // start input thread. @@ -615,9 +648,9 @@ int main(int argc, char **argv) { input_thread.detach(); while (!terminate) { - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // NOLINT } std::lock_guard guard(m); // wait until the thread is not within a critical section - if (INTERACTIVE) std::cerr << std::endl << "Terminating ..." << std::endl; + if (INTERACTIVE) std::cerr << "\nTerminating ..." << std::endl; // NOLINT } diff --git a/src/readline.hpp b/src/readline.hpp index 3f2a0e0..5f1f03b 100644 --- a/src/readline.hpp +++ b/src/readline.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2021-2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #include "readline/history.h" diff --git a/src/split_string.hpp b/src/split_string.hpp index 9ac9689..67376fb 100644 --- a/src/split_string.hpp +++ b/src/split_string.hpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2021-2022 Nikolas Koesling . - * This program is free software. You can redistribute it and/or modify it under the terms of the MIT License. + * This program is free software. You can redistribute it and/or modify it under the terms of the GPLv3 License. */ #pragma once