├── packaging ├── Changelog.txt ├── Readme.rtf ├── debian │ ├── compat │ ├── source │ │ ├── format │ │ └── options │ ├── clickhouse-odbc.prerm │ ├── changelog │ ├── clickhouse-odbc.postinst │ ├── control │ └── rules ├── odbcinst.ini.sample └── clickhouse-odbc.tdc.sample ├── test ├── src │ ├── e2e │ │ └── __init__.py │ └── util │ │ ├── __init__.py │ │ └── env.py ├── requirements.txt ├── pytest.ini ├── detect_driver_manager.py ├── detect_driver_manager.pl ├── docker-compose.yml ├── docker-compose │ └── users.xml └── vcvars_enabled_bash.sh ├── .gitattributes ├── cmake ├── unwind.cmake ├── cxx.cmake ├── darwin │ └── default_libs.cmake ├── extract_flags.cmake ├── packages.cmake ├── arch.cmake └── os.cmake ├── driver ├── exported_symbols_linux.txt ├── object.cpp ├── escaping │ ├── escape_sequences.h │ └── lexer_declare.h ├── test │ ├── gtest_main.cpp │ ├── gtest_env.h │ ├── lexer_ut.cpp │ ├── gtest_env.cpp │ └── load_ut.cpp ├── utils │ ├── resize_without_initialization.h │ ├── object_pool.h │ ├── type_parser.h │ └── sql_encoding.h ├── exception.cpp ├── exception.h ├── platform │ ├── win │ │ └── dllmain.cpp │ └── config_cmake.h.in ├── attributes.cpp ├── api │ └── sql_columns_resultset_mutator.h ├── descriptor.h ├── environment.h └── config │ └── config.h ├── contrib ├── poco │ ├── Foundation │ │ ├── src │ │ │ ├── MSG00001.bin │ │ │ ├── ByteOrder.cpp │ │ │ ├── AtomicFlag.cpp │ │ │ ├── inffast.h │ │ │ ├── Manifest.cpp │ │ │ ├── Runnable.cpp │ │ │ ├── Configurable.cpp │ │ │ ├── EventArgs.cpp │ │ │ ├── PipeImpl.cpp │ │ │ ├── RefCountedObject.cpp │ │ │ ├── SynchronizedObject.cpp │ │ │ ├── Void.cpp │ │ │ ├── BufferedStreamBuf.cpp │ │ │ ├── EventChannel.cpp │ │ │ ├── UnbufferedStreamBuf.cpp │ │ │ ├── Hash.cpp │ │ │ ├── RWLock_POSIX.cpp │ │ │ ├── BufferedBidirectionalStreamBuf.cpp │ │ │ ├── NullChannel.cpp │ │ │ ├── VarVisitor.cpp │ │ │ ├── RWLock.cpp │ │ │ ├── SharedMemory_DUMMY.cpp │ │ │ ├── StreamChannel.cpp │ │ │ ├── Notification.cpp │ │ │ ├── Event.cpp │ │ │ ├── ThreadTarget.cpp │ │ │ ├── AbstractObserver.cpp │ │ │ ├── FileStreamRWLock_POSIX.cpp │ │ │ ├── NamedEvent.cpp │ │ │ ├── NamedMutex.cpp │ │ │ ├── Timezone.cpp │ │ │ ├── Semaphore.cpp │ │ │ ├── Formatter.cpp │ │ │ ├── Channel.cpp │ │ │ ├── FileStreamRWLock_WIN32.cpp │ │ │ ├── FileStreamRWLock.cpp │ │ │ ├── Mutex.cpp │ │ │ ├── Stopwatch.cpp │ │ │ ├── PipeImpl_DUMMY.cpp │ │ │ ├── URIStreamFactory.cpp │ │ │ ├── AtomicCounter.cpp │ │ │ ├── MemoryStream.cpp │ │ │ ├── Checksum.cpp │ │ │ ├── NullStream.cpp │ │ │ ├── Pipe.cpp │ │ │ ├── DataURIStreamFactory.cpp │ │ │ ├── Unicode.cpp │ │ │ ├── Event_WIN32.cpp │ │ │ ├── Mutex_WIN32.cpp │ │ │ ├── Semaphore_WIN32.cpp │ │ │ └── Condition.cpp │ │ └── include │ │ │ └── Poco │ │ │ ├── Poco.h │ │ │ ├── Alignment.h │ │ │ ├── DynamicAny.h │ │ │ ├── DynamicStruct.h │ │ │ ├── DynamicAnyHolder.h │ │ │ ├── PipeImpl.h │ │ │ ├── NamedEvent_Android.h │ │ │ ├── NamedMutex_Android.h │ │ │ ├── EventArgs.h │ │ │ ├── Runnable.h │ │ │ ├── NamedEvent_WIN32U.h │ │ │ ├── UnWindows.h │ │ │ ├── NamedMutex_WIN32U.h │ │ │ ├── ProcessOptions.h │ │ │ ├── Version.h │ │ │ ├── PipeImpl_DUMMY.h │ │ │ ├── OrderedSet.h │ │ │ ├── BufferAllocator.h │ │ │ ├── Semaphore_WIN32.h │ │ │ ├── ActiveStarter.h │ │ │ ├── OrderedMap.h │ │ │ ├── Path_UNIX.h │ │ │ ├── PipeImpl_POSIX.h │ │ │ ├── RWLock_WIN32.h │ │ │ ├── PipeImpl_WIN32.h │ │ │ ├── SharedLibrary_WIN32U.h │ │ │ ├── Environment_WIN32U.h │ │ │ ├── ValidArgs.h │ │ │ ├── Error.h │ │ │ ├── HashFunction.h │ │ │ ├── LRUCache.h │ │ │ ├── Path_WIN32U.h │ │ │ ├── Platform_POSIX.h │ │ │ └── ASCIIEncoding.h │ ├── CMakeLists.txt │ ├── Util │ │ ├── src │ │ │ ├── Validator.cpp │ │ │ ├── TimerTask.cpp │ │ │ ├── OptionCallback.cpp │ │ │ ├── Subsystem.cpp │ │ │ ├── RegExpValidator.cpp │ │ │ ├── IntValidator.cpp │ │ │ └── LoggingSubsystem.cpp │ │ ├── CMakeLists.txt │ │ └── include │ │ │ └── Poco │ │ │ └── Util │ │ │ ├── LoggingSubsystem.h │ │ │ ├── IntValidator.h │ │ │ └── RegExpValidator.h │ ├── Net │ │ ├── src │ │ │ ├── PartHandler.cpp │ │ │ ├── ServerSocketImpl.cpp │ │ │ ├── HTTPServerRequest.cpp │ │ │ ├── HTTPRequestHandler.cpp │ │ │ ├── HTTPServerResponse.cpp │ │ │ ├── HTTPRequestHandlerFactory.cpp │ │ │ ├── TCPServerConnectionFactory.cpp │ │ │ ├── UDPServerParams.cpp │ │ │ ├── NullPartHandler.cpp │ │ │ ├── HTTPBufferAllocator.cpp │ │ │ ├── PartSource.cpp │ │ │ ├── HTTPServerConnectionFactory.cpp │ │ │ ├── TCPServerConnection.cpp │ │ │ ├── TCPServerParams.cpp │ │ │ └── HTTPIOStream.cpp │ │ └── include │ │ │ └── Poco │ │ │ └── Net │ │ │ ├── HTTPBasicStreamBuf.h │ │ │ ├── ServerSocketImpl.h │ │ │ ├── NullPartHandler.h │ │ │ └── HTTPBufferAllocator.h │ ├── Crypto │ │ ├── CMakeLists.txt │ │ └── src │ │ │ ├── KeyPairImpl.cpp │ │ │ ├── CryptoTransform.cpp │ │ │ └── KeyPair.cpp │ ├── NetSSL_Win │ │ ├── CMakeLists.txt │ │ ├── src │ │ │ ├── Session.cpp │ │ │ ├── VerificationErrorArgs.cpp │ │ │ ├── AcceptCertificateHandler.cpp │ │ │ ├── RejectCertificateHandler.cpp │ │ │ ├── KeyConsoleHandler.cpp │ │ │ ├── PrivateKeyFactory.cpp │ │ │ ├── CertificateHandlerFactory.cpp │ │ │ ├── SSLException.cpp │ │ │ └── PrivateKeyPassphraseHandler.cpp │ │ └── include │ │ │ └── Poco │ │ │ └── Net │ │ │ ├── KeyConsoleHandler.h │ │ │ ├── Utility.h │ │ │ └── SSLException.h │ └── NetSSL_OpenSSL │ │ ├── CMakeLists.txt │ │ ├── src │ │ ├── Session.cpp │ │ ├── InvalidCertificateHandler.cpp │ │ ├── KeyConsoleHandler.cpp │ │ ├── VerificationErrorArgs.cpp │ │ ├── AcceptCertificateHandler.cpp │ │ ├── RejectCertificateHandler.cpp │ │ ├── PrivateKeyFactory.cpp │ │ ├── SSLException.cpp │ │ ├── CertificateHandlerFactory.cpp │ │ └── PrivateKeyPassphraseHandler.cpp │ │ └── include │ │ └── Poco │ │ └── Net │ │ ├── SSLException.h │ │ └── KeyConsoleHandler.h ├── openssl-cmake │ ├── fipsmodule.cnf │ ├── linux_s390x │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── linux_x86_64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── darwin_aarch64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── darwin_x86_64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── linux_aarch64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── linux_loongarch64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── linux_ppc64le │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ ├── linux_riscv64 │ │ └── include │ │ │ ├── crypto │ │ │ ├── dso_conf.h │ │ │ └── bn_conf.h │ │ │ └── openssl │ │ │ └── fipskey.h │ └── der_sm2_gen.c ├── libunwind-cmake │ └── unwind-override.c ├── zstd-cmake │ └── CMakeLists.txt ├── double-conversion-cmake │ └── CMakeLists.txt ├── lz4-cmake │ └── CMakeLists.txt ├── nanodbc-cmake │ └── CMakeLists.txt └── unixodbc-cmake │ └── linux_x86_64 │ └── unixodbc_conf.h ├── .gitignore ├── .editorconfig ├── .github ├── workflows │ └── debug.yml └── ISSUE_TEMPLATE │ └── bug_report.md ├── format_sources ├── CPackLists.txt └── ubsan_ignorelist.txt /packaging/Changelog.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packaging/Readme.rtf: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/src/e2e/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packaging/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto encoding=utf-8 2 | -------------------------------------------------------------------------------- /packaging/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /test/requirements.txt: -------------------------------------------------------------------------------- 1 | pyodbc==5.1.0 2 | pytest==8.3.3 3 | -------------------------------------------------------------------------------- /cmake/unwind.cmake: -------------------------------------------------------------------------------- 1 | add_subdirectory(contrib/libunwind-cmake) 2 | -------------------------------------------------------------------------------- /test/src/util/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import * 2 | from .env import * 3 | -------------------------------------------------------------------------------- /driver/exported_symbols_linux.txt: -------------------------------------------------------------------------------- 1 | { 2 | global: SQL*; 3 | local: *; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/MSG00001.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClickHouse/clickhouse-odbc/HEAD/contrib/poco/Foundation/src/MSG00001.bin -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /build_* 3 | /build-* 4 | 5 | .vs/ 6 | 7 | CMakeFiles/ 8 | CMakeCache.txt 9 | 10 | __pycache__/ 11 | *.py[cod] 12 | -------------------------------------------------------------------------------- /test/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | minversion = 8.0 3 | testpaths = 4 | src 5 | filterwarnings = 6 | ignore:There is no current event loop 7 | log_cli=true 8 | -------------------------------------------------------------------------------- /packaging/debian/clickhouse-odbc.prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ -x /usr/bin/odbcinst ]; then 6 | odbcinst -u -d -n Clickhouse 7 | fi 8 | 9 | #DEBHELPER# 10 | -------------------------------------------------------------------------------- /packaging/debian/changelog: -------------------------------------------------------------------------------- 1 | clickhouse-odbc (1.0.0.20190611) unstable; urgency=low 2 | 3 | * Modified source code 4 | 5 | -- Alexey Milovidov Mon, 1 Oct 2024 00:00:00 +0000 6 | -------------------------------------------------------------------------------- /packaging/debian/clickhouse-odbc.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | if [ -x /usr/bin/odbcinst ]; then 6 | odbcinst -i -d -f /usr/share/clickhouse-odbc/unixodbc.ini 7 | fi 8 | 9 | #DEBHELPER# 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_style = space 7 | indent_size = 4 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | max_line_length = 140 11 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/fipsmodule.cnf: -------------------------------------------------------------------------------- 1 | [fips_sect] 2 | activate = 1 3 | conditional-errors = 1 4 | security-checks = 1 5 | module-mac = D6:10:14:8D:C3:5A:83:B9:3B:7D:96:FE:E9:11:EF:B3:94:5C:B3:CA:4E:A9:2B:6D:A9:61:E9:E2:8E:44:EF:B0 6 | -------------------------------------------------------------------------------- /driver/object.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/object.h" 2 | #include "driver/driver.h" 3 | 4 | Object::Object() noexcept 5 | : handle(this) 6 | { 7 | } 8 | 9 | SQLHANDLE Object::getHandle() const noexcept { 10 | return handle; 11 | } 12 | -------------------------------------------------------------------------------- /packaging/debian/source/options: -------------------------------------------------------------------------------- 1 | tar-ignore 2 | tar-ignore="build*" 3 | tar-ignore="contrib/poco/openssl/*" 4 | tar-ignore="contrib/poco/gradle/*" 5 | tar-ignore="contrib/poco/Data/SQLite/*" 6 | tar-ignore="contrib/poco/PDF/*" 7 | tar-ignore="contrib/poco/XML/*" 8 | -------------------------------------------------------------------------------- /.github/workflows/debug.yml: -------------------------------------------------------------------------------- 1 | # Log all debug info to facilitate debugging 2 | name: debug 3 | 4 | 'on': 5 | [push, pull_request, release] 6 | 7 | jobs: 8 | DebugInfo: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: hmarr/debug-action@v3 12 | -------------------------------------------------------------------------------- /format_sources: -------------------------------------------------------------------------------- 1 | # Settings -> Configure KDevelop -> Source Formatter -> [C++, C] ; Custom Script Formatter ; Kdevelop: kdev_format_source 2 | *.c *.cpp *.h *.hpp: mv $TMPFILE $TMPFILE.tmp; cat $TMPFILE.tmp | clang-format -style=file -assume-filename=`pwd`/.clang-format > $TMPFILE 3 | -------------------------------------------------------------------------------- /driver/escaping/escape_sequences.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | /** Replaces ODBC escape-sequence into a ClickHouse SQL-dialect. 6 | * 7 | * In case of error, input is returned as-is, with no modifications. 8 | */ 9 | std::string replaceEscapeSequences(const std::string & query); 10 | -------------------------------------------------------------------------------- /driver/test/gtest_main.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/test/gtest_env.h" 2 | 3 | #include 4 | 5 | int main(int argc, char * argv[]) { 6 | ::testing::InitGoogleTest(&argc, argv); 7 | ::testing::AddGlobalTestEnvironment(new TestEnvironment(argc, argv)); 8 | return RUN_ALL_TESTS(); 9 | } 10 | -------------------------------------------------------------------------------- /contrib/libunwind-cmake/unwind-override.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /// On MacOS this function will be replaced with a dynamic symbol 4 | /// from the system library. 5 | #if !defined(OS_DARWIN) 6 | int backtrace(void ** buffer, int size) 7 | { 8 | return unw_backtrace(buffer, size); 9 | } 10 | #endif 11 | -------------------------------------------------------------------------------- /CPackLists.txt: -------------------------------------------------------------------------------- 1 | # This file will be included at CPack-time, once per generator after CPack has set CPACK_GENERATOR to the actual generator being used. 2 | 3 | if ( 4 | CPACK_GENERATOR MATCHES "RPM" OR 5 | CPACK_GENERATOR MATCHES "DEB" 6 | ) 7 | set (CPACK_PACKAGING_INSTALL_PREFIX "${CPACK_PACKAGE_INSTALL_DIRECTORY}") 8 | endif () 9 | -------------------------------------------------------------------------------- /cmake/cxx.cmake: -------------------------------------------------------------------------------- 1 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_LIBCPP_DEBUG=0") # More checks in debug build. 2 | 3 | add_subdirectory(contrib/libcxxabi-cmake) 4 | add_subdirectory(contrib/libcxx-cmake) 5 | 6 | # Exception handling library is embedded into libcxxabi. 7 | 8 | target_link_libraries(global-libs INTERFACE cxx cxxabi) 9 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/ByteOrder.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ByteOrder.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: ByteOrder 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/ByteOrder.h" 16 | -------------------------------------------------------------------------------- /driver/escaping/lexer_declare.h: -------------------------------------------------------------------------------- 1 | 2 | // clang-format off 3 | 4 | //DECLARE(SQL_TSI_FRAC_SECOND), 5 | DECLARE(SQL_TSI_SECOND), 6 | DECLARE(SQL_TSI_MINUTE), 7 | DECLARE(SQL_TSI_HOUR), 8 | DECLARE(SQL_TSI_DAY), 9 | DECLARE(SQL_TSI_WEEK), 10 | DECLARE(SQL_TSI_MONTH), 11 | //DECLARE(SQL_TSI_QUARTER), 12 | DECLARE(SQL_TSI_YEAR), 13 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/AtomicFlag.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicFlag.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: AtomicFlag 7 | // 8 | // Copyright (c) 2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/AtomicCounter.h" 16 | 17 | -------------------------------------------------------------------------------- /driver/utils/resize_without_initialization.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/platform/platform.h" 4 | 5 | #include 6 | #define resize_without_initialization(container, size) folly::resizeWithoutInitialization(container, size) 7 | 8 | FOLLY_DECLARE_STRING_RESIZE_WITHOUT_INIT(char16_t) 9 | FOLLY_DECLARE_STRING_RESIZE_WITHOUT_INIT(char32_t) 10 | -------------------------------------------------------------------------------- /contrib/poco/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(cmake/PocoMacros.cmake) 2 | 3 | add_subdirectory(Foundation) 4 | add_subdirectory(Util) 5 | add_subdirectory(Net) 6 | if (OS_LINUX OR OS_DARWIN) 7 | add_subdirectory(Crypto) 8 | add_subdirectory(NetSSL_OpenSSL) 9 | add_library(Poco::Net::SSL ALIAS NetSSL) 10 | else() 11 | add_subdirectory(NetSSL_Win) 12 | add_library(Poco::Net::WinSSL ALIAS NetSSLWin) 13 | endif() 14 | -------------------------------------------------------------------------------- /test/detect_driver_manager.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import re 5 | import pyodbc 6 | 7 | try: 8 | connection = pyodbc.connect("DSN=__nonexistent_dsn__") 9 | except pyodbc.Error as error: 10 | result = re.search(r"\[([^\[\]]+)]\[Driver Manager]", str(error)) 11 | if result and len(result.groups()) >= 1: 12 | print(result.group(1)) 13 | else: 14 | raise 15 | -------------------------------------------------------------------------------- /test/detect_driver_manager.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | use 5.16.0; 4 | use utf8; 5 | use open ':encoding(utf8)', ':std'; 6 | use strict; 7 | use warnings; 8 | use DBI; 9 | 10 | eval { 11 | my $dbh = DBI->connect('dbi:ODBC:DSN=__nonexistent_dsn__', '', '', { RaiseError => 1, PrintError => 0 }); 12 | }; 13 | 14 | if ($@ =~ /\[([^\[\]]+)\]\[Driver Manager\]/) { 15 | print "$1\n"; 16 | } 17 | elsif ($@) { 18 | die $@; 19 | } 20 | -------------------------------------------------------------------------------- /packaging/debian/control: -------------------------------------------------------------------------------- 1 | Source: clickhouse-odbc 2 | Priority: optional 3 | Maintainer: Alexey Milovidov 4 | Build-Depends: debhelper (>= 9), cmake3 | cmake, lsb-release, unixodbc-dev | libiodbc2-dev 5 | Standards-Version: 4.1.1 6 | Homepage: https://clickhouse.com/ 7 | 8 | Package: clickhouse-odbc 9 | Section: database 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: Clickhouse odbc driver 13 | . 14 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start); 12 | -------------------------------------------------------------------------------- /driver/exception.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/exception.h" 2 | 3 | SqlException::SqlException(const std::string & message_, const std::string & sql_state_, SQLRETURN return_code_) 4 | : std::runtime_error(message_) 5 | , sql_state(sql_state_) 6 | , return_code(return_code_) 7 | { 8 | } 9 | 10 | const std::string & SqlException::getSQLState() const noexcept { 11 | return sql_state; 12 | } 13 | 14 | const SQLRETURN SqlException::getReturnCode() const noexcept { 15 | return return_code; 16 | } 17 | -------------------------------------------------------------------------------- /contrib/zstd-cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(ZSTD_BUILD_SHARED OFF CACHE BOOL "" FORCE) 2 | set(ZSTD_BUILD_STATIC ON CACHE BOOL "" FORCE) 3 | set(ZSTD_BUILD_PROGRAMS OFF CACHE BOOL "" FORCE) 4 | 5 | get_directory_property(SAVED_LINK_LIBS LINK_LIBRARIES) 6 | set_property(DIRECTORY PROPERTY LINK_LIBRARIES "") 7 | add_subdirectory(../zstd/build/cmake ${CMAKE_CURRENT_BINARY_DIR}/contrib/zstd/) 8 | set_property(DIRECTORY PROPERTY LINK_LIBRARIES ${SAVED_LINK_LIBS}) 9 | add_library (ch_contrib::zstd ALIAS libzstd_static) 10 | -------------------------------------------------------------------------------- /driver/test/gtest_env.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | class TestEnvironment 9 | : public ::testing::Environment 10 | { 11 | public: 12 | TestEnvironment(int argc, char * argv[]); 13 | virtual ~TestEnvironment(); 14 | 15 | static TestEnvironment & getInstance(); 16 | 17 | const std::string& getDSN(); 18 | 19 | private: 20 | static TestEnvironment * environment_; 21 | 22 | std::vector command_line_params_; 23 | }; 24 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Poco.h: -------------------------------------------------------------------------------- 1 | // 2 | // Poco.h 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: Foundation 7 | // 8 | // Basic definitions for the POCO libraries. 9 | // 10 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Poco_INCLUDED 18 | #define Foundation_Poco_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | #endif // Foundation_Poco_INCLUDED 25 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Manifest.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Manifest.cpp 3 | // 4 | // Library: Foundation 5 | // Package: SharedLibrary 6 | // Module: ClassLoader 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Manifest.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | ManifestBase::ManifestBase() 22 | { 23 | } 24 | 25 | 26 | ManifestBase::~ManifestBase() 27 | { 28 | } 29 | 30 | 31 | } // namespace Poco 32 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Runnable.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Runnable.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Thread 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Runnable.h" 16 | #include "Poco/Thread.h" 17 | 18 | 19 | namespace Poco { 20 | 21 | 22 | Runnable::Runnable() 23 | { 24 | } 25 | 26 | 27 | Runnable::~Runnable() 28 | { 29 | } 30 | 31 | 32 | } // namespace Poco 33 | -------------------------------------------------------------------------------- /contrib/poco/Util/src/Validator.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Validator.cpp 3 | // 4 | // Library: Util 5 | // Package: Options 6 | // Module: Validator 7 | // 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Util/Validator.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Util { 20 | 21 | 22 | Validator::Validator() 23 | { 24 | } 25 | 26 | 27 | Validator::~Validator() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Util 33 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Configurable.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Configurable.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: Configurable 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Configurable.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | Configurable::Configurable() 22 | { 23 | } 24 | 25 | 26 | Configurable::~Configurable() 27 | { 28 | } 29 | 30 | 31 | } // namespace Poco 32 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/PartHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PartHandler.cpp 3 | // 4 | // Library: Net 5 | // Package: Messages 6 | // Module: PartHandler 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/PartHandler.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | PartHandler::PartHandler() 23 | { 24 | } 25 | 26 | 27 | PartHandler::~PartHandler() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/EventArgs.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // EventArgs.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Events 6 | // Module: EventArgs 7 | // 8 | // Implementation of EventArgs 9 | // 10 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #include "Poco/EventArgs.h" 18 | 19 | 20 | namespace Poco { 21 | 22 | 23 | EventArgs::EventArgs() 24 | { 25 | } 26 | 27 | 28 | EventArgs::~EventArgs() 29 | { 30 | } 31 | 32 | 33 | } // namespace Poco 34 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/PipeImpl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: PipeImpl 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/PipeImpl.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "PipeImpl_WIN32.cpp" 20 | #elif defined(POCO_OS_FAMILY_UNIX) 21 | #include "PipeImpl_POSIX.cpp" 22 | #else 23 | #include "PipeImpl_DUMMY.cpp" 24 | #endif 25 | -------------------------------------------------------------------------------- /driver/exception.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/platform/platform.h" 4 | 5 | #include 6 | #include 7 | 8 | class SqlException 9 | : public std::runtime_error 10 | { 11 | public: 12 | explicit SqlException(const std::string & message_, const std::string & sql_state_ = "HY000", SQLRETURN return_code_ = SQL_ERROR); 13 | const std::string & getSQLState() const noexcept; 14 | const SQLRETURN getReturnCode() const noexcept; 15 | 16 | private: 17 | const std::string sql_state; 18 | const SQLRETURN return_code = SQL_ERROR; 19 | }; 20 | -------------------------------------------------------------------------------- /contrib/poco/Crypto/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Sources 2 | file(GLOB SRCS_G "src/*.cpp") 3 | POCO_SOURCES_AUTO(SRCS ${SRCS_G}) 4 | 5 | # Headers 6 | file(GLOB_RECURSE HDRS_G "include/*.h") 7 | POCO_HEADERS_AUTO(SRCS ${HDRS_G}) 8 | 9 | add_library(Crypto ${SRCS}) 10 | set_target_properties(Crypto PROPERTIES CXX_STANDARD 17) 11 | add_library(Poco::Crypto ALIAS Crypto) 12 | 13 | target_link_libraries(Crypto PUBLIC Poco::Foundation OpenSSL::SSL OpenSSL::Crypto) 14 | target_include_directories(Crypto 15 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include 16 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src 17 | ) 18 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Alignment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Alignment.h 3 | // 4 | // Library: Foundation 5 | // Package: Dynamic 6 | // Module: Alignment 7 | // 8 | // Definition of the Alignment class. 9 | // 10 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Alignment_INCLUDED 18 | #define Foundation_Alignment_INCLUDED 19 | 20 | 21 | #include 22 | #define POCO_HAVE_ALIGNMENT 23 | 24 | 25 | #endif // Foundation_Alignment_INCLUDED 26 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Sources 2 | file(GLOB SRCS_G "src/*.cpp") 3 | POCO_SOURCES_AUTO(SRCS ${SRCS_G}) 4 | 5 | # Headers 6 | file(GLOB_RECURSE HDRS_G "include/*.h") 7 | POCO_HEADERS_AUTO(SRCS ${HDRS_G}) 8 | 9 | add_library(NetSSLWin ${SRCS}) 10 | set_target_properties(NetSSLWin PROPERTIES CXX_STANDARD 17) 11 | add_library(Poco::NetSSLWin ALIAS NetSSLWin) 12 | 13 | target_link_libraries(NetSSLWin PUBLIC Poco::Net Poco::Util Crypt32.lib) 14 | target_include_directories(NetSSLWin 15 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include 16 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src 17 | ) 18 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/RefCountedObject.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RefCountedObject.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: RefCountedObject 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/RefCountedObject.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | RefCountedObject::RefCountedObject(): _counter(1) 22 | { 23 | } 24 | 25 | 26 | RefCountedObject::~RefCountedObject() 27 | { 28 | } 29 | 30 | 31 | } // namespace Poco 32 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/DynamicAny.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicAny.h 3 | // 4 | // Library: Foundation 5 | // Package: Dynamic 6 | // Module: Var 7 | // 8 | // Forward header for Var class to maintain backward compatibility. 9 | // 10 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_DynamicAny_INCLUDED 18 | #define Foundation_DynamicAny_INCLUDED 19 | 20 | //@ deprecated 21 | #include "Poco/Dynamic/Var.h" 22 | 23 | 24 | #endif // Foundation_DynamicAny_INCLUDED 25 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/SynchronizedObject.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SynchronizedObject.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: SynchronizedObject 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/SynchronizedObject.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | SynchronizedObject::SynchronizedObject() 22 | { 23 | } 24 | 25 | 26 | SynchronizedObject::~SynchronizedObject() 27 | { 28 | } 29 | 30 | 31 | } // namespace Poco 32 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/ServerSocketImpl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ServerSocketImpl.cpp 3 | // 4 | // Library: Net 5 | // Package: Sockets 6 | // Module: ServerSocketImpl 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/ServerSocketImpl.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | ServerSocketImpl::ServerSocketImpl() 23 | { 24 | } 25 | 26 | 27 | ServerSocketImpl::~ServerSocketImpl() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPServerRequest.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPServerRequest.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTPServer 6 | // Module: HTTPServerRequest 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPServerRequest.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | HTTPServerRequest::HTTPServerRequest() 23 | { 24 | } 25 | 26 | 27 | HTTPServerRequest::~HTTPServerRequest() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/DynamicStruct.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicStruct.h 3 | // 4 | // Library: Foundation 5 | // Package: Dynamic 6 | // Module: Struct 7 | // 8 | // Forward header for Struct class to maintain backward compatibility. 9 | // 10 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_DynamicStruct_INCLUDED 18 | #define Foundation_DynamicStruct_INCLUDED 19 | 20 | //@ deprecated 21 | #include "Poco/Dynamic/Struct.h" 22 | 23 | 24 | #endif // Foundation_DynamicStruct_INCLUDED 25 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Void.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Void.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: Void 7 | // 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Void.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | Void::Void() 22 | { 23 | } 24 | 25 | 26 | Void::Void(const Void&) 27 | { 28 | } 29 | 30 | 31 | Void::~Void() 32 | { 33 | } 34 | 35 | 36 | Void& Void::operator = (const Void&) 37 | { 38 | return *this; 39 | } 40 | 41 | 42 | } // namespace Poco 43 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPRequestHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPRequestHandler.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTPServer 6 | // Module: HTTPRequestHandler 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPRequestHandler.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | HTTPRequestHandler::HTTPRequestHandler() 23 | { 24 | } 25 | 26 | 27 | HTTPRequestHandler::~HTTPRequestHandler() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPServerResponse.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPServerResponse.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTPServer 6 | // Module: HTTPServerResponse 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPServerResponse.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | HTTPServerResponse::HTTPServerResponse() 23 | { 24 | } 25 | 26 | 27 | HTTPServerResponse::~HTTPServerResponse() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/BufferedStreamBuf.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // BufferedStreamBuf.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: StreamBuf 7 | // 8 | // Copyright (c) 2025, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/BufferedStreamBuf.h" 16 | 17 | namespace Poco { 18 | 19 | #if defined(POCO_OS_FAMILY_WINDOWS) 20 | template class Foundation_API BasicBufferedStreamBuf>; 21 | #else 22 | template class BasicBufferedStreamBuf>; 23 | #endif 24 | 25 | } 26 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/DynamicAnyHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DynamicAnyHolder.h 3 | // 4 | // Library: Foundation 5 | // Package: Dynamic 6 | // Module: VarHolder 7 | // 8 | // Forward header for VarHolder class to maintain backward compatibility 9 | // 10 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_DynamicAnyHolder_INCLUDED 18 | #define Foundation_DynamicAnyHolder_INCLUDED 19 | 20 | //@ deprecated 21 | #include "Poco/Dynamic/VarHolder.h" 22 | 23 | 24 | #endif // Foundation_DynamicAnyHolder_INCLUDED 25 | -------------------------------------------------------------------------------- /contrib/poco/Crypto/src/KeyPairImpl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KeyPairImpl.cpp 3 | // 4 | // 5 | // Library: Crypto 6 | // Package: CryptoCore 7 | // Module: KeyPairImpl 8 | // 9 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. 10 | // and Contributors. 11 | // 12 | // SPDX-License-Identifier: BSL-1.0 13 | // 14 | 15 | 16 | #include "Poco/Crypto/KeyPairImpl.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Crypto { 21 | 22 | 23 | KeyPairImpl::KeyPairImpl(const std::string& name, Type type): 24 | _name(name), 25 | _type(type) 26 | { 27 | } 28 | 29 | 30 | KeyPairImpl::~KeyPairImpl() 31 | { 32 | } 33 | 34 | 35 | } } // namespace Poco::Crypto 36 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/EventChannel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // EventChannel.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: EventChannel 7 | // 8 | // Copyright (c) 2015, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/EventChannel.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | EventChannel::EventChannel() 22 | { 23 | } 24 | 25 | 26 | EventChannel::~EventChannel() 27 | { 28 | } 29 | 30 | 31 | void EventChannel::log(const Message& msg) 32 | { 33 | messageLogged(this, msg); 34 | } 35 | 36 | 37 | } // namespace Poco 38 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/UnbufferedStreamBuf.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // UnbufferedStreamBuf.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: StreamBuf 7 | // 8 | // Copyright (c) 2025, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/UnbufferedStreamBuf.h" 16 | 17 | namespace Poco { 18 | 19 | #if defined(POCO_OS_FAMILY_WINDOWS) 20 | template class Foundation_API BasicUnbufferedStreamBuf>; 21 | #else 22 | template class BasicUnbufferedStreamBuf>; 23 | #endif 24 | 25 | } 26 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPRequestHandlerFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPRequestHandlerFactory.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTPServer 6 | // Module: HTTPRequestHandlerFactory 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPRequestHandlerFactory.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | HTTPRequestHandlerFactory::HTTPRequestHandlerFactory() 23 | { 24 | } 25 | 26 | 27 | HTTPRequestHandlerFactory::~HTTPRequestHandlerFactory() 28 | { 29 | } 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Util/src/TimerTask.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // TimerTask.cpp 3 | // 4 | // Library: Util 5 | // Package: Timer 6 | // Module: TimerTask 7 | // 8 | // Copyright (c) 2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Util/TimerTask.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Util { 20 | 21 | 22 | TimerTask::TimerTask(): 23 | _lastExecution(0), 24 | _isCancelled(false) 25 | { 26 | } 27 | 28 | 29 | TimerTask::~TimerTask() 30 | { 31 | } 32 | 33 | 34 | void TimerTask::cancel() 35 | { 36 | _isCancelled = true; 37 | } 38 | 39 | 40 | } } // namespace Poco::Util 41 | -------------------------------------------------------------------------------- /ubsan_ignorelist.txt: -------------------------------------------------------------------------------- 1 | # Note, this file is ignorelist file [1] not suppressions [2]. 2 | # 3 | # [1]: https://clang.llvm.org/docs/SanitizerSpecialCaseList.html 4 | # [2]: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#runtime-suppressions 5 | # 6 | # See also [3] for all UBSan checks. 7 | # 8 | # [3]: https://github.com/llvm-mirror/compiler-rt/blob/master/lib/ubsan/ubsan_checks.inc 9 | # 10 | # Caveats for generic entry "fun": 11 | # - does not work for __attribute__((__always_inline__)) 12 | # - and may not work for functions that had been inlined 13 | # - requires asterisk at the beginning *and* end for static functions 14 | # 15 | [undefined] 16 | src:*/contrib/* 17 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Hash.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Hash.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Hashing 6 | // Module: Hash 7 | // 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Hash.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | std::size_t hash(const std::string& str) 22 | { 23 | std::size_t h = 0; 24 | std::string::const_iterator it = str.begin(); 25 | std::string::const_iterator end = str.end(); 26 | while (it != end) 27 | { 28 | h = h * 0xf4243 ^ *it++; 29 | } 30 | return h; 31 | } 32 | 33 | 34 | } // namespace Poco 35 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/RWLock_POSIX.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RWLock_POSIX.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: RWLock 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/RWLock_POSIX.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | RWLockImpl::RWLockImpl() 22 | { 23 | if (pthread_rwlock_init(&_rwl, NULL)) 24 | throw SystemException("cannot create reader/writer lock"); 25 | } 26 | 27 | 28 | RWLockImpl::~RWLockImpl() 29 | { 30 | pthread_rwlock_destroy(&_rwl); 31 | } 32 | 33 | 34 | } // namespace Poco 35 | -------------------------------------------------------------------------------- /contrib/poco/Crypto/src/CryptoTransform.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CryptoTransform.cpp 3 | // 4 | // Library: Crypto 5 | // Package: Cipher 6 | // Module: CryptoTransform 7 | // 8 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Crypto/CryptoTransform.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Crypto { 20 | 21 | 22 | CryptoTransform::CryptoTransform() 23 | { 24 | } 25 | 26 | 27 | CryptoTransform::~CryptoTransform() 28 | { 29 | } 30 | 31 | 32 | int CryptoTransform::setPadding(int padding) 33 | { 34 | return 1; 35 | } 36 | 37 | 38 | } } // namespace Poco::Crypto 39 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_s390x/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_x86_64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/BufferedBidirectionalStreamBuf.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // BufferedBidirectionalStreamBuf.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: StreamBuf 7 | // 8 | // Copyright (c) 2025, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/BufferedBidirectionalStreamBuf.h" 16 | 17 | namespace Poco { 18 | 19 | #if defined(POCO_OS_FAMILY_WINDOWS) 20 | template class Foundation_API BasicBufferedBidirectionalStreamBuf>; 21 | #else 22 | template class BasicBufferedBidirectionalStreamBuf>; 23 | #endif 24 | 25 | } 26 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/TCPServerConnectionFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // TCPServerConnectionFactory.cpp 3 | // 4 | // Library: Net 5 | // Package: TCPServer 6 | // Module: TCPServerConnectionFactory 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/TCPServerConnectionFactory.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | TCPServerConnectionFactory::TCPServerConnectionFactory(): 23 | _stopped(false) 24 | { 25 | } 26 | 27 | 28 | TCPServerConnectionFactory::~TCPServerConnectionFactory() 29 | { 30 | } 31 | 32 | 33 | } } // namespace Poco::Net 34 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Sources 2 | file(GLOB SRCS_G "src/*.cpp") 3 | POCO_SOURCES_AUTO(SRCS ${SRCS_G}) 4 | 5 | # Headers 6 | file(GLOB_RECURSE HDRS_G "include/*.h") 7 | POCO_HEADERS_AUTO(SRCS ${HDRS_G}) 8 | 9 | add_library(NetSSL ${SRCS}) 10 | set_target_properties(NetSSL PROPERTIES CXX_STANDARD 17) 11 | add_library(Poco::NetSSL ALIAS NetSSL) 12 | 13 | target_link_libraries(NetSSL PUBLIC Poco::Crypto Poco::Util Poco::Net) 14 | target_include_directories(NetSSL 15 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include 16 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src 17 | ) 18 | 19 | if(MSVC AND OPENSSL_USE_STATIC_LIBS) 20 | target_link_libraries(NetSSL PUBLIC ws2_32.lib Crypt32.lib) 21 | endif() 22 | 23 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_aarch64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".dylib" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_x86_64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".dylib" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_aarch64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_loongarch64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_ppc64le/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_riscv64/include/crypto/dso_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/dso_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_DSO_CONF_H 13 | # define OSSL_CRYPTO_DSO_CONF_H 14 | # pragma once 15 | 16 | # define DSO_DLFCN 17 | # define HAVE_DLFCN_H 18 | # define DSO_EXTENSION ".so" 19 | #endif 20 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/NullChannel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NullChannel.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: NullChannel 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/NullChannel.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | NullChannel::NullChannel() 22 | { 23 | } 24 | 25 | 26 | NullChannel::~NullChannel() 27 | { 28 | } 29 | 30 | 31 | void NullChannel::log(const Message&) 32 | { 33 | } 34 | 35 | 36 | void NullChannel::setProperty(const std::string&, const std::string&) 37 | { 38 | } 39 | 40 | 41 | } // namespace Poco 42 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/VarVisitor.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // VarVisitor.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Dynamic 6 | // Module: VarVisitor 7 | // 8 | // 9 | // Copyright (c) 2023, Applied Informatics Software Engineering GmbH. 10 | // and Contributors. 11 | // 12 | // SPDX-License-Identifier: BSL-1.0 13 | // 14 | 15 | #include "Poco/Dynamic/VarVisitor.h" 16 | 17 | namespace Poco { 18 | namespace Dynamic { 19 | 20 | bool Visitor::visit(const Var &x) const 21 | { 22 | bool wasHandled = false; 23 | auto it = _handlers.find(x.type()); 24 | if (it != _handlers.end()) 25 | { 26 | it->second(x); 27 | wasHandled = true; 28 | } 29 | return wasHandled; 30 | } 31 | 32 | } } // namespace Poco::Dynamic 33 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/Session.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Session.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: Session 7 | // 8 | // Copyright (c) 2010-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #if defined(__APPLE__) 16 | // Some OpenSSL functions are deprecated in OS X 10.7 17 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 18 | #endif 19 | 20 | 21 | #include "Poco/Net/Session.h" 22 | 23 | 24 | namespace Poco { 25 | namespace Net { 26 | 27 | 28 | Session::Session() 29 | { 30 | } 31 | 32 | 33 | Session::~Session() 34 | { 35 | } 36 | 37 | 38 | } } // namespace Poco::Net 39 | -------------------------------------------------------------------------------- /contrib/poco/Util/src/OptionCallback.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // OptionCallback.cpp 3 | // 4 | // Library: Util 5 | // Package: Options 6 | // Module: OptionCallback 7 | // 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Util/OptionCallback.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Util { 20 | 21 | 22 | AbstractOptionCallback::AbstractOptionCallback() 23 | { 24 | } 25 | 26 | 27 | AbstractOptionCallback::AbstractOptionCallback(const AbstractOptionCallback&) 28 | { 29 | } 30 | 31 | 32 | AbstractOptionCallback::~AbstractOptionCallback() 33 | { 34 | } 35 | 36 | 37 | } } // namespace Poco::Util 38 | -------------------------------------------------------------------------------- /driver/platform/win/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/platform/platform.h" 2 | 3 | /// Saved module handle. 4 | HINSTANCE module_instance = 0; 5 | 6 | extern "C" { 7 | 8 | BOOL WINAPI EXPORTED_FUNCTION(DllMain)(HANDLE hInst, ULONG ul_reason_for_call, LPVOID) { 9 | switch (ul_reason_for_call) { 10 | case DLL_PROCESS_ATTACH: 11 | module_instance = (HINSTANCE)hInst; /* Save for dialog boxes */ 12 | break; 13 | 14 | case DLL_THREAD_ATTACH: 15 | break; 16 | 17 | case DLL_PROCESS_DETACH: 18 | break; 19 | 20 | case DLL_THREAD_DETACH: 21 | break; 22 | 23 | default: 24 | break; 25 | } 26 | 27 | return TRUE; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /contrib/poco/Util/src/Subsystem.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Subsystem.cpp 3 | // 4 | // Library: Util 5 | // Package: Application 6 | // Module: Subsystem 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Util/Subsystem.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Util { 20 | 21 | 22 | Subsystem::Subsystem() 23 | { 24 | } 25 | 26 | 27 | Subsystem::~Subsystem() 28 | { 29 | } 30 | 31 | 32 | void Subsystem::reinitialize(Application& app) 33 | { 34 | uninitialize(); 35 | initialize(app); 36 | } 37 | 38 | 39 | void Subsystem::defineOptions(OptionSet& options) 40 | { 41 | } 42 | 43 | 44 | } } // namespace Poco::Util 45 | -------------------------------------------------------------------------------- /packaging/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | # Uncomment this to turn on verbose mode. 5 | #export DH_VERBOSE=1 6 | 7 | export DEB_BUILD_MAINT_OPTIONS=hardening=+all 8 | 9 | ifndef DH_VERBOSE 10 | CMAKE_FLAGS += -DCMAKE_VERBOSE_MAKEFILE=0 11 | endif 12 | 13 | # libssl.a without PIC, will use .so 14 | CMAKE_FLAGS += -DOPENSSL_USE_SHARED_LIBS=1 15 | 16 | %: 17 | dh $@ --parallel --buildsystem=cmake 18 | 19 | override_dh_auto_configure: 20 | dh_auto_configure -- $(CMAKE_FLAGS) 21 | 22 | override_dh_install: 23 | dh_install 24 | rm -rf debian/clickhouse-odbc/usr/include debian/clickhouse-odbc/usr/lib/cmake debian/clickhouse-odbc/usr/lib/libPoco*.a 25 | # anything except odbc dir: 26 | rm -f debian/clickhouse-odbc/usr/lib/*/* || true 27 | -------------------------------------------------------------------------------- /packaging/odbcinst.ini.sample: -------------------------------------------------------------------------------- 1 | # Insert the content of this file into ~/.odbcinst.ini or /etc/odbcinst.ini files, 2 | # and fix the absolute paths to libclickhouseodbc.so and libclickhouseodbcw.so files. 3 | 4 | [ODBC Drivers] 5 | ClickHouse ODBC Driver (ANSI) = Installed 6 | ClickHouse ODBC Driver (Unicode) = Installed 7 | 8 | [ClickHouse ODBC Driver (ANSI)] 9 | Description = ODBC Driver (ANSI) for ClickHouse 10 | Driver = /usr/local/lib64/libclickhouseodbc.so 11 | Setup = /usr/local/lib64/libclickhouseodbc.so 12 | UsageCount = 1 13 | 14 | [ClickHouse ODBC Driver (Unicode)] 15 | Description = ODBC Driver (Unicode) for ClickHouse 16 | Driver = /usr/local/lib64/libclickhouseodbcw.so 17 | Setup = /usr/local/lib64/libclickhouseodbcw.so 18 | UsageCount = 1 19 | -------------------------------------------------------------------------------- /contrib/double-conversion-cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(LIBRARY_DIR "${CMAKE_SOURCE_DIR}/contrib/double-conversion") 2 | 3 | add_library(_double-conversion 4 | "${LIBRARY_DIR}/double-conversion/bignum-dtoa.cc" 5 | "${LIBRARY_DIR}/double-conversion/bignum.cc" 6 | "${LIBRARY_DIR}/double-conversion/cached-powers.cc" 7 | "${LIBRARY_DIR}/double-conversion/double-to-string.cc" 8 | "${LIBRARY_DIR}/double-conversion/fast-dtoa.cc" 9 | "${LIBRARY_DIR}/double-conversion/fixed-dtoa.cc" 10 | "${LIBRARY_DIR}/double-conversion/string-to-double.cc" 11 | "${LIBRARY_DIR}/double-conversion/strtod.cc" 12 | ) 13 | 14 | target_include_directories(_double-conversion SYSTEM BEFORE PUBLIC "${LIBRARY_DIR}") 15 | 16 | add_library(ch_contrib::double_conversion ALIAS _double-conversion) 17 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/PipeImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: PipeImpl 7 | // 8 | // Definition of the PipeImpl class. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_PipeImpl_INCLUDED 18 | #define Foundation_PipeImpl_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | #if defined(POCO_OS_FAMILY_WINDOWS) 25 | #include "Poco/PipeImpl_WIN32.h" 26 | #elif defined(POCO_OS_FAMILY_UNIX) 27 | #include "Poco/PipeImpl_POSIX.h" 28 | #else 29 | #include "Poco/PipeImpl_DUMMY.h" 30 | #endif 31 | 32 | 33 | #endif // Foundation_PipeImpl_INCLUDED 34 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/RWLock.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RWLock.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: RWLock 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/RWLock.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "RWLock_WIN32.cpp" 20 | #elif POCO_OS == POCO_OS_ANDROID 21 | #include "RWLock_Android.cpp" 22 | #elif defined(POCO_VXWORKS) 23 | #include "RWLock_VX.cpp" 24 | #else 25 | #include "RWLock_POSIX.cpp" 26 | #endif 27 | 28 | 29 | namespace Poco { 30 | 31 | 32 | RWLock::RWLock() 33 | { 34 | } 35 | 36 | 37 | RWLock::~RWLock() 38 | { 39 | } 40 | 41 | 42 | } // namespace Poco 43 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/SharedMemory_DUMMY.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SharedMemoryImpl.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: SharedMemoryImpl 7 | // 8 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/SharedMemory_DUMMY.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | SharedMemoryImpl::SharedMemoryImpl(const std::string&, std::size_t, SharedMemory::AccessMode, const void*, bool) 22 | { 23 | } 24 | 25 | 26 | SharedMemoryImpl::SharedMemoryImpl(const Poco::File&, SharedMemory::AccessMode, const void*) 27 | { 28 | } 29 | 30 | 31 | SharedMemoryImpl::~SharedMemoryImpl() 32 | { 33 | } 34 | 35 | 36 | } // namespace Poco 37 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/StreamChannel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // StreamChannel.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: StreamChannel 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/StreamChannel.h" 16 | #include "Poco/Message.h" 17 | 18 | 19 | namespace Poco { 20 | 21 | 22 | StreamChannel::StreamChannel(std::ostream& str): _str(str) 23 | { 24 | } 25 | 26 | 27 | StreamChannel::~StreamChannel() 28 | { 29 | } 30 | 31 | 32 | void StreamChannel::log(const Message& msg) 33 | { 34 | FastMutex::ScopedLock lock(_mutex); 35 | 36 | _str << msg.getText() << std::endl; 37 | } 38 | 39 | 40 | } // namespace Poco 41 | -------------------------------------------------------------------------------- /packaging/clickhouse-odbc.tdc.sample: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/docker-compose.yml: -------------------------------------------------------------------------------- 1 | services: 2 | clickhouse: 3 | image: 'docker.io/clickhouse/clickhouse-server:${CLICKHOUSE_VERSION-25.3-alpine}' 4 | container_name: 'clickhouse-odbc-clickhouse-server' 5 | environment: 6 | CLICKHOUSE_SKIP_USER_SETUP: 1 7 | ports: 8 | - '8123:8123' 9 | - '9000:9000' 10 | ulimits: 11 | nofile: 12 | soft: 262144 13 | hard: 262144 14 | volumes: 15 | - './docker-compose/config.xml:/etc/clickhouse-server/config.xml:z' 16 | - './docker-compose/users.xml:/etc/clickhouse-server/users.xml:z' 17 | networks: 18 | - clickhouse-odbc 19 | 20 | networks: 21 | clickhouse-odbc: 22 | driver: bridge 23 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Notification.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Notification.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Notifications 6 | // Module: Notification 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Notification.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | 21 | 22 | Notification::Notification(const std::string& name): 23 | _pName(name.empty() ? nullptr : new std::string(name)) 24 | { 25 | } 26 | 27 | 28 | Notification::~Notification() 29 | { 30 | } 31 | 32 | 33 | std::string Notification::name() const 34 | { 35 | return _pName ? *_pName : typeid(*this).name(); 36 | } 37 | 38 | 39 | } // namespace Poco 40 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Event.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Event.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Event 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Event.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "Event_WIN32.cpp" 20 | #elif defined(POCO_VXWORKS) 21 | #include "Event_VX.cpp" 22 | #else 23 | #include "Event_POSIX.cpp" 24 | #endif 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | Event::Event(EventType type) : EventImpl(type == EVENT_AUTORESET) 31 | { 32 | } 33 | 34 | 35 | Event::Event(bool autoReset): EventImpl(autoReset) 36 | { 37 | } 38 | 39 | 40 | Event::~Event() = default; 41 | 42 | 43 | } // namespace Poco 44 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/ThreadTarget.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ThreadTarget.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: ThreadTarget 7 | // 8 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/ThreadTarget.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | ThreadTarget::ThreadTarget(Callback method): _method(method) 22 | { 23 | } 24 | 25 | 26 | ThreadTarget::ThreadTarget(const ThreadTarget& te): _method(te._method) 27 | { 28 | } 29 | 30 | 31 | ThreadTarget& ThreadTarget::operator = (const ThreadTarget& te) 32 | { 33 | _method = te._method; 34 | return *this; 35 | } 36 | 37 | 38 | ThreadTarget::~ThreadTarget() 39 | { 40 | } 41 | 42 | 43 | } // namespace Poco 44 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/AbstractObserver.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AbstractObserver.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Notifications 6 | // Module: NotificationCenter 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/AbstractObserver.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | AbstractObserver::AbstractObserver() 22 | { 23 | } 24 | 25 | 26 | AbstractObserver::AbstractObserver(const AbstractObserver& /*observer*/) 27 | { 28 | } 29 | 30 | 31 | AbstractObserver::~AbstractObserver() 32 | { 33 | } 34 | 35 | 36 | AbstractObserver& AbstractObserver::operator = (const AbstractObserver& /*observer*/) 37 | { 38 | return *this; 39 | } 40 | 41 | 42 | } // namespace Poco 43 | -------------------------------------------------------------------------------- /cmake/darwin/default_libs.cmake: -------------------------------------------------------------------------------- 1 | #set (DEFAULT_LIBS "-nodefaultlibs") 2 | 3 | set (DEFAULT_LIBS "${DEFAULT_LIBS} ${COVERAGE_OPTION} -lc -lm -lpthread -ldl") 4 | 5 | message(STATUS "Default libraries: ${DEFAULT_LIBS}") 6 | 7 | set(CMAKE_CXX_STANDARD_LIBRARIES ${DEFAULT_LIBS}) 8 | set(CMAKE_C_STANDARD_LIBRARIES ${DEFAULT_LIBS}) 9 | 10 | # Minimal supported SDK version 11 | set(CMAKE_OSX_DEPLOYMENT_TARGET 13.3) 12 | 13 | # Unfortunately '-pthread' doesn't work with '-nodefaultlibs'. 14 | # Just make sure we have pthreads at all. 15 | set(THREADS_PREFER_PTHREAD_FLAG ON) 16 | find_package(Threads REQUIRED) 17 | 18 | #include (cmake/unwind.cmake) 19 | #include (cmake/cxx.cmake) 20 | #link_libraries(global-group) 21 | # 22 | #target_link_libraries(global-group INTERFACE 23 | # $ 24 | #) 25 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/FileStreamRWLock_POSIX.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FileStreamRWLock_POSIX.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: FileStreamRWLock 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/FileStreamRWLock_POSIX.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | FileStreamRWLockImpl::FileStreamRWLockImpl(const FileStream::NativeHandle &fd, Poco::UInt64 offset, Poco::UInt64 size): 22 | _fd(fd), _lockMode(0) 23 | { 24 | _flock.l_whence = SEEK_SET; 25 | _flock.l_start = offset; 26 | _flock.l_len = size; 27 | _flock.l_pid = 0; 28 | } 29 | 30 | 31 | FileStreamRWLockImpl::~FileStreamRWLockImpl() 32 | { 33 | } 34 | 35 | 36 | } // namespace Poco 37 | -------------------------------------------------------------------------------- /test/src/util/env.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | LOGGER = logging.getLogger(__name__) 5 | DEFAULT_DSN = "ClickHouse DSN (ANSI)" 6 | 7 | 8 | def read_dsn_from_env(): 9 | env_dsn = os.getenv("DSN") 10 | if env_dsn is None: 11 | LOGGER.info(f"Setting DSN to default value: {DEFAULT_DSN}") 12 | return DEFAULT_DSN 13 | return env_dsn 14 | 15 | 16 | DSN = read_dsn_from_env() 17 | CLICKHOUSE_LOG_PATH = os.getenv("CLICKHOUSE_LOG", "/var/log/clickhouse-server/clickhouse-server.log") 18 | ODBC_DRIVER_TRACE_LOG_PATH = os.getenv("ODBC_DRIVER_TRACE_LOG", "/tmp/clickhouse-odbc-driver-trace.log") 19 | ODBC_DRIVER_W_TRACE_LOG_PATH = os.getenv("ODBC_DRIVER_W_TRACE_LOG", "/tmp/clickhouse-odbc-driver-w-trace.log") 20 | ODBC_MANAGER_TRACE_LOG_PATH = os.getenv("ODBC_MANAGER_TRACE_LOG", "/tmp/odbc-driver-manager-trace.log") 21 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/NamedEvent.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedEvent 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/NamedEvent.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "NamedEvent_WIN32U.cpp" 20 | #elif POCO_OS == POCO_OS_ANDROID 21 | #include "NamedEvent_Android.cpp" 22 | #elif defined(POCO_OS_FAMILY_UNIX) 23 | #include "NamedEvent_UNIX.cpp" 24 | #endif 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | NamedEvent::NamedEvent(const std::string& name): 31 | NamedEventImpl(name) 32 | { 33 | } 34 | 35 | 36 | NamedEvent::~NamedEvent() 37 | { 38 | } 39 | 40 | 41 | } // namespace Poco 42 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/NamedMutex.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedMutex 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/NamedMutex.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "NamedMutex_WIN32U.cpp" 20 | #elif POCO_OS == POCO_OS_ANDROID 21 | #include "NamedMutex_Android.cpp" 22 | #elif defined(POCO_OS_FAMILY_UNIX) 23 | #include "NamedMutex_UNIX.cpp" 24 | #endif 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | NamedMutex::NamedMutex(const std::string& name): 31 | NamedMutexImpl(name) 32 | { 33 | } 34 | 35 | 36 | NamedMutex::~NamedMutex() 37 | { 38 | } 39 | 40 | 41 | } // namespace Poco 42 | -------------------------------------------------------------------------------- /contrib/poco/Util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Sources 2 | file(GLOB SRCS_G "src/*.cpp") 3 | POCO_SOURCES_AUTO(SRCS ${SRCS_G}) 4 | 5 | # Headers 6 | file(GLOB_RECURSE HDRS_G "include/*.h") 7 | POCO_HEADERS_AUTO(SRCS ${HDRS_G}) 8 | 9 | POCO_SOURCES_AUTO_PLAT(SRCS WIN32 10 | src/WinRegistryConfiguration.cpp 11 | src/WinRegistryKey.cpp 12 | src/WinService.cpp 13 | ) 14 | 15 | add_library(Util ${SRCS}) 16 | set_target_properties(Util PROPERTIES CXX_STANDARD 17) 17 | add_library(Poco::Util ALIAS Util) 18 | 19 | target_link_libraries(Util PUBLIC Poco::Foundation) 20 | target_compile_definitions(Util PUBLIC POCO_UTIL_NO_XMLCONFIGURATION) 21 | target_compile_definitions(Util PUBLIC POCO_UTIL_NO_JSONCONFIGURATION) 22 | 23 | target_include_directories(Util 24 | PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include 25 | PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src 26 | ) 27 | 28 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Timezone.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Timezone.cpp 3 | // 4 | // Library: Foundation 5 | // Package: DateTime 6 | // Module: Timezone 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) 16 | #define _CRT_SECURE_NO_WARNINGS 17 | #endif 18 | 19 | 20 | #include "Poco/Timezone.h" 21 | #include 22 | 23 | 24 | #if defined(POCO_OS_FAMILY_WINDOWS) 25 | #include "Timezone_WIN32.cpp" 26 | #elif defined(POCO_VXWORKS) 27 | #include "Timezone_VX.cpp" 28 | #else 29 | #include "Timezone_UNIX.cpp" 30 | #endif 31 | 32 | 33 | namespace Poco { 34 | 35 | 36 | int Timezone::tzd() 37 | { 38 | return utcOffset() + dst(); 39 | } 40 | 41 | 42 | } // namespace Poco 43 | -------------------------------------------------------------------------------- /test/docker-compose/users.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | random 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ::/0 15 | 16 | default 17 | default 18 | 1 19 | 20 | 21 | 22 | 23 | 24 | 25 | 3600 26 | 0 27 | 0 28 | 0 29 | 0 30 | 0 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | ### Describe the bug 12 | 13 | ### Steps to reproduce 14 | 1. 15 | 2. 16 | 3. 17 | 18 | ### Expected behaviour 19 | 20 | ### Code example 21 | 22 | ### Error log 23 | 24 | ### Query log 25 | 26 | ### Configuration 27 | #### Environment 28 | * Driver version: 29 | * OS: 30 | * ODBC Driver manager: 31 | 32 | #### ClickHouse server 33 | * ClickHouse Server version: 34 | * ClickHouse Server non-default settings, if any: 35 | * `CREATE TABLE` statements for tables involved: 36 | * Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary 37 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Semaphore.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Semaphore.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Semaphore 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Semaphore.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "Semaphore_WIN32.cpp" 20 | #elif defined(POCO_VXWORKS) 21 | #include "Semaphore_VX.cpp" 22 | #else 23 | #include "Semaphore_POSIX.cpp" 24 | #endif 25 | 26 | 27 | namespace Poco { 28 | 29 | 30 | Semaphore::Semaphore(int n): SemaphoreImpl(n, n) 31 | { 32 | } 33 | 34 | 35 | Semaphore::Semaphore(int n, int max): SemaphoreImpl(n, max) 36 | { 37 | } 38 | 39 | 40 | Semaphore::~Semaphore() 41 | { 42 | } 43 | 44 | 45 | } // namespace Poco 46 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Formatter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Formatter.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: Formatter 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Formatter.h" 16 | #include "Poco/Exception.h" 17 | 18 | 19 | namespace Poco { 20 | 21 | 22 | Formatter::Formatter() 23 | { 24 | } 25 | 26 | 27 | Formatter::~Formatter() 28 | { 29 | } 30 | 31 | 32 | void Formatter::setProperty(const std::string& /*name*/, const std::string& /*value*/) 33 | { 34 | throw PropertyNotSupportedException(); 35 | } 36 | 37 | 38 | std::string Formatter::getProperty(const std::string& /*name*/) const 39 | { 40 | throw PropertyNotSupportedException(); 41 | } 42 | 43 | 44 | } // namespace Poco 45 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/Session.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Session.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: Session 7 | // 8 | // Copyright (c) 2010, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/Session.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | Session::Session(SSL_SESSION* pSession): 24 | _pSession(pSession) 25 | { 26 | } 27 | 28 | 29 | Session::~Session() 30 | { 31 | SSL_SESSION_free(_pSession); 32 | } 33 | 34 | 35 | bool Session::isResumable() const 36 | { 37 | #if OPENSSL_VERSION_NUMBER >= 0x10101000L 38 | return SSL_SESSION_is_resumable(_pSession) == 1; 39 | #else 40 | return false; 41 | #endif 42 | } 43 | 44 | 45 | } } // namespace Poco::Net 46 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/VerificationErrorArgs.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // VerificationErrorArgs.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: VerificationErrorArgs 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/VerificationErrorArgs.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | VerificationErrorArgs::VerificationErrorArgs(const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg): 23 | _cert(cert), 24 | _errorDepth(errDepth), 25 | _errorNumber(errNum), 26 | _errorMessage(errMsg), 27 | _ignoreError(false) 28 | { 29 | } 30 | 31 | 32 | VerificationErrorArgs::~VerificationErrorArgs() 33 | { 34 | } 35 | 36 | 37 | } } // namespace Poco::Net 38 | -------------------------------------------------------------------------------- /cmake/extract_flags.cmake: -------------------------------------------------------------------------------- 1 | macro (extract_flags 2 | _mixed_flags_val 3 | _defines_name 4 | _include_dirs_name 5 | _compiler_flags_name 6 | _linker_flags_name 7 | ) 8 | string (REPLACE " " ";" _mixed_flags "${_mixed_flags_val}") 9 | 10 | foreach (_flag ${_mixed_flags}) 11 | if ("${_flag}" MATCHES "^-D(.*)$") 12 | list (APPEND ${_defines_name} "${CMAKE_MATCH_1}") 13 | elseif ("${_flag}" MATCHES "^-I(.*)$") 14 | list (APPEND ${_include_dirs_name} "${CMAKE_MATCH_1}") 15 | elseif ("${_flag}" MATCHES "^-L(.*)$" OR "${_flag}" MATCHES "^-l(.*)$") 16 | list (APPEND ${_linker_flags_name} "${_flag}") 17 | else () 18 | list (APPEND ${_compiler_flags_name} "${_flag}") 19 | endif () 20 | endforeach () 21 | 22 | unset (_flag) 23 | unset (_mixed_flags) 24 | endmacro () 25 | -------------------------------------------------------------------------------- /contrib/lz4-cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # lz4 is the main compression method, cannot be disabled. 2 | 3 | set (LIBRARY_DIR "${CMAKE_SOURCE_DIR}/contrib/lz4") 4 | set (SRCS 5 | "${LIBRARY_DIR}/lib/lz4.c" 6 | "${LIBRARY_DIR}/lib/lz4hc.c" 7 | "${LIBRARY_DIR}/lib/lz4frame.c" 8 | "${LIBRARY_DIR}/lib/xxhash.c" 9 | ) 10 | 11 | add_library (_lz4 ${SRCS}) 12 | add_library (ch_contrib::lz4 ALIAS _lz4) 13 | 14 | target_compile_definitions (_lz4 PUBLIC LZ4_DISABLE_DEPRECATE_WARNINGS=1) 15 | target_compile_definitions (_lz4 PUBLIC LZ4_FAST_DEC_LOOP=1) 16 | 17 | if(ARCH_S390X) 18 | target_compile_definitions(_lz4 PRIVATE LZ4_STATIC_LINKING_ONLY_ENDIANNESS_INDEPENDENT_OUTPUT) 19 | endif() 20 | 21 | if (SANITIZE STREQUAL "undefined") 22 | target_compile_options (_lz4 PRIVATE -fno-sanitize=undefined) 23 | endif () 24 | target_include_directories(_lz4 PUBLIC "${LIBRARY_DIR}/lib") 25 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/InvalidCertificateHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // InvalidCertificateHandler.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: InvalidCertificateHandler 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/InvalidCertificateHandler.h" 16 | #include "Poco/Net/SSLManager.h" 17 | #include "Poco/Delegate.h" 18 | 19 | 20 | using Poco::Delegate; 21 | 22 | 23 | namespace Poco { 24 | namespace Net { 25 | 26 | 27 | InvalidCertificateHandler::InvalidCertificateHandler(bool handleErrorsOnServerSide): _handleErrorsOnServerSide(handleErrorsOnServerSide) 28 | { 29 | } 30 | 31 | 32 | InvalidCertificateHandler::~InvalidCertificateHandler() 33 | { 34 | } 35 | 36 | 37 | } } // namespace Poco::Net 38 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/AcceptCertificateHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AcceptCertificateHandler.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: AcceptCertificateHandler 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/AcceptCertificateHandler.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | AcceptCertificateHandler::AcceptCertificateHandler(bool server): InvalidCertificateHandler(server) 23 | { 24 | } 25 | 26 | 27 | AcceptCertificateHandler::~AcceptCertificateHandler() 28 | { 29 | } 30 | 31 | 32 | void AcceptCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) 33 | { 34 | errorCert.setIgnoreError(true); 35 | } 36 | 37 | 38 | } } // namespace Poco::Net 39 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/RejectCertificateHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RejectCertificateHandler.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: RejectCertificateHandler 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/RejectCertificateHandler.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | RejectCertificateHandler::RejectCertificateHandler(bool server): InvalidCertificateHandler(server) 23 | { 24 | } 25 | 26 | 27 | RejectCertificateHandler::~RejectCertificateHandler() 28 | { 29 | } 30 | 31 | 32 | void RejectCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) 33 | { 34 | errorCert.setIgnoreError(false); 35 | } 36 | 37 | 38 | } } // namespace Poco::Net 39 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/NamedEvent_Android.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_Android.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedEvent 7 | // 8 | // Definition of the NamedEventImpl class for Android. 9 | // 10 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_NamedEvent_Android_INCLUDED 18 | #define Foundation_NamedEvent_Android_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | namespace Poco { 25 | 26 | 27 | class Foundation_API NamedEventImpl 28 | { 29 | protected: 30 | NamedEventImpl(const std::string& name); 31 | ~NamedEventImpl(); 32 | void setImpl(); 33 | void waitImpl(); 34 | }; 35 | 36 | 37 | } // namespace Poco 38 | 39 | 40 | #endif // Foundation_NamedEvent_Android_INCLUDED 41 | -------------------------------------------------------------------------------- /contrib/poco/Net/include/Poco/Net/HTTPBasicStreamBuf.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPBasicStreamBuf.h 3 | // 4 | // Library: Net 5 | // Package: HTTP 6 | // Module: HTTPBasicStreamBuf 7 | // 8 | // Definition of the HTTPBasicStreamBuf class. 9 | // 10 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Net_HTTPBasicStreamBuf_INCLUDED 18 | #define Net_HTTPBasicStreamBuf_INCLUDED 19 | 20 | 21 | #include "Poco/Net/Net.h" 22 | #include "Poco/BufferedStreamBuf.h" 23 | #include "Poco/Net/HTTPBufferAllocator.h" 24 | 25 | 26 | namespace Poco { 27 | namespace Net { 28 | 29 | 30 | using HTTPBasicStreamBuf = Poco::BasicBufferedStreamBuf, HTTPBufferAllocator>; 31 | 32 | 33 | } } // namespace Poco::Net 34 | 35 | 36 | #endif // Net_HTTPBasicStreamBuf_INCLUDED 37 | -------------------------------------------------------------------------------- /driver/attributes.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/attributes.h" 2 | 3 | bool AttributeContainer::hasAttrInteger(int attr) const { 4 | const auto it = attributes.find(attr); 5 | return (it != attributes.end() && std::holds_alternative(it->second)); 6 | } 7 | 8 | bool AttributeContainer::hasAttrString(int attr) const { 9 | const auto it = attributes.find(attr); 10 | return (it != attributes.end() && std::holds_alternative(it->second)); 11 | } 12 | 13 | bool AttributeContainer::hasAttr(int attr) const { 14 | const auto it = attributes.find(attr); 15 | return (it != attributes.end() && !it->second.valueless_by_exception()); 16 | } 17 | 18 | void AttributeContainer::resetAttr(int attr) { 19 | attributes.erase(attr); 20 | } 21 | 22 | void AttributeContainer::resetAttrs() { 23 | attributes.clear(); 24 | } 25 | 26 | void AttributeContainer::onAttrChange(int attr) { 27 | } 28 | -------------------------------------------------------------------------------- /driver/test/lexer_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/escaping/lexer.h" 2 | 3 | #include 4 | 5 | TEST(LexerCase, ParseString) { 6 | Token tok = Lexer("'2017-01-01'").Consume(); 7 | 8 | ASSERT_EQ(tok.type, Token::STRING); 9 | ASSERT_EQ(tok.literal, "'2017-01-01'"); 10 | } 11 | 12 | TEST(LexerCase, ParseIdent) { 13 | auto tok = Lexer("nonquoted").Consume(); 14 | ASSERT_EQ(tok.type, Token::IDENT); 15 | tok = Lexer("nonquoted_string").Consume(); 16 | ASSERT_EQ(tok.type, Token::IDENT); 17 | tok = Lexer("table.field").Consume(); 18 | ASSERT_EQ(tok.type, Token::IDENT); 19 | tok = Lexer("`table`.`field`").Consume(); 20 | ASSERT_STREQ(tok.literal.to_string().c_str(), "`table`.`field`"); 21 | ASSERT_EQ(tok.type, Token::IDENT); 22 | tok = Lexer("Custom_SQL_Query.amount").Consume(); 23 | ASSERT_STREQ(tok.literal.to_string().c_str(), "Custom_SQL_Query.amount"); 24 | } 25 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Channel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Channel.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Logging 6 | // Module: Channel 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Channel.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | Channel::Channel() 22 | { 23 | } 24 | 25 | 26 | Channel::~Channel() 27 | { 28 | } 29 | 30 | 31 | void Channel::open() 32 | { 33 | } 34 | 35 | 36 | void Channel::close() 37 | { 38 | } 39 | 40 | 41 | void Channel::setProperty(const std::string& name, const std::string& /*value*/) 42 | { 43 | throw PropertyNotSupportedException(name); 44 | } 45 | 46 | 47 | std::string Channel::getProperty(const std::string& name) const 48 | { 49 | throw PropertyNotSupportedException(name); 50 | } 51 | 52 | 53 | } // namespace Poco 54 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/KeyConsoleHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KeyConsoleHandler.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: KeyConsoleHandler 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/KeyConsoleHandler.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | KeyConsoleHandler::KeyConsoleHandler(bool server):PrivateKeyPassphraseHandler(server) 24 | { 25 | } 26 | 27 | 28 | KeyConsoleHandler::~KeyConsoleHandler() 29 | { 30 | } 31 | 32 | 33 | void KeyConsoleHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey) 34 | { 35 | std::cout << "Please enter the passphrase for the private key: "; 36 | std::cin >> privateKey; 37 | } 38 | 39 | 40 | } } // namespace Poco::Net 41 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/NamedMutex_Android.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_Android.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedMutex 7 | // 8 | // Definition of the NamedMutexImpl class for Android. 9 | // 10 | // Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_NamedMutex_Android_INCLUDED 18 | #define Foundation_NamedMutex_Android_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | namespace Poco { 25 | 26 | 27 | class Foundation_API NamedMutexImpl 28 | { 29 | protected: 30 | NamedMutexImpl(const std::string& name); 31 | ~NamedMutexImpl(); 32 | void lockImpl(); 33 | bool tryLockImpl(); 34 | void unlockImpl(); 35 | }; 36 | 37 | 38 | } // namespace Poco 39 | 40 | 41 | #endif // Foundation_NamedMutex_Android_INCLUDED 42 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/KeyConsoleHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KeyConsoleHandler.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: KeyConsoleHandler 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/KeyConsoleHandler.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | KeyConsoleHandler::KeyConsoleHandler(bool server):PrivateKeyPassphraseHandler(server) 24 | { 25 | } 26 | 27 | 28 | KeyConsoleHandler::~KeyConsoleHandler() 29 | { 30 | } 31 | 32 | 33 | void KeyConsoleHandler::onPrivateKeyRequested(const void* pSender, std::string& privateKey) 34 | { 35 | std::cout << "Please enter the passphrase for the private key: "; 36 | std::cin >> privateKey; 37 | } 38 | 39 | 40 | } } // namespace Poco::Net 41 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/FileStreamRWLock_WIN32.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FileStreamRWLock_WIN32.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: FileStreamRWLock 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/FileStreamRWLock_WIN32.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | FileStreamRWLockImpl::FileStreamRWLockImpl(const FileStream::NativeHandle &fd, Poco::UInt64 offset, Poco::UInt64 size): 22 | _fd(fd) 23 | { 24 | LARGE_INTEGER offt; 25 | offt.QuadPart = offset; 26 | memset(&_overlapped, 0, sizeof(OVERLAPPED)); 27 | 28 | _overlapped.Offset = offt.LowPart; 29 | _overlapped.OffsetHigh = offt.HighPart; 30 | _size.QuadPart = size; 31 | } 32 | 33 | 34 | FileStreamRWLockImpl::~FileStreamRWLockImpl() 35 | { 36 | } 37 | 38 | 39 | } // namespace Poco 40 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/VerificationErrorArgs.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // VerificationErrorArgs.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: VerificationErrorArgs 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/VerificationErrorArgs.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | VerificationErrorArgs::VerificationErrorArgs(Poco::Net::Context::Ptr pContext, const X509Certificate& cert, int errDepth, int errNum, const std::string& errMsg): 23 | _pContext(pContext), 24 | _cert(cert), 25 | _errorDepth(errDepth), 26 | _errorNumber(errNum), 27 | _errorMessage(errMsg), 28 | _ignoreError(false) 29 | { 30 | } 31 | 32 | 33 | VerificationErrorArgs::~VerificationErrorArgs() 34 | { 35 | } 36 | 37 | 38 | } } // namespace Poco::Net 39 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/FileStreamRWLock.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // FileStreamRWLock.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: FileStreamRWLock 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/FileStreamRWLock.h" 16 | 17 | 18 | #if defined(POCO_OS_FAMILY_WINDOWS) 19 | #include "FileStreamRWLock_WIN32.cpp" 20 | #else 21 | #include "FileStreamRWLock_POSIX.cpp" 22 | #endif 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | FileStreamRWLock::FileStreamRWLock(const FileStream &fs, Poco::UInt64 offset, Poco::UInt64 size) : 29 | FileStreamRWLockImpl(fs.nativeHandle(), offset, size) 30 | { 31 | } 32 | 33 | 34 | FileStreamRWLock::~FileStreamRWLock() 35 | { 36 | if (_locked) 37 | { 38 | unlockImpl(); 39 | _locked = false; 40 | } 41 | } 42 | 43 | 44 | } // namespace Poco 45 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/AcceptCertificateHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AcceptCertificateHandler.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: AcceptCertificateHandler 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/AcceptCertificateHandler.h" 16 | #include "Poco/Net/VerificationErrorArgs.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | AcceptCertificateHandler::AcceptCertificateHandler(bool server): InvalidCertificateHandler(server) 24 | { 25 | } 26 | 27 | 28 | AcceptCertificateHandler::~AcceptCertificateHandler() 29 | { 30 | } 31 | 32 | 33 | void AcceptCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) 34 | { 35 | errorCert.setIgnoreError(true); 36 | } 37 | 38 | 39 | } } // namespace Poco::Net 40 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/RejectCertificateHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RejectCertificateHandler.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: RejectCertificateHandler 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/RejectCertificateHandler.h" 16 | #include "Poco/Net/VerificationErrorArgs.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | RejectCertificateHandler::RejectCertificateHandler(bool server): InvalidCertificateHandler(server) 24 | { 25 | } 26 | 27 | 28 | RejectCertificateHandler::~RejectCertificateHandler() 29 | { 30 | } 31 | 32 | 33 | void RejectCertificateHandler::onInvalidCertificate(const void*, VerificationErrorArgs& errorCert) 34 | { 35 | errorCert.setIgnoreError(false); 36 | } 37 | 38 | 39 | } } // namespace Poco::Net 40 | -------------------------------------------------------------------------------- /driver/api/sql_columns_resultset_mutator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/result_set.h" 4 | #include "driver/statement.h" 5 | #include 6 | 7 | /** 8 | * This mutator injects missing information in `systems.columns` required by SQLColumns, 9 | * such as SQL type (e.g., SQL_TINYINT, SQL_INTEGER), column value, octet length, and other 10 | * details stored only in the driver. 11 | * 12 | * The result set must match the structure described at: 13 | * https://learn.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolumns-function 14 | */ 15 | class SQLColumnsResultSetMutator 16 | : public ResultMutator 17 | { 18 | public: 19 | explicit SQLColumnsResultSetMutator(Statement & statement_) 20 | : statement{statement_} 21 | { 22 | } 23 | 24 | void transformRow(const std::vector & /*unused*/, Row & row) override; 25 | 26 | 27 | private: 28 | 29 | Statement & statement; 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/UDPServerParams.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // UDPServerParams.cpp 3 | // 4 | // Library: Net 5 | // Package: UDP 6 | // Module: UDPServerParams 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/UDPServerParams.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | UDPServerParams::UDPServerParams(const Poco::Net::SocketAddress& sa, 23 | int nSockets, 24 | Poco::Timespan timeout, 25 | std::size_t handlerBufListSize, 26 | bool notifySender, 27 | int backlogThreshold): _sa(sa), 28 | _nSockets(nSockets), 29 | _timeout(timeout), 30 | _handlerBufListSize(handlerBufListSize), 31 | _notifySender(notifySender), 32 | _backlogThreshold(backlogThreshold) 33 | { 34 | } 35 | 36 | 37 | UDPServerParams::~UDPServerParams() 38 | { 39 | } 40 | 41 | 42 | } } // namespace Poco::Net 43 | -------------------------------------------------------------------------------- /cmake/packages.cmake: -------------------------------------------------------------------------------- 1 | if (OS_LINUX) 2 | if (EXISTS "/etc/os-release") 3 | find_program (AWK awk) 4 | 5 | if (AWK) 6 | execute_process ( 7 | COMMAND ${AWK} "-F=" "$1==\"ID\" { gsub(/\"/, \"\", $2); print tolower($2) ;}" "/etc/os-release" 8 | OUTPUT_VARIABLE _os_release_id 9 | OUTPUT_STRIP_TRAILING_WHITESPACE 10 | ) 11 | 12 | if (_os_release_id STREQUAL "rhel") 13 | set (UNIX_RHEL 1) 14 | elseif (_os_release_id STREQUAL "fedora") 15 | set (UNIX_FEDORA 1) 16 | elseif (_os_release_id STREQUAL "centos") 17 | set (UNIX_CENTOS 1) 18 | elseif (_os_release_id STREQUAL "debian") 19 | set (UNIX_DEBIAN 1) 20 | elseif (_os_release_id STREQUAL "ubuntu") 21 | set (UNIX_UBUNTU 1) 22 | endif () 23 | endif () 24 | endif () 25 | endif () 26 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/der_sm2_gen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from providers/common/der/der_sm2_gen.c.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #include "prov/der_sm2.h" 14 | 15 | /* Well known OIDs precompiled */ 16 | 17 | /* 18 | * sm2-with-SM3 OBJECT IDENTIFIER ::= { sm-scheme 501 } 19 | */ 20 | const unsigned char ossl_der_oid_sm2_with_SM3[DER_OID_SZ_sm2_with_SM3] = { 21 | DER_OID_V_sm2_with_SM3 22 | }; 23 | 24 | /* 25 | * curveSM2 OBJECT IDENTIFIER ::= { sm-scheme 301 } 26 | */ 27 | const unsigned char ossl_der_oid_curveSM2[DER_OID_SZ_curveSM2] = { 28 | DER_OID_V_curveSM2 29 | }; 30 | 31 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/NullPartHandler.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NullPartHandler.cpp 3 | // 4 | // Library: Net 5 | // Package: Messages 6 | // Module: NullPartHandler 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/NullPartHandler.h" 16 | #include "Poco/Net/MessageHeader.h" 17 | #include "Poco/NullStream.h" 18 | #include "Poco/StreamCopier.h" 19 | 20 | 21 | using Poco::NullOutputStream; 22 | using Poco::StreamCopier; 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | NullPartHandler::NullPartHandler() 30 | { 31 | } 32 | 33 | 34 | NullPartHandler::~NullPartHandler() 35 | { 36 | } 37 | 38 | 39 | void NullPartHandler::handlePart(const MessageHeader& header, std::istream& stream) 40 | { 41 | NullOutputStream ostr; 42 | StreamCopier::copyStream(stream, ostr); 43 | } 44 | 45 | 46 | } } // namespace Poco::Net 47 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/PrivateKeyFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PrivateKeyFactory.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: PrivateKeyFactory 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/PrivateKeyFactory.h" 16 | #include "Poco/Net/SSLManager.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | PrivateKeyFactory::PrivateKeyFactory() 24 | { 25 | } 26 | 27 | 28 | PrivateKeyFactory::~PrivateKeyFactory() 29 | { 30 | } 31 | 32 | 33 | PrivateKeyFactoryRegistrar::PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory) 34 | { 35 | SSLManager::instance().privateKeyFactoryMgr().setFactory(name, pFactory); 36 | } 37 | 38 | 39 | PrivateKeyFactoryRegistrar::~PrivateKeyFactoryRegistrar() 40 | { 41 | } 42 | 43 | 44 | } } // namespace Poco::Net 45 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPBufferAllocator.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPBufferAllocator.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTP 6 | // Module: HTTPBufferAllocator 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPBufferAllocator.h" 16 | 17 | 18 | using Poco::MemoryPool; 19 | 20 | 21 | namespace Poco { 22 | namespace Net { 23 | 24 | 25 | MemoryPool HTTPBufferAllocator::_pool(HTTPBufferAllocator::BUFFER_SIZE, 16); 26 | 27 | 28 | char* HTTPBufferAllocator::allocate(std::streamsize size) 29 | { 30 | poco_assert_dbg (size == BUFFER_SIZE); 31 | 32 | return reinterpret_cast(_pool.get()); 33 | } 34 | 35 | 36 | void HTTPBufferAllocator::deallocate(char* ptr, std::streamsize size) 37 | { 38 | poco_assert_dbg (size == BUFFER_SIZE); 39 | 40 | _pool.release(ptr); 41 | } 42 | 43 | 44 | } } // namespace Poco::Net 45 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/PrivateKeyFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PrivateKeyFactory.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: PrivateKeyFactory 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/PrivateKeyFactory.h" 16 | #include "Poco/Net/SSLManager.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | PrivateKeyFactory::PrivateKeyFactory() 24 | { 25 | } 26 | 27 | 28 | PrivateKeyFactory::~PrivateKeyFactory() 29 | { 30 | } 31 | 32 | 33 | PrivateKeyFactoryRegistrar::PrivateKeyFactoryRegistrar(const std::string& name, PrivateKeyFactory* pFactory) 34 | { 35 | SSLManager::instance().privateKeyFactoryMgr().setFactory(name, pFactory); 36 | } 37 | 38 | 39 | PrivateKeyFactoryRegistrar::~PrivateKeyFactoryRegistrar() 40 | { 41 | } 42 | 43 | 44 | } } // namespace Poco::Net 45 | -------------------------------------------------------------------------------- /driver/platform/config_cmake.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VERSION_MAJOR @PROJECT_VERSION_MAJOR@ 4 | #define VERSION_MINOR @PROJECT_VERSION_MINOR@ 5 | #define VERSION_PATCH @PROJECT_VERSION_PATCH@ 6 | #define VERSION_TWEAK @PROJECT_VERSION_TWEAK@ 7 | #define VERSION_EXTRA "" 8 | #define VERSION_STRING "@PROJECT_VERSION@" 9 | 10 | #define SYSTEM_STRING "@CMAKE_SYSTEM@" 11 | #define ODBC_PROVIDER "@ODBC_PROVIDER@" 12 | 13 | #define DSN_DEFAULT_ANSI "@CH_ODBC_DEFAULT_DSN_ANSI@" 14 | #define DSN_DEFAULT_UNICODE "@CH_ODBC_DEFAULT_DSN_UNICODE@" 15 | 16 | // See the usage of each workaround in the code, for comments. 17 | #cmakedefine WORKAROUND_ALLOW_UNSAFE_DISPATCH 18 | #cmakedefine WORKAROUND_DISABLE_SSL 19 | #cmakedefine WORKAROUND_USE_ICU 20 | #cmakedefine WORKAROUND_ICU_USE_EXPLICIT_PIVOTING 21 | #cmakedefine WORKAROUND_ENABLE_TRIM_TRAILING_NULL 22 | #cmakedefine WORKAROUND_ENABLE_DEFINE_SQLBindParam 23 | #cmakedefine WORKAROUND_ENABLE_NO_UNICODE_CHARS_IN_COLUMN_NAMES_IN_TESTS 24 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Mutex.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Mutex.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Mutex 7 | // 8 | // Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Mutex.h" 16 | 17 | #if defined(POCO_ENABLE_STD_MUTEX) 18 | #include "Mutex_STD.cpp" 19 | #elif defined(POCO_OS_FAMILY_WINDOWS) 20 | #include "Mutex_WIN32.cpp" 21 | #elif defined(POCO_VXWORKS) 22 | #include "Mutex_VX.cpp" 23 | #else 24 | #include "Mutex_POSIX.cpp" 25 | #endif 26 | 27 | 28 | namespace Poco { 29 | 30 | 31 | Mutex::Mutex() 32 | { 33 | } 34 | 35 | 36 | Mutex::~Mutex() 37 | { 38 | } 39 | 40 | 41 | FastMutex::FastMutex() 42 | { 43 | } 44 | 45 | 46 | FastMutex::~FastMutex() 47 | { 48 | } 49 | 50 | 51 | SpinlockMutex::SpinlockMutex() 52 | { 53 | } 54 | 55 | 56 | SpinlockMutex::~SpinlockMutex() 57 | { 58 | } 59 | 60 | 61 | } // namespace Poco 62 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/SSLException.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SSLException.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: SSLException 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/SSLException.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | POCO_IMPLEMENT_EXCEPTION(SSLException, NetException, "SSL Exception") 24 | POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSL context exception") 25 | POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, SSLException, "Invalid certficate") 26 | POCO_IMPLEMENT_EXCEPTION(CertificateValidationException, SSLException, "Certificate validation error") 27 | POCO_IMPLEMENT_EXCEPTION(SSLConnectionUnexpectedlyClosedException, SSLException, "SSL connection unexpectedly closed") 28 | 29 | 30 | } } // namespace Poco::Net 31 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Stopwatch.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Stopwatch.cpp 3 | // 4 | // Library: Foundation 5 | // Package: DateTime 6 | // Module: Stopwatch 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Stopwatch.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | Stopwatch::Stopwatch(): _elapsed(0), _running(false) 22 | { 23 | } 24 | 25 | 26 | Stopwatch::~Stopwatch() 27 | { 28 | } 29 | 30 | 31 | Clock::ClockDiff Stopwatch::elapsed() const 32 | { 33 | if (_running) 34 | { 35 | Clock current; 36 | return _elapsed + (current - _start); 37 | } 38 | else 39 | { 40 | return _elapsed; 41 | } 42 | } 43 | 44 | 45 | void Stopwatch::reset() 46 | { 47 | _elapsed = 0; 48 | _running = false; 49 | } 50 | 51 | 52 | void Stopwatch::restart() 53 | { 54 | _elapsed = 0; 55 | _start.update(); 56 | _running = true; 57 | } 58 | 59 | 60 | } // namespace Poco 61 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_x86_64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_aarch64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_ppc64le/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_riscv64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_s390x/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_x86_64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_aarch64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_loongarch64/include/crypto/bn_conf.h: -------------------------------------------------------------------------------- 1 | /* WARNING: do not edit! */ 2 | /* Generated by Makefile from include/crypto/bn_conf.h.in */ 3 | /* 4 | * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. 5 | * 6 | * Licensed under the Apache License 2.0 (the "License"). You may not use 7 | * this file except in compliance with the License. You can obtain a copy 8 | * in the file LICENSE in the source distribution or at 9 | * https://www.openssl.org/source/license.html 10 | */ 11 | 12 | #ifndef OSSL_CRYPTO_BN_CONF_H 13 | # define OSSL_CRYPTO_BN_CONF_H 14 | # pragma once 15 | 16 | /* 17 | * The contents of this file are not used in the UEFI build, as 18 | * both 32-bit and 64-bit builds are supported from a single run 19 | * of the Configure script. 20 | */ 21 | 22 | /* Should we define BN_DIV2W here? */ 23 | 24 | /* Only one for the following should be defined */ 25 | #define SIXTY_FOUR_BIT_LONG 26 | #undef SIXTY_FOUR_BIT 27 | #undef THIRTY_TWO_BIT 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/EventArgs.h: -------------------------------------------------------------------------------- 1 | // 2 | // EventArgs.h 3 | // 4 | // Library: Foundation 5 | // Package: Events 6 | // Module: EventArgs 7 | // 8 | // Definition of EventArgs. 9 | // 10 | // Copyright (c) 2006-2011, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_EventArgs_INCLUDED 18 | #define Foundation_EventArgs_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | namespace Poco { 25 | 26 | 27 | class Foundation_API EventArgs 28 | /// The purpose of the EventArgs class is to be used as parameter 29 | /// when one doesn't want to send any data. 30 | /// 31 | /// One can use EventArgs as a base class for one's own event arguments 32 | /// but with the arguments being a template parameter this is not 33 | /// necessary. 34 | { 35 | public: 36 | EventArgs(); 37 | 38 | virtual ~EventArgs(); 39 | }; 40 | 41 | 42 | } // namespace Poco 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Runnable.h: -------------------------------------------------------------------------------- 1 | // 2 | // Runnable.h 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Thread 7 | // 8 | // Definition of the Runnable class. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Runnable_INCLUDED 18 | #define Foundation_Runnable_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | namespace Poco { 25 | 26 | 27 | class Foundation_API Runnable 28 | /// The Runnable interface with the run() method 29 | /// must be implemented by classes that provide 30 | /// an entry point for a thread. 31 | { 32 | public: 33 | Runnable(); 34 | virtual ~Runnable(); 35 | 36 | virtual void run() = 0; 37 | /// Do whatever the thread needs to do. Must 38 | /// be overridden by subclasses. 39 | }; 40 | 41 | 42 | } // namespace Poco 43 | 44 | 45 | #endif // Foundation_Runnable_INCLUDED 46 | -------------------------------------------------------------------------------- /contrib/nanodbc-cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (OS_DARWIN OR OS_LINUX) 2 | if (NOT TARGET ch_contrib::unixodbc) 3 | message(FATAL_ERROR "Configuration error: unixodbc is not a target") 4 | endif() 5 | 6 | set (LIBRARY_DIR "${CMAKE_SOURCE_DIR}/contrib/nanodbc") 7 | 8 | set (SRCS 9 | "${LIBRARY_DIR}/nanodbc/nanodbc.cpp" 10 | ) 11 | 12 | add_library(_nanodbc ${SRCS}) 13 | target_link_libraries(_nanodbc PUBLIC ch_contrib::unixodbc) 14 | target_include_directories(_nanodbc SYSTEM PUBLIC "${LIBRARY_DIR}/") 15 | add_library(ch_contrib::nanodbc ALIAS _nanodbc) 16 | 17 | elseif (OS_WINDOWS) 18 | set (LIBRARY_DIR "${CMAKE_SOURCE_DIR}/contrib/nanodbc") 19 | set (SRCS 20 | "${LIBRARY_DIR}/nanodbc/nanodbc.cpp" 21 | ) 22 | 23 | add_library(_nanodbc ${SRCS}) 24 | target_link_libraries(_nanodbc PUBLIC ODBC::Driver) 25 | target_include_directories(_nanodbc SYSTEM PUBLIC "${LIBRARY_DIR}/") 26 | add_library(ch_contrib::nanodbc ALIAS _nanodbc) 27 | endif() 28 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/NamedEvent_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedEvent_WIN32U.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedEvent 7 | // 8 | // Definition of the NamedEventImpl class for Windows. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_NamedEvent_WIN32U_INCLUDED 18 | #define Foundation_NamedEvent_WIN32U_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/UnWindows.h" 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | class Foundation_API NamedEventImpl 29 | { 30 | protected: 31 | NamedEventImpl(const std::string& name); 32 | ~NamedEventImpl(); 33 | void setImpl(); 34 | void waitImpl(); 35 | 36 | private: 37 | std::string _name; 38 | std::wstring _uname; 39 | HANDLE _event; 40 | }; 41 | 42 | 43 | } // namespace Poco 44 | 45 | 46 | #endif // Foundation_NamedEvent_WIN32U_INCLUDED 47 | -------------------------------------------------------------------------------- /contrib/poco/Net/include/Poco/Net/ServerSocketImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // ServerSocketImpl.h 3 | // 4 | // Library: Net 5 | // Package: Sockets 6 | // Module: ServerSocketImpl 7 | // 8 | // Definition of the ServerSocketImpl class. 9 | // 10 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Net_ServerSocketImpl_INCLUDED 18 | #define Net_ServerSocketImpl_INCLUDED 19 | 20 | 21 | #include "Poco/Net/Net.h" 22 | #include "Poco/Net/SocketImpl.h" 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | class Net_API ServerSocketImpl: public SocketImpl 30 | /// This class implements a TCP server socket. 31 | { 32 | public: 33 | ServerSocketImpl(); 34 | /// Creates the ServerSocketImpl. 35 | 36 | protected: 37 | ~ServerSocketImpl() override; 38 | /// Destroys the ServerSocketImpl. 39 | }; 40 | 41 | 42 | } } // namespace Poco::Net 43 | 44 | 45 | #endif // Net_ServerSocketImpl_INCLUDED 46 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/UnWindows.h: -------------------------------------------------------------------------------- 1 | // 2 | // UnWindows.h 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: UnWindows 7 | // 8 | // Simple wrapper around the header file. 9 | // 10 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_UnWindows_INCLUDED 18 | #define Foundation_UnWindows_INCLUDED 19 | 20 | 21 | // Reduce bloat 22 | #if defined(_WIN32) 23 | #if !defined(WIN32_LEAN_AND_MEAN) && !defined(POCO_BLOATED_WIN32) 24 | #define WIN32_LEAN_AND_MEAN 25 | #endif 26 | #endif 27 | 28 | // disable min/max macros 29 | #if !defined(NOMINMAX) 30 | #define NOMINMAX 31 | #endif 32 | 33 | #if !defined(POCO_NO_WINDOWS_H) 34 | #include 35 | #ifdef __MINGW32__ 36 | #include 37 | #include 38 | #include 39 | #endif // __MINGW32__ 40 | #endif 41 | 42 | 43 | #endif // Foundation_UnWindows_INCLUDED 44 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/PipeImpl_DUMMY.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_DUMMY.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: PipeImpl 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/PipeImpl_DUMMY.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | PipeImpl::PipeImpl() 22 | { 23 | } 24 | 25 | 26 | PipeImpl::~PipeImpl() 27 | { 28 | } 29 | 30 | 31 | int PipeImpl::writeBytes(const void* buffer, int length) 32 | { 33 | return 0; 34 | } 35 | 36 | 37 | int PipeImpl::readBytes(void* buffer, int length) 38 | { 39 | return 0; 40 | } 41 | 42 | 43 | PipeImpl::Handle PipeImpl::readHandle() const 44 | { 45 | return 0; 46 | } 47 | 48 | 49 | PipeImpl::Handle PipeImpl::writeHandle() const 50 | { 51 | return 0; 52 | } 53 | 54 | 55 | void PipeImpl::closeRead() 56 | { 57 | } 58 | 59 | 60 | void PipeImpl::closeWrite() 61 | { 62 | } 63 | 64 | 65 | } // namespace Poco 66 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/NamedMutex_WIN32U.h: -------------------------------------------------------------------------------- 1 | // 2 | // NamedMutex_WIN32U.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: NamedMutex 7 | // 8 | // Definition of the NamedMutexImpl class for Windows. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_NamedMutex_WIN32U_INCLUDED 18 | #define Foundation_NamedMutex_WIN32U_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/UnWindows.h" 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | class Foundation_API NamedMutexImpl 29 | { 30 | protected: 31 | NamedMutexImpl(const std::string& name); 32 | ~NamedMutexImpl(); 33 | void lockImpl(); 34 | bool tryLockImpl(); 35 | void unlockImpl(); 36 | 37 | private: 38 | std::string _name; 39 | std::wstring _uname; 40 | HANDLE _mutex; 41 | }; 42 | 43 | 44 | } // namespace Poco 45 | 46 | 47 | #endif // Foundation_NamedMutex_WIN32U_INCLUDED 48 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/ProcessOptions.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProcessOptions.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: ProcessOptions 7 | // 8 | // Definition of the ProcessOptions class. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_ProcessOptions_INCLUDED 18 | #define Foundation_ProcessOptions_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | namespace Poco { 25 | 26 | 27 | enum ProcessOptions 28 | /// Options to configure child process behavior. 29 | { 30 | PROCESS_CLOSE_STDIN = 1, 31 | /// Causes the child process STDIN to be closed. 32 | 33 | PROCESS_CLOSE_STDOUT = 2, 34 | /// Causes the child process STDOUT to be closed. 35 | 36 | PROCESS_CLOSE_STDERR = 4, 37 | /// Causes the child process STDERR to be closed. 38 | }; 39 | 40 | 41 | } // namespace Poco 42 | 43 | 44 | #endif // Foundation_ProcessOptions_INCLUDED 45 | -------------------------------------------------------------------------------- /driver/test/gtest_env.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/test/gtest_env.h" 2 | 3 | #include 4 | 5 | TestEnvironment * TestEnvironment::environment_ = nullptr; 6 | 7 | TestEnvironment::TestEnvironment::TestEnvironment(int argc, char * argv[]) { 8 | for (std::size_t i = 1; i < argc; ++i) { 9 | command_line_params_.emplace_back(argv[i]); 10 | } 11 | 12 | if (environment_ == nullptr) 13 | environment_ = this; 14 | } 15 | 16 | TestEnvironment::~TestEnvironment() { 17 | if (environment_ == this) 18 | environment_ = nullptr; 19 | } 20 | 21 | TestEnvironment & TestEnvironment::getInstance() { 22 | if (environment_ == nullptr) 23 | throw std::runtime_error("TestEnvironment instance not available"); 24 | 25 | return *environment_; 26 | } 27 | 28 | const std::string & TestEnvironment::getDSN() { 29 | if (command_line_params_.size() != 1) 30 | throw std::runtime_error("Unable to extract positional command-line parameter value for DSN"); 31 | 32 | return command_line_params_[0]; 33 | }; 34 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/PartSource.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PartSource.cpp 3 | // 4 | // Library: Net 5 | // Package: Messages 6 | // Module: PartSource 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/PartSource.h" 16 | 17 | 18 | namespace Poco { 19 | namespace Net { 20 | 21 | 22 | const int PartSource::UNKNOWN_CONTENT_LENGTH = -1; 23 | 24 | 25 | PartSource::PartSource(): 26 | _mediaType("application/octet-stream") 27 | { 28 | } 29 | 30 | 31 | PartSource::PartSource(const std::string& mediaType): 32 | _mediaType(mediaType) 33 | { 34 | } 35 | 36 | 37 | PartSource::~PartSource() 38 | { 39 | } 40 | 41 | 42 | namespace 43 | { 44 | static const std::string EMPTY; 45 | } 46 | 47 | 48 | const std::string& PartSource::filename() const 49 | { 50 | return EMPTY; 51 | } 52 | 53 | std::streamsize PartSource::getContentLength() const 54 | { 55 | return UNKNOWN_CONTENT_LENGTH; 56 | } 57 | 58 | } } // namespace Poco::Net 59 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/CertificateHandlerFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CertificateHandlerFactory.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: CertificateHandlerFactory 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/CertificateHandlerFactory.h" 16 | #include "Poco/Net/SSLManager.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | CertificateHandlerFactory::CertificateHandlerFactory() 24 | { 25 | } 26 | 27 | 28 | CertificateHandlerFactory::~CertificateHandlerFactory() 29 | { 30 | } 31 | 32 | 33 | CertificateHandlerFactoryRegistrar::CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory) 34 | { 35 | SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, pFactory); 36 | } 37 | 38 | 39 | CertificateHandlerFactoryRegistrar::~CertificateHandlerFactoryRegistrar() 40 | { 41 | } 42 | 43 | 44 | } } // namespace Poco::Net 45 | -------------------------------------------------------------------------------- /driver/test/load_ut.cpp: -------------------------------------------------------------------------------- 1 | #include "driver/platform/platform.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | int main(int argc, char * argv[]) { 8 | if (argc < 2) 9 | return 1; 10 | const auto & endl = "\n"; 11 | { 12 | std::cout << " Loading " << argv[1] << endl; 13 | Poco::SharedLibrary lib(argv[1]); 14 | 15 | std::string func_name = argc < 3 ? "SQLDummyOrdinal" : argv[2]; 16 | auto has_symbol = lib.hasSymbol(func_name); 17 | std::cout << " hasSymbol(" << func_name << ") = " << has_symbol << endl; 18 | if (!has_symbol) 19 | return 2; 20 | auto symbol = lib.getSymbol(func_name); 21 | std::cout << " symbol = " << symbol << ". " << endl; 22 | SQLRETURN (*f)(void); 23 | f = reinterpret_cast(symbol); 24 | f(); 25 | std::cout << " Run ok. " << endl; 26 | 27 | lib.unload(); 28 | std::cout << " Unload ok. " << endl; 29 | } 30 | std::cout << " Destruct ok. " << endl; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /driver/utils/object_pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/platform/platform.h" 4 | 5 | #include 6 | #include 7 | 8 | // A pool of at most max_size movable objects, that helps to reuse their capacity but not the content. 9 | // Makes sense to use with std::string's and std::vector's to avoid reallocations of underlying storage. 10 | template 11 | class ObjectPool { 12 | public: 13 | explicit ObjectPool(const std::size_t max_size) 14 | : max_size_(max_size) 15 | { 16 | } 17 | 18 | void put(T && obj) { 19 | cache_.emplace_back(std::move(obj)); 20 | while (cache_.size() > max_size_) { 21 | cache_.pop_front(); 22 | } 23 | } 24 | 25 | T get() { 26 | if (cache_.empty()) { 27 | return T{}; 28 | } 29 | else { 30 | T obj = std::move(cache_.front()); 31 | cache_.pop_front(); 32 | return obj; 33 | } 34 | } 35 | 36 | private: 37 | const std::size_t max_size_; 38 | std::deque cache_; 39 | }; 40 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/src/CertificateHandlerFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CertificateHandlerFactory.cpp 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: CertificateHandlerFactory 7 | // 8 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/CertificateHandlerFactory.h" 16 | #include "Poco/Net/SSLManager.h" 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | CertificateHandlerFactory::CertificateHandlerFactory() 24 | { 25 | } 26 | 27 | 28 | CertificateHandlerFactory::~CertificateHandlerFactory() 29 | { 30 | } 31 | 32 | 33 | CertificateHandlerFactoryRegistrar::CertificateHandlerFactoryRegistrar(const std::string& name, CertificateHandlerFactory* pFactory) 34 | { 35 | SSLManager::instance().certificateHandlerFactoryMgr().setFactory(name, pFactory); 36 | } 37 | 38 | 39 | CertificateHandlerFactoryRegistrar::~CertificateHandlerFactoryRegistrar() 40 | { 41 | } 42 | 43 | 44 | } } // namespace Poco::Net 45 | -------------------------------------------------------------------------------- /driver/descriptor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/driver.h" 4 | #include "driver/connection.h" 5 | #include "driver/diagnostics.h" 6 | 7 | #include 8 | 9 | class DescriptorRecord 10 | : public AttributeContainer 11 | { 12 | public: 13 | bool hasColumnSize() const; 14 | SQLULEN getColumnSize() const; 15 | 16 | bool hasDecimalDigits() const; 17 | SQLSMALLINT getDecimalDigits() const; 18 | 19 | void consistencyCheck(); 20 | 21 | protected: 22 | virtual void onAttrChange(int attr) final override; 23 | }; 24 | 25 | class Descriptor 26 | : public Child 27 | { 28 | private: 29 | using ChildType = Child; 30 | 31 | public: 32 | explicit Descriptor(Connection & connection); 33 | Descriptor & operator= (Descriptor & other); 34 | 35 | std::size_t getRecordCount() const; 36 | DescriptorRecord& getRecord(std::size_t num, SQLINTEGER current_role); 37 | 38 | const std::vector & getRecordContainer() const; 39 | 40 | private: 41 | std::vector records; 42 | }; 43 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/URIStreamFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // URIStreamFactory.cpp 3 | // 4 | // Library: Foundation 5 | // Package: URI 6 | // Module: URIStreamFactory 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/URIStreamFactory.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | 21 | 22 | URIStreamFactory::URIStreamFactory() 23 | { 24 | } 25 | 26 | 27 | URIStreamFactory::~URIStreamFactory() 28 | { 29 | } 30 | 31 | 32 | URIRedirection::URIRedirection(const std::string& uri): 33 | _uri(uri) 34 | { 35 | } 36 | 37 | 38 | URIRedirection::URIRedirection(const URIRedirection& redir): 39 | _uri(redir._uri) 40 | { 41 | } 42 | 43 | 44 | URIRedirection& URIRedirection::operator = (const URIRedirection& redir) 45 | { 46 | URIRedirection tmp(redir); 47 | swap(tmp); 48 | return *this; 49 | } 50 | 51 | 52 | void URIRedirection::swap(URIRedirection& redir) noexcept 53 | { 54 | std::swap(_uri, redir._uri); 55 | } 56 | 57 | 58 | } // namespace Poco 59 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/include/Poco/Net/SSLException.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSLException.h 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: SSLException 7 | // 8 | // Definition of the SSLException class. 9 | // 10 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef NetSSL_SSLException_INCLUDED 18 | #define NetSSL_SSLException_INCLUDED 19 | 20 | 21 | #include "Poco/Net/NetSSL.h" 22 | #include "Poco/Net/NetException.h" 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | POCO_DECLARE_EXCEPTION(NetSSL_API, SSLException, NetException) 30 | POCO_DECLARE_EXCEPTION(NetSSL_API, SSLContextException, SSLException) 31 | POCO_DECLARE_EXCEPTION(NetSSL_API, InvalidCertificateException, SSLException) 32 | POCO_DECLARE_EXCEPTION(NetSSL_API, CertificateValidationException, SSLException) 33 | POCO_DECLARE_EXCEPTION(NetSSL_API, SSLConnectionUnexpectedlyClosedException, SSLException) 34 | 35 | 36 | } } // namespace Poco::Net 37 | 38 | 39 | #endif // NetSSL_SSLException_INCLUDED 40 | -------------------------------------------------------------------------------- /contrib/poco/Net/include/Poco/Net/NullPartHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // NullPartHandler.h 3 | // 4 | // Library: Net 5 | // Package: Messages 6 | // Module: NullPartHandler 7 | // 8 | // Definition of the NullPartHandler class. 9 | // 10 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Net_NullPartHandler_INCLUDED 18 | #define Net_NullPartHandler_INCLUDED 19 | 20 | 21 | #include "Poco/Net/Net.h" 22 | #include "Poco/Net/PartHandler.h" 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | class Net_API NullPartHandler: public PartHandler 30 | /// A very special PartHandler that simply discards all data. 31 | { 32 | public: 33 | NullPartHandler(); 34 | /// Creates the NullPartHandler. 35 | 36 | ~NullPartHandler(); 37 | /// Destroys the NullPartHandler. 38 | 39 | void handlePart(const MessageHeader& header, std::istream& stream); 40 | /// Reads and discards all data from the stream. 41 | }; 42 | 43 | 44 | } } // namespace Poco::Net 45 | 46 | 47 | #endif // Net_NullPartHandler_INCLUDED 48 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/HTTPServerConnectionFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPServerConnectionFactory.cpp 3 | // 4 | // Library: Net 5 | // Package: HTTPServer 6 | // Module: HTTPServerConnectionFactory 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/HTTPServerConnectionFactory.h" 16 | #include "Poco/Net/HTTPServerConnection.h" 17 | #include "Poco/Net/HTTPRequestHandlerFactory.h" 18 | 19 | 20 | namespace Poco { 21 | namespace Net { 22 | 23 | 24 | HTTPServerConnectionFactory::HTTPServerConnectionFactory(HTTPServerParams::Ptr pParams, HTTPRequestHandlerFactory::Ptr pFactory): 25 | _pParams(pParams), 26 | _pFactory(pFactory) 27 | { 28 | poco_check_ptr (pFactory); 29 | } 30 | 31 | 32 | HTTPServerConnectionFactory::~HTTPServerConnectionFactory() 33 | { 34 | } 35 | 36 | 37 | TCPServerConnection* HTTPServerConnectionFactory::createConnection(const StreamSocket& socket) 38 | { 39 | return new HTTPServerConnection(socket, _pParams, _pFactory); 40 | } 41 | 42 | 43 | } } // namespace Poco::Net 44 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/AtomicCounter.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicCounter.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: AtomicCounter 7 | // 8 | // Copyright (c) 2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/AtomicCounter.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | AtomicCounter::AtomicCounter(): 22 | _counter(0) 23 | { 24 | } 25 | 26 | 27 | AtomicCounter::AtomicCounter(AtomicCounter::ValueType initialValue): 28 | _counter(initialValue) 29 | { 30 | } 31 | 32 | 33 | AtomicCounter::AtomicCounter(const AtomicCounter& counter): 34 | _counter(counter.value()) 35 | { 36 | } 37 | 38 | 39 | AtomicCounter::~AtomicCounter() 40 | { 41 | } 42 | 43 | 44 | AtomicCounter& AtomicCounter::operator = (const AtomicCounter& counter) 45 | { 46 | _counter.store(counter._counter.load()); 47 | return *this; 48 | } 49 | 50 | 51 | AtomicCounter& AtomicCounter::operator = (AtomicCounter::ValueType value) 52 | { 53 | _counter.store(value); 54 | return *this; 55 | } 56 | 57 | 58 | } // namespace Poco 59 | -------------------------------------------------------------------------------- /contrib/poco/Net/src/TCPServerConnection.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // TCPServerConnection.cpp 3 | // 4 | // Library: Net 5 | // Package: TCPServer 6 | // Module: TCPServerConnection 7 | // 8 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/TCPServerConnection.h" 16 | #include "Poco/Exception.h" 17 | #include "Poco/ErrorHandler.h" 18 | 19 | 20 | using Poco::Exception; 21 | using Poco::ErrorHandler; 22 | 23 | 24 | namespace Poco { 25 | namespace Net { 26 | 27 | 28 | TCPServerConnection::TCPServerConnection(const StreamSocket& socket): 29 | _socket(socket) 30 | { 31 | } 32 | 33 | 34 | TCPServerConnection::~TCPServerConnection() 35 | { 36 | } 37 | 38 | 39 | void TCPServerConnection::start() 40 | { 41 | try 42 | { 43 | run(); 44 | } 45 | catch (Exception& exc) 46 | { 47 | ErrorHandler::handle(exc); 48 | } 49 | catch (std::exception& exc) 50 | { 51 | ErrorHandler::handle(exc); 52 | } 53 | catch (...) 54 | { 55 | ErrorHandler::handle(); 56 | } 57 | } 58 | 59 | 60 | } } // namespace Poco::Net 61 | -------------------------------------------------------------------------------- /driver/environment.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "driver/driver.h" 4 | #include "driver/diagnostics.h" 5 | #include "driver/utils/type_info.h" 6 | 7 | #include 8 | #include 9 | 10 | class Environment 11 | : public Child 12 | { 13 | private: 14 | using ChildType = Child; 15 | 16 | public: 17 | explicit Environment(Driver & driver); 18 | 19 | // Leave unimplemented for general case. 20 | template T & allocateChild(); 21 | template void deallocateChild(SQLHANDLE) noexcept; 22 | 23 | const TypeInfo & getTypeInfo(const std::string & type_name, const std::string & type_name_without_parameters) const; 24 | 25 | public: 26 | #if defined(SQL_OV_ODBC3_80) 27 | int odbc_version = SQL_OV_ODBC3_80; 28 | #else 29 | int odbc_version = SQL_OV_ODBC3; 30 | #endif 31 | 32 | private: 33 | std::unordered_map> connections; 34 | }; 35 | 36 | template <> Connection& Environment::allocateChild(); 37 | template <> void Environment::deallocateChild(SQLHANDLE handle) noexcept; 38 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/MemoryStream.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // MemoryStream.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: MemoryStream 7 | // 8 | // Copyright (c) 2009, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/MemoryStream.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | MemoryIOS::MemoryIOS(char* pBuffer, std::streamsize bufferSize): 22 | _buf(pBuffer, bufferSize) 23 | { 24 | poco_ios_init(&_buf); 25 | } 26 | 27 | 28 | MemoryIOS::~MemoryIOS() 29 | { 30 | } 31 | 32 | 33 | MemoryInputStream::MemoryInputStream(const char* pBuffer, std::streamsize bufferSize): 34 | MemoryIOS(const_cast(pBuffer), bufferSize), 35 | std::istream(&_buf) 36 | { 37 | } 38 | 39 | 40 | MemoryInputStream::~MemoryInputStream() 41 | { 42 | } 43 | 44 | 45 | MemoryOutputStream::MemoryOutputStream(char* pBuffer, std::streamsize bufferSize): 46 | MemoryIOS(pBuffer, bufferSize), 47 | std::ostream(&_buf) 48 | { 49 | } 50 | 51 | 52 | MemoryOutputStream::~MemoryOutputStream() 53 | { 54 | } 55 | 56 | 57 | } // namespace Poco 58 | -------------------------------------------------------------------------------- /test/vcvars_enabled_bash.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -Eeuo pipefail 4 | 5 | VCVRANGE="${VCVRANGE:-(0,999)}" 6 | VCVARSALL_ARGS="${VCVARSALL_ARGS:-x64}" 7 | 8 | VSWHERE="${VSWHERE:-C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe}" 9 | OLD_VSWHERE="${OLD_VSWHERE:-no}" 10 | 11 | if [ -z "${VCVARSALL:-}" ]; then 12 | if [[ "$OLD_VSWHERE" == "yes" ]]; then 13 | VCVARSALL="$("${VSWHERE}" -nologo -utf8 -format value -products "*" -version "${VCVRANGE}" -property installationPath | grep -m1 "\S" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" 14 | VCVARSALL="${VCVARSALL}/VC/Auxiliary/Build/vcvarsall.bat" 15 | else 16 | VCVARSALL="$("${VSWHERE}" -nologo -sort -utf8 -format value -products "*" -version "${VCVRANGE}" -find "**/vcvarsall.bat" | grep -m1 "\S" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" 17 | fi 18 | fi 19 | 20 | VCVARSALL="${VCVARSALL//\\//}" 21 | 22 | echo "\ 23 | call \"${VCVARSALL}\" ${VCVARSALL_ARGS} 24 | if %errorlevel% neq 0 exit /b %errorlevel% 25 | bash -Eeuxo pipefail -c \"$@\" 26 | if %errorlevel% neq 0 exit /b %errorlevel% 27 | " | cmd 28 | 29 | exit $? 30 | -------------------------------------------------------------------------------- /contrib/poco/Crypto/src/KeyPair.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // KeyPair.cpp 3 | // 4 | // Library: Crypto 5 | // Package: CryptoCore 6 | // Module: KeyPair 7 | // 8 | // Copyright (c) 2008, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Crypto/KeyPair.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Crypto { 21 | 22 | 23 | KeyPair::KeyPair(KeyPairImpl::Ptr pKeyPairImpl): 24 | _pImpl(pKeyPairImpl) 25 | { 26 | } 27 | 28 | 29 | KeyPair::KeyPair(const KeyPair& other): 30 | _pImpl(other._pImpl) 31 | { 32 | } 33 | 34 | 35 | KeyPair::KeyPair(KeyPair&& other) noexcept: 36 | _pImpl(std::move(other._pImpl)) 37 | { 38 | } 39 | 40 | 41 | KeyPair::~KeyPair() 42 | { 43 | } 44 | 45 | 46 | KeyPair& KeyPair::operator = (const KeyPair& other) 47 | { 48 | if (&other != this) 49 | { 50 | _pImpl = other._pImpl; 51 | } 52 | return *this; 53 | } 54 | 55 | 56 | KeyPair& KeyPair::operator = (KeyPair&& other) noexcept 57 | { 58 | _pImpl = std::move(other._pImpl); 59 | return *this; 60 | } 61 | 62 | 63 | } } // namespace Poco::Crypto 64 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Checksum.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Checksum.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: Checksum 7 | // 8 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Checksum.h" 16 | #if defined(POCO_UNBUNDLED) 17 | #include 18 | #else 19 | #include "zlib.h" 20 | #endif 21 | 22 | 23 | namespace Poco { 24 | 25 | 26 | Checksum::Checksum(): 27 | _type(TYPE_CRC32), 28 | _value(crc32(0L, Z_NULL, 0)) 29 | { 30 | } 31 | 32 | 33 | Checksum::Checksum(Type t): 34 | _type(t), 35 | _value(0) 36 | { 37 | if (t == TYPE_CRC32) 38 | _value = crc32(0L, Z_NULL, 0); 39 | else 40 | _value = adler32(0L, Z_NULL, 0); 41 | } 42 | 43 | 44 | Checksum::~Checksum() 45 | { 46 | } 47 | 48 | 49 | void Checksum::update(const char* data, unsigned length) 50 | { 51 | if (_type == TYPE_ADLER32) 52 | _value = adler32(_value, reinterpret_cast(data), length); 53 | else 54 | _value = crc32(_value, reinterpret_cast(data), length); 55 | } 56 | 57 | 58 | } // namespace Poco 59 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/NullStream.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NullStream.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: NullStream 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/NullStream.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | NullStreamBuf::NullStreamBuf() 22 | { 23 | } 24 | 25 | 26 | NullStreamBuf::~NullStreamBuf() 27 | { 28 | } 29 | 30 | 31 | int NullStreamBuf::readFromDevice() 32 | { 33 | return -1; 34 | } 35 | 36 | 37 | int NullStreamBuf::writeToDevice(char c) 38 | { 39 | return charToInt(c); 40 | } 41 | 42 | 43 | NullIOS::NullIOS() 44 | { 45 | poco_ios_init(&_buf); 46 | } 47 | 48 | 49 | NullIOS::~NullIOS() 50 | { 51 | } 52 | 53 | 54 | NullInputStream::NullInputStream(): std::istream(&_buf) 55 | { 56 | } 57 | 58 | 59 | NullInputStream::~NullInputStream() 60 | { 61 | } 62 | 63 | 64 | NullOutputStream::NullOutputStream(): std::ostream(&_buf) 65 | { 66 | } 67 | 68 | 69 | NullOutputStream::~NullOutputStream() 70 | { 71 | } 72 | 73 | 74 | } // namespace Poco 75 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Version.h: -------------------------------------------------------------------------------- 1 | // 2 | // Version.h 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: Version 7 | // 8 | // Version information for the POCO C++ Libraries. 9 | // 10 | // Copyright (c) 2004-2023, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Version_INCLUDED 18 | #define Foundation_Version_INCLUDED 19 | 20 | 21 | // 22 | // Version Information 23 | // 24 | // Since 1.6.0, we're using Semantic Versioning 2.0 25 | // (http://semver.org/spec/v2.0.0.html) 26 | // 27 | // Version format is 0xAABBCCDD, where 28 | // - AA is the major version number, 29 | // - BB is the minor version number, 30 | // - CC is the patch version number, and 31 | // - DD is the pre-release designation/number. 32 | // The pre-release designation hex digits have a special meaning: 33 | // 00: final/stable releases 34 | // Dx: development releases 35 | // Ax: alpha releases 36 | // Bx: beta releases 37 | // 38 | 39 | #define POCO_VERSION 0x010E0200 40 | 41 | #endif // Foundation_Version_INCLUDED 42 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/PipeImpl_DUMMY.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_DUMMY.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: PipeImpl 7 | // 8 | // Definition of the PipeImpl_DUMMY class. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_PipeImpl_DUMMY_INCLUDED 18 | #define Foundation_PipeImpl_DUMMY_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/RefCountedObject.h" 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | class Foundation_API PipeImpl: public RefCountedObject 29 | /// A dummy implementation of PipeImpl for platforms 30 | /// that do not support pipes. 31 | { 32 | public: 33 | typedef int Handle; 34 | 35 | PipeImpl(); 36 | ~PipeImpl(); 37 | int writeBytes(const void* buffer, int length); 38 | int readBytes(void* buffer, int length); 39 | Handle readHandle() const; 40 | Handle writeHandle() const; 41 | void closeRead(); 42 | void closeWrite(); 43 | }; 44 | 45 | 46 | } // namespace Poco 47 | 48 | 49 | #endif // Foundation_PipeImpl_DUMMY_INCLUDED 50 | -------------------------------------------------------------------------------- /contrib/poco/Net/include/Poco/Net/HTTPBufferAllocator.h: -------------------------------------------------------------------------------- 1 | // 2 | // HTTPBufferAllocator.h 3 | // 4 | // Library: Net 5 | // Package: HTTP 6 | // Module: HTTPBufferAllocator 7 | // 8 | // Definition of the HTTPBufferAllocator class. 9 | // 10 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Net_HTTPBufferAllocator_INCLUDED 18 | #define Net_HTTPBufferAllocator_INCLUDED 19 | 20 | 21 | #include "Poco/Net/Net.h" 22 | #include "Poco/MemoryPool.h" 23 | #include 24 | 25 | 26 | namespace Poco { 27 | namespace Net { 28 | 29 | 30 | class Net_API HTTPBufferAllocator 31 | /// A BufferAllocator for HTTP streams. 32 | { 33 | public: 34 | static char* allocate(std::streamsize size); 35 | static void deallocate(char* ptr, std::streamsize size); 36 | 37 | enum 38 | { 39 | BUFFER_SIZE = 1024UL * 128 // Increase buffer size to match zstd's recommended output buffer size 40 | }; 41 | 42 | private: 43 | static Poco::MemoryPool _pool; 44 | }; 45 | 46 | 47 | } } // namespace Poco::Net 48 | 49 | 50 | #endif // Net_HTTPBufferAllocator_INCLUDED 51 | -------------------------------------------------------------------------------- /contrib/poco/Util/src/RegExpValidator.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RegExpValidator.cpp 3 | // 4 | // Library: Util 5 | // Package: Options 6 | // Module: RegExpValidator 7 | // 8 | // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Util/RegExpValidator.h" 16 | #include "Poco/Util/Option.h" 17 | #include "Poco/Util/OptionException.h" 18 | #include "Poco/RegularExpression.h" 19 | #include "Poco/Format.h" 20 | 21 | 22 | using Poco::format; 23 | 24 | 25 | namespace Poco { 26 | namespace Util { 27 | 28 | 29 | RegExpValidator::RegExpValidator(const std::string& regexp): 30 | _regexp(regexp) 31 | { 32 | } 33 | 34 | 35 | RegExpValidator::~RegExpValidator() 36 | { 37 | } 38 | 39 | 40 | void RegExpValidator::validate(const Option& option, const std::string& value) 41 | { 42 | if (!RegularExpression::match(value, _regexp, RegularExpression::RE_ANCHORED | RegularExpression::RE_UTF8)) 43 | throw InvalidArgumentException(format("argument for %s does not match regular expression %s", option.fullName(), _regexp)); 44 | } 45 | 46 | 47 | } } // namespace Poco::Util 48 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/OrderedSet.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderedSet.h 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: OrderedSet 7 | // 8 | // Definition of the OrderedSet class template. 9 | // 10 | // Copyright (c) 2012, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_OrderedSet_INCLUDED 18 | #define Foundation_OrderedSet_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | #ifdef min 25 | #undef min 26 | #endif 27 | #ifdef max 28 | #undef max 29 | #endif 30 | #include "Poco/ordered_hash.h" 31 | #include "Poco/ordered_set.h" 32 | 33 | 34 | namespace Poco { 35 | 36 | 37 | template, 39 | class KeyEqual = std::equal_to, 40 | class Allocator = std::allocator, 41 | class ValueTypeContainer = std::deque> 42 | using OrderedSet = tsl::ordered_set; 43 | /// For documentation, see https://tessil.github.io/ordered-map/ 44 | 45 | } // namespace Poco 46 | 47 | 48 | #endif // Foundation_OrderedSet_INCLUDED 49 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Pipe.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Pipe.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: Pipe 7 | // 8 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Pipe.h" 16 | 17 | 18 | namespace Poco { 19 | 20 | 21 | Pipe::Pipe(): 22 | _pImpl(new PipeImpl) 23 | { 24 | } 25 | 26 | 27 | Pipe::Pipe(const Pipe& pipe): 28 | _pImpl(pipe._pImpl) 29 | { 30 | _pImpl->duplicate(); 31 | } 32 | 33 | 34 | Pipe::~Pipe() 35 | { 36 | _pImpl->release(); 37 | } 38 | 39 | 40 | Pipe& Pipe::operator = (const Pipe& pipe) 41 | { 42 | if (this != &pipe) 43 | { 44 | _pImpl->release(); 45 | _pImpl = pipe._pImpl; 46 | _pImpl->duplicate(); 47 | } 48 | return *this; 49 | } 50 | 51 | 52 | void Pipe::close(CloseMode mode) 53 | { 54 | switch (mode) 55 | { 56 | case CLOSE_READ: 57 | _pImpl->closeRead(); 58 | break; 59 | case CLOSE_WRITE: 60 | _pImpl->closeWrite(); 61 | break; 62 | default: 63 | _pImpl->closeRead(); 64 | _pImpl->closeWrite(); 65 | break; 66 | } 67 | } 68 | 69 | 70 | } // namespace Poco 71 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/src/SSLException.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SSLException.cpp 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: SSLException 7 | // 8 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Net/SSLException.h" 16 | #include 17 | 18 | 19 | namespace Poco { 20 | namespace Net { 21 | 22 | 23 | POCO_IMPLEMENT_EXCEPTION(SSLException, NetException, "SSL Exception") 24 | POCO_IMPLEMENT_EXCEPTION(SSLContextException, SSLException, "SSL context exception") 25 | POCO_IMPLEMENT_EXCEPTION(CertificateException, SSLException, "Certificate exception") 26 | POCO_IMPLEMENT_EXCEPTION(NoCertificateException, CertificateException, "No certificate") 27 | POCO_IMPLEMENT_EXCEPTION(InvalidCertificateException, CertificateException, "Invalid certficate") 28 | POCO_IMPLEMENT_EXCEPTION(CertificateValidationException, CertificateException, "Certificate validation error") 29 | POCO_IMPLEMENT_EXCEPTION(SSLConnectionUnexpectedlyClosedException, SSLException, "SSL connection unexpectedly closed") 30 | 31 | 32 | } } // namespace Poco::Net 33 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/BufferAllocator.h: -------------------------------------------------------------------------------- 1 | // 2 | // BufferAllocator.h 3 | // 4 | // Library: Foundation 5 | // Package: Streams 6 | // Module: BufferAllocator 7 | // 8 | // Definition of the BufferAllocator class. 9 | // 10 | // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_BufferAllocator_INCLUDED 18 | #define Foundation_BufferAllocator_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include 23 | #include 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | template 30 | class BufferAllocator 31 | /// The BufferAllocator used if no specific 32 | /// BufferAllocator has been specified. 33 | { 34 | public: 35 | typedef ch char_type; 36 | 37 | static char_type* allocate(std::streamsize size) 38 | { 39 | return new char_type[static_cast(size)]; 40 | } 41 | 42 | static void deallocate(char_type* ptr, std::streamsize /*size*/) noexcept 43 | { 44 | delete [] ptr; 45 | } 46 | }; 47 | 48 | 49 | } // namespace Poco 50 | 51 | 52 | #endif // Foundation_BufferAllocator_INCLUDED 53 | -------------------------------------------------------------------------------- /cmake/arch.cmake: -------------------------------------------------------------------------------- 1 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 2 | set (ARCH_BITS 64) 3 | elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) 4 | set (ARCH_BITS 32) 5 | endif () 6 | 7 | if (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64") 8 | if (CMAKE_LIBRARY_ARCHITECTURE MATCHES "i386") 9 | message (FATAL_ERROR "32bit platforms are not supported") 10 | endif () 11 | set (ARCH_AMD64 1) 12 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*|ARM64.*)") 13 | set (ARCH_AARCH64 1) 14 | set (ARCH_ARM 1) 15 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc64le.*|ppc64le.*|PPC64LE.*)") 16 | set (ARCH_PPC64LE 1) 17 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x.*|S390X.*)") 18 | set (ARCH_S390X 1) 19 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") 20 | set (ARCH_RISCV64 1) 21 | elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64") 22 | set (ARCH_LOONGARCH64 1) 23 | else () 24 | message (FATAL_ERROR "Platform ${CMAKE_SYSTEM_PROCESSOR} is not supported") 25 | endif () 26 | 27 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") 28 | set (COMPILER_GCC 1) 29 | elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 30 | set (COMPILER_CLANG 1) 31 | endif () 32 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/DataURIStreamFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // DataURIStreamFactory.cpp 3 | // 4 | // Library: Foundation 5 | // Package: URI 6 | // Module: DataURIStreamFactory 7 | // 8 | // Copyright (c) 2019, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/DataURIStreamFactory.h" 16 | #include "Poco/DataURIStream.h" 17 | #include "Poco/URI.h" 18 | #include "Poco/URIStreamOpener.h" 19 | 20 | 21 | namespace Poco { 22 | 23 | 24 | DataURIStreamFactory::DataURIStreamFactory() 25 | { 26 | } 27 | 28 | 29 | DataURIStreamFactory::~DataURIStreamFactory() 30 | { 31 | } 32 | 33 | 34 | std::istream* DataURIStreamFactory::open(const URI& uri) 35 | { 36 | poco_assert (uri.getScheme() == "data"); 37 | 38 | return new DataURIStream(uri); 39 | } 40 | 41 | 42 | void DataURIStreamFactory::registerFactory() 43 | { 44 | URIStreamOpener::defaultOpener().registerStreamFactory("data", new DataURIStreamFactory); 45 | } 46 | 47 | 48 | void DataURIStreamFactory::unregisterFactory() 49 | { 50 | URIStreamOpener::defaultOpener().unregisterStreamFactory("data"); 51 | } 52 | 53 | 54 | } // namespace Poco 55 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_aarch64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/darwin_x86_64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_aarch64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_ppc64le/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_riscv64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_s390x/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_x86_64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/openssl-cmake/linux_loongarch64/include/openssl/fipskey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by Makefile from include/openssl/fipskey.h.in 4 | * 5 | * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the Apache License 2.0 (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #ifndef OPENSSL_FIPSKEY_H 14 | # define OPENSSL_FIPSKEY_H 15 | # pragma once 16 | 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | /* 22 | * The FIPS validation HMAC key, usable as an array initializer. 23 | */ 24 | #define FIPS_KEY_ELEMENTS \ 25 | 0xf4, 0x55, 0x66, 0x50, 0xac, 0x31, 0xd3, 0x54, 0x61, 0x61, 0x0b, 0xac, 0x4e, 0xd8, 0x1b, 0x1a, 0x18, 0x1b, 0x2d, 0x8a, 0x43, 0xea, 0x28, 0x54, 0xcb, 0xae, 0x22, 0xca, 0x74, 0x56, 0x08, 0x13 26 | 27 | /* 28 | * The FIPS validation key, as a string. 29 | */ 30 | #define FIPS_KEY_STRING "f4556650ac31d35461610bac4ed81b1a181b2d8a43ea2854cbae22ca74560813" 31 | 32 | # ifdef __cplusplus 33 | } 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Semaphore_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // Semaphore_WIN32.h 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: Semaphore 7 | // 8 | // Definition of the SemaphoreImpl class for WIN32. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Semaphore_WIN32_INCLUDED 18 | #define Foundation_Semaphore_WIN32_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/Exception.h" 23 | #include "Poco/UnWindows.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API SemaphoreImpl 30 | { 31 | protected: 32 | SemaphoreImpl(int n, int max); 33 | ~SemaphoreImpl(); 34 | void setImpl(); 35 | void waitImpl(); 36 | bool waitImpl(long milliseconds); 37 | 38 | private: 39 | HANDLE _sema; 40 | }; 41 | 42 | 43 | // 44 | // inlines 45 | // 46 | inline void SemaphoreImpl::setImpl() 47 | { 48 | if (!ReleaseSemaphore(_sema, 1, NULL)) 49 | { 50 | throw SystemException("cannot signal semaphore"); 51 | } 52 | } 53 | 54 | 55 | } // namespace Poco 56 | 57 | 58 | #endif // Foundation_Semaphore_WIN32_INCLUDED 59 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/ActiveStarter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ActiveStarter.h 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: ActiveObjects 7 | // 8 | // Definition of the ActiveStarter class. 9 | // 10 | // Copyright (c) 2006-2007, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_ActiveStarter_INCLUDED 18 | #define Foundation_ActiveStarter_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/ActiveThreadPool.h" 23 | #include "Poco/ActiveRunnable.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | template 30 | class ActiveStarter 31 | /// The default implementation of the StarterType 32 | /// policy for ActiveMethod. It starts the method 33 | /// in its own thread, obtained from the default 34 | /// thread pool. 35 | { 36 | public: 37 | static void start(OwnerType* /*pOwner*/, ActiveRunnableBase::Ptr pRunnable) 38 | { 39 | ActiveThreadPool::defaultPool().start(*pRunnable); 40 | pRunnable->duplicate(); // The runnable will release itself. 41 | } 42 | }; 43 | 44 | 45 | } // namespace Poco 46 | 47 | 48 | #endif // Foundation_ActiveStarter_INCLUDED 49 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/OrderedMap.h: -------------------------------------------------------------------------------- 1 | // 2 | // OrderedMap.h 3 | // 4 | // Library: Foundation 5 | // Package: Core 6 | // Module: OrderedMap 7 | // 8 | // Definition of the OrderedMap class template. 9 | // 10 | // Copyright (c) 2012, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_OrderedMap_INCLUDED 18 | #define Foundation_OrderedMap_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | 23 | 24 | #ifdef min 25 | #undef min 26 | #endif 27 | #ifdef max 28 | #undef max 29 | #endif 30 | #include "Poco/ordered_hash.h" 31 | #include "Poco/ordered_map.h" 32 | 33 | 34 | namespace Poco { 35 | 36 | 37 | template, 40 | class KeyEqual = std::equal_to, 41 | class Allocator = std::allocator>, 42 | class ValueTypeContainer = std::deque, Allocator>> 43 | using OrderedMap = tsl::ordered_map; 44 | /// For documentation, see https://tessil.github.io/ordered-map/ 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_OrderedMap_INCLUDED 51 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/Path_UNIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Path_UNIX.h 3 | // 4 | // Library: Foundation 5 | // Package: Filesystem 6 | // Module: Path 7 | // 8 | // Definition of the PathImpl class fo rUnix. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_Path_UNIX_INCLUDED 18 | #define Foundation_Path_UNIX_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | class PathImpl 29 | { 30 | public: 31 | static std::string selfImpl(); 32 | static std::string currentImpl(); 33 | static std::string homeImpl(); 34 | static std::string configHomeImpl(); 35 | static std::string dataHomeImpl(); 36 | static std::string tempHomeImpl(); 37 | static std::string cacheHomeImpl(); 38 | static std::string tempImpl(); 39 | static std::string configImpl(); 40 | static std::string nullImpl(); 41 | static std::string expandImpl(const std::string& path); 42 | static void listRootsImpl(std::vector& roots); 43 | 44 | }; 45 | 46 | 47 | } // namespace Poco 48 | 49 | 50 | #endif // Foundation_Path_UNIX_INCLUDED 51 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/PipeImpl_POSIX.h: -------------------------------------------------------------------------------- 1 | // 2 | // PipeImpl_POSIX.h 3 | // 4 | // Library: Foundation 5 | // Package: Processes 6 | // Module: PipeImpl 7 | // 8 | // Definition of the PipeImpl class for POSIX. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_PipeImpl_POSIX_INCLUDED 18 | #define Foundation_PipeImpl_POSIX_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/RefCountedObject.h" 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | class Foundation_API PipeImpl: public RefCountedObject 29 | /// A dummy implementation of PipeImpl for platforms 30 | /// that do not support pipes. 31 | { 32 | public: 33 | typedef int Handle; 34 | 35 | PipeImpl(); 36 | ~PipeImpl(); 37 | int writeBytes(const void* buffer, int length); 38 | int readBytes(void* buffer, int length); 39 | Handle readHandle() const; 40 | Handle writeHandle() const; 41 | void closeRead(); 42 | void closeWrite(); 43 | 44 | private: 45 | int _readfd; 46 | int _writefd; 47 | }; 48 | 49 | 50 | } // namespace Poco 51 | 52 | 53 | #endif // Foundation_PipeImpl_POSIX_INCLUDED 54 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_Win/include/Poco/Net/KeyConsoleHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyConsoleHandler.h 3 | // 4 | // Library: NetSSL_Win 5 | // Package: SSLCore 6 | // Module: KeyConsoleHandler 7 | // 8 | // Definition of the KeyConsoleHandler class. 9 | // 10 | // Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef NetSSL_KeyConsoleHandler_INCLUDED 18 | #define NetSSL_KeyConsoleHandler_INCLUDED 19 | 20 | 21 | #include "Poco/Net/NetSSL.h" 22 | #include "Poco/Net/PrivateKeyPassphraseHandler.h" 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | class NetSSL_Win_API KeyConsoleHandler: public PrivateKeyPassphraseHandler 30 | /// An implementation of PrivateKeyPassphraseHandler that 31 | /// reads the key for a certificate from the console. 32 | { 33 | public: 34 | KeyConsoleHandler(bool server); 35 | /// Creates the KeyConsoleHandler. 36 | 37 | ~KeyConsoleHandler(); 38 | /// Destroys the KeyConsoleHandler. 39 | 40 | void onPrivateKeyRequested(const void* pSender, std::string& privateKey); 41 | }; 42 | 43 | 44 | } } // namespace Poco::Net 45 | 46 | 47 | #endif // NetSSL_KeyConsoleHandler_INCLUDED 48 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/include/Poco/RWLock_WIN32.h: -------------------------------------------------------------------------------- 1 | // 2 | // RWLock_WIN32.h 3 | // 4 | // Library: Foundation 5 | // Package: Threading 6 | // Module: RWLock 7 | // 8 | // Definition of the RWLockImpl class for WIN32. 9 | // 10 | // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef Foundation_RWLock_WIN32_INCLUDED 18 | #define Foundation_RWLock_WIN32_INCLUDED 19 | 20 | 21 | #include "Poco/Foundation.h" 22 | #include "Poco/Exception.h" 23 | #include "Poco/UnWindows.h" 24 | 25 | 26 | namespace Poco { 27 | 28 | 29 | class Foundation_API RWLockImpl 30 | { 31 | protected: 32 | RWLockImpl(); 33 | ~RWLockImpl(); 34 | void readLockImpl(); 35 | bool tryReadLockImpl(); 36 | void writeLockImpl(); 37 | bool tryWriteLockImpl(); 38 | void unlockImpl(); 39 | 40 | private: 41 | void addWriter(); 42 | void removeWriter(); 43 | DWORD tryReadLockOnce(); 44 | 45 | HANDLE _mutex; 46 | HANDLE _readEvent; 47 | HANDLE _writeEvent; 48 | unsigned _readers; 49 | unsigned _writersWaiting; 50 | unsigned _writers; 51 | }; 52 | 53 | 54 | } // namespace Poco 55 | 56 | 57 | #endif // Foundation_RWLock_WIN32_INCLUDED 58 | -------------------------------------------------------------------------------- /contrib/poco/NetSSL_OpenSSL/include/Poco/Net/KeyConsoleHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyConsoleHandler.h 3 | // 4 | // Library: NetSSL_OpenSSL 5 | // Package: SSLCore 6 | // Module: KeyConsoleHandler 7 | // 8 | // Definition of the KeyConsoleHandler class. 9 | // 10 | // Copyright (c) 2006-2009, Applied Informatics Software Engineering GmbH. 11 | // and Contributors. 12 | // 13 | // SPDX-License-Identifier: BSL-1.0 14 | // 15 | 16 | 17 | #ifndef NetSSL_KeyConsoleHandler_INCLUDED 18 | #define NetSSL_KeyConsoleHandler_INCLUDED 19 | 20 | 21 | #include "Poco/Net/NetSSL.h" 22 | #include "Poco/Net/PrivateKeyPassphraseHandler.h" 23 | 24 | 25 | namespace Poco { 26 | namespace Net { 27 | 28 | 29 | class NetSSL_API KeyConsoleHandler: public PrivateKeyPassphraseHandler 30 | /// An implementation of PrivateKeyPassphraseHandler that 31 | /// reads the key for a certificate from the console. 32 | { 33 | public: 34 | KeyConsoleHandler(bool server); 35 | /// Creates the KeyConsoleHandler. 36 | 37 | ~KeyConsoleHandler(); 38 | /// Destroys the KeyConsoleHandler. 39 | 40 | void onPrivateKeyRequested(const void* pSender, std::string& privateKey); 41 | }; 42 | 43 | 44 | } } // namespace Poco::Net 45 | 46 | 47 | #endif // NetSSL_KeyConsoleHandler_INCLUDED 48 | -------------------------------------------------------------------------------- /contrib/poco/Foundation/src/Unicode.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Unicode.cpp 3 | // 4 | // Library: Foundation 5 | // Package: Text 6 | // Module: Unicode 7 | // 8 | // Copyright (c) 2007, Applied Informatics Software Engineering GmbH. 9 | // and Contributors. 10 | // 11 | // SPDX-License-Identifier: BSL-1.0 12 | // 13 | 14 | 15 | #include "Poco/Unicode.h" 16 | 17 | 18 | extern "C" 19 | { 20 | #include "pcre2_config.h" 21 | #include "pcre2_internal.h" 22 | } 23 | 24 | 25 | namespace Poco { 26 | 27 | 28 | void Unicode::properties(int ch, CharacterProperties& props) 29 | { 30 | if (ch > UCP_MAX_CODEPOINT) ch = 0; 31 | const ucd_record* ucd = GET_UCD(ch); 32 | props.category = static_cast(PRIV(ucp_gentype)[ucd->chartype]); 33 | props.type = static_cast(ucd->chartype); 34 | props.script = static_cast