diff --git a/base/poco/Crypto/include/Poco/Crypto/Crypto.h b/base/poco/Crypto/include/Poco/Crypto/Crypto.h index a6b8a5cf22f..42dc8cb137c 100644 --- a/base/poco/Crypto/include/Poco/Crypto/Crypto.h +++ b/base/poco/Crypto/include/Poco/Crypto/Crypto.h @@ -66,15 +66,6 @@ enum RSAPaddingMode // Crypto_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) -# if defined(POCO_DLL) -# if defined(Crypto_EXPORTS) -# define Crypto_API __declspec(dllexport) -# else -# define Crypto_API __declspec(dllimport) -# endif -# endif -#endif #if !defined(Crypto_API) @@ -89,76 +80,6 @@ enum RSAPaddingMode // // Automatically link Crypto and OpenSSL libraries. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) -# if defined(POCO_INTERNAL_OPENSSL_MSVC_VER) -# if defined(POCO_EXTERNAL_OPENSSL) -# pragma message("External OpenSSL defined but internal headers used - possible mismatch!") -# endif // POCO_EXTERNAL_OPENSSL -# if !defined(_DEBUG) -# define POCO_DEBUG_SUFFIX "" -# if !defined(_DLL) -# define POCO_STATIC_SUFFIX "mt" -# else // _DLL -# define POCO_STATIC_SUFFIX "" -# endif -# else // _DEBUG -# define POCO_DEBUG_SUFFIX "d" -# if !defined(_DLL) -# define POCO_STATIC_SUFFIX "mt" -# else // _DLL -# define POCO_STATIC_SUFFIX "" -# endif -# endif -# pragma comment(lib, "libcrypto" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib") -# pragma comment(lib, "libssl" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib") -# if !defined(_WIN64) && !defined(_DLL) && (POCO_INTERNAL_OPENSSL_MSVC_VER == 120) \ - && (POCO_MSVC_VERSION < POCO_INTERNAL_OPENSSL_MSVC_VER) -# pragma comment(lib, "libPreVS2013CRT" POCO_STATIC_SUFFIX POCO_DEBUG_SUFFIX ".lib") -# endif -# if !defined(_DLL) && (POCO_MSVS_VERSION >= 2015) -# pragma comment(lib, "legacy_stdio_definitions.lib") -# pragma comment(lib, "legacy_stdio_wide_specifiers.lib") -# endif -# elif defined(POCO_EXTERNAL_OPENSSL) -# if POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_SLPRO -# if defined(POCO_DLL) -# if OPENSSL_VERSION_PREREQ(1, 1) -# pragma comment(lib, "libcrypto.lib") -# pragma comment(lib, "libssl.lib") -# else -# pragma comment(lib, "libeay32.lib") -# pragma comment(lib, "ssleay32.lib") -# endif -# else -# if OPENSSL_VERSION_PREREQ(1, 1) -# if defined(_WIN64) -# pragma comment(lib, "libcrypto64" POCO_LIB_SUFFIX) -# pragma comment(lib, "libssl64" POCO_LIB_SUFFIX) -# else -# pragma comment(lib, "libcrypto32" POCO_LIB_SUFFIX) -# pragma comment(lib, "libssl32" POCO_LIB_SUFFIX) -# endif -# else -# pragma comment(lib, "libeay32" POCO_LIB_SUFFIX) -# pragma comment(lib, "ssleay32" POCO_LIB_SUFFIX) -# endif -# endif -# elif POCO_EXTERNAL_OPENSSL == POCO_EXTERNAL_OPENSSL_DEFAULT -# if OPENSSL_VERSION_PREREQ(1, 1) -# pragma comment(lib, "libcrypto.lib") -# pragma comment(lib, "libssl.lib") -# else -# pragma comment(lib, "libeay32.lib") -# pragma comment(lib, "ssleay32.lib") -# endif -# endif -# endif // POCO_INTERNAL_OPENSSL_MSVC_VER -# if !defined(Crypto_EXPORTS) -# pragma comment(lib, "PocoCrypto" POCO_LIB_SUFFIX) -# endif -# endif // POCO_NO_AUTOMATIC_LIBS -#endif namespace Poco diff --git a/base/poco/Crypto/src/OpenSSLInitializer.cpp b/base/poco/Crypto/src/OpenSSLInitializer.cpp index a3bc1d01431..31798e8dd7e 100644 --- a/base/poco/Crypto/src/OpenSSLInitializer.cpp +++ b/base/poco/Crypto/src/OpenSSLInitializer.cpp @@ -22,36 +22,12 @@ #if OPENSSL_VERSION_NUMBER >= 0x0907000L #include #endif -#if defined(POCO_OS_FAMILY_WINDOWS) - #define POCO_STR_HELPER(x) #x - #define POCO_STR(x) POCO_STR_HELPER(x) - #if defined POCO_INTERNAL_OPENSSL_MSVC_VER - #define POCO_INTERNAL_OPENSSL_BUILD \ - " (POCO internal build, MSVC version " \ - POCO_STR(POCO_INTERNAL_OPENSSL_MSVC_VER) ")" - #else - #define POCO_INTERNAL_OPENSSL_BUILD "" - #endif - #pragma message (OPENSSL_VERSION_TEXT POCO_INTERNAL_OPENSSL_BUILD) -#endif using Poco::RandomInputStream; using Poco::Thread; -#if defined(_MSC_VER) && !defined(_DLL) && defined(POCO_INTERNAL_OPENSSL_MSVC_VER) - - #if (POCO_MSVS_VERSION >= 2015) - FILE _iob[] = { *stdin, *stdout, *stderr }; - extern "C" FILE * __cdecl __iob_func(void) { return _iob; } - #endif // (POCO_MSVS_VERSION >= 2015) - - #if (POCO_MSVS_VERSION < 2012) - extern "C" __declspec(noreturn) void __cdecl __report_rangecheckfailure(void) { ::ExitProcess(1); } - #endif // (POCO_MSVS_VERSION < 2012) - -#endif // _MSC_VER && _MT && !POCO_EXTERNAL_OPENSSL && (POCO_MSVS_VERSION < 2013) namespace Poco { @@ -100,7 +76,6 @@ void OpenSSLInitializer::initialize() int nMutexes = CRYPTO_num_locks(); _mutexes = new Poco::FastMutex[nMutexes]; CRYPTO_set_locking_callback(&OpenSSLInitializer::lock); -#ifndef POCO_OS_FAMILY_WINDOWS // Not needed on Windows (see SF #110: random unhandled exceptions when linking with ssl). // https://sourceforge.net/p/poco/bugs/110/ // @@ -109,7 +84,6 @@ void OpenSSLInitializer::initialize() // then a default implementation is used - on Windows and BeOS this uses the system's // default thread identifying APIs" CRYPTO_set_id_callback(&OpenSSLInitializer::id); -#endif CRYPTO_set_dynlock_create_callback(&OpenSSLInitializer::dynlockCreate); CRYPTO_set_dynlock_lock_callback(&OpenSSLInitializer::dynlock); CRYPTO_set_dynlock_destroy_callback(&OpenSSLInitializer::dynlockDestroy); @@ -124,9 +98,7 @@ void OpenSSLInitializer::uninitialize() EVP_cleanup(); ERR_free_strings(); CRYPTO_set_locking_callback(0); -#ifndef POCO_OS_FAMILY_WINDOWS CRYPTO_set_id_callback(0); -#endif delete [] _mutexes; CONF_modules_free(); diff --git a/base/poco/Crypto/src/X509Certificate.cpp b/base/poco/Crypto/src/X509Certificate.cpp index 542066665df..8c2ba698d7b 100644 --- a/base/poco/Crypto/src/X509Certificate.cpp +++ b/base/poco/Crypto/src/X509Certificate.cpp @@ -20,10 +20,6 @@ #include "Poco/Format.h" #include #include -#ifdef _WIN32 -// fix for WIN32 header conflict -#undef X509_NAME -#endif #include #include #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Binder.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Binder.h index f0c7aa47d93..3169563879c 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Binder.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Binder.h @@ -31,9 +31,6 @@ #include "Poco/Data/ODBC/TypeInfo.h" #include "Poco/Data/ODBC/Utility.h" #include "Poco/Exception.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ConnectionHandle.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ConnectionHandle.h index e5bfa5efe3e..362361af783 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ConnectionHandle.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ConnectionHandle.h @@ -20,9 +20,6 @@ #include "Poco/Data/ODBC/EnvironmentHandle.h" #include "Poco/Data/ODBC/ODBC.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h index 343514c0626..135a368efad 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Diagnostics.h @@ -22,9 +22,6 @@ #include #include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/Utility.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/EnvironmentHandle.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/EnvironmentHandle.h index 6535f4e34d1..adf567e4158 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/EnvironmentHandle.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/EnvironmentHandle.h @@ -19,9 +19,6 @@ #include "Poco/Data/ODBC/ODBC.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Error.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Error.h index 3335cbfc2b6..dcded9f217a 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Error.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Error.h @@ -23,9 +23,6 @@ #include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/Utility.h" #include "Poco/Format.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Extractor.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Extractor.h index eb9ae0db019..82e2f895638 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Extractor.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Extractor.h @@ -34,9 +34,6 @@ #include "Poco/Exception.h" #include "Poco/Nullable.h" #include "Poco/UTFString.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Handle.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Handle.h index 41ffd1ce84c..0d1cee48f09 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Handle.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Handle.h @@ -23,9 +23,6 @@ #include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/ODBCException.h" #include "Poco/Data/ODBC/Utility.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBC.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBC.h index 8a6fa6560f9..4ae6d3aeb95 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBC.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBC.h @@ -21,9 +21,6 @@ #include "Poco/Foundation.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif // @@ -34,13 +31,6 @@ // ODBC_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(ODBC_EXPORTS) -# define ODBC_API __declspec(dllexport) -# else -# define ODBC_API __declspec(dllimport) -# endif -#endif #if !defined(ODBC_API) @@ -58,11 +48,6 @@ // // Automatically link Data library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(ODBC_EXPORTS) -# pragma comment(lib, "PocoDataODBC" POCO_LIB_SUFFIX) -# endif -#endif #endif // ODBC_ODBC_INCLUDED diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCMetaColumn.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCMetaColumn.h index f8760532a14..4783427fefa 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCMetaColumn.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCMetaColumn.h @@ -23,9 +23,6 @@ #include "Poco/Data/ODBC/Handle.h" #include "Poco/Data/ODBC/ODBC.h" #include "Poco/Data/ODBC/ODBCException.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCStatementImpl.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCStatementImpl.h index 7ef7aaf7c0b..e50228a6d52 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCStatementImpl.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/ODBCStatementImpl.h @@ -29,9 +29,6 @@ #include "Poco/Data/StatementImpl.h" #include "Poco/Format.h" #include "Poco/SharedPtr.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Parameter.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Parameter.h index f32c52b17af..b5baee3b507 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Parameter.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Parameter.h @@ -20,9 +20,6 @@ #include "Poco/Data/ODBC/Handle.h" #include "Poco/Data/ODBC/ODBC.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Preparator.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Preparator.h index af58108cf14..f92e4ea7083 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Preparator.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Preparator.h @@ -31,9 +31,6 @@ #include "Poco/DynamicAny.h" #include "Poco/SharedPtr.h" #include "Poco/UTFString.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h index cd47bc7518b..259f26afff8 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h @@ -27,9 +27,6 @@ #include "Poco/Data/ODBC/TypeInfo.h" #include "Poco/Mutex.h" #include "Poco/SharedPtr.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h index 5200a61c7dc..e26ada65858 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h @@ -23,9 +23,6 @@ #include "Poco/Data/ODBC/ODBC.h" #include "Poco/DynamicAny.h" #include "Poco/NamedTuple.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #include diff --git a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Unicode.h b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Unicode.h index 40148ed79c2..170498841d4 100644 --- a/base/poco/Data/ODBC/include/Poco/Data/ODBC/Unicode.h +++ b/base/poco/Data/ODBC/include/Poco/Data/ODBC/Unicode.h @@ -22,9 +22,6 @@ #include "Poco/Buffer.h" #include "Poco/Exception.h" #include "Poco/UnicodeConverter.h" -#ifdef POCO_OS_FAMILY_WINDOWS -# include -#endif #ifndef SQL_NOUNICODEMAP # define SQL_NOUNICODEMAP #endif @@ -33,10 +30,7 @@ #include -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# define POCO_ODBC_UNICODE -# define POCO_ODBC_UNICODE_WINDOWS -#elif defined(POCO_OS_FAMILY_UNIX) && defined(UNICODE) +#if defined(POCO_OS_FAMILY_UNIX) && defined(UNICODE) # define POCO_ODBC_UNICODE # ifdef POCO_UNIXODBC # define POCO_ODBC_UNICODE_UNIXODBC diff --git a/base/poco/Data/ODBC/src/Binder.cpp b/base/poco/Data/ODBC/src/Binder.cpp index aa2c9e157f1..7e99f71dc28 100644 --- a/base/poco/Data/ODBC/src/Binder.cpp +++ b/base/poco/Data/ODBC/src/Binder.cpp @@ -500,18 +500,6 @@ void Binder::getColumnOrParameterSize(std::size_t pos, SQLINTEGER& size) { size = DEFAULT_PARAM_SIZE; //On Linux, PostgreSQL driver segfaults on SQLGetDescField, so this is disabled for now -#ifdef POCO_OS_FAMILY_WINDOWS - SQLHDESC hIPD = 0; - if (!Utility::isError(SQLGetStmtAttr(_rStmt, SQL_ATTR_IMP_PARAM_DESC, &hIPD, SQL_IS_POINTER, 0))) - { - SQLUINTEGER sz = 0; - if (!Utility::isError(SQLGetDescField(hIPD, (SQLSMALLINT) pos + 1, SQL_DESC_LENGTH, &sz, SQL_IS_UINTEGER, 0)) && - sz > 0) - { - size = sz; - } - } -#endif } if (colSize > 0 && paramSize > 0) diff --git a/base/poco/Data/ODBC/src/ODBCStatementImpl.cpp b/base/poco/Data/ODBC/src/ODBCStatementImpl.cpp index 9dd8c4e7a8f..b27dade266a 100644 --- a/base/poco/Data/ODBC/src/ODBCStatementImpl.cpp +++ b/base/poco/Data/ODBC/src/ODBCStatementImpl.cpp @@ -20,9 +20,6 @@ #include "Poco/Exception.h" -#ifdef POCO_OS_FAMILY_WINDOWS - #pragma warning(disable:4312)// 'type cast' : conversion from 'std::size_t' to 'SQLPOINTER' of greater size -#endif using Poco::DataFormatException; diff --git a/base/poco/Data/include/Poco/Data/Data.h b/base/poco/Data/include/Poco/Data/Data.h index 7243d36c091..3eec5de3251 100644 --- a/base/poco/Data/include/Poco/Data/Data.h +++ b/base/poco/Data/include/Poco/Data/Data.h @@ -31,13 +31,6 @@ // Data_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(Data_EXPORTS) -# define Data_API __declspec(dllexport) -# else -# define Data_API __declspec(dllimport) -# endif -#endif #if !defined(Data_API) @@ -52,11 +45,6 @@ // // Automatically link Data library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Data_EXPORTS) -# pragma comment(lib, "PocoData" POCO_LIB_SUFFIX) -# endif -#endif #endif // Data_Data_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Alignment.h b/base/poco/Foundation/include/Poco/Alignment.h index 72218910dd2..b1d48ffd62d 100644 --- a/base/poco/Foundation/include/Poco/Alignment.h +++ b/base/poco/Foundation/include/Poco/Alignment.h @@ -135,7 +135,6 @@ struct AlignedCharArrayImpl; // MSVC requires special handling here. -# ifndef _MSC_VER # ifdef POCO_COMPILER_CLANG @@ -179,58 +178,6 @@ POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192); # undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT # endif // POCO_HAVE_ALIGNMENT -# else // _MSC_VER - -// We provide special variations of this template for the most common -// alignments because __declspec(align(...)) doesn't actually work when it is -// a member of a by-value function argument in MSVC, even if the alignment -// request is something reasonably like 8-byte or 16-byte. -template <> -struct AlignedCharArrayImpl<1> -{ - char aligned; -}; -template <> -struct AlignedCharArrayImpl<2> -{ - short aligned; -}; -template <> -struct AlignedCharArrayImpl<4> -{ - int aligned; -}; -template <> -struct AlignedCharArrayImpl<8> -{ - double aligned; -}; - -# define POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \ - template <> \ - struct AlignedCharArrayImpl \ - { \ - __declspec(align(x)) char aligned; \ - } - -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128); - -# if (_MSC_VER > 1600) // MSVC 2010 complains on alignment larger than 128 -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(512); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1024); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2048); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4096); -POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8192); -# endif // _MSC_VER > 1600 - -// Any larger and MSVC complains. -# undef POCO_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT - -# define POCO_HAVE_ALIGNMENT -# endif // _MSC_VER // POCO_HAVE_ALIGNMENT will be defined on the pre-C++11 platforms/compilers where // it can be reliably determined and used. Uncomment the line below to explicitly diff --git a/base/poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h b/base/poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h index ec00d61eeb6..05d2f81b16d 100644 --- a/base/poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h +++ b/base/poco/Foundation/include/Poco/BufferedBidirectionalStreamBuf.h @@ -161,9 +161,6 @@ private: // instantiation - to avoid duplicate symbols due to multiple // instantiations in different libraries. // -#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS) -template class Foundation_API BasicBufferedBidirectionalStreamBuf>; -#endif typedef BasicBufferedBidirectionalStreamBuf> BufferedBidirectionalStreamBuf; diff --git a/base/poco/Foundation/include/Poco/BufferedStreamBuf.h b/base/poco/Foundation/include/Poco/BufferedStreamBuf.h index ea81e5fafa8..9f4cbd4e4d8 100644 --- a/base/poco/Foundation/include/Poco/BufferedStreamBuf.h +++ b/base/poco/Foundation/include/Poco/BufferedStreamBuf.h @@ -151,9 +151,6 @@ private: // instantiation - to avoid duplicate symbols due to multiple // instantiations in different libraries. // -#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS) -template class Foundation_API BasicBufferedStreamBuf>; -#endif typedef BasicBufferedStreamBuf> BufferedStreamBuf; diff --git a/base/poco/Foundation/include/Poco/ByteOrder.h b/base/poco/Foundation/include/Poco/ByteOrder.h index e5ce630c03a..4f2644ddf4e 100644 --- a/base/poco/Foundation/include/Poco/ByteOrder.h +++ b/base/poco/Foundation/include/Poco/ByteOrder.h @@ -18,9 +18,6 @@ #include "Poco/Foundation.h" #include "Poco/Types.h" -#if defined(_MSC_VER) -# include // builtins -#endif namespace Poco @@ -99,11 +96,7 @@ public: #if !defined(POCO_NO_BYTESWAP_BUILTINS) -# if defined(_MSC_VER) -# if (POCO_MSVC_VERSION > 71) -# define POCO_HAVE_MSC_BYTESWAP 1 -# endif -# elif defined(__clang__) +# if defined(__clang__) # if __has_builtin(__builtin_bswap32) # define POCO_HAVE_GCC_BYTESWAP 1 # endif diff --git a/base/poco/Foundation/include/Poco/ClassLibrary.h b/base/poco/Foundation/include/Poco/ClassLibrary.h index b254fafd3cb..deb43f26297 100644 --- a/base/poco/Foundation/include/Poco/ClassLibrary.h +++ b/base/poco/Foundation/include/Poco/ClassLibrary.h @@ -23,11 +23,7 @@ #include "Poco/Manifest.h" -#if defined(_WIN32) -# define POCO_LIBRARY_API __declspec(dllexport) -#else # define POCO_LIBRARY_API -#endif // diff --git a/base/poco/Foundation/include/Poco/Config.h b/base/poco/Foundation/include/Poco/Config.h index 10be8cdb7ea..e3fcb9d91cd 100644 --- a/base/poco/Foundation/include/Poco/Config.h +++ b/base/poco/Foundation/include/Poco/Config.h @@ -159,9 +159,6 @@ // Windows CE has no locale support -#if defined(_WIN32_WCE) -# define POCO_NO_LOCALE -#endif // Enable the poco_debug_* and poco_trace_* macros diff --git a/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32.h b/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32.h deleted file mode 100644 index 81b1dd06d35..00000000000 --- a/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// DirectoryIterator_WIN32.h -// -// Library: Foundation -// Package: Filesystem -// Module: DirectoryIterator -// -// Definition of the DirectoryIteratorImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_DirectoryIterator_WIN32_INCLUDED -#define Foundation_DirectoryIterator_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API DirectoryIteratorImpl -{ -public: - DirectoryIteratorImpl(const std::string & path); - ~DirectoryIteratorImpl(); - - void duplicate(); - void release(); - - const std::string & get() const; - const std::string & next(); - -private: - HANDLE _fh; - WIN32_FIND_DATA _fd; - std::string _current; - int _rc; -}; - - -// -// inlines -// -const std::string & DirectoryIteratorImpl::get() const -{ - return _current; -} - - -inline void DirectoryIteratorImpl::duplicate() -{ - ++_rc; -} - - -inline void DirectoryIteratorImpl::release() -{ - if (--_rc == 0) - delete this; -} - - -} // namespace Poco - - -#endif // Foundation_DirectoryIterator_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h b/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h deleted file mode 100644 index dc358c620a6..00000000000 --- a/base/poco/Foundation/include/Poco/DirectoryIterator_WIN32U.h +++ /dev/null @@ -1,74 +0,0 @@ -// -// DirectoryIterator_WIN32U.h -// -// Library: Foundation -// Package: Filesystem -// Module: DirectoryIterator -// -// Definition of the DirectoryIteratorImpl class for WIN32. -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_DirectoryIterator_WIN32U_INCLUDED -#define Foundation_DirectoryIterator_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API DirectoryIteratorImpl -{ -public: - DirectoryIteratorImpl(const std::string & path); - ~DirectoryIteratorImpl(); - - void duplicate(); - void release(); - - const std::string & get() const; - const std::string & next(); - -private: - HANDLE _fh; - WIN32_FIND_DATAW _fd; - std::string _current; - int _rc; -}; - - -// -// inlines -// -const std::string & DirectoryIteratorImpl::get() const -{ - return _current; -} - - -inline void DirectoryIteratorImpl::duplicate() -{ - ++_rc; -} - - -inline void DirectoryIteratorImpl::release() -{ - if (--_rc == 0) - delete this; -} - - -} // namespace Poco - - -#endif // Foundation_DirectoryIterator_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Environment_VX.h b/base/poco/Foundation/include/Poco/Environment_VX.h deleted file mode 100644 index 583103ac620..00000000000 --- a/base/poco/Foundation/include/Poco/Environment_VX.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// Environment_VX.h -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Definition of the EnvironmentImpl class for VxWorks. -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Environment_VX_INCLUDED -#define Foundation_Environment_VX_INCLUDED - - -#include -#include "Poco/Foundation.h" -#include "Poco/Mutex.h" - - -namespace Poco -{ - - -class Foundation_API EnvironmentImpl -{ -public: - typedef UInt8 NodeId[6]; /// Ethernet address. - - static std::string getImpl(const std::string & name); - static bool hasImpl(const std::string & name); - static void setImpl(const std::string & name, const std::string & value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); - static void nodeIdImpl(NodeId & id); - static unsigned processorCountImpl(); - -private: - typedef std::map StringMap; - - static StringMap _map; - static FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_Environment_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Environment_WIN32.h b/base/poco/Foundation/include/Poco/Environment_WIN32.h deleted file mode 100644 index 451a27a5792..00000000000 --- a/base/poco/Foundation/include/Poco/Environment_WIN32.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Environment_WIN32.h -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Definition of the EnvironmentImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Environment_WIN32_INCLUDED -#define Foundation_Environment_WIN32_INCLUDED - - -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API EnvironmentImpl -{ -public: - typedef UInt8 NodeId[6]; /// Ethernet address. - - static std::string getImpl(const std::string & name); - static bool hasImpl(const std::string & name); - static void setImpl(const std::string & name, const std::string & value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); - static void nodeIdImpl(NodeId & id); - static unsigned processorCountImpl(); -}; - - -} // namespace Poco - - -#endif // Foundation_Environment_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Environment_WIN32U.h b/base/poco/Foundation/include/Poco/Environment_WIN32U.h deleted file mode 100644 index 95ef6aac7bf..00000000000 --- a/base/poco/Foundation/include/Poco/Environment_WIN32U.h +++ /dev/null @@ -1,49 +0,0 @@ -// -// Environment_WIN32U.h -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Definition of the EnvironmentImpl class for WIN32. -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Environment_WIN32U_INCLUDED -#define Foundation_Environment_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API EnvironmentImpl -{ -public: - typedef UInt8 NodeId[6]; /// Ethernet address. - - static std::string getImpl(const std::string & name); - static bool hasImpl(const std::string & name); - static void setImpl(const std::string & name, const std::string & value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); - static void nodeIdImpl(NodeId & id); - static unsigned processorCountImpl(); -}; - - -} // namespace Poco - - -#endif // Foundation_Environment_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Environment_WINCE.h b/base/poco/Foundation/include/Poco/Environment_WINCE.h deleted file mode 100644 index a9bf71181e7..00000000000 --- a/base/poco/Foundation/include/Poco/Environment_WINCE.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// Environment_WINCE.h -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Definition of the EnvironmentImpl class for WINCE. -// -// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Environment_WINCE_INCLUDED -#define Foundation_Environment_WINCE_INCLUDED - - -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API EnvironmentImpl -{ -public: - typedef UInt8 NodeId[6]; /// Ethernet address. - - static std::string getImpl(const std::string & name); - static bool hasImpl(const std::string & name); - static void setImpl(const std::string & name, const std::string & value); - static std::string osNameImpl(); - static std::string osDisplayNameImpl(); - static std::string osVersionImpl(); - static std::string osArchitectureImpl(); - static std::string nodeNameImpl(); - static void nodeIdImpl(NodeId & id); - static unsigned processorCountImpl(); - -private: - static bool envVar(const std::string & name, std::string * value); - - static const std::string TEMP; - static const std::string TMP; - static const std::string HOMEPATH; - static const std::string COMPUTERNAME; - static const std::string OS; - static const std::string NUMBER_OF_PROCESSORS; - static const std::string PROCESSOR_ARCHITECTURE; -}; - - -} // namespace Poco - - -#endif // Foundation_Environment_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Error.h b/base/poco/Foundation/include/Poco/Error.h index 534631ded18..9150e470cea 100644 --- a/base/poco/Foundation/include/Poco/Error.h +++ b/base/poco/Foundation/include/Poco/Error.h @@ -30,19 +30,11 @@ class Foundation_API Error /// for error reporting. { public: -#ifdef POCO_OS_FAMILY_WINDOWS - static DWORD last(); - /// Utility function returning the last error. - - static std::string getMessage(DWORD errorCode); - /// Utility function translating numeric error code to string. -#else static int last(); /// Utility function returning the last error. static std::string getMessage(int errorCode); /// Utility function translating numeric error code to string. -#endif }; diff --git a/base/poco/Foundation/include/Poco/Event.h b/base/poco/Foundation/include/Poco/Event.h index 26c26d295a4..9dddb353003 100644 --- a/base/poco/Foundation/include/Poco/Event.h +++ b/base/poco/Foundation/include/Poco/Event.h @@ -22,13 +22,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/Event_WIN32.h" -#elif defined(POCO_VXWORKS) -# include "Poco/Event_VX.h" -#else # include "Poco/Event_POSIX.h" -#endif namespace Poco diff --git a/base/poco/Foundation/include/Poco/EventLogChannel.h b/base/poco/Foundation/include/Poco/EventLogChannel.h index e0b2089887c..e6a79088204 100644 --- a/base/poco/Foundation/include/Poco/EventLogChannel.h +++ b/base/poco/Foundation/include/Poco/EventLogChannel.h @@ -86,11 +86,7 @@ protected: static int getType(const Message & msg); static int getCategory(const Message & msg); void setUpRegistry() const; -#if defined(POCO_WIN32_UTF8) - static std::wstring findLibrary(const wchar_t * name); -#else static std::string findLibrary(const char * name); -#endif private: std::string _name; diff --git a/base/poco/Foundation/include/Poco/Event_VX.h b/base/poco/Foundation/include/Poco/Event_VX.h deleted file mode 100644 index adee455d6c7..00000000000 --- a/base/poco/Foundation/include/Poco/Event_VX.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// Event_VX.h -// -// Library: Foundation -// Package: Threading -// Module: Event -// -// Definition of the EventImpl class for VxWorks. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Event_VX_INCLUDED -#define Foundation_Event_VX_INCLUDED - - -#include -#include "Poco/Exception.h" -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API EventImpl -{ -protected: - EventImpl(bool autoReset); - ~EventImpl(); - void setImpl(); - void waitImpl(); - bool waitImpl(long milliseconds); - void resetImpl(); - -private: - bool _auto; - volatile bool _state; - SEM_ID _sem; -}; - - -} // namespace Poco - - -#endif // Foundation_Event_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Event_WIN32.h b/base/poco/Foundation/include/Poco/Event_WIN32.h deleted file mode 100644 index abda1d5686d..00000000000 --- a/base/poco/Foundation/include/Poco/Event_WIN32.h +++ /dev/null @@ -1,69 +0,0 @@ -// -// Event_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Event -// -// Definition of the EventImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Event_WIN32_INCLUDED -#define Foundation_Event_WIN32_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API EventImpl -{ -protected: - EventImpl(bool autoReset); - ~EventImpl(); - void setImpl(); - void waitImpl(); - bool waitImpl(long milliseconds); - void resetImpl(); - -private: - HANDLE _event; -}; - - -// -// inlines -// -inline void EventImpl::setImpl() -{ - if (!SetEvent(_event)) - { - throw SystemException("cannot signal event"); - } -} - - -inline void EventImpl::resetImpl() -{ - if (!ResetEvent(_event)) - { - throw SystemException("cannot reset event"); - } -} - - -} // namespace Poco - - -#endif // Foundation_Event_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/FPEnvironment.h b/base/poco/Foundation/include/Poco/FPEnvironment.h index 0cc40e21041..398c2af5eaa 100644 --- a/base/poco/Foundation/include/Poco/FPEnvironment.h +++ b/base/poco/Foundation/include/Poco/FPEnvironment.h @@ -27,12 +27,8 @@ # include "Poco/FPEnvironment_DEC.h" #elif defined(sun) || defined(__sun) # include "Poco/FPEnvironment_SUN.h" -#elif defined(__QNX__) -# include "Poco/FPEnvironment_QNX.h" #elif defined(POCO_OS_FAMILY_UNIX) # include "Poco/FPEnvironment_C99.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/FPEnvironment_WIN32.h" #else # include "Poco/FPEnvironment_DUMMY.h" #endif diff --git a/base/poco/Foundation/include/Poco/FPEnvironment_DEC.h b/base/poco/Foundation/include/Poco/FPEnvironment_DEC.h deleted file mode 100644 index caaa0e09602..00000000000 --- a/base/poco/Foundation/include/Poco/FPEnvironment_DEC.h +++ /dev/null @@ -1,90 +0,0 @@ -// -// FPEnvironment_DEC.h -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Definitions of class FPEnvironmentImpl for Tru64 and OpenVMS Alpha. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_FPEnvironment_DEC_INCLUDED -#define Foundation_FPEnvironment_DEC_INCLUDED - - -#include "Poco/Foundation.h" -#if defined(__VMS) -# include -#else -# include -#endif - - -namespace Poco -{ - - -class FPEnvironmentImpl -{ -protected: - enum RoundingModeImpl - { - FP_ROUND_DOWNWARD_IMPL = 0, - FP_ROUND_UPWARD_IMPL = 0, - FP_ROUND_TONEAREST_IMPL = 0, - FP_ROUND_TOWARDZERO_IMPL = 0 - }; - enum FlagImpl - { -#if defined(__VMS) - FP_DIVIDE_BY_ZERO_IMPL = IEEE$M_STATUS_DZE, - FP_INEXACT_IMPL = IEEE$M_STATUS_INE, - FP_OVERFLOW_IMPL = IEEE$M_STATUS_OVF, - FP_UNDERFLOW_IMPL = IEEE$M_STATUS_UNF, - FP_INVALID_IMPL = IEEE$M_STATUS_INV -#else - FP_DIVIDE_BY_ZERO_IMPL = IEEE_STATUS_DZE, - FP_INEXACT_IMPL = IEEE_STATUS_INE, - FP_OVERFLOW_IMPL = IEEE_STATUS_OVF, - FP_UNDERFLOW_IMPL = IEEE_STATUS_UNF, - FP_INVALID_IMPL = IEEE_STATUS_INV -#endif - }; - FPEnvironmentImpl(); - FPEnvironmentImpl(const FPEnvironmentImpl & env); - ~FPEnvironmentImpl(); - FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env); - void keepCurrentImpl(); - static void clearFlagsImpl(); - static bool isFlagImpl(FlagImpl flag); - static void setRoundingModeImpl(RoundingModeImpl mode); - static RoundingModeImpl getRoundingModeImpl(); - static bool isInfiniteImpl(float value); - static bool isInfiniteImpl(double value); - static bool isInfiniteImpl(long double value); - static bool isNaNImpl(float value); - static bool isNaNImpl(double value); - static bool isNaNImpl(long double value); - static float copySignImpl(float target, float source); - static double copySignImpl(double target, double source); - static long double copySignImpl(long double target, long double source); - -private: -#if defined(__VMS) - struct _ieee _env; -#else - unsigned long _env; -#endif -}; - - -} // namespace Poco - - -#endif // Foundation_FPEnvironment_DEC_INCLUDED diff --git a/base/poco/Foundation/include/Poco/FPEnvironment_QNX.h b/base/poco/Foundation/include/Poco/FPEnvironment_QNX.h deleted file mode 100644 index 360abf8d31c..00000000000 --- a/base/poco/Foundation/include/Poco/FPEnvironment_QNX.h +++ /dev/null @@ -1,134 +0,0 @@ -// -// FPEnvironment_QNX.h -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Definitions of class FPEnvironmentImpl for QNX. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_FPEnvironment_QNX_INCLUDED -#define Foundation_FPEnvironment_QNX_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class FPEnvironmentImpl -{ -protected: - enum RoundingModeImpl - { - FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, - FP_ROUND_UPWARD_IMPL = FE_UPWARD, - FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, - FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO - }; - enum FlagImpl - { - FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, - FP_INEXACT_IMPL = FE_INEXACT, - FP_OVERFLOW_IMPL = FE_OVERFLOW, - FP_UNDERFLOW_IMPL = FE_UNDERFLOW, - FP_INVALID_IMPL = FE_INVALID - }; - FPEnvironmentImpl(); - FPEnvironmentImpl(const FPEnvironmentImpl & env); - ~FPEnvironmentImpl(); - FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env); - void keepCurrentImpl(); - static void clearFlagsImpl(); - static bool isFlagImpl(FlagImpl flag); - static void setRoundingModeImpl(RoundingModeImpl mode); - static RoundingModeImpl getRoundingModeImpl(); - static bool isInfiniteImpl(float value); - static bool isInfiniteImpl(double value); - static bool isInfiniteImpl(long double value); - static bool isNaNImpl(float value); - static bool isNaNImpl(double value); - static bool isNaNImpl(long double value); - static float copySignImpl(float target, float source); - static double copySignImpl(double target, double source); - static long double copySignImpl(long double target, long double source); - -private: - fenv_t _env; -}; - - -// -// inlines -// -inline bool FPEnvironmentImpl::isInfiniteImpl(float value) -{ - using namespace std; - return isinf(value) != 0; -} - - -inline bool FPEnvironmentImpl::isInfiniteImpl(double value) -{ - using namespace std; - return isinf(value) != 0; -} - - -inline bool FPEnvironmentImpl::isInfiniteImpl(long double value) -{ - using namespace std; - return isinf((double)value) != 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(float value) -{ - using namespace std; - return isnan(value) != 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(double value) -{ - using namespace std; - return isnan(value) != 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(long double value) -{ - using namespace std; - return isnan((double)value) != 0; -} - - -inline float FPEnvironmentImpl::copySignImpl(float target, float source) -{ - using namespace std; - return copysignf(target, source); -} - - -inline double FPEnvironmentImpl::copySignImpl(double target, double source) -{ - using namespace std; - return copysign(target, source); -} - - -} // namespace Poco - - -#endif // Foundation_FPEnvironment_QNX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/FPEnvironment_SUN.h b/base/poco/Foundation/include/Poco/FPEnvironment_SUN.h deleted file mode 100644 index 7b31307e1ca..00000000000 --- a/base/poco/Foundation/include/Poco/FPEnvironment_SUN.h +++ /dev/null @@ -1,75 +0,0 @@ -// -// FPEnvironment_SUN.h -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Definitions of class FPEnvironmentImpl for Solaris. -// -// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_FPEnvironment_SUN_INCLUDED -#define Foundation_FPEnvironment_SUN_INCLUDED - - -#include -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class FPEnvironmentImpl -{ -protected: - enum RoundingModeImpl - { - FP_ROUND_DOWNWARD_IMPL = FP_RM, - FP_ROUND_UPWARD_IMPL = FP_RP, - FP_ROUND_TONEAREST_IMPL = FP_RN, - FP_ROUND_TOWARDZERO_IMPL = FP_RZ - }; - enum FlagImpl - { - FP_DIVIDE_BY_ZERO_IMPL = FP_X_DZ, - FP_INEXACT_IMPL = FP_X_IMP, - FP_OVERFLOW_IMPL = FP_X_OFL, - FP_UNDERFLOW_IMPL = FP_X_UFL, - FP_INVALID_IMPL = FP_X_INV - }; - FPEnvironmentImpl(); - FPEnvironmentImpl(const FPEnvironmentImpl & env); - ~FPEnvironmentImpl(); - FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env); - void keepCurrentImpl(); - static void clearFlagsImpl(); - static bool isFlagImpl(FlagImpl flag); - static void setRoundingModeImpl(RoundingModeImpl mode); - static RoundingModeImpl getRoundingModeImpl(); - static bool isInfiniteImpl(float value); - static bool isInfiniteImpl(double value); - static bool isInfiniteImpl(long double value); - static bool isNaNImpl(float value); - static bool isNaNImpl(double value); - static bool isNaNImpl(long double value); - static float copySignImpl(float target, float source); - static double copySignImpl(double target, double source); - static long double copySignImpl(long double target, long double source); - -private: - fp_rnd _rnd; - fp_except _exc; -}; - - -} // namespace Poco - - -#endif // Foundation_FPEnvironment_SUN_INCLUDED diff --git a/base/poco/Foundation/include/Poco/FPEnvironment_WIN32.h b/base/poco/Foundation/include/Poco/FPEnvironment_WIN32.h deleted file mode 100644 index 0a36bde9712..00000000000 --- a/base/poco/Foundation/include/Poco/FPEnvironment_WIN32.h +++ /dev/null @@ -1,151 +0,0 @@ -// -// FPEnvironment_WIN32.h -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Definitions of class FPEnvironmentImpl for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_FPEnvironment_WIN32_INCLUDED -#define Foundation_FPEnvironment_WIN32_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" - -#ifndef _SW_INEXACT -# define _SW_INEXACT 0x00000001 // inexact (precision) -#endif -#ifndef _SW_UNDERFLOW -# define _SW_UNDERFLOW 0x00000002 // underflow -#endif -#ifndef _SW_OVERFLOW -# define _SW_OVERFLOW 0x00000004 // overflow -#endif -#ifndef _SW_ZERODIVIDE -# define _SW_ZERODIVIDE 0x00000008 // zero divide -#endif -#ifndef _SW_INVALID -# define _SW_INVALID 0x00000010 // invalid -#endif -#ifndef _SW_DENORMAL -# define _SW_DENORMAL 0x00080000 // denormal status bit -#endif - - -namespace Poco -{ - - -class Foundation_API FPEnvironmentImpl -{ -protected: - enum RoundingModeImpl - { - FP_ROUND_DOWNWARD_IMPL = _RC_DOWN, - FP_ROUND_UPWARD_IMPL = _RC_UP, - FP_ROUND_TONEAREST_IMPL = _RC_NEAR, - FP_ROUND_TOWARDZERO_IMPL = _RC_CHOP - }; - enum FlagImpl - { - FP_DIVIDE_BY_ZERO_IMPL = _SW_ZERODIVIDE, - FP_INEXACT_IMPL = _SW_INEXACT, - FP_OVERFLOW_IMPL = _SW_OVERFLOW, - FP_UNDERFLOW_IMPL = _SW_UNDERFLOW, - FP_INVALID_IMPL = _SW_INVALID - }; - FPEnvironmentImpl(); - FPEnvironmentImpl(const FPEnvironmentImpl & env); - ~FPEnvironmentImpl(); - FPEnvironmentImpl & operator=(const FPEnvironmentImpl & env); - void keepCurrentImpl(); - static void clearFlagsImpl(); - static bool isFlagImpl(FlagImpl flag); - static void setRoundingModeImpl(RoundingModeImpl mode); - static RoundingModeImpl getRoundingModeImpl(); - static bool isInfiniteImpl(float value); - static bool isInfiniteImpl(double value); - static bool isInfiniteImpl(long double value); - static bool isNaNImpl(float value); - static bool isNaNImpl(double value); - static bool isNaNImpl(long double value); - static float copySignImpl(float target, float source); - static double copySignImpl(double target, double source); - static long double copySignImpl(long double target, long double source); - -private: - unsigned _env; -}; - - -// -// inlines -// -inline bool FPEnvironmentImpl::isInfiniteImpl(float value) -{ - return _finite(value) == 0; -} - - -inline bool FPEnvironmentImpl::isInfiniteImpl(double value) -{ - return _finite(value) == 0; -} - - -inline bool FPEnvironmentImpl::isInfiniteImpl(long double value) -{ - return _finite(value) == 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(float value) -{ - return _isnan(value) != 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(double value) -{ - return _isnan(value) != 0; -} - - -inline bool FPEnvironmentImpl::isNaNImpl(long double value) -{ - return _isnan(value) != 0; -} - - -inline float FPEnvironmentImpl::copySignImpl(float target, float source) -{ - return float(_copysign(target, source)); -} - - -inline double FPEnvironmentImpl::copySignImpl(double target, double source) -{ - return _copysign(target, source); -} - - -inline long double FPEnvironmentImpl::copySignImpl(long double target, long double source) -{ - return (source > 0 && target > 0) || (source < 0 && target < 0) ? target : -target; -} - - -} // namespace Poco - - -#endif // Foundation_FPEnvironment_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/File.h b/base/poco/Foundation/include/Poco/File.h index b2a61cedf75..b7a3816bbed 100644 --- a/base/poco/Foundation/include/Poco/File.h +++ b/base/poco/Foundation/include/Poco/File.h @@ -23,17 +23,7 @@ #include "Poco/Timestamp.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# if defined(_WIN32_WCE) -# include "File_WINCE.h" -# else -# include "Poco/File_WIN32U.h" -# endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/File_WIN32.h" -#elif defined(POCO_VXWORKS) -# include "Poco/File_VX.h" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) # include "Poco/File_UNIX.h" #endif diff --git a/base/poco/Foundation/include/Poco/FileStream.h b/base/poco/Foundation/include/Poco/FileStream.h index 6b09c971043..819f237af3c 100644 --- a/base/poco/Foundation/include/Poco/FileStream.h +++ b/base/poco/Foundation/include/Poco/FileStream.h @@ -19,11 +19,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/FileStream_WIN32.h" -#else # include "Poco/FileStream_POSIX.h" -#endif #include #include diff --git a/base/poco/Foundation/include/Poco/File_VX.h b/base/poco/Foundation/include/Poco/File_VX.h deleted file mode 100644 index f329d0a6d41..00000000000 --- a/base/poco/Foundation/include/Poco/File_VX.h +++ /dev/null @@ -1,85 +0,0 @@ -// -// File_VX.h -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Definition of the FileImpl class for VxWorks. -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_File_VX_INCLUDED -#define Foundation_File_VX_INCLUDED - - -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class FileImpl -{ -protected: - typedef UInt64 FileSizeImpl; - - FileImpl(); - FileImpl(const std::string & path); - virtual ~FileImpl(); - void swapImpl(FileImpl & file); - void setPathImpl(const std::string & path); - const std::string & getPathImpl() const; - bool existsImpl() const; - bool canReadImpl() const; - bool canWriteImpl() const; - bool canExecuteImpl() const; - bool isFileImpl() const; - bool isDirectoryImpl() const; - bool isLinkImpl() const; - bool isDeviceImpl() const; - bool isHiddenImpl() const; - Timestamp createdImpl() const; - Timestamp getLastModifiedImpl() const; - void setLastModifiedImpl(const Timestamp & ts); - FileSizeImpl getSizeImpl() const; - void setSizeImpl(FileSizeImpl size); - void setWriteableImpl(bool flag = true); - void setExecutableImpl(bool flag = true); - void copyToImpl(const std::string & path) const; - void renameToImpl(const std::string & path); - void linkToImpl(const std::string & path, int type) const; - void removeImpl(); - bool createFileImpl(); - bool createDirectoryImpl(); - FileSizeImpl totalSpaceImpl() const; - FileSizeImpl usableSpaceImpl() const; - FileSizeImpl freeSpaceImpl() const; - static void handleLastErrorImpl(const std::string & path); - -private: - std::string _path; - - friend class DirectoryIteratorImpl; -}; - - -// -// inlines -// -inline const std::string & FileImpl::getPathImpl() const -{ - return _path; -} - - -} // namespace Poco - - -#endif // Foundation_File_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/File_WIN32.h b/base/poco/Foundation/include/Poco/File_WIN32.h deleted file mode 100644 index 236abb0ff5e..00000000000 --- a/base/poco/Foundation/include/Poco/File_WIN32.h +++ /dev/null @@ -1,88 +0,0 @@ -// -// File_WIN32.h -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Definition of the FileImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_File_WIN32_INCLUDED -#define Foundation_File_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Timestamp.h" - - -namespace Poco -{ - - -class Foundation_API FileImpl -{ -protected: - typedef UInt64 FileSizeImpl; - - FileImpl(); - FileImpl(const std::string & path); - virtual ~FileImpl(); - void swapImpl(FileImpl & file); - void setPathImpl(const std::string & path); - const std::string & getPathImpl() const; - bool existsImpl() const; - bool canReadImpl() const; - bool canWriteImpl() const; - bool canExecuteImpl() const; - bool isFileImpl() const; - bool isDirectoryImpl() const; - bool isLinkImpl() const; - bool isDeviceImpl() const; - bool isHiddenImpl() const; - Timestamp createdImpl() const; - Timestamp getLastModifiedImpl() const; - void setLastModifiedImpl(const Timestamp & ts); - FileSizeImpl getSizeImpl() const; - void setSizeImpl(FileSizeImpl size); - void setWriteableImpl(bool flag = true); - void setExecutableImpl(bool flag = true); - void copyToImpl(const std::string & path) const; - void renameToImpl(const std::string & path); - void linkToImpl(const std::string & path, int type) const; - void removeImpl(); - bool createFileImpl(); - bool createDirectoryImpl(); - FileSizeImpl totalSpaceImpl() const; - FileSizeImpl usableSpaceImpl() const; - FileSizeImpl freeSpaceImpl() const; - static void handleLastErrorImpl(const std::string & path); - -private: - std::string _path; - - friend class FileHandle; - friend class DirectoryIteratorImpl; - friend class WindowsDirectoryWatcherStrategy; -}; - - -// -// inlines -// -inline const std::string & FileImpl::getPathImpl() const -{ - return _path; -} - - -} // namespace Poco - - -#endif // Foundation_File_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/File_WIN32U.h b/base/poco/Foundation/include/Poco/File_WIN32U.h deleted file mode 100644 index 87a4f3e7e11..00000000000 --- a/base/poco/Foundation/include/Poco/File_WIN32U.h +++ /dev/null @@ -1,92 +0,0 @@ -// -// File_WIN32U.h -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Definition of the Unicode FileImpl class for WIN32. -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_File_WIN32U_INCLUDED -#define Foundation_File_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Timestamp.h" - - -namespace Poco -{ - - -class Foundation_API FileImpl -{ -protected: - typedef UInt64 FileSizeImpl; - - FileImpl(); - FileImpl(const std::string & path); - virtual ~FileImpl(); - void swapImpl(FileImpl & file); - void setPathImpl(const std::string & path); - const std::string & getPathImpl() const; - bool existsImpl() const; - bool canReadImpl() const; - bool canWriteImpl() const; - bool canExecuteImpl() const; - bool isFileImpl() const; - bool isDirectoryImpl() const; - bool isLinkImpl() const; - bool isDeviceImpl() const; - bool isHiddenImpl() const; - Timestamp createdImpl() const; - Timestamp getLastModifiedImpl() const; - void setLastModifiedImpl(const Timestamp & ts); - FileSizeImpl getSizeImpl() const; - void setSizeImpl(FileSizeImpl size); - void setWriteableImpl(bool flag = true); - void setExecutableImpl(bool flag = true); - void copyToImpl(const std::string & path) const; - void renameToImpl(const std::string & path); - void linkToImpl(const std::string & path, int type) const; - void removeImpl(); - bool createFileImpl(); - bool createDirectoryImpl(); - FileSizeImpl totalSpaceImpl() const; - FileSizeImpl usableSpaceImpl() const; - FileSizeImpl freeSpaceImpl() const; - static void handleLastErrorImpl(const std::string & path); - static void convertPath(const std::string & utf8Path, std::wstring & utf16Path); - -private: - std::string _path; - std::wstring _upath; - - friend class FileHandle; - friend class DirectoryIteratorImpl; - friend class WindowsDirectoryWatcherStrategy; - friend class FileStreamBuf; - friend class LogFileImpl; -}; - - -// -// inlines -// -inline const std::string & FileImpl::getPathImpl() const -{ - return _path; -} - - -} // namespace Poco - - -#endif // Foundation_File_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/File_WINCE.h b/base/poco/Foundation/include/Poco/File_WINCE.h deleted file mode 100644 index 457e2c94538..00000000000 --- a/base/poco/Foundation/include/Poco/File_WINCE.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// File_WIN32U.h -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Definition of the Unicode FileImpl class for WIN32. -// -// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_File_WINCE_INCLUDED -#define Foundation_File_WINCE_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Timestamp.h" - - -namespace Poco -{ - - -class Foundation_API FileImpl -{ -protected: - typedef UInt64 FileSizeImpl; - - FileImpl(); - FileImpl(const std::string & path); - virtual ~FileImpl(); - void swapImpl(FileImpl & file); - void setPathImpl(const std::string & path); - const std::string & getPathImpl() const; - bool existsImpl() const; - bool canReadImpl() const; - bool canWriteImpl() const; - bool canExecuteImpl() const; - bool isFileImpl() const; - bool isDirectoryImpl() const; - bool isLinkImpl() const; - bool isDeviceImpl() const; - bool isHiddenImpl() const; - Timestamp createdImpl() const; - Timestamp getLastModifiedImpl() const; - void setLastModifiedImpl(const Timestamp & ts); - FileSizeImpl getSizeImpl() const; - void setSizeImpl(FileSizeImpl size); - void setWriteableImpl(bool flag = true); - void setExecutableImpl(bool flag = true); - void copyToImpl(const std::string & path) const; - void renameToImpl(const std::string & path); - void linkToImpl(const std::string & path, int type) const; - void removeImpl(); - bool createFileImpl(); - bool createDirectoryImpl(); - FileSizeImpl totalSpaceImpl() const; - FileSizeImpl usableSpaceImpl() const; - FileSizeImpl freeSpaceImpl() const; - static void handleLastErrorImpl(const std::string & path); - static void convertPath(const std::string & utf8Path, std::wstring & utf16Path); - -private: - std::string _path; - std::wstring _upath; - - friend class FileHandle; - friend class DirectoryIteratorImpl; - friend class FileStreamBuf; - friend class LogFileImpl; -}; - - -// -// inlines -// -inline const std::string & FileImpl::getPathImpl() const -{ - return _path; -} - - -} // namespace Poco - - -#endif // Foundation_File_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Foundation.h b/base/poco/Foundation/include/Poco/Foundation.h index 51bcc4e509d..34493041720 100644 --- a/base/poco/Foundation/include/Poco/Foundation.h +++ b/base/poco/Foundation/include/Poco/Foundation.h @@ -29,11 +29,6 @@ // // Ensure that POCO_DLL is default unless POCO_STATIC is defined // -#if defined(_WIN32) && defined(_DLL) -# if !defined(POCO_DLL) && !defined(POCO_STATIC) -# define POCO_DLL -# endif -#endif // @@ -44,13 +39,6 @@ // Foundation_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if (defined(_WIN32) || defined(_WIN32_WCE)) && defined(POCO_DLL) -# if defined(Foundation_EXPORTS) -# define Foundation_API __declspec(dllexport) -# else -# define Foundation_API __declspec(dllimport) -# endif -#endif #if !defined(Foundation_API) @@ -65,42 +53,13 @@ // // Automatically link Foundation library. // -#if defined(_MSC_VER) -# if defined(POCO_DLL) -# if defined(_DEBUG) -# define POCO_LIB_SUFFIX "d.lib" -# else -# define POCO_LIB_SUFFIX ".lib" -# endif -# elif defined(_DLL) -# if defined(_DEBUG) -# define POCO_LIB_SUFFIX "mdd.lib" -# else -# define POCO_LIB_SUFFIX "md.lib" -# endif -# else -# if defined(_DEBUG) -# define POCO_LIB_SUFFIX "mtd.lib" -# else -# define POCO_LIB_SUFFIX "mt.lib" -# endif -# endif - -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Foundation_EXPORTS) -# pragma comment(lib, "PocoFoundation" POCO_LIB_SUFFIX) -# endif -#endif // // Include platform-specific definitions // #include "Poco/Platform.h" -#if defined(_WIN32) -# include "Poco/Platform_WIN32.h" -#elif defined(POCO_VXWORKS) -# include "Poco/Platform_VX.h" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) # include "Poco/Platform_POSIX.h" #endif @@ -113,15 +72,6 @@ // // Cleanup inconsistencies // -#ifdef POCO_OS_FAMILY_WINDOWS -# if defined(POCO_WIN32_UTF8) && defined(POCO_NO_WSTRING) -# error POCO_WIN32_UTF8 and POCO_NO_WSTRING are mutually exclusive. -# endif -#else -# ifdef POCO_WIN32_UTF8 -# undef POCO_WIN32_UTF8 -# endif -#endif // @@ -150,8 +100,6 @@ # define POCO_DEPRECATED __attribute__((deprecated)) #elif defined(__clang__) # define POCO_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) -# define POCO_DEPRECATED __declspec(deprecated) #else # define POCO_DEPRECATED #endif diff --git a/base/poco/Foundation/include/Poco/LogFile.h b/base/poco/Foundation/include/Poco/LogFile.h index 1614dfccdc0..d831b126fbf 100644 --- a/base/poco/Foundation/include/Poco/LogFile.h +++ b/base/poco/Foundation/include/Poco/LogFile.h @@ -21,13 +21,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# include "Poco/LogFile_WIN32U.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/LogFile_WIN32.h" -#else # include "Poco/LogFile_STD.h" -#endif namespace Poco diff --git a/base/poco/Foundation/include/Poco/LogFile_WIN32.h b/base/poco/Foundation/include/Poco/LogFile_WIN32.h deleted file mode 100644 index f95b973e2c1..00000000000 --- a/base/poco/Foundation/include/Poco/LogFile_WIN32.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// LogFile_WIN32.h -// -// Library: Foundation -// Package: Logging -// Module: LogFile -// -// Definition of the LogFileImpl class using the Windows file APIs. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_LogFile_WIN32_INCLUDED -#define Foundation_LogFile_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Timestamp.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API LogFileImpl -/// The implementation of LogFile for Windows. -/// The native filesystem APIs are used for -/// total control over locking behavior. -{ -public: - LogFileImpl(const std::string & path); - ~LogFileImpl(); - void writeImpl(const std::string & text, bool flush); - void writeBinaryImpl(const char * data, size_t size, bool flush); - UInt64 sizeImpl() const; - Timestamp creationDateImpl() const; - const std::string & pathImpl() const; - -private: - void createFile(); - - std::string _path; - HANDLE _hFile; - Timestamp _creationDate; -}; - - -} // namespace Poco - - -#endif // Foundation_LogFile_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/LogFile_WIN32U.h b/base/poco/Foundation/include/Poco/LogFile_WIN32U.h deleted file mode 100644 index a9aba7729ee..00000000000 --- a/base/poco/Foundation/include/Poco/LogFile_WIN32U.h +++ /dev/null @@ -1,56 +0,0 @@ -// -// LogFile_WIN32U.h -// -// Library: Foundation -// Package: Logging -// Module: LogFile -// -// Definition of the LogFileImpl class using the Windows file APIs. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_LogFile_WIN32U_INCLUDED -#define Foundation_LogFile_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Timestamp.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API LogFileImpl -/// The implementation of LogFile for Windows. -/// The native filesystem APIs are used for -/// total control over locking behavior. -{ -public: - LogFileImpl(const std::string & path); - ~LogFileImpl(); - void writeImpl(const std::string & text, bool flush); - void writeBinaryImpl(const char * data, size_t size, bool flush); - UInt64 sizeImpl() const; - Timestamp creationDateImpl() const; - const std::string & pathImpl() const; - -private: - void createFile(); - - std::string _path; - HANDLE _hFile; - Timestamp _creationDate; -}; - - -} // namespace Poco - - -#endif // Foundation_LogFile_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Mutex.h b/base/poco/Foundation/include/Poco/Mutex.h index de1bf2fbbaf..6ed3fd44d9e 100644 --- a/base/poco/Foundation/include/Poco/Mutex.h +++ b/base/poco/Foundation/include/Poco/Mutex.h @@ -23,17 +23,7 @@ #include "Poco/ScopedLock.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# if defined(_WIN32_WCE) -# include "Poco/Mutex_WINCE.h" -# else -# include "Poco/Mutex_WIN32.h" -# endif -#elif defined(POCO_VXWORKS) -# include "Poco/Mutex_VX.h" -#else # include "Poco/Mutex_POSIX.h" -#endif namespace Poco diff --git a/base/poco/Foundation/include/Poco/Mutex_VX.h b/base/poco/Foundation/include/Poco/Mutex_VX.h deleted file mode 100644 index 50569672c89..00000000000 --- a/base/poco/Foundation/include/Poco/Mutex_VX.h +++ /dev/null @@ -1,81 +0,0 @@ -// -// Mutex_VX.h -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Definition of the MutexImpl and FastMutexImpl classes for VxWorks. -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Mutex_VX_INCLUDED -#define Foundation_Mutex_VX_INCLUDED - - -#include -#include -#include "Poco/Exception.h" -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API MutexImpl -{ -protected: - MutexImpl(); - MutexImpl(bool fast); - ~MutexImpl(); - void lockImpl(); - bool tryLockImpl(); - bool tryLockImpl(long milliseconds); - void unlockImpl(); - -private: - SEM_ID _sem; -}; - - -class Foundation_API FastMutexImpl : public MutexImpl -{ -protected: - FastMutexImpl(); - ~FastMutexImpl(); -}; - - -// -// inlines -// -inline void MutexImpl::lockImpl() -{ - if (semTake(_sem, WAIT_FOREVER) != OK) - throw SystemException("cannot lock mutex"); -} - - -inline bool MutexImpl::tryLockImpl() -{ - return semTake(_sem, NO_WAIT) == OK; -} - - -inline void MutexImpl::unlockImpl() -{ - if (semGive(_sem) != OK) - throw SystemException("cannot unlock mutex"); -} - - -} // namespace Poco - - -#endif // Foundation_Mutex_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Mutex_WIN32.h b/base/poco/Foundation/include/Poco/Mutex_WIN32.h deleted file mode 100644 index bfcd481fbe0..00000000000 --- a/base/poco/Foundation/include/Poco/Mutex_WIN32.h +++ /dev/null @@ -1,86 +0,0 @@ -// -// Mutex_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Definition of the MutexImpl and FastMutexImpl classes for WIN32. -// -// Copyright (c) 2004-2008, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Mutex_WIN32_INCLUDED -#define Foundation_Mutex_WIN32_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API MutexImpl -{ -protected: - MutexImpl(); - ~MutexImpl(); - void lockImpl(); - bool tryLockImpl(); - bool tryLockImpl(long milliseconds); - void unlockImpl(); - -private: - CRITICAL_SECTION _cs; -}; - - -typedef MutexImpl FastMutexImpl; - - -// -// inlines -// -inline void MutexImpl::lockImpl() -{ - try - { - EnterCriticalSection(&_cs); - } - catch (...) - { - throw SystemException("cannot lock mutex"); - } -} - - -inline bool MutexImpl::tryLockImpl() -{ - try - { - return TryEnterCriticalSection(&_cs) != 0; - } - catch (...) - { - } - throw SystemException("cannot lock mutex"); -} - - -inline void MutexImpl::unlockImpl() -{ - LeaveCriticalSection(&_cs); -} - - -} // namespace Poco - - -#endif // Foundation_Mutex_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Mutex_WINCE.h b/base/poco/Foundation/include/Poco/Mutex_WINCE.h deleted file mode 100644 index 01b903a2d93..00000000000 --- a/base/poco/Foundation/include/Poco/Mutex_WINCE.h +++ /dev/null @@ -1,51 +0,0 @@ -// -// Mutex_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Definition of the MutexImpl and FastMutexImpl classes for WIN32. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Mutex_WINCE_INCLUDED -#define Foundation_Mutex_WINCE_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API MutexImpl -{ -protected: - MutexImpl(); - ~MutexImpl(); - void lockImpl(); - bool tryLockImpl(); - bool tryLockImpl(long milliseconds); - void unlockImpl(); - -private: - HANDLE _mutex; -}; - - -typedef MutexImpl FastMutexImpl; - - -} // namespace Poco - - -#endif // Foundation_Mutex_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/NamedEvent.h b/base/poco/Foundation/include/Poco/NamedEvent.h index 6affa3cde6f..16a5e387233 100644 --- a/base/poco/Foundation/include/Poco/NamedEvent.h +++ b/base/poco/Foundation/include/Poco/NamedEvent.h @@ -21,11 +21,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# include "Poco/NamedEvent_WIN32U.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/NamedEvent_WIN32.h" -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID # include "Poco/NamedEvent_Android.h" #elif defined(POCO_OS_FAMILY_UNIX) # include "Poco/NamedEvent_UNIX.h" diff --git a/base/poco/Foundation/include/Poco/NamedEvent_WIN32.h b/base/poco/Foundation/include/Poco/NamedEvent_WIN32.h deleted file mode 100644 index 68ebd24c29c..00000000000 --- a/base/poco/Foundation/include/Poco/NamedEvent_WIN32.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// NamedEvent_WIN32.h -// -// Library: Foundation -// Package: Processes -// Module: NamedEvent -// -// Definition of the NamedEventImpl class for Windows. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_NamedEvent_WIN32_INCLUDED -#define Foundation_NamedEvent_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API NamedEventImpl -{ -protected: - NamedEventImpl(const std::string & name); - ~NamedEventImpl(); - void setImpl(); - void waitImpl(); - -private: - std::string _name; - HANDLE _event; -}; - - -} // namespace Poco - - -#endif // Foundation_NamedEvent_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/NamedEvent_WIN32U.h b/base/poco/Foundation/include/Poco/NamedEvent_WIN32U.h deleted file mode 100644 index f97daed7847..00000000000 --- a/base/poco/Foundation/include/Poco/NamedEvent_WIN32U.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// NamedEvent_WIN32U.h -// -// Library: Foundation -// Package: Processes -// Module: NamedEvent -// -// Definition of the NamedEventImpl class for Windows. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_NamedEvent_WIN32U_INCLUDED -#define Foundation_NamedEvent_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API NamedEventImpl -{ -protected: - NamedEventImpl(const std::string & name); - ~NamedEventImpl(); - void setImpl(); - void waitImpl(); - -private: - std::string _name; - std::wstring _uname; - HANDLE _event; -}; - - -} // namespace Poco - - -#endif // Foundation_NamedEvent_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/NamedMutex.h b/base/poco/Foundation/include/Poco/NamedMutex.h index d91732fd787..9dce963f2c1 100644 --- a/base/poco/Foundation/include/Poco/NamedMutex.h +++ b/base/poco/Foundation/include/Poco/NamedMutex.h @@ -22,11 +22,7 @@ #include "Poco/ScopedLock.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# include "Poco/NamedMutex_WIN32U.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/NamedMutex_WIN32.h" -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID # include "Poco/NamedMutex_Android.h" #elif defined(POCO_OS_FAMILY_UNIX) # include "Poco/NamedMutex_UNIX.h" diff --git a/base/poco/Foundation/include/Poco/NamedMutex_WIN32.h b/base/poco/Foundation/include/Poco/NamedMutex_WIN32.h deleted file mode 100644 index 5b33d1b2d35..00000000000 --- a/base/poco/Foundation/include/Poco/NamedMutex_WIN32.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// NamedMutex_WIN32.h -// -// Library: Foundation -// Package: Processes -// Module: NamedMutex -// -// Definition of the NamedMutexImpl class for Windows. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_NamedMutex_WIN32_INCLUDED -#define Foundation_NamedMutex_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API NamedMutexImpl -{ -protected: - NamedMutexImpl(const std::string & name); - ~NamedMutexImpl(); - void lockImpl(); - bool tryLockImpl(); - void unlockImpl(); - -private: - std::string _name; - HANDLE _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_NamedMutex_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/NamedMutex_WIN32U.h b/base/poco/Foundation/include/Poco/NamedMutex_WIN32U.h deleted file mode 100644 index 50b3a328302..00000000000 --- a/base/poco/Foundation/include/Poco/NamedMutex_WIN32U.h +++ /dev/null @@ -1,48 +0,0 @@ -// -// NamedMutex_WIN32U.h -// -// Library: Foundation -// Package: Processes -// Module: NamedMutex -// -// Definition of the NamedMutexImpl class for Windows. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_NamedMutex_WIN32U_INCLUDED -#define Foundation_NamedMutex_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API NamedMutexImpl -{ -protected: - NamedMutexImpl(const std::string & name); - ~NamedMutexImpl(); - void lockImpl(); - bool tryLockImpl(); - void unlockImpl(); - -private: - std::string _name; - std::wstring _uname; - HANDLE _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_NamedMutex_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Path.h b/base/poco/Foundation/include/Poco/Path.h index a82cdfb78fa..7c683ec441d 100644 --- a/base/poco/Foundation/include/Poco/Path.h +++ b/base/poco/Foundation/include/Poco/Path.h @@ -470,8 +470,6 @@ inline char Path::separator() { #if defined(POCO_OS_FAMILY_VMS) return '.'; -#elif defined(POCO_OS_FAMILY_WINDOWS) - return '\\'; #else return '/'; #endif @@ -482,8 +480,6 @@ inline char Path::pathSeparator() { #if defined(POCO_OS_FAMILY_VMS) return ','; -#elif defined(POCO_OS_FAMILY_WINDOWS) - return ';'; #else return ':'; #endif diff --git a/base/poco/Foundation/include/Poco/Path_WIN32.h b/base/poco/Foundation/include/Poco/Path_WIN32.h deleted file mode 100644 index d75f154cb47..00000000000 --- a/base/poco/Foundation/include/Poco/Path_WIN32.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// Path_WIN32.h -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Definition of the PathImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Path_WIN32_INCLUDED -#define Foundation_Path_WIN32_INCLUDED - - -#include -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API PathImpl -{ -public: - static std::string currentImpl(); - static std::string homeImpl(); - static std::string configHomeImpl(); - static std::string dataHomeImpl(); - static std::string cacheHomeImpl(); - static std::string tempHomeImpl(); - static std::string tempImpl(); - static std::string configImpl(); - static std::string nullImpl(); - static std::string systemImpl(); - static std::string expandImpl(const std::string & path); - static void listRootsImpl(std::vector & roots); -}; - - -} // namespace Poco - - -#endif // Foundation_Path_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Path_WIN32U.h b/base/poco/Foundation/include/Poco/Path_WIN32U.h deleted file mode 100644 index 7c20999cd1b..00000000000 --- a/base/poco/Foundation/include/Poco/Path_WIN32U.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// Path_WIN32U.h -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Definition of the PathImpl class for WIN32. -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Path_WIN32U_INCLUDED -#define Foundation_Path_WIN32U_INCLUDED - - -#include -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API PathImpl -{ -public: - static std::string currentImpl(); - static std::string homeImpl(); - static std::string configHomeImpl(); - static std::string dataHomeImpl(); - static std::string cacheHomeImpl(); - static std::string tempHomeImpl(); - static std::string tempImpl(); - static std::string configImpl(); - static std::string nullImpl(); - static std::string systemImpl(); - static std::string expandImpl(const std::string & path); - static void listRootsImpl(std::vector & roots); - - enum - { - MAX_PATH_LEN = 32767 - }; -}; - - -} // namespace Poco - - -#endif // Foundation_Path_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Path_WINCE.h b/base/poco/Foundation/include/Poco/Path_WINCE.h deleted file mode 100644 index d615e2452ef..00000000000 --- a/base/poco/Foundation/include/Poco/Path_WINCE.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// Path_WINCE.h -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Definition of the PathImpl class for WIN32. -// -// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Path_WINCE_INCLUDED -#define Foundation_Path_WINCE_INCLUDED - - -#include -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API PathImpl -{ -public: - static std::string currentImpl(); - static std::string homeImpl(); - static std::string configHomeImpl(); - static std::string dataHomeImpl(); - static std::string cacheHomeImpl(); - static std::string tempHomeImpl(); - static std::string tempImpl(); - static std::string configImpl(); - static std::string nullImpl(); - static std::string systemImpl(); - static std::string expandImpl(const std::string & path); - static void listRootsImpl(std::vector & roots); - - enum - { - MAX_PATH_LEN = 32767 - }; -}; - - -} // namespace Poco - - -#endif // Foundation_Path_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/PipeImpl.h b/base/poco/Foundation/include/Poco/PipeImpl.h index 980a75d9690..03e39236be7 100644 --- a/base/poco/Foundation/include/Poco/PipeImpl.h +++ b/base/poco/Foundation/include/Poco/PipeImpl.h @@ -21,13 +21,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# if defined(_WIN32_WCE) -# include "PipeImpl_DUMMY.h" -# else -# include "Poco/PipeImpl_WIN32.h" -# endif -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) # include "Poco/PipeImpl_POSIX.h" #else # include "Poco/PipeImpl_DUMMY.h" diff --git a/base/poco/Foundation/include/Poco/PipeImpl_WIN32.h b/base/poco/Foundation/include/Poco/PipeImpl_WIN32.h deleted file mode 100644 index 08ea26e8c79..00000000000 --- a/base/poco/Foundation/include/Poco/PipeImpl_WIN32.h +++ /dev/null @@ -1,55 +0,0 @@ -// -// PipeImpl_WIN32.h -// -// Library: Foundation -// Package: Processes -// Module: PipeImpl -// -// Definition of the PipeImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_PipeImpl_WIN32_INCLUDED -#define Foundation_PipeImpl_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API PipeImpl : public RefCountedObject -/// A dummy implementation of PipeImpl for platforms -/// that do not support pipes. -{ -public: - typedef HANDLE Handle; - - PipeImpl(); - ~PipeImpl(); - int writeBytes(const void * buffer, int length); - int readBytes(void * buffer, int length); - Handle readHandle() const; - Handle writeHandle() const; - void closeRead(); - void closeWrite(); - -private: - HANDLE _readHandle; - HANDLE _writeHandle; -}; - - -} // namespace Poco - - -#endif // Foundation_PipeImpl_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Platform.h b/base/poco/Foundation/include/Poco/Platform.h index fea9f14352b..eb8f80a0d25 100644 --- a/base/poco/Foundation/include/Poco/Platform.h +++ b/base/poco/Foundation/include/Poco/Platform.h @@ -86,27 +86,12 @@ #elif defined(sun) || defined(__sun) # define POCO_OS_FAMILY_UNIX 1 # define POCO_OS POCO_OS_SOLARIS -#elif defined(__QNX__) -# define POCO_OS_FAMILY_UNIX 1 -# define POCO_OS POCO_OS_QNX -#elif defined(__CYGWIN__) -# define POCO_OS_FAMILY_UNIX 1 -# define POCO_OS POCO_OS_CYGWIN -#elif defined(POCO_VXWORKS) -# define POCO_OS_FAMILY_UNIX 1 -# define POCO_OS POCO_OS_VXWORKS #elif defined(unix) || defined(__unix) || defined(__unix__) # define POCO_OS_FAMILY_UNIX 1 # define POCO_OS POCO_OS_UNKNOWN_UNIX -#elif defined(_WIN32_WCE) -# define POCO_OS_FAMILY_WINDOWS 1 -# define POCO_OS POCO_OS_WINDOWS_CE #elif defined(_WIN32) || defined(_WIN64) # define POCO_OS_FAMILY_WINDOWS 1 # define POCO_OS POCO_OS_WINDOWS_NT -#elif defined(__VMS) -# define POCO_OS_FAMILY_VMS 1 -# define POCO_OS POCO_OS_VMS #endif @@ -155,10 +140,7 @@ # define POCO_ARCH_LITTLE_ENDIAN 1 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(_M_MRX000) # define POCO_ARCH POCO_ARCH_MIPS -# if defined(POCO_OS_FAMILY_WINDOWS) -// Is this OK? Supports windows only little endian?? -# define POCO_ARCH_LITTLE_ENDIAN 1 -# elif defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB) +# if defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB) # define POCO_ARCH_BIG_ENDIAN 1 # elif defined(__MIPSEL__) || defined(_MIPSEL) || defined(__MIPSEL) # define POCO_ARCH_LITTLE_ENDIAN 1 @@ -232,32 +214,20 @@ #if defined(__clang__) # define POCO_COMPILER_CLANG -#elif defined(_MSC_VER) -# define POCO_COMPILER_MSVC #elif defined(__GNUC__) # define POCO_COMPILER_GCC #elif defined(__MINGW32__) || defined(__MINGW64__) # define POCO_COMPILER_MINGW #elif defined(__INTEL_COMPILER) || defined(__ICC) || defined(__ECC) || defined(__ICL) # define POCO_COMPILER_INTEL -#elif defined(__SUNPRO_CC) -# define POCO_COMPILER_SUN #elif defined(__MWERKS__) || defined(__CWCC__) # define POCO_COMPILER_CODEWARRIOR #elif defined(__sgi) || defined(sgi) # define POCO_COMPILER_SGI -#elif defined(__HP_aCC) -# define POCO_COMPILER_HP_ACC #elif defined(__BORLANDC__) || defined(__CODEGEARC__) # define POCO_COMPILER_CBUILDER #elif defined(__DMC__) # define POCO_COMPILER_DMARS -#elif defined(__DECCXX) -# define POCO_COMPILER_COMPAC -#elif (defined(__xlc__) || defined(__xlC__)) && defined(__IBMCPP__) -# define POCO_COMPILER_IBM_XLC // IBM XL C++ -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define POCO_COMPILER_IBM_XLC_ZOS // IBM z/OS C++ #endif @@ -273,11 +243,7 @@ #endif -#if defined(POCO_OS_FAMILY_WINDOWS) -# define POCO_DEFAULT_NEWLINE_CHARS "\r\n" -#else # define POCO_DEFAULT_NEWLINE_CHARS "\n" -#endif #endif // Foundation_Platform_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Platform_POSIX.h b/base/poco/Foundation/include/Poco/Platform_POSIX.h index cc2667bdac8..96f0c32cb9e 100644 --- a/base/poco/Foundation/include/Poco/Platform_POSIX.h +++ b/base/poco/Foundation/include/Poco/Platform_POSIX.h @@ -25,9 +25,6 @@ #if defined(hpux) || defined(_hpux) # if defined(__hppa) || defined(__hppa__) # define POCO_NO_SYS_SELECT_H 1 -# if defined(__HP_aCC) -# define POCO_NO_TEMPLATE_ICOMPARE 1 -# endif # endif #endif diff --git a/base/poco/Foundation/include/Poco/Platform_VX.h b/base/poco/Foundation/include/Poco/Platform_VX.h deleted file mode 100644 index fbe566f7da8..00000000000 --- a/base/poco/Foundation/include/Poco/Platform_VX.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// Platform_VX.h -// -// Library: Foundation -// Package: Core -// Module: Platform -// -// Platform and architecture identification macros -// and platform-specific definitions for VxWorks -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Platform_VX_INCLUDED -#define Foundation_Platform_VX_INCLUDED - - -#define POCO_NO_SYS_SELECT_H -#define POCO_NO_FPENVIRONMENT -#define POCO_NO_WSTRING -#define POCO_NO_SHAREDMEMORY -#define POCO_NO_SYSLOGCHANNEL - - -#endif // Foundation_Platform_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Platform_WIN32.h b/base/poco/Foundation/include/Poco/Platform_WIN32.h deleted file mode 100644 index 9a893591f13..00000000000 --- a/base/poco/Foundation/include/Poco/Platform_WIN32.h +++ /dev/null @@ -1,217 +0,0 @@ -// -// Platform_WIN32.h -// -// Library: Foundation -// Package: Core -// Module: Platform -// -// Platform and architecture identification macros -// and platform-specific definitions for Windows. -// -// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Platform_WIN32_INCLUDED -#define Foundation_Platform_WIN32_INCLUDED - - -#include "Poco/UnWindows.h" - - -#ifndef POCO_FORCE_MIN_WINDOWS_OS_SUPPORT -// Determine the real version. -// This setting can be forced from UnWindows.h -# if defined(_WIN32_WINNT_WINBLUE) -//Windows 8.1 _WIN32_WINNT_WINBLUE (0x0602) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WINBLUE -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WINBLUE -# elif defined(_WIN32_WINNT_WIN8) -//Windows 8 _WIN32_WINNT_WIN8 (0x0602) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WIN8 -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WIN8 -# elif defined(_WIN32_WINNT_WIN7) -//Windows 7 _WIN32_WINNT_WIN7 (0x0601) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WIN7 -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WIN7 -# elif defined(_WIN32_WINNT_WS08) -//Windows Server 2008 _WIN32_WINNT_WS08 (0x0600) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WS08 -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WS08 -# elif defined(_WIN32_WINNT_VISTA) -//Windows Vista _WIN32_WINNT_VISTA (0x0600) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_VISTA -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_VISTA -# elif defined(_WIN32_WINNT_LONGHORN) -//Windows Vista and server 2008 Development _WIN32_WINNT_LONGHORN (0x0600) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_LONGHORN -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION 0x06000000 // hardcoded, VS90 can't find NTDDI_* macros -# elif defined(_WIN32_WINNT_WS03) -//Windows Server 2003 with SP1, -//Windows XP with SP2 _WIN32_WINNT_WS03 (0x0502) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WS03 -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WS03 -# elif defined(_WIN32_WINNT_WINXP) -//Windows Server 2003, Windows XP _WIN32_WINNT_WINXP (0x0501) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WINXP -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION NTDDI_WINXP -# elif defined(_WIN32_WINNT_WIN2K) -//Windows 2000 _WIN32_WINNT_WIN2K (0x0500) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT _WIN32_WINNT_WIN2K -# elif defined(WINVER) -// fail back on WINVER -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT WINVER -# elif !defined(_WIN32_WINNT) -// last resort = Win XP, SP2 is minimum supported -# define _WIN32_WINNT 0x0502 -# ifdef NTDDI_VERSION -# undef NTDDI_VERSION -# endif -# define NTDDI_VERSION 0x05020000 -# endif -#endif // POCO_FORCE_MIN_WINDOWS_OS_SUPPORT - - -#if defined(_MSC_VER) && !defined(POCO_MSVC_SECURE_WARNINGS) && !defined(_CRT_SECURE_NO_DEPRECATE) -# define _CRT_SECURE_NO_DEPRECATE -#endif - - -// Verify that we're built with the multithreaded -// versions of the runtime libraries -#if defined(_MSC_VER) && !defined(_MT) -# error Must compile with /MD, /MDd, /MT or /MTd -#endif - - -// Check debug/release settings consistency -#if defined(NDEBUG) && defined(_DEBUG) -# error Inconsistent build settings (check for /MD[d]) -#endif - - -#if (_MSC_VER >= 1300) && (_MSC_VER < 1400) // Visual Studio 2003, MSVC++ 7.1 -# define POCO_MSVS_VERSION 2003 -# define POCO_MSVC_VERSION 71 -#elif (_MSC_VER >= 1400) && (_MSC_VER < 1500) // Visual Studio 2005, MSVC++ 8.0 -# define POCO_MSVS_VERSION 2005 -# define POCO_MSVC_VERSION 80 -#elif (_MSC_VER >= 1500) && (_MSC_VER < 1600) // Visual Studio 2008, MSVC++ 9.0 -# define POCO_MSVS_VERSION 2008 -# define POCO_MSVC_VERSION 90 -#elif (_MSC_VER >= 1600) && (_MSC_VER < 1700) // Visual Studio 2010, MSVC++ 10.0 -# define POCO_MSVS_VERSION 2010 -# define POCO_MSVC_VERSION 100 -#elif (_MSC_VER >= 1700) && (_MSC_VER < 1800) // Visual Studio 2012, MSVC++ 11.0 -# define POCO_MSVS_VERSION 2012 -# define POCO_MSVC_VERSION 110 -#elif (_MSC_VER >= 1800) && (_MSC_VER < 1900) // Visual Studio 2013, MSVC++ 12.0 -# define POCO_MSVS_VERSION 2013 -# define POCO_MSVC_VERSION 120 -#elif (_MSC_VER >= 1900) && (_MSC_VER < 1910) // Visual Studio 2015, MSVC++ 14.0 -# define POCO_MSVS_VERSION 2015 -# define POCO_MSVC_VERSION 140 -#elif (_MSC_VER >= 1910) && (_MSC_VER < 2000) // Visual Studio 2017, MSVC++ 14.1 -# define POCO_MSVS_VERSION 2017 -# define POCO_MSVC_VERSION 141 -#endif - - -// Unicode Support -#if defined(UNICODE) && !defined(POCO_WIN32_UTF8) -# define POCO_WIN32_UTF8 -#endif - - -#if !defined(POCO_WIN32_UTF8) -# pragma message("Compiling POCO on Windows without #define POCO_WIN32_UTF8 is deprecated.") -#endif - - -// Turn off some annoying warnings -#if defined(_MSC_VER) -# pragma warning(disable : 4018) // signed/unsigned comparison -# pragma warning(disable : 4250) // VC++ 11.0: inheriting from std stream classes produces C4250 warning; \ - // see -# pragma warning(disable : 4251) // ... needs to have dll-interface warning -# pragma warning(disable : 4275) // non dll-interface class 'std::exception' used as base for dll-interface class 'Poco::Exception' -# pragma warning( \ - disable : 4344) // behavior change: use of explicit template arguments results in call to '...' but '...' is a better match -# pragma warning(disable : 4351) // new behavior: elements of array '...' will be default initialized -# pragma warning(disable : 4355) // 'this' : used in base member initializer list -# pragma warning(disable : 4675) // resolved overload was found by argument-dependent lookup -# pragma warning(disable : 4996) // VC++ 8.0 deprecation warnings -#endif - - -// Enable C++11 support for VS 2010 and newer -#if defined(_MSC_VER) && (_MSC_VER >= 1700) && !defined(POCO_ENABLE_CPP11) -# define POCO_ENABLE_CPP11 -#endif - - -#if defined(__INTEL_COMPILER) -# pragma warning(disable : 1738) // base class dllexport/dllimport specification differs from that of the derived class -# pragma warning(disable : 1478) // function ... was declared "deprecated" -# pragma warning(disable : 1744) // field of class type without a DLL interface used in a class with a DLL interface -#endif - - -#endif // Foundation_Platform_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Process.h b/base/poco/Foundation/include/Poco/Process.h index 6d4680335ff..6f45db23062 100644 --- a/base/poco/Foundation/include/Poco/Process.h +++ b/base/poco/Foundation/include/Poco/Process.h @@ -21,17 +21,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# if defined(_WIN32_WCE) -# include "Process_WINCE.h" -# else -# include "Poco/Process_WIN32U.h" -# endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/Process_WIN32.h" -#elif defined(POCO_VXWORKS) -# include "Poco/Process_VX.h" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) # include "Poco/Process_UNIX.h" #endif diff --git a/base/poco/Foundation/include/Poco/Process_VX.h b/base/poco/Foundation/include/Poco/Process_VX.h deleted file mode 100644 index 01ba9c89630..00000000000 --- a/base/poco/Foundation/include/Poco/Process_VX.h +++ /dev/null @@ -1,79 +0,0 @@ -// -// Process_VX.h -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Definition of the ProcessImpl class for VxWorks. -// -// Copyright (c) 2004-20011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Process_VX_INCLUDED -#define Foundation_Process_VX_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" - - -#undef PID - - -namespace Poco -{ - - -class Pipe; - - -class Foundation_API ProcessHandleImpl : public RefCountedObject -{ -public: - ProcessHandleImpl(int pid); - ~ProcessHandleImpl(); - - int id() const; - int wait() const; - -private: - int _pid; -}; - - -class Foundation_API ProcessImpl -{ -public: - typedef int PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; - - static PIDImpl idImpl(); - static void timesImpl(long & userTime, long & kernelTime); - static ProcessHandleImpl * launchImpl( - const std::string & command, - const ArgsImpl & args, - const std::string & initialDirectory, - Pipe * inPipe, - Pipe * outPipe, - Pipe * errPipe, - const EnvImpl & env); - static void killImpl(ProcessHandleImpl & handle); - static void killImpl(PIDImpl pid); - static bool isRunningImpl(const ProcessHandleImpl & handle); - static bool isRunningImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); -}; - - -} // namespace Poco - - -#endif // Foundation_Process_UNIX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Process_WIN32.h b/base/poco/Foundation/include/Poco/Process_WIN32.h deleted file mode 100644 index a516260f64b..00000000000 --- a/base/poco/Foundation/include/Poco/Process_WIN32.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// Process_WIN32.h -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Definition of the ProcessImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Process_WIN32_INCLUDED -#define Foundation_Process_WIN32_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Pipe; - - -class Foundation_API ProcessHandleImpl : public RefCountedObject -{ -public: - ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; - void closeHandle(); - -private: - HANDLE _hProcess; - UInt32 _pid; - - ProcessHandleImpl(const ProcessHandleImpl &); - ProcessHandleImpl & operator=(const ProcessHandleImpl &); -}; - - -class Foundation_API ProcessImpl -{ -public: - typedef UInt32 PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; - - static PIDImpl idImpl(); - static void timesImpl(long & userTime, long & kernelTime); - static ProcessHandleImpl * launchImpl( - const std::string & command, - const ArgsImpl & args, - const std::string & initialDirectory, - Pipe * inPipe, - Pipe * outPipe, - Pipe * errPipe, - const EnvImpl & env); - static void killImpl(ProcessHandleImpl & handle); - static void killImpl(PIDImpl pid); - static bool isRunningImpl(const ProcessHandleImpl & handle); - static bool isRunningImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); -}; - - -} // namespace Poco - - -#endif // Foundation_Process_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Process_WIN32U.h b/base/poco/Foundation/include/Poco/Process_WIN32U.h deleted file mode 100644 index e886b464858..00000000000 --- a/base/poco/Foundation/include/Poco/Process_WIN32U.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// Process_WIN32U.h -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Definition of the ProcessImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Process_WIN32U_INCLUDED -#define Foundation_Process_WIN32U_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Pipe; - - -class Foundation_API ProcessHandleImpl : public RefCountedObject -{ -public: - ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; - void closeHandle(); - -private: - HANDLE _hProcess; - UInt32 _pid; - - ProcessHandleImpl(const ProcessHandleImpl &); - ProcessHandleImpl & operator=(const ProcessHandleImpl &); -}; - - -class Foundation_API ProcessImpl -{ -public: - typedef UInt32 PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; - - static PIDImpl idImpl(); - static void timesImpl(long & userTime, long & kernelTime); - static ProcessHandleImpl * launchImpl( - const std::string & command, - const ArgsImpl & args, - const std::string & initialDirectory, - Pipe * inPipe, - Pipe * outPipe, - Pipe * errPipe, - const EnvImpl & env); - static void killImpl(ProcessHandleImpl & handle); - static void killImpl(PIDImpl pid); - static bool isRunningImpl(const ProcessHandleImpl & handle); - static bool isRunningImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); -}; - - -} // namespace Poco - - -#endif // Foundation_Process_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Process_WINCE.h b/base/poco/Foundation/include/Poco/Process_WINCE.h deleted file mode 100644 index 853fc8c3f9f..00000000000 --- a/base/poco/Foundation/include/Poco/Process_WINCE.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// Process_WINCE.h -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Definition of the ProcessImpl class for WIN32. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Process_WINCE_INCLUDED -#define Foundation_Process_WINCE_INCLUDED - - -#include -#include -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Pipe; - - -class Foundation_API ProcessHandleImpl : public RefCountedObject -{ -public: - ProcessHandleImpl(HANDLE _hProcess, UInt32 pid); - ~ProcessHandleImpl(); - - UInt32 id() const; - HANDLE process() const; - int wait() const; - void closeHandle(); - -private: - HANDLE _hProcess; - UInt32 _pid; - - ProcessHandleImpl(const ProcessHandleImpl &); - ProcessHandleImpl & operator=(const ProcessHandleImpl &); -}; - - -class Foundation_API ProcessImpl -{ -public: - typedef UInt32 PIDImpl; - typedef std::vector ArgsImpl; - typedef std::map EnvImpl; - - static PIDImpl idImpl(); - static void timesImpl(long & userTime, long & kernelTime); - static ProcessHandleImpl * launchImpl( - const std::string & command, - const ArgsImpl & args, - const std::string & initialDirectory, - Pipe * inPipe, - Pipe * outPipe, - Pipe * errPipe, - const EnvImpl & env); - static void killImpl(ProcessHandleImpl & handle); - static void killImpl(PIDImpl pid); - static bool isRunningImpl(const ProcessHandleImpl & handle); - static bool isRunningImpl(PIDImpl pid); - static void requestTerminationImpl(PIDImpl pid); - static std::string terminationEventName(PIDImpl pid); -}; - - -} // namespace Poco - - -#endif // Foundation_Process_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/RWLock.h b/base/poco/Foundation/include/Poco/RWLock.h index 1a4eb3efde2..f187a298365 100644 --- a/base/poco/Foundation/include/Poco/RWLock.h +++ b/base/poco/Foundation/include/Poco/RWLock.h @@ -22,16 +22,8 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# if defined(_WIN32_WCE) -# include "Poco/RWLock_WINCE.h" -# else -# include "Poco/RWLock_WIN32.h" -# endif -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID # include "Poco/RWLock_Android.h" -#elif defined(POCO_VXWORKS) -# include "Poco/RWLock_VX.h" #else # include "Poco/RWLock_POSIX.h" #endif diff --git a/base/poco/Foundation/include/Poco/RWLock_VX.h b/base/poco/Foundation/include/Poco/RWLock_VX.h deleted file mode 100644 index 1d31bdd0cde..00000000000 --- a/base/poco/Foundation/include/Poco/RWLock_VX.h +++ /dev/null @@ -1,91 +0,0 @@ -// -// RWLock_VX.h -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Definition of the RWLockImpl class for POSIX Threads (VxWorks). -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_RWLock_VX_INCLUDED -#define Foundation_RWLock_VX_INCLUDED - - -#include -#include -#include "Poco/Exception.h" -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API RWLockImpl -{ -protected: - RWLockImpl(); - ~RWLockImpl(); - void readLockImpl(); - bool tryReadLockImpl(); - void writeLockImpl(); - bool tryWriteLockImpl(); - void unlockImpl(); - -private: - pthread_mutex_t _mutex; -}; - - -// -// inlines -// -inline void RWLockImpl::readLockImpl() -{ - if (pthread_mutex_lock(&_mutex)) - throw SystemException("cannot lock mutex"); -} - - -inline bool RWLockImpl::tryReadLockImpl() -{ - int rc = pthread_mutex_trylock(&_mutex); - if (rc == 0) - return true; - else if (rc == EBUSY) - return false; - else - throw SystemException("cannot lock mutex"); -} - - -inline void RWLockImpl::writeLockImpl() -{ - readLockImpl(); -} - - -inline bool RWLockImpl::tryWriteLockImpl() -{ - return tryReadLockImpl(); -} - - -inline void RWLockImpl::unlockImpl() -{ - if (pthread_mutex_unlock(&_mutex)) - throw SystemException("cannot unlock mutex"); -} - - -} // namespace Poco - - -#endif // Foundation_RWLock_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/RWLock_WIN32.h b/base/poco/Foundation/include/Poco/RWLock_WIN32.h deleted file mode 100644 index 9d2e3823c3c..00000000000 --- a/base/poco/Foundation/include/Poco/RWLock_WIN32.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// RWLock_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Definition of the RWLockImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_RWLock_WIN32_INCLUDED -#define Foundation_RWLock_WIN32_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API RWLockImpl -{ -protected: - RWLockImpl(); - ~RWLockImpl(); - void readLockImpl(); - bool tryReadLockImpl(); - void writeLockImpl(); - bool tryWriteLockImpl(); - void unlockImpl(); - -private: - void addWriter(); - void removeWriter(); - DWORD tryReadLockOnce(); - - HANDLE _mutex; - HANDLE _readEvent; - HANDLE _writeEvent; - unsigned _readers; - unsigned _writersWaiting; - unsigned _writers; -}; - - -} // namespace Poco - - -#endif // Foundation_RWLock_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/RWLock_WINCE.h b/base/poco/Foundation/include/Poco/RWLock_WINCE.h deleted file mode 100644 index e7347f145a8..00000000000 --- a/base/poco/Foundation/include/Poco/RWLock_WINCE.h +++ /dev/null @@ -1,62 +0,0 @@ -// -// RWLock_WINCE.h -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Definition of the RWLockImpl class for WINCE. -// -// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_RWLock_WINCE_INCLUDED -#define Foundation_RWLock_WINCE_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API RWLockImpl -/// This implementation is based on the one from Stone Steps Inc, -/// licensed under the BSD license. -/// http://forums.stonesteps.ca/thread.asp?t=105 -/// -/// Note that with this implementation, writers always take -/// precedence over readers. -{ -protected: - RWLockImpl(); - ~RWLockImpl(); - void readLockImpl(); - bool tryReadLockImpl(DWORD timeout = 1); - void writeLockImpl(); - bool tryWriteLockImpl(DWORD timeout = 1); - void unlockImpl(); - -private: - DWORD _readerCount; - DWORD _readerWaiting; - DWORD _writerCount; - DWORD _writerWaiting; - HANDLE _readerGreen; - HANDLE _writerGreen; - CRITICAL_SECTION _cs; - bool _writeLock; -}; - - -} // namespace Poco - - -#endif // Foundation_RWLock_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Semaphore.h b/base/poco/Foundation/include/Poco/Semaphore.h index 1382b532523..07a2350a949 100644 --- a/base/poco/Foundation/include/Poco/Semaphore.h +++ b/base/poco/Foundation/include/Poco/Semaphore.h @@ -22,13 +22,7 @@ #include "Poco/Foundation.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/Semaphore_WIN32.h" -#elif defined(POCO_VXWORKS) -# include "Poco/Semaphore_VX.h" -#else # include "Poco/Semaphore_POSIX.h" -#endif namespace Poco diff --git a/base/poco/Foundation/include/Poco/Semaphore_VX.h b/base/poco/Foundation/include/Poco/Semaphore_VX.h deleted file mode 100644 index 0b9e784fbaf..00000000000 --- a/base/poco/Foundation/include/Poco/Semaphore_VX.h +++ /dev/null @@ -1,57 +0,0 @@ -// -// Semaphore_VX.h -// -// Library: Foundation -// Package: Threading -// Module: Semaphore -// -// Definition of the SemaphoreImpl class for VxWorks. -// -// Copyright (c) 2004-20011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Semaphore_VX_INCLUDED -#define Foundation_Semaphore_VX_INCLUDED - - -#include -#include "Poco/Exception.h" -#include "Poco/Foundation.h" - - -namespace Poco -{ - - -class Foundation_API SemaphoreImpl -{ -protected: - SemaphoreImpl(int n, int max); - ~SemaphoreImpl(); - void setImpl(); - void waitImpl(); - bool waitImpl(long milliseconds); - -private: - SEM_ID _sem; -}; - - -// -// inlines -// -inline void SemaphoreImpl::setImpl() -{ - if (semGive(_sem) != OK) - throw SystemException("cannot signal semaphore"); -} - - -} // namespace Poco - - -#endif // Foundation_Semaphore_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Semaphore_WIN32.h b/base/poco/Foundation/include/Poco/Semaphore_WIN32.h deleted file mode 100644 index 399a350ef88..00000000000 --- a/base/poco/Foundation/include/Poco/Semaphore_WIN32.h +++ /dev/null @@ -1,59 +0,0 @@ -// -// Semaphore_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Semaphore -// -// Definition of the SemaphoreImpl class for WIN32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Semaphore_WIN32_INCLUDED -#define Foundation_Semaphore_WIN32_INCLUDED - - -#include "Poco/Exception.h" -#include "Poco/Foundation.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API SemaphoreImpl -{ -protected: - SemaphoreImpl(int n, int max); - ~SemaphoreImpl(); - void setImpl(); - void waitImpl(); - bool waitImpl(long milliseconds); - -private: - HANDLE _sema; -}; - - -// -// inlines -// -inline void SemaphoreImpl::setImpl() -{ - if (!ReleaseSemaphore(_sema, 1, NULL)) - { - throw SystemException("cannot signal semaphore"); - } -} - - -} // namespace Poco - - -#endif // Foundation_Semaphore_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/SharedLibrary.h b/base/poco/Foundation/include/Poco/SharedLibrary.h index dd9f73bb5c0..c68ddd7e03b 100644 --- a/base/poco/Foundation/include/Poco/SharedLibrary.h +++ b/base/poco/Foundation/include/Poco/SharedLibrary.h @@ -23,14 +23,8 @@ #if defined(hpux) || defined(_hpux) # include "Poco/SharedLibrary_HPUX.h" -#elif defined(POCO_VXWORKS) -# include "Poco/SharedLibrary_VX.h" #elif defined(POCO_OS_FAMILY_UNIX) # include "Poco/SharedLibrary_UNIX.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -# include "Poco/SharedLibrary_WIN32U.h" -#elif defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/SharedLibrary_WIN32.h" #endif diff --git a/base/poco/Foundation/include/Poco/SharedLibrary_HPUX.h b/base/poco/Foundation/include/Poco/SharedLibrary_HPUX.h deleted file mode 100644 index 63c6e639d01..00000000000 --- a/base/poco/Foundation/include/Poco/SharedLibrary_HPUX.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// SharedLibrary_HPUX.h -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Definition of the SharedLibraryImpl class for HP-UX. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_SharedLibrary_HPUX_INCLUDED -#define Foundation_SharedLibrary_HPUX_INCLUDED - - -#include -#include "Poco/Foundation.h" -#include "Poco/Mutex.h" - - -namespace Poco -{ - - -class Foundation_API SharedLibraryImpl -{ -protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string & path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void * findSymbolImpl(const std::string & name); - const std::string & getPathImpl() const; - static std::string suffixImpl(); - static bool setSearchPathImpl(const std::string & path); - -private: - std::string _path; - shl_t _handle; - static FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_SharedLibrary_HPUX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/SharedLibrary_VX.h b/base/poco/Foundation/include/Poco/SharedLibrary_VX.h deleted file mode 100644 index dc7cd1fe473..00000000000 --- a/base/poco/Foundation/include/Poco/SharedLibrary_VX.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// SharedLibrary_VX.h -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Definition of the SharedLibraryImpl class for VxWorks. -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_SharedLibrary_VX_INCLUDED -#define Foundation_SharedLibrary_VX_INCLUDED - - -#include -#include "Poco/Foundation.h" -#include "Poco/Mutex.h" - - -namespace Poco -{ - - -class Foundation_API SharedLibraryImpl -{ -protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string & path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void * findSymbolImpl(const std::string & name); - const std::string & getPathImpl() const; - static std::string suffixImpl(); - static bool setSearchPathImpl(const std::string & path); - -private: - std::string _path; - MODULE_ID _moduleId; - static FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_SharedLibrary_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/SharedLibrary_WIN32.h b/base/poco/Foundation/include/Poco/SharedLibrary_WIN32.h deleted file mode 100644 index 86fa35213d0..00000000000 --- a/base/poco/Foundation/include/Poco/SharedLibrary_WIN32.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// SharedLibrary_WIN32.h -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Definition of the SharedLibraryImpl class for Win32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_SharedLibrary_WIN32_INCLUDED -#define Foundation_SharedLibrary_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Mutex.h" - - -namespace Poco -{ - - -class Foundation_API SharedLibraryImpl -{ -protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string & path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void * findSymbolImpl(const std::string & name); - const std::string & getPathImpl() const; - static std::string suffixImpl(); - static bool setSearchPathImpl(const std::string & path); - -private: - std::string _path; - void * _handle; - static FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_SharedLibrary_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/SharedLibrary_WIN32U.h b/base/poco/Foundation/include/Poco/SharedLibrary_WIN32U.h deleted file mode 100644 index 03b85655efc..00000000000 --- a/base/poco/Foundation/include/Poco/SharedLibrary_WIN32U.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// SharedLibrary_WIN32U.h -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Definition of the SharedLibraryImpl class for Win32. -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_SharedLibrary_WIN32U_INCLUDED -#define Foundation_SharedLibrary_WIN32U_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Mutex.h" - - -namespace Poco -{ - - -class Foundation_API SharedLibraryImpl -{ -protected: - SharedLibraryImpl(); - ~SharedLibraryImpl(); - void loadImpl(const std::string & path, int flags); - void unloadImpl(); - bool isLoadedImpl() const; - void * findSymbolImpl(const std::string & name); - const std::string & getPathImpl() const; - static std::string suffixImpl(); - static bool setSearchPathImpl(const std::string & path); - -private: - std::string _path; - void * _handle; - static FastMutex _mutex; -}; - - -} // namespace Poco - - -#endif // Foundation_SharedLibrary_WIN32U_INCLUDED diff --git a/base/poco/Foundation/include/Poco/SharedMemory_WIN32.h b/base/poco/Foundation/include/Poco/SharedMemory_WIN32.h deleted file mode 100644 index ba90c874f68..00000000000 --- a/base/poco/Foundation/include/Poco/SharedMemory_WIN32.h +++ /dev/null @@ -1,104 +0,0 @@ -// -// SharedMemoryImpl.h -// -// Library: Foundation -// Package: Processes -// Module: SharedMemoryImpl -// -// Definition of the SharedMemoryImpl class. -// -// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_SharedMemoryImpl_INCLUDED -#define Foundation_SharedMemoryImpl_INCLUDED - - -#include "Poco/Poco.h" -#include "Poco/RefCountedObject.h" -#include "Poco/SharedMemory.h" - - -namespace Poco -{ - - -class Foundation_API SharedMemoryImpl : public RefCountedObject -/// Shared memory implementation for Windows platforms. -{ -public: - SharedMemoryImpl(const std::string & name, std::size_t size, SharedMemory::AccessMode mode, const void * addrHint, bool server); - /// Creates or connects to a shared memory object with the given name. - /// - /// For maximum portability, name should be a valid Unix filename and not - /// contain any slashes or backslashes. - /// - /// An address hint can be passed to the system, specifying the desired - /// start address of the shared memory area. Whether the hint - /// is actually honored is, however, up to the system. Windows platform - /// will generally ignore the hint. - - SharedMemoryImpl(const Poco::File & file, SharedMemory::AccessMode mode, const void * addrHint); - /// Maps the entire contents of file into a shared memory segment. - /// - /// An address hint can be passed to the system, specifying the desired - /// start address of the shared memory area. Whether the hint - /// is actually honored is, however, up to the system. Windows platform - /// will generally ignore the hint. - - char * begin() const; - /// Returns the begin address of the SharedMemory segment. Will be null for illegal segments. - - char * end() const; - /// Points past the last byte of the end address of the SharedMemory segment. Will be null for illegal segments. - -protected: - void map(); - /// Maps the shared memory object. - - void unmap(); - /// Unmaps the shared memory object. - - void close(); - /// Releases the handle for the shared memory segment. - - ~SharedMemoryImpl(); - /// Destroys the SharedMemoryImpl. - -private: - SharedMemoryImpl(); - SharedMemoryImpl(const SharedMemoryImpl &); - SharedMemoryImpl & operator=(const SharedMemoryImpl &); - - std::string _name; - HANDLE _memHandle; - HANDLE _fileHandle; - DWORD _size; - DWORD _mode; - char * _address; -}; - - -// -// inlines -// -inline char * SharedMemoryImpl::begin() const -{ - return _address; -} - - -inline char * SharedMemoryImpl::end() const -{ - return _address + _size; -} - - -} // namespace Poco - - -#endif // Foundation_SharedMemoryImpl_INCLUDED diff --git a/base/poco/Foundation/include/Poco/StreamUtil.h b/base/poco/Foundation/include/Poco/StreamUtil.h index e6c7cb3fa57..fa1814a0f2e 100644 --- a/base/poco/Foundation/include/Poco/StreamUtil.h +++ b/base/poco/Foundation/include/Poco/StreamUtil.h @@ -73,12 +73,6 @@ #if !defined(POCO_IOS_INIT_HACK) // Microsoft Visual Studio with Dinkumware STL (but not STLport) -# if defined(_MSC_VER) && (!defined(_STLP_MSVC) || defined(_STLP_NO_OWN_IOSTREAMS)) -# define POCO_IOS_INIT_HACK 1 -// QNX with Dinkumware but not GNU C++ Library -# elif defined(__QNX__) && !defined(__GLIBCPP__) -# define POCO_IOS_INIT_HACK 1 -# endif #endif diff --git a/base/poco/Foundation/include/Poco/String.h b/base/poco/Foundation/include/Poco/String.h index 90168ede895..2ac03d38aed 100644 --- a/base/poco/Foundation/include/Poco/String.h +++ b/base/poco/Foundation/include/Poco/String.h @@ -429,13 +429,7 @@ S translateInPlace(S & str, const typename S::value_type * from, const typename poco_check_ptr(from); poco_check_ptr(to); str = translate(str, S(from), S(to)); -#if defined(__SUNPRO_CC) - // Fix around the RVO bug in SunStudio 12.4 - S ret(str); - return ret; -#else return str; -#endif } diff --git a/base/poco/Foundation/include/Poco/Thread.h b/base/poco/Foundation/include/Poco/Thread.h index 49f82cc3713..91ef2ca6746 100644 --- a/base/poco/Foundation/include/Poco/Thread.h +++ b/base/poco/Foundation/include/Poco/Thread.h @@ -23,17 +23,7 @@ #include "Poco/Mutex.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# if defined(_WIN32_WCE) -# include "Poco/Thread_WINCE.h" -# else -# include "Poco/Thread_WIN32.h" -# endif -#elif defined(POCO_VXWORKS) -# include "Poco/Thread_VX.h" -#else # include "Poco/Thread_POSIX.h" -#endif namespace Poco diff --git a/base/poco/Foundation/include/Poco/Thread_POSIX.h b/base/poco/Foundation/include/Poco/Thread_POSIX.h index fb812bdad39..8dd107d554e 100644 --- a/base/poco/Foundation/include/Poco/Thread_POSIX.h +++ b/base/poco/Foundation/include/Poco/Thread_POSIX.h @@ -32,9 +32,6 @@ # include #endif #include -#if defined(POCO_VXWORKS) -# include -#endif namespace Poco @@ -116,11 +113,6 @@ private: , started(false) , joined(false) { -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_init() won't properly initialize the thread. - std::memset(&thread, 0, sizeof(thread)); -#endif } SharedPtr pRunnableTarget; diff --git a/base/poco/Foundation/include/Poco/Thread_VX.h b/base/poco/Foundation/include/Poco/Thread_VX.h deleted file mode 100644 index 381a4932762..00000000000 --- a/base/poco/Foundation/include/Poco/Thread_VX.h +++ /dev/null @@ -1,167 +0,0 @@ -// -// Thread_VX.h -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Definition of the ThreadImpl class for VxWorks tasks. -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Thread_VX_INCLUDED -#define Foundation_Thread_VX_INCLUDED - - -#include -#include -#include "Poco/AutoPtr.h" -#include "Poco/Event.h" -#include "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include "Poco/Runnable.h" -#include "Poco/SignalHandler.h" - - -namespace Poco -{ - - -class Foundation_API ThreadImpl -{ -public: - typedef int TIDImpl; - typedef void (*Callable)(void *); - - enum Priority - { - PRIO_LOWEST_IMPL, - PRIO_LOW_IMPL, - PRIO_NORMAL_IMPL, - PRIO_HIGH_IMPL, - PRIO_HIGHEST_IMPL - }; - - enum Policy - { - POLICY_DEFAULT_IMPL = 0 - }; - - enum - { - DEFAULT_THREAD_STACK_SIZE = 65536 - }; - - struct CallbackData : public RefCountedObject - { - CallbackData() : callback(0), pData(0) { } - - Callable callback; - void * pData; - }; - - ThreadImpl(); - ~ThreadImpl(); - - TIDImpl tidImpl() const; - void setPriorityImpl(int prio); - int getPriorityImpl() const; - void setOSPriorityImpl(int prio, int policy = 0); - int getOSPriorityImpl() const; - static int getMinOSPriorityImpl(int policy); - static int getMaxOSPriorityImpl(int policy); - void setStackSizeImpl(int size); - int getStackSizeImpl() const; - void startImpl(Runnable & target); - void startImpl(Callable target, void * pData = 0); - - void joinImpl(); - bool joinImpl(long milliseconds); - bool isRunningImpl() const; - static void sleepImpl(long milliseconds); - static void yieldImpl(); - static ThreadImpl * currentImpl(); - static TIDImpl currentTidImpl(); - -protected: - static void runnableEntry(void * pThread, int, int, int, int, int, int, int, int, int); - static void callableEntry(void * pThread, int, int, int, int, int, int, int, int, int); - static int mapPrio(int prio); - static int reverseMapPrio(int osPrio); - - struct ThreadData : public RefCountedObject - { - ThreadData() - : pRunnableTarget(0) - , pCallbackTarget(0) - , task(0) - , prio(PRIO_NORMAL_IMPL) - , osPrio(127) - , done(false) - , stackSize(POCO_THREAD_STACK_SIZE) - { - } - - Runnable * pRunnableTarget; - AutoPtr pCallbackTarget; - int task; - int prio; - int osPrio; - Event done; - int stackSize; - }; - -private: - AutoPtr _pData; - static ThreadImpl * _pCurrent; -}; - - -// -// inlines -// -inline int ThreadImpl::getPriorityImpl() const -{ - return _pData->prio; -} - - -inline int ThreadImpl::getOSPriorityImpl() const -{ - return _pData->osPrio; -} - - -inline bool ThreadImpl::isRunningImpl() const -{ - return _pData->pRunnableTarget != 0 || (_pData->pCallbackTarget.get() != 0 && _pData->pCallbackTarget->callback != 0); -} - - -inline void ThreadImpl::yieldImpl() -{ - taskDelay(0); -} - - -inline int ThreadImpl::getStackSizeImpl() const -{ - return _pData->stackSize; -} - - -inline ThreadImpl::TIDImpl ThreadImpl::tidImpl() const -{ - return _pData->task; -} - - -} // namespace Poco - - -#endif // Foundation_Thread_VX_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Thread_WIN32.h b/base/poco/Foundation/include/Poco/Thread_WIN32.h deleted file mode 100644 index c5f4b6ffcc6..00000000000 --- a/base/poco/Foundation/include/Poco/Thread_WIN32.h +++ /dev/null @@ -1,175 +0,0 @@ -// -// Thread_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Definition of the ThreadImpl class for WIN32. -// -// Copyright (c) 2004-2009, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Thread_WIN32_INCLUDED -#define Foundation_Thread_WIN32_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Runnable.h" -#include "Poco/SharedPtr.h" -#include "Poco/UnWindows.h" - - -namespace Poco -{ - - -class Foundation_API ThreadImpl -{ -public: - typedef DWORD TIDImpl; - typedef void (*Callable)(void *); - -#if defined(_DLL) - typedef DWORD(WINAPI * Entry)(LPVOID); -#else - typedef unsigned(__stdcall * Entry)(void *); -#endif - - enum Priority - { - PRIO_LOWEST_IMPL = THREAD_PRIORITY_LOWEST, - PRIO_LOW_IMPL = THREAD_PRIORITY_BELOW_NORMAL, - PRIO_NORMAL_IMPL = THREAD_PRIORITY_NORMAL, - PRIO_HIGH_IMPL = THREAD_PRIORITY_ABOVE_NORMAL, - PRIO_HIGHEST_IMPL = THREAD_PRIORITY_HIGHEST - }; - - enum Policy - { - POLICY_DEFAULT_IMPL = 0 - }; - - ThreadImpl(); - ~ThreadImpl(); - - TIDImpl tidImpl() const; - void setPriorityImpl(int prio); - int getPriorityImpl() const; - void setOSPriorityImpl(int prio, int policy = 0); - int getOSPriorityImpl() const; - static int getMinOSPriorityImpl(int policy); - static int getMaxOSPriorityImpl(int policy); - void setStackSizeImpl(int size); - int getStackSizeImpl() const; - void startImpl(SharedPtr pTarget); - void joinImpl(); - bool joinImpl(long milliseconds); - bool isRunningImpl() const; - static void sleepImpl(long milliseconds); - static void yieldImpl(); - static ThreadImpl * currentImpl(); - static TIDImpl currentTidImpl(); - -protected: -#if defined(_DLL) - static DWORD WINAPI runnableEntry(LPVOID pThread); -#else - static unsigned __stdcall runnableEntry(void * pThread); -#endif - - void createImpl(Entry ent, void * pData); - void threadCleanup(); - -private: - class CurrentThreadHolder - { - public: - CurrentThreadHolder() : _slot(TlsAlloc()) - { - if (_slot == TLS_OUT_OF_INDEXES) - throw SystemException("cannot allocate thread context key"); - } - ~CurrentThreadHolder() { TlsFree(_slot); } - ThreadImpl * get() const { return reinterpret_cast(TlsGetValue(_slot)); } - void set(ThreadImpl * pThread) { TlsSetValue(_slot, pThread); } - - private: - DWORD _slot; - }; - - SharedPtr _pRunnableTarget; - HANDLE _thread; - DWORD _threadId; - int _prio; - int _stackSize; - - static CurrentThreadHolder _currentThreadHolder; -}; - - -// -// inlines -// -inline int ThreadImpl::getPriorityImpl() const -{ - return _prio; -} - - -inline int ThreadImpl::getOSPriorityImpl() const -{ - return _prio; -} - - -inline int ThreadImpl::getMinOSPriorityImpl(int /* policy */) -{ - return PRIO_LOWEST_IMPL; -} - - -inline int ThreadImpl::getMaxOSPriorityImpl(int /* policy */) -{ - return PRIO_HIGHEST_IMPL; -} - - -inline void ThreadImpl::sleepImpl(long milliseconds) -{ - Sleep(DWORD(milliseconds)); -} - - -inline void ThreadImpl::yieldImpl() -{ - Sleep(0); -} - - -inline void ThreadImpl::setStackSizeImpl(int size) -{ - _stackSize = size; -} - - -inline int ThreadImpl::getStackSizeImpl() const -{ - return _stackSize; -} - - -inline ThreadImpl::TIDImpl ThreadImpl::tidImpl() const -{ - return _threadId; -} - - -} // namespace Poco - - -#endif // Foundation_Thread_WIN32_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Thread_WINCE.h b/base/poco/Foundation/include/Poco/Thread_WINCE.h deleted file mode 100644 index 5e5d64c1f4f..00000000000 --- a/base/poco/Foundation/include/Poco/Thread_WINCE.h +++ /dev/null @@ -1,171 +0,0 @@ -// -// Thread_WINCE.h -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Definition of the ThreadImpl class for WIN32. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#ifndef Foundation_Thread_WINCE_INCLUDED -#define Foundation_Thread_WINCE_INCLUDED - - -#include "Poco/Foundation.h" -#include "Poco/Runnable.h" -#include "Poco/SharedPtr.h" -#include "Poco/UnWindows.h" - - -#if !defined(TLS_OUT_OF_INDEXES) // Windows CE 5.x does not define this -# define TLS_OUT_OF_INDEXES 0xFFFFFFFF -#endif - - -namespace Poco -{ - - -class Foundation_API ThreadImpl -{ -public: - typedef DWORD TIDImpl; - typedef void (*Callable)(void *); - typedef DWORD(WINAPI * Entry)(LPVOID); - - enum Priority - { - PRIO_LOWEST_IMPL = THREAD_PRIORITY_LOWEST, - PRIO_LOW_IMPL = THREAD_PRIORITY_BELOW_NORMAL, - PRIO_NORMAL_IMPL = THREAD_PRIORITY_NORMAL, - PRIO_HIGH_IMPL = THREAD_PRIORITY_ABOVE_NORMAL, - PRIO_HIGHEST_IMPL = THREAD_PRIORITY_HIGHEST - }; - - enum Policy - { - POLICY_DEFAULT_IMPL = 0 - }; - - ThreadImpl(); - ~ThreadImpl(); - - TIDImpl tidImpl() const; - void setPriorityImpl(int prio); - int getPriorityImpl() const; - void setOSPriorityImpl(int prio, int policy = 0); - int getOSPriorityImpl() const; - static int getMinOSPriorityImpl(int policy); - static int getMaxOSPriorityImpl(int policy); - void setStackSizeImpl(int size); - int getStackSizeImpl() const; - void startImpl(SharedPtr pTarget); - void joinImpl(); - bool joinImpl(long milliseconds); - bool isRunningImpl() const; - static void sleepImpl(long milliseconds); - static void yieldImpl(); - static ThreadImpl * currentImpl(); - static TIDImpl currentTidImpl(); - -protected: - static DWORD WINAPI runnableEntry(LPVOID pThread); - - void createImpl(Entry ent, void * pData); - void threadCleanup(); - -private: - class CurrentThreadHolder - { - public: - CurrentThreadHolder() : _slot(TlsAlloc()) - { - if (_slot == TLS_OUT_OF_INDEXES) - throw SystemException("cannot allocate thread context key"); - } - ~CurrentThreadHolder() { TlsFree(_slot); } - ThreadImpl * get() const { return reinterpret_cast(TlsGetValue(_slot)); } - void set(ThreadImpl * pThread) { TlsSetValue(_slot, pThread); } - - private: - DWORD _slot; - }; - - SharedPtr _pRunnableTarget; - HANDLE _thread; - DWORD _threadId; - int _prio; - int _stackSize; - - static CurrentThreadHolder _currentThreadHolder; -}; - - -// -// inlines -// -inline int ThreadImpl::getPriorityImpl() const -{ - return _prio; -} - - -inline int ThreadImpl::getOSPriorityImpl() const -{ - return _prio; -} - - -inline int ThreadImpl::getMinOSPriorityImpl(int /* policy */) -{ - return PRIO_LOWEST_IMPL; -} - - -inline int ThreadImpl::getMaxOSPriorityImpl(int /* policy */) -{ - return PRIO_HIGHEST_IMPL; -} - - -inline void ThreadImpl::sleepImpl(long milliseconds) -{ - Sleep(DWORD(milliseconds)); -} - - -inline void ThreadImpl::yieldImpl() -{ - Sleep(0); -} - - -inline void ThreadImpl::setStackSizeImpl(int size) -{ - _stackSize = size; -} - - -inline int ThreadImpl::getStackSizeImpl() const -{ - return _stackSize; -} - - -inline ThreadImpl::TIDImpl ThreadImpl::tidImpl() const -{ - return _threadId; -} - - -} // namespace Poco - - -#endif // Foundation_Thread_WINCE_INCLUDED diff --git a/base/poco/Foundation/include/Poco/Timestamp.h b/base/poco/Foundation/include/Poco/Timestamp.h index 2f94b36b2de..d13d99d3f0b 100644 --- a/base/poco/Foundation/include/Poco/Timestamp.h +++ b/base/poco/Foundation/include/Poco/Timestamp.h @@ -140,10 +140,6 @@ public: /// Since the timestamp has microsecond resolution, /// the returned value is always 1000000. -#if defined(_WIN32) - static Timestamp fromFileTimeNP(UInt32 fileTimeLow, UInt32 fileTimeHigh); - void toFileTimeNP(UInt32 & fileTimeLow, UInt32 & fileTimeHigh) const; -#endif private: TimeVal _ts; diff --git a/base/poco/Foundation/include/Poco/Tuple.h b/base/poco/Foundation/include/Poco/Tuple.h index d79df65bc0f..07a379ff10a 100644 --- a/base/poco/Foundation/include/Poco/Tuple.h +++ b/base/poco/Foundation/include/Poco/Tuple.h @@ -26,11 +26,7 @@ namespace Poco { -#if defined(_MSC_VER) -# define POCO_TYPEWRAPPER_DEFAULTVALUE(T) TypeWrapper::TYPE() -#else # define POCO_TYPEWRAPPER_DEFAULTVALUE(T) typename TypeWrapper::TYPE() -#endif template < diff --git a/base/poco/Foundation/include/Poco/Types.h b/base/poco/Foundation/include/Poco/Types.h index d9a3e5bd26e..156b3584d15 100644 --- a/base/poco/Foundation/include/Poco/Types.h +++ b/base/poco/Foundation/include/Poco/Types.h @@ -25,28 +25,7 @@ namespace Poco { -#if defined(_MSC_VER) -// -// Windows/Visual C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed __int64 Int64; -typedef unsigned __int64 UInt64; -# if defined(_WIN64) -# define POCO_PTR_IS_64_BIT 1 -typedef signed __int64 IntPtr; -typedef unsigned __int64 UIntPtr; -# else -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# endif -# define POCO_HAVE_INT64 1 -#elif defined(__GNUC__) || defined(__clang__) +#if defined(__GNUC__) || defined(__clang__) // // Unix/GCC/Clang // @@ -56,13 +35,6 @@ typedef signed short Int16; typedef unsigned short UInt16; typedef signed int Int32; typedef unsigned int UInt32; -# if defined(_WIN64) -# define POCO_PTR_IS_64_BIT 1 -typedef signed long long IntPtr; -typedef unsigned long long UIntPtr; -typedef signed long long Int64; -typedef unsigned long long UInt64; -# else typedef signed long IntPtr; typedef unsigned long UIntPtr; # if defined(__LP64__) @@ -74,124 +46,6 @@ typedef unsigned long UInt64; typedef signed long long Int64; typedef unsigned long long UInt64; # endif -# endif -# define POCO_HAVE_INT64 1 -#elif defined(__DECCXX) -// -// Compaq C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed __int64 Int64; -typedef unsigned __int64 UInt64; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# define POCO_PTR_IS_64_BIT 1 -# define POCO_LONG_IS_64_BIT 1 -# define POCO_HAVE_INT64 1 -#elif defined(__HP_aCC) -// -// HP Ansi C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# if defined(__LP64__) -# define POCO_PTR_IS_64_BIT 1 -# define POCO_LONG_IS_64_BIT 1 -typedef signed long Int64; -typedef unsigned long UInt64; -# else -typedef signed long long Int64; -typedef unsigned long long UInt64; -# endif -# define POCO_HAVE_INT64 1 -#elif defined(__SUNPRO_CC) -// -// SUN Forte C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# if defined(__sparcv9) -# define POCO_PTR_IS_64_BIT 1 -# define POCO_LONG_IS_64_BIT 1 -typedef signed long Int64; -typedef unsigned long UInt64; -# else -typedef signed long long Int64; -typedef unsigned long long UInt64; -# endif -# define POCO_HAVE_INT64 1 -#elif defined(__IBMCPP__) -// -// IBM XL C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# if defined(__64BIT__) -# define POCO_PTR_IS_64_BIT 1 -# define POCO_LONG_IS_64_BIT 1 -typedef signed long Int64; -typedef unsigned long UInt64; -# else -typedef signed long long Int64; -typedef unsigned long long UInt64; -# endif -# define POCO_HAVE_INT64 1 -#elif defined(__sgi) -// -// MIPSpro C++ -// -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -# if _MIPS_SZLONG == 64 -# define POCO_PTR_IS_64_BIT 1 -# define POCO_LONG_IS_64_BIT 1 -typedef signed long Int64; -typedef unsigned long UInt64; -# else -typedef signed long long Int64; -typedef unsigned long long UInt64; -# endif -# define POCO_HAVE_INT64 1 -#elif defined(_DIAB_TOOL) -typedef signed char Int8; -typedef unsigned char UInt8; -typedef signed short Int16; -typedef unsigned short UInt16; -typedef signed int Int32; -typedef unsigned int UInt32; -typedef signed long IntPtr; -typedef unsigned long UIntPtr; -typedef signed long long Int64; -typedef unsigned long long UInt64; # define POCO_HAVE_INT64 1 #endif diff --git a/base/poco/Foundation/include/Poco/UTFString.h b/base/poco/Foundation/include/Poco/UTFString.h index f03d80fa90f..cd34d212393 100644 --- a/base/poco/Foundation/include/Poco/UTFString.h +++ b/base/poco/Foundation/include/Poco/UTFString.h @@ -225,12 +225,7 @@ typedef std::basic_string UTF16String; typedef UInt32 UTF32Char; typedef std::basic_string UTF32String; #else // POCO_NO_WSTRING -# if defined(POCO_OS_FAMILY_WINDOWS) -typedef wchar_t UTF16Char; -typedef std::wstring UTF16String; -typedef UInt32 UTF32Char; -typedef std::basic_string UTF32String; -# elif defined(__SIZEOF_WCHAR_T__) //gcc +# if defined(__SIZEOF_WCHAR_T__) //gcc # if (__SIZEOF_WCHAR_T__ == 2) typedef wchar_t UTF16Char; typedef std::wstring UTF16String; diff --git a/base/poco/Foundation/include/Poco/UnWindows.h b/base/poco/Foundation/include/Poco/UnWindows.h index 5678752bb5d..1f3835b8af5 100644 --- a/base/poco/Foundation/include/Poco/UnWindows.h +++ b/base/poco/Foundation/include/Poco/UnWindows.h @@ -38,11 +38,6 @@ // Reduce bloat -#if defined(_WIN32) -# if !defined(WIN32_LEAN_AND_MEAN) && !defined(POCO_BLOATED_WIN32) -# define WIN32_LEAN_AND_MEAN -# endif -#endif // Microsoft Visual C++ includes copies of the Windows header files @@ -56,7 +51,6 @@ // definitions.) For more information, see SdkDdkVer.h. -#if !defined(_WIN32_WCE) # if defined(_WIN32_WINNT) # if (_WIN32_WINNT < 0x0502) # error Unsupported Windows version. @@ -76,7 +70,6 @@ # define _WIN32_WINNT 0x0502 # define NTDDI_VERSION 0x05020000 # endif -#endif // To prevent Platform_WIN32.h to modify version defines, diff --git a/base/poco/Foundation/include/Poco/UnbufferedStreamBuf.h b/base/poco/Foundation/include/Poco/UnbufferedStreamBuf.h index 9c867ed0869..56c1d148af2 100644 --- a/base/poco/Foundation/include/Poco/UnbufferedStreamBuf.h +++ b/base/poco/Foundation/include/Poco/UnbufferedStreamBuf.h @@ -156,9 +156,6 @@ private: // instantiation - to avoid duplicate symbols due to multiple // instantiations in different libraries. // -#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS) -template class Foundation_API BasicUnbufferedStreamBuf>; -#endif typedef BasicUnbufferedStreamBuf> UnbufferedStreamBuf; diff --git a/base/poco/Foundation/src/Clock.cpp b/base/poco/Foundation/src/Clock.cpp index e52cd5db453..75ab43042cf 100644 --- a/base/poco/Foundation/src/Clock.cpp +++ b/base/poco/Foundation/src/Clock.cpp @@ -21,10 +21,6 @@ #elif defined(POCO_OS_FAMILY_UNIX) #include #include -#elif defined(POCO_VXWORKS) -#include -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "Poco/UnWindows.h" #endif #include #undef min @@ -93,18 +89,7 @@ void Clock::swap(Clock& timestamp) void Clock::update() { -#if defined(POCO_OS_FAMILY_WINDOWS) - - LARGE_INTEGER perfCounter; - LARGE_INTEGER perfFreq; - if (QueryPerformanceCounter(&perfCounter) && QueryPerformanceFrequency(&perfFreq)) - { - _clock = resolution()*(perfCounter.QuadPart/perfFreq.QuadPart); - _clock += (perfCounter.QuadPart % perfFreq.QuadPart)*resolution()/perfFreq.QuadPart; - } - else throw Poco::SystemException("cannot get system clock"); - -#elif defined(__MACH__) +#if defined(__MACH__) clock_serv_t cs; mach_timespec_t ts; @@ -115,18 +100,6 @@ void Clock::update() _clock = ClockVal(ts.tv_sec)*resolution() + ts.tv_nsec/1000; -#elif defined(POCO_VXWORKS) - - struct timespec ts; -#if defined(CLOCK_MONOTONIC) // should be in VxWorks 6.x - if (clock_gettime(CLOCK_MONOTONIC, &ts)) - throw SystemException("cannot get system clock"); -#else - if (clock_gettime(CLOCK_REALTIME, &ts)) - throw SystemException("cannot get system clock"); -#endif - _clock = ClockVal(ts.tv_sec)*resolution() + ts.tv_nsec/1000; - #elif defined(POCO_HAVE_CLOCK_GETTIME) struct timespec ts; @@ -145,17 +118,7 @@ void Clock::update() Clock::ClockDiff Clock::accuracy() { -#if defined(POCO_OS_FAMILY_WINDOWS) - - LARGE_INTEGER perfFreq; - if (QueryPerformanceFrequency(&perfFreq) && perfFreq.QuadPart > 0) - { - ClockVal acc = resolution()/perfFreq.QuadPart; - return acc > 0 ? acc : 1; - } - else throw Poco::SystemException("cannot get system clock accuracy"); - -#elif defined(__MACH__) +#if defined(__MACH__) clock_serv_t cs; int nanosecs; @@ -168,19 +131,6 @@ Clock::ClockDiff Clock::accuracy() ClockVal acc = nanosecs/1000; return acc > 0 ? acc : 1; -#elif defined(POCO_VXWORKS) - - struct timespec ts; -#if defined(CLOCK_MONOTONIC) // should be in VxWorks 6.x - if (clock_getres(CLOCK_MONOTONIC, &ts)) - throw SystemException("cannot get system clock"); -#else - if (clock_getres(CLOCK_REALTIME, &ts)) - throw SystemException("cannot get system clock"); -#endif - ClockVal acc = ClockVal(ts.tv_sec)*resolution() + ts.tv_nsec/1000; - return acc > 0 ? acc : 1; - #elif defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) struct timespec ts; @@ -200,22 +150,10 @@ Clock::ClockDiff Clock::accuracy() bool Clock::monotonic() { -#if defined(POCO_OS_FAMILY_WINDOWS) +#if defined(__MACH__) return true; -#elif defined(__MACH__) - - return true; - -#elif defined(POCO_VXWORKS) - -#if defined(CLOCK_MONOTONIC) // should be in VxWorks 6.x - return true; -#else - return false; -#endif - #elif defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) return true; diff --git a/base/poco/Foundation/src/Debugger.cpp b/base/poco/Foundation/src/Debugger.cpp index c9efe5eac1f..3a9f7033fcb 100644 --- a/base/poco/Foundation/src/Debugger.cpp +++ b/base/poco/Foundation/src/Debugger.cpp @@ -16,15 +16,10 @@ #include #include #include -#if defined(POCO_OS_FAMILY_WINDOWS) - #include "Poco/UnWindows.h" -#elif defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) +#if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) #include #include #endif -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -#include "Poco/UnicodeConverter.h" -#endif // NOTE: In this module, we use the C library functions (fputs) for, @@ -38,24 +33,7 @@ namespace Poco { bool Debugger::isAvailable() { #if defined(_DEBUG) - #if defined(POCO_OS_FAMILY_WINDOWS) - #if defined(_WIN32_WCE) - #if (_WIN32_WCE >= 0x600) - BOOL isDebuggerPresent; - if (CheckRemoteDebuggerPresent(GetCurrentProcess(), &isDebuggerPresent)) - { - return isDebuggerPresent ? true : false; - } - return false; - #else - return false; - #endif - #else - return IsDebuggerPresent() ? true : false; - #endif - #elif defined(POCO_VXWORKS) - return false; - #elif defined(POCO_OS_FAMILY_UNIX) + #if defined(POCO_OS_FAMILY_UNIX) return std::getenv("POCO_ENABLE_DEBUGGER") ? true : false; #endif #else @@ -70,20 +48,6 @@ void Debugger::message(const std::string& msg) std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr); std::fputs(msg.c_str(), stderr); std::fputs("\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n", stderr); - #if defined(POCO_OS_FAMILY_WINDOWS) - if (isAvailable()) - { - #if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - std::wstring umsg; - UnicodeConverter::toUTF16(msg, umsg); - umsg += '\n'; - OutputDebugStringW(umsg.c_str()); - #else - OutputDebugStringA(msg.c_str()); - OutputDebugStringA("\n"); - #endif - } - #endif #endif } @@ -101,16 +65,7 @@ void Debugger::message(const std::string& msg, const char* file, int line) void Debugger::enter() { #if defined(_DEBUG) - #if defined(POCO_OS_FAMILY_WINDOWS) - if (isAvailable()) - { - DebugBreak(); - } - #elif defined(POCO_VXWORKS) - { - // not supported - } - #elif defined(POCO_OS_FAMILY_UNIX) + #if defined(POCO_OS_FAMILY_UNIX) if (isAvailable()) { kill(getpid(), SIGINT); diff --git a/base/poco/Foundation/src/DirectoryIterator.cpp b/base/poco/Foundation/src/DirectoryIterator.cpp index 28d29e0d2d7..94faaacf536 100644 --- a/base/poco/Foundation/src/DirectoryIterator.cpp +++ b/base/poco/Foundation/src/DirectoryIterator.cpp @@ -15,11 +15,7 @@ #include "Poco/DirectoryIterator.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#include "DirectoryIterator_WIN32U.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "DirectoryIterator_WIN32.cpp" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include "DirectoryIterator_UNIX.cpp" #endif diff --git a/base/poco/Foundation/src/DirectoryIterator_UNIX.cpp b/base/poco/Foundation/src/DirectoryIterator_UNIX.cpp index 16be5051eab..6f5e3fd8175 100644 --- a/base/poco/Foundation/src/DirectoryIterator_UNIX.cpp +++ b/base/poco/Foundation/src/DirectoryIterator_UNIX.cpp @@ -13,11 +13,7 @@ #include "Poco/DirectoryIterator_UNIX.h" -#if defined(POCO_VXWORKS) -#include "Poco/File_VX.h" -#else #include "Poco/File_UNIX.h" -#endif #include "Poco/Path.h" @@ -29,11 +25,7 @@ DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _pDir(0), Path p(path); p.makeFile(); -#if defined(POCO_VXWORKS) - _pDir = opendir(const_cast(p.toString().c_str())); -#else _pDir = opendir(p.toString().c_str()); -#endif if (!_pDir) File::handleLastError(path); next(); diff --git a/base/poco/Foundation/src/DirectoryIterator_WIN32.cpp b/base/poco/Foundation/src/DirectoryIterator_WIN32.cpp deleted file mode 100644 index e7ebfc859b0..00000000000 --- a/base/poco/Foundation/src/DirectoryIterator_WIN32.cpp +++ /dev/null @@ -1,66 +0,0 @@ -// -// DirectoryIterator_WIN32.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: DirectoryIterator -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/DirectoryIterator_WIN32.h" -#include "Poco/File_WIN32.h" -#include "Poco/Path.h" - - -namespace Poco { - - -DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVALID_HANDLE_VALUE), _rc(1) -{ - Path p(path); - p.makeDirectory(); - std::string findPath = p.toString(); - findPath.append("*"); - - _fh = FindFirstFile(findPath.c_str(), &_fd); - if (_fh == INVALID_HANDLE_VALUE) - { - if (GetLastError() != ERROR_NO_MORE_FILES) - File::handleLastError(path); - } - else - { - _current = _fd.cFileName; - if (_current == "." || _current == "..") - next(); - } -} - - -DirectoryIteratorImpl::~DirectoryIteratorImpl() -{ - if (_fh != INVALID_HANDLE_VALUE) - FindClose(_fh); -} - - -const std::string& DirectoryIteratorImpl::next() -{ - do - { - if (FindNextFile(_fh, &_fd) != 0) - _current = _fd.cFileName; - else - _current.clear(); - } - while (_current == "." || _current == ".."); - return _current; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/DirectoryIterator_WIN32U.cpp b/base/poco/Foundation/src/DirectoryIterator_WIN32U.cpp deleted file mode 100644 index 8f17bc31441..00000000000 --- a/base/poco/Foundation/src/DirectoryIterator_WIN32U.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// -// DirectoryIterator_WIN32U.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: DirectoryIterator -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/DirectoryIterator_WIN32U.h" -#if defined(_WIN32_WCE) -#include "Poco/File_WINCE.h" -#else -#include "Poco/File_WIN32U.h" -#endif -#include "Poco/Path.h" -#include "Poco/UnicodeConverter.h" -#include - - -namespace Poco { - - -DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _fh(INVALID_HANDLE_VALUE), _rc(1) -{ - Path p(path); - p.makeDirectory(); - std::string findPath = p.toString(); - findPath.append("*"); - std::wstring uFindPath; - FileImpl::convertPath(findPath, uFindPath); - - _fh = FindFirstFileW(uFindPath.c_str(), &_fd); - if (_fh == INVALID_HANDLE_VALUE) - { - if (GetLastError() != ERROR_NO_MORE_FILES) - File::handleLastError(path); - } - else - { - UnicodeConverter::toUTF8(_fd.cFileName, _current); - if (_current == "." || _current == "..") - next(); - } -} - - -DirectoryIteratorImpl::~DirectoryIteratorImpl() -{ - if (_fh != INVALID_HANDLE_VALUE) - FindClose(_fh); -} - - -const std::string& DirectoryIteratorImpl::next() -{ - do - { - _current.clear(); - if (FindNextFileW(_fh, &_fd) != 0) - { - UnicodeConverter::toUTF8(_fd.cFileName, _current); - } - } - while (_current == "." || _current == ".."); - return _current; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/DirectoryWatcher.cpp b/base/poco/Foundation/src/DirectoryWatcher.cpp index 68aef99d29f..b559da65e09 100644 --- a/base/poco/Foundation/src/DirectoryWatcher.cpp +++ b/base/poco/Foundation/src/DirectoryWatcher.cpp @@ -179,13 +179,7 @@ public: filter |= FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_LAST_WRITE; std::string path(owner().directory().path()); -#if defined(POCO_WIN32_UTF8) - std::wstring upath; - FileImpl::convertPath(path.c_str(), upath); - HANDLE hChange = FindFirstChangeNotificationW(upath.c_str(), FALSE, filter); -#else HANDLE hChange = FindFirstChangeNotificationA(path.c_str(), FALSE, filter); -#endif if (hChange == INVALID_HANDLE_VALUE) { diff --git a/base/poco/Foundation/src/Environment.cpp b/base/poco/Foundation/src/Environment.cpp index 32753efc5ab..00891ee2b92 100644 --- a/base/poco/Foundation/src/Environment.cpp +++ b/base/poco/Foundation/src/Environment.cpp @@ -18,16 +18,8 @@ #include // sprintf() -#if defined(POCO_VXWORKS) -#include "Environment_VX.cpp" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include "Environment_UNIX.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Environment_WINCE.cpp" -#else -#include "Environment_WIN32.cpp" -#endif #endif @@ -149,11 +141,7 @@ bool Environment::isUnix() bool Environment::isWindows() { -#if defined(POCO_OS_FAMILY_WINDOWS) - return true; -#else return false; -#endif } diff --git a/base/poco/Foundation/src/Environment_UNIX.cpp b/base/poco/Foundation/src/Environment_UNIX.cpp index 04622dd1874..202e5d88f83 100644 --- a/base/poco/Foundation/src/Environment_UNIX.cpp +++ b/base/poco/Foundation/src/Environment_UNIX.cpp @@ -185,11 +185,7 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id) /// #include #include #include -#ifndef __CYGWIN__ #include -#else // workaround for Cygwin, which does not have if_arp.h -#define ARPHRD_ETHER 1 /* Ethernet 10Mbps */ -#endif #include /// #include #include diff --git a/base/poco/Foundation/src/Environment_VX.cpp b/base/poco/Foundation/src/Environment_VX.cpp deleted file mode 100644 index 44dc6907688..00000000000 --- a/base/poco/Foundation/src/Environment_VX.cpp +++ /dev/null @@ -1,157 +0,0 @@ - -// Environment_VX.cpp -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Environment_VX.h" -#include "Poco/Exception.h" -#include "Poco/Buffer.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace Poco { - - -EnvironmentImpl::StringMap EnvironmentImpl::_map; -FastMutex EnvironmentImpl::_mutex; - - -std::string EnvironmentImpl::getImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - const char* val = getenv(name.c_str()); - if (val) - return std::string(val); - else - throw NotFoundException(name); -} - - -bool EnvironmentImpl::hasImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - return getenv(name.c_str()) != 0; -} - - -void EnvironmentImpl::setImpl(const std::string& name, const std::string& value) -{ - FastMutex::ScopedLock lock(_mutex); - - std::string var = name; - var.append("="); - var.append(value); - std::swap(_map[name], var); - if (putenv((char*) _map[name].c_str())) - { - std::string msg = "cannot set environment variable: "; - msg.append(name); - throw SystemException(msg); - } -} - - -std::string EnvironmentImpl::osNameImpl() -{ - return runtimeName; -} - - -std::string EnvironmentImpl::osDisplayNameImpl() -{ - return osNameImpl(); -} - - -std::string EnvironmentImpl::osVersionImpl() -{ - return runtimeVersion; -} - - -std::string EnvironmentImpl::osArchitectureImpl() -{ -#if POCO_ARCH == POCO_ARCH_IA32 - return "i386"; -#elif POCO_ARCH == POCO_ARCH_MIPS - return "mips"; -#elif POCO_ARCH == POCO_ARCH_PPC - return "ppc"; -#elif POCO_ARCH == POCO_ARCH_ARM - return "arm"; -#elif POCO_ARCH == POCO_ARCH_SH - return "sh"; -#else - return "unknown"; -#endif -} - - -std::string EnvironmentImpl::nodeNameImpl() -{ - char buffer[64]; - if (gethostname(buffer, sizeof(buffer)) == OK) - return buffer; - else - return "unknown"; -} - - -unsigned EnvironmentImpl::processorCountImpl() -{ - return 1; -} - - -void EnvironmentImpl::nodeIdImpl(NodeId& id) -{ - std::memset(&id, 0, sizeof(id)); - - int ifIndex = 1; - char ifName[32]; - for (;;) - { - if (ifIndexToIfName(ifIndex, ifName) == OK) - { - struct ifnet* pIf = ifunit(ifName); - if (pIf) - { - std::memcpy(&id, ((struct arpcom *) pIf)->ac_enaddr, sizeof(id)); - return; - } - } - else break; - ++ifIndex; - } - throw SystemException("cannot get Ethernet hardware address"); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Environment_WIN32.cpp b/base/poco/Foundation/src/Environment_WIN32.cpp deleted file mode 100644 index 62845fab029..00000000000 --- a/base/poco/Foundation/src/Environment_WIN32.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// -// Environment_WIN32.cpp -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Environment_WIN32.h" -#include "Poco/Exception.h" -#include -#include -#include "Poco/UnWindows.h" -#include -#include -#include -#include - - -namespace Poco { - - -std::string EnvironmentImpl::getImpl(const std::string& name) -{ - DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0); - if (len == 0) throw NotFoundException(name); - char* buffer = new char[len]; - GetEnvironmentVariableA(name.c_str(), buffer, len); - std::string result(buffer); - delete [] buffer; - return result; -} - - -bool EnvironmentImpl::hasImpl(const std::string& name) -{ - DWORD len = GetEnvironmentVariableA(name.c_str(), 0, 0); - return len > 0; -} - - -void EnvironmentImpl::setImpl(const std::string& name, const std::string& value) -{ - if (SetEnvironmentVariableA(name.c_str(), value.c_str()) == 0) - { - std::string msg = "cannot set environment variable: "; - msg.append(name); - throw SystemException(msg); - } -} - - -std::string EnvironmentImpl::osNameImpl() -{ - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information"); - switch (vi.dwPlatformId) - { - case VER_PLATFORM_WIN32s: - return "Windows 3.x"; - case VER_PLATFORM_WIN32_WINDOWS: - return vi.dwMinorVersion == 0 ? "Windows 95" : "Windows 98"; - case VER_PLATFORM_WIN32_NT: - return "Windows NT"; - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::osDisplayNameImpl() -{ - OSVERSIONINFOEX vi; // OSVERSIONINFOEX is supported starting at Windows 2000 - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx((OSVERSIONINFO*) &vi) == 0) throw SystemException("Cannot get OS version information"); - switch (vi.dwMajorVersion) - { - case 10: - switch (vi.dwMinorVersion) - { - case 0: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 10" : "Windows Server 2016"; - } - case 6: - switch (vi.dwMinorVersion) - { - case 0: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows Vista" : "Windows Server 2008"; - case 1: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 7" : "Windows Server 2008 R2"; - case 2: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 8" : "Windows Server 2012"; - case 3: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 8.1" : "Windows Server 2012 R2"; - default: - return "Unknown"; - } - case 5: - switch (vi.dwMinorVersion) - { - case 0: - return "Windows 2000"; - case 1: - return "Windows XP"; - case 2: - return "Windows Server 2003/Windows Server 2003 R2"; - default: - return "Unknown"; - } - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::osVersionImpl() -{ - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information"); - std::ostringstream str; - str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF); - if (vi.szCSDVersion[0]) str << ": " << vi.szCSDVersion; - str << ")"; - return str.str(); -} - - -std::string EnvironmentImpl::osArchitectureImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - switch (si.wProcessorArchitecture) - { - case PROCESSOR_ARCHITECTURE_INTEL: - return "IA32"; - case PROCESSOR_ARCHITECTURE_MIPS: - return "MIPS"; - case PROCESSOR_ARCHITECTURE_ALPHA: - return "ALPHA"; - case PROCESSOR_ARCHITECTURE_PPC: - return "PPC"; - case PROCESSOR_ARCHITECTURE_IA64: - return "IA64"; -#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 - case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: - return "IA64/32"; -#endif -#ifdef PROCESSOR_ARCHITECTURE_AMD64 - case PROCESSOR_ARCHITECTURE_AMD64: - return "AMD64"; -#endif - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::nodeNameImpl() -{ - char name[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD size = sizeof(name); - if (GetComputerNameA(name, &size) == 0) throw SystemException("Cannot get computer name"); - return std::string(name); -} - - -void EnvironmentImpl::nodeIdImpl(NodeId& id) -{ - std::memset(&id, 0, sizeof(id)); - - PIP_ADAPTER_INFO pAdapterInfo; - PIP_ADAPTER_INFO pAdapter = 0; - ULONG len = sizeof(IP_ADAPTER_INFO); - pAdapterInfo = reinterpret_cast(new char[len]); - // Make an initial call to GetAdaptersInfo to get - // the necessary size into len - DWORD rc = GetAdaptersInfo(pAdapterInfo, &len); - if (rc == ERROR_BUFFER_OVERFLOW) - { - delete [] reinterpret_cast(pAdapterInfo); - pAdapterInfo = reinterpret_cast(new char[len]); - } - else if (rc != ERROR_SUCCESS) - { - return; - } - if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR) - { - pAdapter = pAdapterInfo; - bool found = false; - while (pAdapter && !found) - { - if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id)) - { - found = true; - std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength); - } - pAdapter = pAdapter->Next; - } - } - delete [] reinterpret_cast(pAdapterInfo); -} - - -unsigned EnvironmentImpl::processorCountImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwNumberOfProcessors; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Environment_WIN32U.cpp b/base/poco/Foundation/src/Environment_WIN32U.cpp deleted file mode 100644 index 624ff83c8ce..00000000000 --- a/base/poco/Foundation/src/Environment_WIN32U.cpp +++ /dev/null @@ -1,235 +0,0 @@ -// -// Environment_WIN32U.cpp -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Environment_WIN32U.h" -#include "Poco/Exception.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Buffer.h" -#include -#include -#include "Poco/UnWindows.h" -#include -#include -#include -#include - - -namespace Poco { - - -std::string EnvironmentImpl::getImpl(const std::string& name) -{ - std::wstring uname; - UnicodeConverter::toUTF16(name, uname); - DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0); - if (len == 0) throw NotFoundException(name); - Buffer buffer(len); - GetEnvironmentVariableW(uname.c_str(), buffer.begin(), len); - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), len - 1, result); - return result; -} - - -bool EnvironmentImpl::hasImpl(const std::string& name) -{ - std::wstring uname; - UnicodeConverter::toUTF16(name, uname); - DWORD len = GetEnvironmentVariableW(uname.c_str(), 0, 0); - return len > 0; -} - - -void EnvironmentImpl::setImpl(const std::string& name, const std::string& value) -{ - std::wstring uname; - std::wstring uvalue; - UnicodeConverter::toUTF16(name, uname); - UnicodeConverter::toUTF16(value, uvalue); - if (SetEnvironmentVariableW(uname.c_str(), uvalue.c_str()) == 0) - { - std::string msg = "cannot set environment variable: "; - msg.append(name); - throw SystemException(msg); - } -} - - -std::string EnvironmentImpl::osNameImpl() -{ - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx(&vi) == 0) throw SystemException("Cannot get OS version information"); - switch (vi.dwPlatformId) - { - case VER_PLATFORM_WIN32s: - return "Windows 3.x"; - case VER_PLATFORM_WIN32_WINDOWS: - return vi.dwMinorVersion == 0 ? "Windows 95" : "Windows 98"; - case VER_PLATFORM_WIN32_NT: - return "Windows NT"; - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::osDisplayNameImpl() -{ - OSVERSIONINFOEX vi; // OSVERSIONINFOEX is supported starting at Windows 2000 - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx((OSVERSIONINFO*) &vi) == 0) throw SystemException("Cannot get OS version information"); - switch (vi.dwMajorVersion) - { - case 10: - switch (vi.dwMinorVersion) - { - case 0: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 10" : "Windows Server 2016"; - } - case 6: - switch (vi.dwMinorVersion) - { - case 0: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows Vista" : "Windows Server 2008"; - case 1: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 7" : "Windows Server 2008 R2"; - case 2: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 8" : "Windows Server 2012"; - case 3: - return vi.wProductType == VER_NT_WORKSTATION ? "Windows 8.1" : "Windows Server 2012 R2"; - default: - return "Unknown"; - } - case 5: - switch (vi.dwMinorVersion) - { - case 0: - return "Windows 2000"; - case 1: - return "Windows XP"; - case 2: - return "Windows Server 2003/Windows Server 2003 R2"; - default: - return "Unknown"; - } - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::osVersionImpl() -{ - OSVERSIONINFOW vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionExW(&vi) == 0) throw SystemException("Cannot get OS version information"); - std::ostringstream str; - str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF); - std::string version; - UnicodeConverter::toUTF8(vi.szCSDVersion, version); - if (!version.empty()) str << ": " << version; - str << ")"; - return str.str(); -} - - -std::string EnvironmentImpl::osArchitectureImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - switch (si.wProcessorArchitecture) - { - case PROCESSOR_ARCHITECTURE_INTEL: - return "IA32"; - case PROCESSOR_ARCHITECTURE_MIPS: - return "MIPS"; - case PROCESSOR_ARCHITECTURE_ALPHA: - return "ALPHA"; - case PROCESSOR_ARCHITECTURE_PPC: - return "PPC"; - case PROCESSOR_ARCHITECTURE_IA64: - return "IA64"; -#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 - case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: - return "IA64/32"; -#endif -#ifdef PROCESSOR_ARCHITECTURE_AMD64 - case PROCESSOR_ARCHITECTURE_AMD64: - return "AMD64"; -#endif - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::nodeNameImpl() -{ - wchar_t name[MAX_COMPUTERNAME_LENGTH + 1]; - DWORD size = MAX_COMPUTERNAME_LENGTH + 1; - if (GetComputerNameW(name, &size) == 0) throw SystemException("Cannot get computer name"); - std::string result; - UnicodeConverter::toUTF8(name, result); - return result; -} - - -void EnvironmentImpl::nodeIdImpl(NodeId& id) -{ - std::memset(&id, 0, sizeof(id)); - - PIP_ADAPTER_INFO pAdapterInfo; - PIP_ADAPTER_INFO pAdapter = 0; - ULONG len = sizeof(IP_ADAPTER_INFO); - pAdapterInfo = reinterpret_cast(new char[len]); - // Make an initial call to GetAdaptersInfo to get - // the necessary size into len - DWORD rc = GetAdaptersInfo(pAdapterInfo, &len); - if (rc == ERROR_BUFFER_OVERFLOW) - { - delete [] reinterpret_cast(pAdapterInfo); - pAdapterInfo = reinterpret_cast(new char[len]); - } - else if (rc != ERROR_SUCCESS) - { - return; - } - if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR) - { - pAdapter = pAdapterInfo; - bool found = false; - while (pAdapter && !found) - { - if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id)) - { - found = true; - std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength); - } - pAdapter = pAdapter->Next; - } - } - delete [] reinterpret_cast(pAdapterInfo); -} - - -unsigned EnvironmentImpl::processorCountImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwNumberOfProcessors; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Environment_WINCE.cpp b/base/poco/Foundation/src/Environment_WINCE.cpp deleted file mode 100644 index afa59b68d35..00000000000 --- a/base/poco/Foundation/src/Environment_WINCE.cpp +++ /dev/null @@ -1,243 +0,0 @@ -// -// Environment_WINCE.cpp -// -// Library: Foundation -// Package: Core -// Module: Environment -// -// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Environment_WINCE.h" -#include "Poco/Exception.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/String.h" -#include "Poco/Path.h" -#include "Poco/NumberFormatter.h" -#include -#include -#include -#include - - -namespace Poco { - - -const std::string EnvironmentImpl::TEMP("TEMP"); -const std::string EnvironmentImpl::TMP("TMP"); -const std::string EnvironmentImpl::HOMEPATH("HOMEPATH"); -const std::string EnvironmentImpl::COMPUTERNAME("COMPUTERNAME"); -const std::string EnvironmentImpl::OS("OS"); -const std::string EnvironmentImpl::NUMBER_OF_PROCESSORS("NUMBER_OF_PROCESSORS"); -const std::string EnvironmentImpl::PROCESSOR_ARCHITECTURE("PROCESSOR_ARCHITECTURE"); - - -std::string EnvironmentImpl::getImpl(const std::string& name) -{ - std::string value; - if (!envVar(name, &value)) throw NotFoundException(name); - return value; -} - - -bool EnvironmentImpl::hasImpl(const std::string& name) -{ - return envVar(name, 0); -} - - -void EnvironmentImpl::setImpl(const std::string& name, const std::string& value) -{ - throw NotImplementedException("Cannot set environment variables on Windows CE"); -} - - -std::string EnvironmentImpl::osNameImpl() -{ - return "Windows CE"; -} - - -std::string EnvironmentImpl::osDisplayNameImpl() -{ - return osNameImpl(); -} - - -std::string EnvironmentImpl::osVersionImpl() -{ - OSVERSIONINFOW vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionExW(&vi) == 0) throw SystemException("Cannot get OS version information"); - std::ostringstream str; - str << vi.dwMajorVersion << "." << vi.dwMinorVersion << " (Build " << (vi.dwBuildNumber & 0xFFFF); - std::string version; - UnicodeConverter::toUTF8(vi.szCSDVersion, version); - if (!version.empty()) str << ": " << version; - str << ")"; - return str.str(); -} - - -std::string EnvironmentImpl::osArchitectureImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - switch (si.wProcessorArchitecture) - { - case PROCESSOR_ARCHITECTURE_INTEL: - return "IA32"; - case PROCESSOR_ARCHITECTURE_MIPS: - return "MIPS"; - case PROCESSOR_ARCHITECTURE_ALPHA: - return "ALPHA"; - case PROCESSOR_ARCHITECTURE_PPC: - return "PPC"; - case PROCESSOR_ARCHITECTURE_IA64: - return "IA64"; -#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 - case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: - return "IA64/32"; -#endif -#ifdef PROCESSOR_ARCHITECTURE_AMD64 - case PROCESSOR_ARCHITECTURE_AMD64: - return "AMD64"; -#endif - case PROCESSOR_ARCHITECTURE_SHX: - return "SHX"; - case PROCESSOR_ARCHITECTURE_ARM: - return "ARM"; - default: - return "Unknown"; - } -} - - -std::string EnvironmentImpl::nodeNameImpl() -{ - HKEY hKey; - DWORD dwDisposition; - if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, L"\\Ident", 0, 0, 0, 0, 0, &hKey, &dwDisposition) != ERROR_SUCCESS) - throw SystemException("Cannot get node name", "registry key not found"); - - std::string value; - DWORD dwType; - BYTE bData[1026]; - DWORD dwData = sizeof(bData); - if (RegQueryValueExW(hKey, L"Name", 0, &dwType, bData, &dwData) == ERROR_SUCCESS) - { - switch (dwType) - { - case REG_SZ: - UnicodeConverter::toUTF8(reinterpret_cast(bData), value); - break; - - default: - RegCloseKey(hKey); - throw SystemException("Cannot get node name", "registry value has wrong type"); - } - } - else - { - RegCloseKey(hKey); - throw SystemException("Cannot get node name", "registry value not found"); - } - RegCloseKey(hKey); - return value; -} - - -void EnvironmentImpl::nodeIdImpl(NodeId& id) -{ - PIP_ADAPTER_INFO pAdapterInfo; - PIP_ADAPTER_INFO pAdapter = 0; - ULONG len = sizeof(IP_ADAPTER_INFO); - pAdapterInfo = reinterpret_cast(new char[len]); - // Make an initial call to GetAdaptersInfo to get - // the necessary size into len - DWORD rc = GetAdaptersInfo(pAdapterInfo, &len); - if (rc == ERROR_BUFFER_OVERFLOW) - { - delete [] reinterpret_cast(pAdapterInfo); - pAdapterInfo = reinterpret_cast(new char[len]); - } - else if (rc != ERROR_SUCCESS) - { - throw SystemException("cannot get network adapter list"); - } - try - { - bool found = false; - if (GetAdaptersInfo(pAdapterInfo, &len) == NO_ERROR) - { - pAdapter = pAdapterInfo; - while (pAdapter && !found) - { - if (pAdapter->Type == MIB_IF_TYPE_ETHERNET && pAdapter->AddressLength == sizeof(id)) - { - std::memcpy(&id, pAdapter->Address, pAdapter->AddressLength); - found = true; - } - pAdapter = pAdapter->Next; - } - } - else throw SystemException("cannot get network adapter list"); - if (!found) throw SystemException("no Ethernet adapter found"); - } - catch (Exception&) - { - delete [] reinterpret_cast(pAdapterInfo); - throw; - } - delete [] reinterpret_cast(pAdapterInfo); -} - - -unsigned EnvironmentImpl::processorCountImpl() -{ - SYSTEM_INFO si; - GetSystemInfo(&si); - return si.dwNumberOfProcessors; -} - - -bool EnvironmentImpl::envVar(const std::string& name, std::string* value) -{ - if (icompare(name, TEMP) == 0) - { - if (value) *value = Path::temp(); - } - else if (icompare(name, TMP) == 0) - { - if (value) *value = Path::temp(); - } - else if (icompare(name, HOMEPATH) == 0) - { - if (value) *value = Path::home(); - } - else if (icompare(name, COMPUTERNAME) == 0) - { - if (value) *value = nodeNameImpl(); - } - else if (icompare(name, OS) == 0) - { - if (value) *value = osNameImpl(); - } - else if (icompare(name, NUMBER_OF_PROCESSORS) == 0) - { - if (value) *value = NumberFormatter::format(processorCountImpl()); - } - else if (icompare(name, PROCESSOR_ARCHITECTURE) == 0) - { - if (value) *value = osArchitectureImpl(); - } - else return false; - return true; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Error.cpp b/base/poco/Foundation/src/Error.cpp index fbd3673f6bc..750c9c7f344 100644 --- a/base/poco/Foundation/src/Error.cpp +++ b/base/poco/Foundation/src/Error.cpp @@ -23,34 +23,6 @@ namespace Poco { -#ifdef POCO_OS_FAMILY_WINDOWS - - - DWORD Error::last() - { - return GetLastError(); - } - - - std::string Error::getMessage(DWORD errorCode) - { - std::string errMsg; - DWORD dwFlg = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; - #if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - LPWSTR lpMsgBuf = 0; - if (FormatMessageW(dwFlg, 0, errorCode, 0, (LPWSTR) & lpMsgBuf, 0, NULL)) - UnicodeConverter::toUTF8(lpMsgBuf, errMsg); - #else - LPTSTR lpMsgBuf = 0; - if (FormatMessageA(dwFlg, 0, errorCode, 0, (LPTSTR) & lpMsgBuf, 0, NULL)) - errMsg = lpMsgBuf; - #endif - LocalFree(lpMsgBuf); - return errMsg; - } - - -#else int Error::last() @@ -111,7 +83,6 @@ namespace Poco { } -#endif } // namespace Poco diff --git a/base/poco/Foundation/src/Event.cpp b/base/poco/Foundation/src/Event.cpp index c8e8fa0b9e1..6bdeabd6ced 100644 --- a/base/poco/Foundation/src/Event.cpp +++ b/base/poco/Foundation/src/Event.cpp @@ -15,13 +15,7 @@ #include "Poco/Event.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "Event_WIN32.cpp" -#elif defined(POCO_VXWORKS) -#include "Event_VX.cpp" -#else #include "Event_POSIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/EventLogChannel.cpp b/base/poco/Foundation/src/EventLogChannel.cpp index ed4e25a6dc5..ec35a9b5d28 100644 --- a/base/poco/Foundation/src/EventLogChannel.cpp +++ b/base/poco/Foundation/src/EventLogChannel.cpp @@ -16,9 +16,6 @@ #include "Poco/Message.h" #include "Poco/String.h" #include "pocomsg.h" -#if defined(POCO_WIN32_UTF8) -#include "Poco/UnicodeConverter.h" -#endif namespace Poco { @@ -35,18 +32,6 @@ EventLogChannel::EventLogChannel(): _h(0) { const DWORD maxPathLen = MAX_PATH + 1; -#if defined(POCO_WIN32_UTF8) - wchar_t name[maxPathLen]; - int n = GetModuleFileNameW(NULL, name, maxPathLen); - if (n > 0) - { - wchar_t* end = name + n - 1; - while (end > name && *end != '\\') --end; - if (*end == '\\') ++end; - std::wstring uname(end); - UnicodeConverter::toUTF8(uname, _name); - } -#else char name[maxPathLen]; int n = GetModuleFileNameA(NULL, name, maxPathLen); if (n > 0) @@ -56,7 +41,6 @@ EventLogChannel::EventLogChannel(): if (*end == '\\') ++end; _name = end; } -#endif } @@ -93,15 +77,7 @@ EventLogChannel::~EventLogChannel() void EventLogChannel::open() { setUpRegistry(); -#if defined(POCO_WIN32_UTF8) - std::wstring uhost; - UnicodeConverter::toUTF16(_host, uhost); - std::wstring uname; - UnicodeConverter::toUTF16(_name, uname); - _h = RegisterEventSourceW(uhost.empty() ? NULL : uhost.c_str(), uname.c_str()); -#else _h = RegisterEventSource(_host.empty() ? NULL : _host.c_str(), _name.c_str()); -#endif if (!_h) throw SystemException("cannot register event source"); } @@ -116,15 +92,8 @@ void EventLogChannel::close() void EventLogChannel::log(const Message& msg) { if (!_h) open(); -#if defined(POCO_WIN32_UTF8) - std::wstring utext; - UnicodeConverter::toUTF16(msg.getText(), utext); - const wchar_t* pMsg = utext.c_str(); - ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL); -#else const char* pMsg = msg.getText().c_str(); ReportEvent(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL); -#endif } @@ -209,96 +178,30 @@ void EventLogChannel::setUpRegistry() const key.append(_name); HKEY hKey; DWORD disp; -#if defined(POCO_WIN32_UTF8) - std::wstring ukey; - UnicodeConverter::toUTF16(key, ukey); - DWORD rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ukey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp); -#else DWORD rc = RegCreateKeyEx(HKEY_LOCAL_MACHINE, key.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp); -#endif if (rc != ERROR_SUCCESS) return; if (disp == REG_CREATED_NEW_KEY) { -#if defined(POCO_WIN32_UTF8) - std::wstring path; - #if defined(POCO_DLL) - #if defined(_DEBUG) - #if defined(_WIN64) - path = findLibrary(L"PocoFoundation64d.dll"); - #else - path = findLibrary(L"PocoFoundationd.dll"); - #endif - #else - #if defined(_WIN64) - path = findLibrary(L"PocoFoundation64.dll"); - #else - path = findLibrary(L"PocoFoundation.dll"); - #endif - #endif - #endif - - if (path.empty()) - path = findLibrary(L"PocoMsg.dll"); -#else std::string path; - #if defined(POCO_DLL) - #if defined(_DEBUG) - #if defined(_WIN64) - path = findLibrary("PocoFoundation64d.dll"); - #else - path = findLibrary("PocoFoundationd.dll"); - #endif - #else - #if defined(_WIN64) - path = findLibrary("PocoFoundation64.dll"); - #else - path = findLibrary("PocoFoundation.dll"); - #endif - #endif - #endif if (path.empty()) path = findLibrary("PocoMsg.dll"); -#endif if (!path.empty()) { DWORD count = 8; DWORD types = 7; -#if defined(POCO_WIN32_UTF8) - RegSetValueExW(hKey, L"CategoryMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), static_cast(sizeof(wchar_t)*(path.size() + 1))); - RegSetValueExW(hKey, L"EventMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), static_cast(sizeof(wchar_t)*(path.size() + 1))); - RegSetValueExW(hKey, L"CategoryCount", 0, REG_DWORD, (const BYTE*) &count, static_cast(sizeof(count))); - RegSetValueExW(hKey, L"TypesSupported", 0, REG_DWORD, (const BYTE*) &types, static_cast(sizeof(types))); -#else RegSetValueEx(hKey, "CategoryMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), static_cast(path.size() + 1)); RegSetValueEx(hKey, "EventMessageFile", 0, REG_SZ, (const BYTE*) path.c_str(), static_cast(path.size() + 1)); RegSetValueEx(hKey, "CategoryCount", 0, REG_DWORD, (const BYTE*) &count, static_cast(sizeof(count))); RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (const BYTE*) &types, static_cast(sizeof(types))); -#endif } } RegCloseKey(hKey); } -#if defined(POCO_WIN32_UTF8) -std::wstring EventLogChannel::findLibrary(const wchar_t* name) -{ - std::wstring path; - HMODULE dll = LoadLibraryW(name); - if (dll) - { - const DWORD maxPathLen = MAX_PATH + 1; - wchar_t name[maxPathLen]; - int n = GetModuleFileNameW(dll, name, maxPathLen); - if (n > 0) path = name; - FreeLibrary(dll); - } - return path; -} -#else std::string EventLogChannel::findLibrary(const char* name) { std::string path; @@ -313,7 +216,6 @@ std::string EventLogChannel::findLibrary(const char* name) } return path; } -#endif } // namespace Poco diff --git a/base/poco/Foundation/src/Event_POSIX.cpp b/base/poco/Foundation/src/Event_POSIX.cpp index 50fb6f78a82..62047a50b3d 100644 --- a/base/poco/Foundation/src/Event_POSIX.cpp +++ b/base/poco/Foundation/src/Event_POSIX.cpp @@ -13,13 +13,8 @@ #include "Poco/Event_POSIX.h" -#if defined(POCO_VXWORKS) -#include -#include -#else #include #include -#endif // @@ -49,13 +44,6 @@ namespace Poco { EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false) { -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_mutex_init() won't properly initialize the mutex - // resulting in a subsequent freeze in pthread_mutex_destroy() - // if the mutex has never been used. - std::memset(&_mutex, 0, sizeof(_mutex)); -#endif if (pthread_mutex_init(&_mutex, NULL)) throw SystemException("cannot create event (mutex)"); diff --git a/base/poco/Foundation/src/Event_VX.cpp b/base/poco/Foundation/src/Event_VX.cpp deleted file mode 100644 index 18f667156ed..00000000000 --- a/base/poco/Foundation/src/Event_VX.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// Event_POSIX.cpp -// -// Library: Foundation -// Package: Threading -// Module: Event -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Event_VX.h" -#include - - -namespace Poco { - - -EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false) -{ - _sem = semCCreate(SEM_Q_PRIORITY, 0); - if (_sem == 0) - throw Poco::SystemException("cannot create event"); -} - - -EventImpl::~EventImpl() -{ - semDelete(_sem); -} - - -void EventImpl::setImpl() -{ - if (_auto) - { - if (semGive(_sem) != OK) - throw SystemException("cannot set event"); - } - else - { - _state = true; - if (semFlush(_sem) != OK) - throw SystemException("cannot set event"); - } -} - - -void EventImpl::resetImpl() -{ - _state = false; -} - - -void EventImpl::waitImpl() -{ - if (!_state) - { - if (semTake(_sem, WAIT_FOREVER) != OK) - throw SystemException("cannot wait for event"); - } -} - - -bool EventImpl::waitImpl(long milliseconds) -{ - if (!_state) - { - int ticks = milliseconds*sysClkRateGet()/1000; - return semTake(_sem, ticks) == OK; - } - else return true; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Event_WIN32.cpp b/base/poco/Foundation/src/Event_WIN32.cpp deleted file mode 100644 index 256951870a9..00000000000 --- a/base/poco/Foundation/src/Event_WIN32.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// Event_WIN32.cpp -// -// Library: Foundation -// Package: Threading -// Module: Event -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Event_WIN32.h" - - -namespace Poco { - - -EventImpl::EventImpl(bool autoReset) -{ - _event = CreateEventW(NULL, autoReset ? FALSE : TRUE, FALSE, NULL); - if (!_event) - throw SystemException("cannot create event"); -} - - -EventImpl::~EventImpl() -{ - CloseHandle(_event); -} - - -void EventImpl::waitImpl() -{ - switch (WaitForSingleObject(_event, INFINITE)) - { - case WAIT_OBJECT_0: - return; - default: - throw SystemException("wait for event failed"); - } -} - - -bool EventImpl::waitImpl(long milliseconds) -{ - switch (WaitForSingleObject(_event, milliseconds + 1)) - { - case WAIT_TIMEOUT: - return false; - case WAIT_OBJECT_0: - return true; - default: - throw SystemException("wait for event failed"); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/FPEnvironment.cpp b/base/poco/Foundation/src/FPEnvironment.cpp index 94a837f9cd6..5eee4cf9646 100644 --- a/base/poco/Foundation/src/FPEnvironment.cpp +++ b/base/poco/Foundation/src/FPEnvironment.cpp @@ -23,12 +23,8 @@ #include "FPEnvironment_DEC.cpp" #elif defined(sun) || defined(__sun) #include "FPEnvironment_SUN.cpp" -#elif defined(__QNX__) -#include "FPEnvironment_QNX.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "FPEnvironment_C99.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "FPEnvironment_WIN32.cpp" #else #include "FPEnvironment_DUMMY.cpp" #endif diff --git a/base/poco/Foundation/src/FPEnvironment_DEC.cpp b/base/poco/Foundation/src/FPEnvironment_DEC.cpp index 037e28df76c..b5995f83bf5 100644 --- a/base/poco/Foundation/src/FPEnvironment_DEC.cpp +++ b/base/poco/Foundation/src/FPEnvironment_DEC.cpp @@ -22,9 +22,6 @@ #include #include #include -#if defined(__VMS) -#include -#endif #include "Poco/FPEnvironment_DEC.h" @@ -33,16 +30,7 @@ namespace Poco { FPEnvironmentImpl::FPEnvironmentImpl() { -#if defined(__VMS) - #pragma pointer_size save - #pragma pointer_size 32 - struct _ieee env; - sys$ieee_set_fp_control(0, 0, &env); - #pragma pointer_size restore - _env = env; -#else _env = ieee_get_fp_control(); -#endif } @@ -54,17 +42,7 @@ FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env) FPEnvironmentImpl::~FPEnvironmentImpl() { -#if defined(__VMS) - #pragma pointer_size save - #pragma pointer_size 32 - struct _ieee mask; - mask.ieee$q_flags = 0xFFFFFFFFFFFFFFFF; - struct _ieee env = _env; - sys$ieee_set_fp_control(&mask, &env, 0); - #pragma pointer_size restore -#else ieee_set_fp_control(_env); -#endif } @@ -134,48 +112,19 @@ long double FPEnvironmentImpl::copySignImpl(long double target, long double sour void FPEnvironmentImpl::keepCurrentImpl() { -#if defined(__VMS) - #pragma pointer_size save - #pragma pointer_size 32 - struct _ieee env; - sys$ieee_set_fp_control(0, 0, &env); - #pragma pointer_size restore - _env = env; -#else ieee_set_fp_control(_env); -#endif } void FPEnvironmentImpl::clearFlagsImpl() { -#if defined(__VMS) - #pragma pointer_size save - #pragma pointer_size 32 - struct _ieee mask; - mask.ieee$q_flags = 0xFFFFFFFFFFFFFFFF; - struct _ieee clr; - clr.ieee$q_flags = 0; - sys$ieee_set_fp_control(&mask, &clr, 0); - #pragma pointer_size restore -#else ieee_set_fp_control(0); -#endif } bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag) { -#if defined(__VMS) - #pragma pointer_size save - #pragma pointer_size 32 - struct _ieee flags; - sys$ieee_set_fp_control(0, 0, &flags); - return (flags.ieee$q_flags & flag) != 0; - #pragma pointer_size restore -#else return (ieee_get_fp_control() & flag) != 0; -#endif } diff --git a/base/poco/Foundation/src/FPEnvironment_SUN.cpp b/base/poco/Foundation/src/FPEnvironment_SUN.cpp deleted file mode 100644 index 36ee36431df..00000000000 --- a/base/poco/Foundation/src/FPEnvironment_SUN.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// -// FPEnvironment_SUN.cpp -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include -#include "Poco/FPEnvironment_SUN.h" - - -namespace Poco { - - -FPEnvironmentImpl::FPEnvironmentImpl() -{ - _rnd = fpgetround(); - _exc = fpgetmask(); -} - - -FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env) -{ - _rnd = env._rnd; - _exc = env._exc; -} - - -FPEnvironmentImpl::~FPEnvironmentImpl() -{ - fpsetround(_rnd); - fpsetmask(_exc); -} - - -FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env) -{ - _rnd = env._rnd; - _exc = env._exc; - return *this; -} - - -bool FPEnvironmentImpl::isInfiniteImpl(float value) -{ - int cls = fpclass(value); - return cls == FP_PINF || cls == FP_NINF; -} - - -bool FPEnvironmentImpl::isInfiniteImpl(double value) -{ - int cls = fpclass(value); - return cls == FP_PINF || cls == FP_NINF; -} - - -bool FPEnvironmentImpl::isInfiniteImpl(long double value) -{ - int cls = fpclass(value); - return cls == FP_PINF || cls == FP_NINF; -} - - -bool FPEnvironmentImpl::isNaNImpl(float value) -{ - return isnanf(value) != 0; -} - - -bool FPEnvironmentImpl::isNaNImpl(double value) -{ - return isnan(value) != 0; -} - - -bool FPEnvironmentImpl::isNaNImpl(long double value) -{ - return isnan((double) value) != 0; -} - - -float FPEnvironmentImpl::copySignImpl(float target, float source) -{ - return (float) copysign(target, source); -} - - -double FPEnvironmentImpl::copySignImpl(double target, double source) -{ - return (float) copysign(target, source); -} - - -long double FPEnvironmentImpl::copySignImpl(long double target, long double source) -{ - return (source > 0 && target > 0) || (source < 0 && target < 0) ? target : -target; -} - - -void FPEnvironmentImpl::keepCurrentImpl() -{ - fpsetround(_rnd); - fpsetmask(_exc); -} - - -void FPEnvironmentImpl::clearFlagsImpl() -{ - fpsetsticky(0); -} - - -bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag) -{ - return (fpgetsticky() & flag) != 0; -} - - -void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode) -{ - fpsetround((fp_rnd) mode); -} - - -FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl() -{ - return (FPEnvironmentImpl::RoundingModeImpl) fpgetround(); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/FPEnvironment_WIN32.cpp b/base/poco/Foundation/src/FPEnvironment_WIN32.cpp deleted file mode 100644 index 32c7f65e7b7..00000000000 --- a/base/poco/Foundation/src/FPEnvironment_WIN32.cpp +++ /dev/null @@ -1,76 +0,0 @@ -// -// FPEnvironment_WIN32.cpp -// -// Library: Foundation -// Package: Core -// Module: FPEnvironment -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/FPEnvironment_WIN32.h" - - -namespace Poco { - - -FPEnvironmentImpl::FPEnvironmentImpl() -{ - _env = _controlfp(0, 0); -} - - -FPEnvironmentImpl::FPEnvironmentImpl(const FPEnvironmentImpl& env) -{ - _env = env._env; -} - - -FPEnvironmentImpl::~FPEnvironmentImpl() -{ - _controlfp(_env, _MCW_RC); -} - - -FPEnvironmentImpl& FPEnvironmentImpl::operator = (const FPEnvironmentImpl& env) -{ - _env = env._env; - return *this; -} - - -void FPEnvironmentImpl::keepCurrentImpl() -{ - _env = _controlfp(0, 0); -} - - -void FPEnvironmentImpl::clearFlagsImpl() -{ - _clearfp(); -} - - -bool FPEnvironmentImpl::isFlagImpl(FlagImpl flag) -{ - return (_statusfp() & flag) != 0; -} - - -void FPEnvironmentImpl::setRoundingModeImpl(RoundingModeImpl mode) -{ - _controlfp(mode, _MCW_RC); -} - - -FPEnvironmentImpl::RoundingModeImpl FPEnvironmentImpl::getRoundingModeImpl() -{ - return RoundingModeImpl(_controlfp(0, 0) & _MCW_RC); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/File.cpp b/base/poco/Foundation/src/File.cpp index ec198d13909..220242eecfb 100644 --- a/base/poco/Foundation/src/File.cpp +++ b/base/poco/Foundation/src/File.cpp @@ -17,17 +17,7 @@ #include "Poco/DirectoryIterator.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#if defined(_WIN32_WCE) -#include "File_WINCE.cpp" -#else -#include "File_WIN32U.cpp" -#endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "File_WIN32.cpp" -#elif defined(POCO_VXWORKS) -#include "File_VX.cpp" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include "File_UNIX.cpp" #endif #include "Poco/Thread.h" diff --git a/base/poco/Foundation/src/FileStream.cpp b/base/poco/Foundation/src/FileStream.cpp index 4f94a249087..db9e4e9fd9e 100644 --- a/base/poco/Foundation/src/FileStream.cpp +++ b/base/poco/Foundation/src/FileStream.cpp @@ -14,11 +14,7 @@ #include "Poco/FileStream.h" #include "Poco/Exception.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "FileStream_WIN32.cpp" -#else #include "FileStream_POSIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/FileStream_POSIX.cpp b/base/poco/Foundation/src/FileStream_POSIX.cpp index 848d7c367e2..1cec74e2ceb 100644 --- a/base/poco/Foundation/src/FileStream_POSIX.cpp +++ b/base/poco/Foundation/src/FileStream_POSIX.cpp @@ -89,11 +89,7 @@ int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length) { if (_fd == -1) return -1; -#if defined(POCO_VXWORKS) - int n = write(_fd, const_cast(buffer), length); -#else int n = write(_fd, buffer, length); -#endif if (n == -1) File::handleLastError(_path); _pos += n; diff --git a/base/poco/Foundation/src/FileStream_WIN32.cpp b/base/poco/Foundation/src/FileStream_WIN32.cpp deleted file mode 100644 index 28f53c9d403..00000000000 --- a/base/poco/Foundation/src/FileStream_WIN32.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// -// FileStream.cpp -// -// Library: Foundation -// Package: Streams -// Module: FileStream -// -// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/FileStream.h" -#include "Poco/File.h" -#include "Poco/Exception.h" -#if defined (POCO_WIN32_UTF8) -#include "Poco/UnicodeConverter.h" -#endif - - -namespace Poco { - - -FileStreamBuf::FileStreamBuf(): - BufferedBidirectionalStreamBuf(BUFFER_SIZE, std::ios::in | std::ios::out), - _handle(INVALID_HANDLE_VALUE), - _pos(0) -{ -} - - -FileStreamBuf::~FileStreamBuf() -{ - close(); -} - - -void FileStreamBuf::open(const std::string& path, std::ios::openmode mode) -{ - poco_assert (_handle == INVALID_HANDLE_VALUE); - - _path = path; - _pos = 0; - setMode(mode); - resetBuffers(); - - DWORD access = 0; - if (mode & std::ios::in) - access |= GENERIC_READ; - if (mode & std::ios::out) - access |= GENERIC_WRITE; - - DWORD shareMode = FILE_SHARE_READ; - if (!(mode & std::ios::out)) - shareMode |= FILE_SHARE_WRITE; - - DWORD creationDisp = OPEN_EXISTING; - if (mode & std::ios::trunc) - creationDisp = CREATE_ALWAYS; - else if (mode & std::ios::out) - creationDisp = OPEN_ALWAYS; - - DWORD flags = FILE_ATTRIBUTE_NORMAL; - -#if defined (POCO_WIN32_UTF8) - std::wstring utf16Path; - FileImpl::convertPath(path, utf16Path); - _handle = CreateFileW(utf16Path.c_str(), access, shareMode, NULL, creationDisp, flags, NULL); -#else - _handle = CreateFileA(path.c_str(), access, shareMode, NULL, creationDisp, flags, NULL); -#endif - - if (_handle == INVALID_HANDLE_VALUE) - File::handleLastError(_path); - - if ((mode & std::ios::ate) || (mode & std::ios::app)) - seekoff(0, std::ios::end, mode); -} - - -int FileStreamBuf::readFromDevice(char* buffer, std::streamsize length) -{ - if (INVALID_HANDLE_VALUE == _handle || !(getMode() & std::ios::in)) - return -1; - - if (getMode() & std::ios::out) - sync(); - - DWORD bytesRead(0); - BOOL rc = ReadFile(_handle, buffer, static_cast(length), &bytesRead, NULL); - if (rc == 0) - File::handleLastError(_path); - - _pos += bytesRead; - - return static_cast(bytesRead); -} - - -int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length) -{ - if (INVALID_HANDLE_VALUE == _handle || !(getMode() & std::ios::out)) - return -1; - - if (getMode() & std::ios::app) - { - LARGE_INTEGER li; - li.QuadPart = 0; - li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_END); - if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) - File::handleLastError(_path); - _pos = li.QuadPart; - } - - DWORD bytesWritten(0); - BOOL rc = WriteFile(_handle, buffer, static_cast(length), &bytesWritten, NULL); - if (rc == 0) - File::handleLastError(_path); - - _pos += bytesWritten; - - return static_cast(bytesWritten); -} - - -bool FileStreamBuf::close() -{ - bool success = true; - if (_handle != INVALID_HANDLE_VALUE) - { - try - { - if (getMode() & std::ios::out) - sync(); - } - catch (...) - { - success = false; - } - CloseHandle(_handle); - _handle = INVALID_HANDLE_VALUE; - } - return success; -} - - -std::streampos FileStreamBuf::seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode) -{ - if (INVALID_HANDLE_VALUE == _handle || !(getMode() & mode)) - return -1; - - if (getMode() & std::ios::out) - sync(); - - std::streamoff adj; - if (mode & std::ios::in) - adj = static_cast(egptr() - gptr()); - else - adj = 0; - - resetBuffers(); - - DWORD offset = FILE_BEGIN; - if (dir == std::ios::cur) - { - offset = FILE_CURRENT; - off -= adj; - } - else if (dir == std::ios::end) - { - offset = FILE_END; - } - - LARGE_INTEGER li; - li.QuadPart = off; - li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, offset); - - if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) - File::handleLastError(_path); - _pos = li.QuadPart; - return std::streampos(static_cast(_pos)); -} - - -std::streampos FileStreamBuf::seekpos(std::streampos pos, std::ios::openmode mode) -{ - if (INVALID_HANDLE_VALUE == _handle || !(getMode() & mode)) - return -1; - - if (getMode() & std::ios::out) - sync(); - - resetBuffers(); - - LARGE_INTEGER li; - li.QuadPart = pos; - li.LowPart = SetFilePointer(_handle, li.LowPart, &li.HighPart, FILE_BEGIN); - - if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) - File::handleLastError(_path); - _pos = li.QuadPart; - return std::streampos(static_cast(_pos)); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/File_VX.cpp b/base/poco/Foundation/src/File_VX.cpp deleted file mode 100644 index 9f59b478a88..00000000000 --- a/base/poco/Foundation/src/File_VX.cpp +++ /dev/null @@ -1,408 +0,0 @@ -// -// File_VX.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/File_VX.h" -#include "Poco/Buffer.h" -#include "Poco/Exception.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -namespace Poco { - - -FileImpl::FileImpl() -{ -} - - -FileImpl::FileImpl(const std::string& path): _path(path) -{ - std::string::size_type n = _path.size(); - if (n > 1 && _path[n - 1] == '/') - _path.resize(n - 1); -} - - -FileImpl::~FileImpl() -{ -} - - -void FileImpl::swapImpl(FileImpl& file) -{ - std::swap(_path, file._path); -} - - -void FileImpl::setPathImpl(const std::string& path) -{ - _path = path; - std::string::size_type n = _path.size(); - if (n > 1 && _path[n - 1] == '/') - _path.resize(n - 1); -} - - -bool FileImpl::existsImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - return stat(const_cast(_path.c_str()), &st) == 0; -} - - -bool FileImpl::canReadImpl() const -{ - poco_assert (!_path.empty()); - - return true; -} - - -bool FileImpl::canWriteImpl() const -{ - poco_assert (!_path.empty()); - - return true; -} - - -bool FileImpl::canExecuteImpl() const -{ - return false; -} - - -bool FileImpl::isFileImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return S_ISREG(st.st_mode); - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::isDirectoryImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return S_ISDIR(st.st_mode); - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::isLinkImpl() const -{ - return false; -} - - -bool FileImpl::isDeviceImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode); - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::isHiddenImpl() const -{ - poco_assert (!_path.empty()); - Path p(_path); - p.makeFile(); - - return p.getFileName()[0] == '.'; -} - - -Timestamp FileImpl::createdImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return Timestamp::fromEpochTime(st.st_ctime); - else - handleLastErrorImpl(_path); - return 0; -} - - -Timestamp FileImpl::getLastModifiedImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return Timestamp::fromEpochTime(st.st_mtime); - else - handleLastErrorImpl(_path); - return 0; -} - - -void FileImpl::setLastModifiedImpl(const Timestamp& ts) -{ - poco_assert (!_path.empty()); - - struct utimbuf tb; - tb.actime = ts.epochTime(); - tb.modtime = ts.epochTime(); - if (utime(const_cast(_path.c_str()), &tb) != 0) - handleLastErrorImpl(_path); -} - - -FileImpl::FileSizeImpl FileImpl::getSizeImpl() const -{ - poco_assert (!_path.empty()); - - struct stat st; - if (stat(const_cast(_path.c_str()), &st) == 0) - return st.st_size; - else - handleLastErrorImpl(_path); - return 0; -} - - -void FileImpl::setSizeImpl(FileSizeImpl size) -{ - poco_assert (!_path.empty()); - - int fd = open(_path.c_str(), O_WRONLY, S_IRWXU); - if (fd != -1) - { - try - { - if (ftruncate(fd, size) != 0) - handleLastErrorImpl(_path); - } - catch (...) - { - close(fd); - throw; - } - } -} - - -void FileImpl::setWriteableImpl(bool flag) -{ - poco_assert (!_path.empty()); -} - - -void FileImpl::setExecutableImpl(bool flag) -{ - poco_assert (!_path.empty()); -} - - -void FileImpl::copyToImpl(const std::string& path) const -{ - poco_assert (!_path.empty()); - - int sd = open(_path.c_str(), O_RDONLY, 0); - if (sd == -1) handleLastErrorImpl(_path); - - struct stat st; - if (fstat(sd, &st) != 0) - { - close(sd); - handleLastErrorImpl(_path); - } - const long blockSize = st.st_blksize; - - int dd = open(path.c_str(), O_CREAT | O_TRUNC | O_WRONLY, st.st_mode & S_IRWXU); - if (dd == -1) - { - close(sd); - handleLastErrorImpl(path); - } - Buffer buffer(blockSize); - try - { - int n; - while ((n = read(sd, buffer.begin(), blockSize)) > 0) - { - if (write(dd, buffer.begin(), n) != n) - handleLastErrorImpl(path); - } - if (n < 0) - handleLastErrorImpl(_path); - } - catch (...) - { - close(sd); - close(dd); - throw; - } - close(sd); - close(dd); -} - - -void FileImpl::renameToImpl(const std::string& path) -{ - poco_assert (!_path.empty()); - - if (rename(_path.c_str(), path.c_str()) != 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::linkToImpl(const std::string& path, int type) const -{ - throw Poco::NotImplementedException("File::linkTo() is not available on this platform"); -} - - -void FileImpl::removeImpl() -{ - poco_assert (!_path.empty()); - - int rc; - if (!isLinkImpl() && isDirectoryImpl()) - rc = rmdir(_path.c_str()); - else - rc = unlink(const_cast(_path.c_str())); - if (rc) handleLastErrorImpl(_path); -} - - -bool FileImpl::createFileImpl() -{ - poco_assert (!_path.empty()); - - int n = open(_path.c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - if (n != -1) - { - close(n); - return true; - } - if (n == -1 && errno == EEXIST) - return false; - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::createDirectoryImpl() -{ - poco_assert (!_path.empty()); - - if (existsImpl() && isDirectoryImpl()) - return false; - if (mkdir(_path.c_str()) != 0) - handleLastErrorImpl(_path); - return true; -} - - -FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const -{ - poco_assert(!_path.empty()); - - struct statfs stats; - if (statfs(_path.c_str(), &stats) != 0) - handleLastErrorImpl(_path); - - return (FileSizeImpl)stats.f_blocks * (FileSizeImpl)stats.f_bsize; -} - - -FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const -{ - poco_assert(!_path.empty()); - - struct statfs stats; - if (statfs(_path.c_str(), &stats) != 0) - handleLastErrorImpl(_path); - - return (FileSizeImpl)stats.f_bavail * (FileSizeImpl)stats.f_bsize; -} - - -FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const -{ - poco_assert(!_path.empty()); - - struct statfs stats; - if (statfs(_path.c_str(), &stats) != 0) - handleLastErrorImpl(_path); - - return (FileSizeImpl)stats.f_bfree * (FileSizeImpl)stats.f_bsize; -} - - -void FileImpl::handleLastErrorImpl(const std::string& path) -{ - switch (errno) - { - case EIO: - throw IOException(path); - case EPERM: - throw FileAccessDeniedException("insufficient permissions", path); - case EACCES: - throw FileAccessDeniedException(path); - case ENOENT: - throw FileNotFoundException(path); - case ENOTDIR: - throw OpenFileException("not a directory", path); - case EISDIR: - throw OpenFileException("not a file", path); - case EROFS: - throw FileReadOnlyException(path); - case EEXIST: - throw FileExistsException(path); - case ENOSPC: - throw FileException("no space left on device", path); - case ENOTEMPTY: - throw DirectoryNotEmptyException(path); - case ENAMETOOLONG: - throw PathSyntaxException(path); - case ENFILE: - case EMFILE: - throw FileException("too many open files", path); - default: - throw FileException(std::strerror(errno), path); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/File_WIN32.cpp b/base/poco/Foundation/src/File_WIN32.cpp deleted file mode 100644 index 2c569e36976..00000000000 --- a/base/poco/Foundation/src/File_WIN32.cpp +++ /dev/null @@ -1,465 +0,0 @@ -// -// File_WIN32.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/File_WIN32.h" -#include "Poco/Exception.h" -#include "Poco/String.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -class FileHandle -{ -public: - FileHandle(const std::string& path, DWORD access, DWORD share, DWORD disp) - { - _h = CreateFileA(path.c_str(), access, share, 0, disp, 0, 0); - if (_h == INVALID_HANDLE_VALUE) - { - FileImpl::handleLastErrorImpl(path); - } - } - - ~FileHandle() - { - if (_h != INVALID_HANDLE_VALUE) CloseHandle(_h); - } - - HANDLE get() const - { - return _h; - } - -private: - HANDLE _h; -}; - - -FileImpl::FileImpl() -{ -} - - -FileImpl::FileImpl(const std::string& path): _path(path) -{ - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } -} - - -FileImpl::~FileImpl() -{ -} - - -void FileImpl::swapImpl(FileImpl& file) -{ - std::swap(_path, file._path); -} - - -void FileImpl::setPathImpl(const std::string& path) -{ - _path = path; - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } -} - - -bool FileImpl::existsImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - case ERROR_NOT_READY: - case ERROR_INVALID_DRIVE: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canReadImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canWriteImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_READONLY) == 0; -} - - -bool FileImpl::canExecuteImpl() const -{ - Path p(_path); - return icompare(p.getExtension(), "exe") == 0; -} - - -bool FileImpl::isFileImpl() const -{ - return !isDirectoryImpl() && !isDeviceImpl(); -} - - -bool FileImpl::isDirectoryImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; -} - - -bool FileImpl::isLinkImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_DIRECTORY) == 0 && (attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0; -} - - - -bool FileImpl::isDeviceImpl() const -{ - return - _path.compare(0, 4, "\\\\.\\") == 0 || - icompare(_path, "CON") == 0 || - icompare(_path, "PRN") == 0 || - icompare(_path, "AUX") == 0 || - icompare(_path, "NUL") == 0 || - ( (icompare(_path, 0, 3, "LPT") == 0 || icompare(_path, 0, 3, "COM") == 0) && - _path.size() == 4 && - _path[3] > 0x30 && - isdigit(_path[3]) - ); -} - - -bool FileImpl::isHiddenImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; -} - - -Timestamp FileImpl::createdImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftCreationTime.dwLowDateTime, fad.ftCreationTime.dwHighDateTime); -} - - -Timestamp FileImpl::getLastModifiedImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftLastWriteTime.dwLowDateTime, fad.ftLastWriteTime.dwHighDateTime); -} - - -void FileImpl::setLastModifiedImpl(const Timestamp& ts) -{ - poco_assert (!_path.empty()); - - UInt32 low; - UInt32 high; - ts.toFileTimeNP(low, high); - FILETIME ft; - ft.dwLowDateTime = low; - ft.dwHighDateTime = high; - FileHandle fh(_path, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); - if (SetFileTime(fh.get(), 0, &ft, &ft) == 0) - handleLastErrorImpl(_path); -} - - -FileImpl::FileSizeImpl FileImpl::getSizeImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesEx(_path.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - LARGE_INTEGER li; - li.LowPart = fad.nFileSizeLow; - li.HighPart = fad.nFileSizeHigh; - return li.QuadPart; -} - - -void FileImpl::setSizeImpl(FileSizeImpl size) -{ - poco_assert (!_path.empty()); - - FileHandle fh(_path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); - LARGE_INTEGER li; - li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) - handleLastErrorImpl(_path); - if (SetEndOfFile(fh.get()) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setWriteableImpl(bool flag) -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributes(_path.c_str()); - if (attr == -1) - handleLastErrorImpl(_path); - if (flag) - attr &= ~FILE_ATTRIBUTE_READONLY; - else - attr |= FILE_ATTRIBUTE_READONLY; - if (SetFileAttributes(_path.c_str(), attr) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setExecutableImpl(bool flag) -{ - // not supported -} - - -void FileImpl::copyToImpl(const std::string& path) const -{ - poco_assert (!_path.empty()); - - if (CopyFileA(_path.c_str(), path.c_str(), FALSE) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::renameToImpl(const std::string& path) -{ - poco_assert (!_path.empty()); - - if (MoveFileExA(_path.c_str(), path.c_str(), MOVEFILE_REPLACE_EXISTING) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::linkToImpl(const std::string& path, int type) const -{ - poco_assert (!_path.empty()); - - if (type == 0) - { - if (CreateHardLinkA(path.c_str(), _path.c_str(), NULL) == 0) - handleLastErrorImpl(_path); - } - else - { -#if _WIN32_WINNT >= 0x0600 && defined(SYMBOLIC_LINK_FLAG_DIRECTORY) - DWORD flags = 0; - if (isDirectoryImpl()) flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; -#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE - flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; -#endif - if (CreateSymbolicLinkA(path.c_str(), _path.c_str(), flags) == 0) - handleLastErrorImpl(_path); -#else - throw Poco::NotImplementedException("Symbolic link support not available in used version of the Windows SDK") -#endif - - } -} - - -void FileImpl::removeImpl() -{ - poco_assert (!_path.empty()); - - if (isDirectoryImpl()) - { - if (RemoveDirectoryA(_path.c_str()) == 0) - handleLastErrorImpl(_path); - } - else - { - if (DeleteFileA(_path.c_str()) == 0) - handleLastErrorImpl(_path); - } -} - - -bool FileImpl::createFileImpl() -{ - poco_assert (!_path.empty()); - - HANDLE hFile = CreateFileA(_path.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0); - if (hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - return true; - } - else if (GetLastError() == ERROR_FILE_EXISTS) - return false; - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::createDirectoryImpl() -{ - poco_assert (!_path.empty()); - - if (existsImpl() && isDirectoryImpl()) - return false; - if (CreateDirectoryA(_path.c_str(), 0) == 0) - handleLastErrorImpl(_path); - return true; -} - - -FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExA(_path.c_str(), NULL, &space, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExA(upath.c_str(), &space, NULL, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExA(_path.c_str(), NULL, NULL, &space)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -void FileImpl::handleLastErrorImpl(const std::string& path) -{ - DWORD err = GetLastError(); - switch (err) - { - case ERROR_FILE_NOT_FOUND: - throw FileNotFoundException(path, err); - case ERROR_PATH_NOT_FOUND: - case ERROR_BAD_NETPATH: - case ERROR_CANT_RESOLVE_FILENAME: - case ERROR_INVALID_DRIVE: - throw PathNotFoundException(path, err); - case ERROR_ACCESS_DENIED: - throw FileAccessDeniedException(path, err); - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - throw FileExistsException(path, err); - case ERROR_INVALID_NAME: - case ERROR_DIRECTORY: - case ERROR_FILENAME_EXCED_RANGE: - case ERROR_BAD_PATHNAME: - throw PathSyntaxException(path, err); - case ERROR_FILE_READ_ONLY: - throw FileReadOnlyException(path, err); - case ERROR_CANNOT_MAKE: - throw CreateFileException(path, err); - case ERROR_DIR_NOT_EMPTY: - throw DirectoryNotEmptyException(path, err); - case ERROR_WRITE_FAULT: - throw WriteFileException(path, err); - case ERROR_READ_FAULT: - throw ReadFileException(path, err); - case ERROR_SHARING_VIOLATION: - throw FileException("sharing violation", path, err); - case ERROR_LOCK_VIOLATION: - throw FileException("lock violation", path, err); - case ERROR_HANDLE_EOF: - throw ReadFileException("EOF reached", path, err); - case ERROR_HANDLE_DISK_FULL: - case ERROR_DISK_FULL: - throw WriteFileException("disk is full", path, err); - case ERROR_NEGATIVE_SEEK: - throw FileException("negative seek", path, err); - default: - throw FileException(path, err); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/File_WIN32U.cpp b/base/poco/Foundation/src/File_WIN32U.cpp deleted file mode 100644 index f8609f17c09..00000000000 --- a/base/poco/Foundation/src/File_WIN32U.cpp +++ /dev/null @@ -1,492 +0,0 @@ -// -// File_WIN32U.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/File_WIN32U.h" -#include "Poco/Exception.h" -#include "Poco/String.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -class FileHandle -{ -public: - FileHandle(const std::string& path, const std::wstring& upath, DWORD access, DWORD share, DWORD disp) - { - _h = CreateFileW(upath.c_str(), access, share, 0, disp, 0, 0); - if (_h == INVALID_HANDLE_VALUE) - { - FileImpl::handleLastErrorImpl(path); - } - } - - ~FileHandle() - { - if (_h != INVALID_HANDLE_VALUE) CloseHandle(_h); - } - - HANDLE get() const - { - return _h; - } - -private: - HANDLE _h; -}; - - -FileImpl::FileImpl() -{ -} - - -FileImpl::FileImpl(const std::string& path): _path(path) -{ - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } - convertPath(_path, _upath); -} - - -FileImpl::~FileImpl() -{ -} - - -void FileImpl::swapImpl(FileImpl& file) -{ - std::swap(_path, file._path); - std::swap(_upath, file._upath); -} - - -void FileImpl::setPathImpl(const std::string& path) -{ - _path = path; - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } - convertPath(_path, _upath); -} - - -bool FileImpl::existsImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - case ERROR_NOT_READY: - case ERROR_INVALID_DRIVE: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canReadImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canWriteImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_READONLY) == 0; -} - - -bool FileImpl::canExecuteImpl() const -{ - Path p(_path); - return icompare(p.getExtension(), "exe") == 0; -} - - -bool FileImpl::isFileImpl() const -{ - return !isDirectoryImpl() && !isDeviceImpl(); -} - - -bool FileImpl::isDirectoryImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; -} - - -bool FileImpl::isLinkImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_DIRECTORY) == 0 && (attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0; -} - - -bool FileImpl::isDeviceImpl() const -{ - return - _path.compare(0, 4, "\\\\.\\") == 0 || - icompare(_path, "CON") == 0 || - icompare(_path, "PRN") == 0 || - icompare(_path, "AUX") == 0 || - icompare(_path, "NUL") == 0 || - ( (icompare(_path, 0, 3, "LPT") == 0 || icompare(_path, 0, 3, "COM") == 0) && - _path.size() == 4 && - _path[3] > 0x30 && - isdigit(_path[3]) - ); -} - - -bool FileImpl::isHiddenImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; -} - - -Timestamp FileImpl::createdImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftCreationTime.dwLowDateTime, fad.ftCreationTime.dwHighDateTime); -} - - -Timestamp FileImpl::getLastModifiedImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftLastWriteTime.dwLowDateTime, fad.ftLastWriteTime.dwHighDateTime); -} - - -void FileImpl::setLastModifiedImpl(const Timestamp& ts) -{ - poco_assert (!_path.empty()); - - UInt32 low; - UInt32 high; - ts.toFileTimeNP(low, high); - FILETIME ft; - ft.dwLowDateTime = low; - ft.dwHighDateTime = high; - FileHandle fh(_path, _upath, FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); - if (SetFileTime(fh.get(), 0, &ft, &ft) == 0) - handleLastErrorImpl(_path); -} - - -FileImpl::FileSizeImpl FileImpl::getSizeImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - LARGE_INTEGER li; - li.LowPart = fad.nFileSizeLow; - li.HighPart = fad.nFileSizeHigh; - return li.QuadPart; -} - - -void FileImpl::setSizeImpl(FileSizeImpl size) -{ - poco_assert (!_path.empty()); - - FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); - LARGE_INTEGER li; - li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) - handleLastErrorImpl(_path); - if (SetEndOfFile(fh.get()) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setWriteableImpl(bool flag) -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == -1) - handleLastErrorImpl(_path); - if (flag) - attr &= ~FILE_ATTRIBUTE_READONLY; - else - attr |= FILE_ATTRIBUTE_READONLY; - if (SetFileAttributesW(_upath.c_str(), attr) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setExecutableImpl(bool flag) -{ - // not supported -} - - -void FileImpl::copyToImpl(const std::string& path) const -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::renameToImpl(const std::string& path) -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (MoveFileExW(_upath.c_str(), upath.c_str(), MOVEFILE_REPLACE_EXISTING) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::linkToImpl(const std::string& path, int type) const -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - - if (type == 0) - { - if (CreateHardLinkW(upath.c_str(), _upath.c_str(), NULL) == 0) - handleLastErrorImpl(_path); - } - else - { -#if _WIN32_WINNT >= 0x0600 && defined(SYMBOLIC_LINK_FLAG_DIRECTORY) - DWORD flags = 0; - if (isDirectoryImpl()) flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; -#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE - flags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; -#endif - if (CreateSymbolicLinkW(upath.c_str(), _upath.c_str(), flags) == 0) - handleLastErrorImpl(_path); -#else - throw Poco::NotImplementedException("Symbolic link support not available in used version of the Windows SDK"); -#endif - } -} - - -void FileImpl::removeImpl() -{ - poco_assert (!_path.empty()); - - if (isDirectoryImpl()) - { - if (RemoveDirectoryW(_upath.c_str()) == 0) - handleLastErrorImpl(_path); - } - else - { - if (DeleteFileW(_upath.c_str()) == 0) - handleLastErrorImpl(_path); - } -} - - -bool FileImpl::createFileImpl() -{ - poco_assert (!_path.empty()); - - HANDLE hFile = CreateFileW(_upath.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0); - if (hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - return true; - } - else if (GetLastError() == ERROR_FILE_EXISTS) - return false; - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::createDirectoryImpl() -{ - poco_assert (!_path.empty()); - - if (existsImpl() && isDirectoryImpl()) - return false; - if (CreateDirectoryW(_upath.c_str(), 0) == 0) - handleLastErrorImpl(_path); - return true; -} - - -FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, &space, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), &space, NULL, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, NULL, &space)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -void FileImpl::handleLastErrorImpl(const std::string& path) -{ - DWORD err = GetLastError(); - switch (err) - { - case ERROR_FILE_NOT_FOUND: - throw FileNotFoundException(path, err); - case ERROR_PATH_NOT_FOUND: - case ERROR_BAD_NETPATH: - case ERROR_CANT_RESOLVE_FILENAME: - case ERROR_INVALID_DRIVE: - throw PathNotFoundException(path, err); - case ERROR_ACCESS_DENIED: - throw FileAccessDeniedException(path, err); - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - throw FileExistsException(path, err); - case ERROR_INVALID_NAME: - case ERROR_DIRECTORY: - case ERROR_FILENAME_EXCED_RANGE: - case ERROR_BAD_PATHNAME: - throw PathSyntaxException(path, err); - case ERROR_FILE_READ_ONLY: - throw FileReadOnlyException(path, err); - case ERROR_CANNOT_MAKE: - throw CreateFileException(path, err); - case ERROR_DIR_NOT_EMPTY: - throw DirectoryNotEmptyException(path, err); - case ERROR_WRITE_FAULT: - throw WriteFileException(path, err); - case ERROR_READ_FAULT: - throw ReadFileException(path, err); - case ERROR_SHARING_VIOLATION: - throw FileException("sharing violation", path, err); - case ERROR_LOCK_VIOLATION: - throw FileException("lock violation", path, err); - case ERROR_HANDLE_EOF: - throw ReadFileException("EOF reached", path, err); - case ERROR_HANDLE_DISK_FULL: - case ERROR_DISK_FULL: - throw WriteFileException("disk is full", path, err); - case ERROR_NEGATIVE_SEEK: - throw FileException("negative seek", path, err); - default: - throw FileException(path, err); - } -} - - -void FileImpl::convertPath(const std::string& utf8Path, std::wstring& utf16Path) -{ - UnicodeConverter::toUTF16(utf8Path, utf16Path); - if (utf16Path.size() > MAX_PATH - 12) // Note: CreateDirectory has a limit of MAX_PATH - 12 (room for 8.3 file name) - { - if (utf16Path[0] == '\\' || utf16Path[1] == ':') - { - if (utf16Path.compare(0, 4, L"\\\\?\\", 4) != 0) - { - if (utf16Path[1] == '\\') - utf16Path.insert(0, L"\\\\?\\UNC\\", 8); - else - utf16Path.insert(0, L"\\\\?\\", 4); - } - } - } -} - -} // namespace Poco diff --git a/base/poco/Foundation/src/File_WINCE.cpp b/base/poco/Foundation/src/File_WINCE.cpp deleted file mode 100644 index ea726c4bcf3..00000000000 --- a/base/poco/Foundation/src/File_WINCE.cpp +++ /dev/null @@ -1,441 +0,0 @@ -// -// File_WIN32U.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: File -// -// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/File_WINCE.h" -#include "Poco/Exception.h" -#include "Poco/String.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Path.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -class FileHandle -{ -public: - FileHandle(const std::string& path, const std::wstring& upath, DWORD access, DWORD share, DWORD disp) - { - _h = CreateFileW(upath.c_str(), access, share, 0, disp, 0, 0); - if (_h == INVALID_HANDLE_VALUE) - { - FileImpl::handleLastErrorImpl(path); - } - } - - ~FileHandle() - { - if (_h != INVALID_HANDLE_VALUE) CloseHandle(_h); - } - - HANDLE get() const - { - return _h; - } - -private: - HANDLE _h; -}; - - -FileImpl::FileImpl() -{ -} - - -FileImpl::FileImpl(const std::string& path): _path(path) -{ - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } - convertPath(_path, _upath); -} - - -FileImpl::~FileImpl() -{ -} - - -void FileImpl::swapImpl(FileImpl& file) -{ - std::swap(_path, file._path); - std::swap(_upath, file._upath); -} - - -void FileImpl::setPathImpl(const std::string& path) -{ - _path = path; - std::string::size_type n = _path.size(); - if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':'))) - { - _path.resize(n - 1); - } - convertPath(_path, _upath); -} - - -bool FileImpl::existsImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - case ERROR_NOT_READY: - case ERROR_INVALID_DRIVE: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canReadImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - return false; - default: - handleLastErrorImpl(_path); - } - } - return true; -} - - -bool FileImpl::canWriteImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_READONLY) == 0; -} - - -bool FileImpl::canExecuteImpl() const -{ - Path p(_path); - return icompare(p.getExtension(), "exe") == 0; -} - - -bool FileImpl::isFileImpl() const -{ - return !isDirectoryImpl() && !isDeviceImpl(); -} - - -bool FileImpl::isDirectoryImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; -} - - -bool FileImpl::isLinkImpl() const -{ - return false; -} - - -bool FileImpl::isDeviceImpl() const -{ - return false; -} - - -bool FileImpl::isHiddenImpl() const -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == INVALID_FILE_ATTRIBUTES) - handleLastErrorImpl(_path); - return (attr & FILE_ATTRIBUTE_HIDDEN) != 0; -} - - -Timestamp FileImpl::createdImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftCreationTime.dwLowDateTime, fad.ftCreationTime.dwHighDateTime); -} - - -Timestamp FileImpl::getLastModifiedImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - return Timestamp::fromFileTimeNP(fad.ftLastWriteTime.dwLowDateTime, fad.ftLastWriteTime.dwHighDateTime); -} - - -void FileImpl::setLastModifiedImpl(const Timestamp& ts) -{ - poco_assert (!_path.empty()); - - UInt32 low; - UInt32 high; - ts.toFileTimeNP(low, high); - FILETIME ft; - ft.dwLowDateTime = low; - ft.dwHighDateTime = high; - FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_WRITE, OPEN_EXISTING); - if (SetFileTime(fh.get(), 0, &ft, &ft) == 0) - handleLastErrorImpl(_path); -} - - -FileImpl::FileSizeImpl FileImpl::getSizeImpl() const -{ - poco_assert (!_path.empty()); - - WIN32_FILE_ATTRIBUTE_DATA fad; - if (GetFileAttributesExW(_upath.c_str(), GetFileExInfoStandard, &fad) == 0) - handleLastErrorImpl(_path); - LARGE_INTEGER li; - li.LowPart = fad.nFileSizeLow; - li.HighPart = fad.nFileSizeHigh; - return li.QuadPart; -} - - -void FileImpl::setSizeImpl(FileSizeImpl size) -{ - poco_assert (!_path.empty()); - - FileHandle fh(_path, _upath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING); - LARGE_INTEGER li; - li.QuadPart = size; - if (SetFilePointer(fh.get(), li.LowPart, &li.HighPart, FILE_BEGIN) == INVALID_SET_FILE_POINTER) - handleLastErrorImpl(_path); - if (SetEndOfFile(fh.get()) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setWriteableImpl(bool flag) -{ - poco_assert (!_path.empty()); - - DWORD attr = GetFileAttributesW(_upath.c_str()); - if (attr == -1) - handleLastErrorImpl(_path); - if (flag) - attr &= ~FILE_ATTRIBUTE_READONLY; - else - attr |= FILE_ATTRIBUTE_READONLY; - if (SetFileAttributesW(_upath.c_str(), attr) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::setExecutableImpl(bool flag) -{ - // not supported -} - - -void FileImpl::copyToImpl(const std::string& path) const -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (CopyFileW(_upath.c_str(), upath.c_str(), FALSE) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::renameToImpl(const std::string& path) -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (MoveFileW(_upath.c_str(), upath.c_str()) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::linkToImpl(const std::string& path, int type) const -{ - throw Poco::NotImplementedException("File::linkTo() is not available on this platform"); -} - - -void FileImpl::removeImpl() -{ - poco_assert (!_path.empty()); - - if (isDirectoryImpl()) - { - if (RemoveDirectoryW(_upath.c_str()) == 0) - handleLastErrorImpl(_path); - } - else - { - if (DeleteFileW(_upath.c_str()) == 0) - handleLastErrorImpl(_path); - } -} - - -bool FileImpl::createFileImpl() -{ - poco_assert (!_path.empty()); - - HANDLE hFile = CreateFileW(_upath.c_str(), GENERIC_WRITE, 0, 0, CREATE_NEW, 0, 0); - if (hFile != INVALID_HANDLE_VALUE) - { - CloseHandle(hFile); - return true; - } - else if (GetLastError() == ERROR_FILE_EXISTS) - return false; - else - handleLastErrorImpl(_path); - return false; -} - - -bool FileImpl::createDirectoryImpl() -{ - poco_assert (!_path.empty()); - - if (existsImpl() && isDirectoryImpl()) - return false; - if (CreateDirectoryW(_upath.c_str(), 0) == 0) - handleLastErrorImpl(_path); - return true; -} - - -FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, &space, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), &space, NULL, NULL)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const -{ - poco_assert(!_path.empty()); - - ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, NULL, &space)) - handleLastErrorImpl(_path); - return space.QuadPart; -} - - -void FileImpl::handleLastErrorImpl(const std::string& path) -{ - switch (GetLastError()) - { - case ERROR_FILE_NOT_FOUND: - throw FileNotFoundException(path); - case ERROR_PATH_NOT_FOUND: - case ERROR_BAD_NETPATH: - case ERROR_CANT_RESOLVE_FILENAME: - case ERROR_INVALID_DRIVE: - throw PathNotFoundException(path); - case ERROR_ACCESS_DENIED: - throw FileAccessDeniedException(path); - case ERROR_ALREADY_EXISTS: - case ERROR_FILE_EXISTS: - throw FileExistsException(path); - case ERROR_INVALID_NAME: - case ERROR_DIRECTORY: - case ERROR_FILENAME_EXCED_RANGE: - case ERROR_BAD_PATHNAME: - throw PathSyntaxException(path); - case ERROR_FILE_READ_ONLY: - throw FileReadOnlyException(path); - case ERROR_CANNOT_MAKE: - throw CreateFileException(path); - case ERROR_DIR_NOT_EMPTY: - throw DirectoryNotEmptyException(path); - case ERROR_WRITE_FAULT: - throw WriteFileException(path); - case ERROR_READ_FAULT: - throw ReadFileException(path); - case ERROR_SHARING_VIOLATION: - throw FileException("sharing violation", path); - case ERROR_LOCK_VIOLATION: - throw FileException("lock violation", path); - case ERROR_HANDLE_EOF: - throw ReadFileException("EOF reached", path); - case ERROR_HANDLE_DISK_FULL: - case ERROR_DISK_FULL: - throw WriteFileException("disk is full", path); - case ERROR_NEGATIVE_SEEK: - throw FileException("negative seek", path); - default: - throw FileException(path); - } -} - - -void FileImpl::convertPath(const std::string& utf8Path, std::wstring& utf16Path) -{ - UnicodeConverter::toUTF16(utf8Path, utf16Path); -} - -} // namespace Poco diff --git a/base/poco/Foundation/src/LocalDateTime.cpp b/base/poco/Foundation/src/LocalDateTime.cpp index 720f41a4d27..33d67891fc9 100644 --- a/base/poco/Foundation/src/LocalDateTime.cpp +++ b/base/poco/Foundation/src/LocalDateTime.cpp @@ -18,9 +18,6 @@ #include "Poco/Exception.h" #include #include -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -#include "wce_time.h" -#endif namespace Poco { @@ -261,22 +258,13 @@ void LocalDateTime::determineTzd(bool adjust) { std::time_t epochTime = _dateTime.timestamp().epochTime(); #if defined(_WIN32) || defined(POCO_NO_POSIX_TSF) -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - std::tm* broken = wceex_localtime(&epochTime); -#else std::tm* broken = std::localtime(&epochTime); -#endif if (!broken) throw Poco::SystemException("cannot get local time"); _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); #else std::tm broken; -#if defined(POCO_VXWORKS) - if (localtime_r(&epochTime, &broken) != OK) - throw Poco::SystemException("cannot get local time"); -#else if (!localtime_r(&epochTime, &broken)) throw Poco::SystemException("cannot get local time"); -#endif _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); #endif adjustForTzd(); @@ -302,11 +290,7 @@ std::time_t LocalDateTime::dstOffset(int& dstOffset) const broken.tm_min = _dateTime.minute(); broken.tm_sec = _dateTime.second(); broken.tm_isdst = -1; -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - local = wceex_mktime(&broken); -#else local = std::mktime(&broken); -#endif dstOffset = (broken.tm_isdst == 1) ? 3600 : 0; return local; diff --git a/base/poco/Foundation/src/LogFile.cpp b/base/poco/Foundation/src/LogFile.cpp index 2aaaf8c5698..3dd69216990 100644 --- a/base/poco/Foundation/src/LogFile.cpp +++ b/base/poco/Foundation/src/LogFile.cpp @@ -15,13 +15,7 @@ #include "Poco/LogFile.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#include "LogFile_WIN32U.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "LogFile_WIN32.cpp" -#else #include "LogFile_STD.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/LogFile_WIN32.cpp b/base/poco/Foundation/src/LogFile_WIN32.cpp deleted file mode 100644 index df1d403c44f..00000000000 --- a/base/poco/Foundation/src/LogFile_WIN32.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// -// LogFile_WIN32.cpp -// -// Library: Foundation -// Package: Logging -// Module: LogFile -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/LogFile_WIN32.h" -#include "Poco/File.h" -#include "Poco/Exception.h" - - -namespace Poco { - - -LogFileImpl::LogFileImpl(const std::string& path): _path(path), _hFile(INVALID_HANDLE_VALUE) -{ - File file(path); - if (file.exists()) - { - if (0 == sizeImpl()) - _creationDate = file.getLastModified(); - else - _creationDate = file.created(); - } -} - - -LogFileImpl::~LogFileImpl() -{ - CloseHandle(_hFile); -} - - -void LogFileImpl::writeImpl(const std::string& text, bool flush) -{ - if (INVALID_HANDLE_VALUE == _hFile) createFile(); - - DWORD bytesWritten; - BOOL res = WriteFile(_hFile, text.data(), (DWORD) text.size(), &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - res = WriteFile(_hFile, "\r\n", 2, &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - if (flush) - { - res = FlushFileBuffers(_hFile); - if (!res) throw WriteFileException(_path); - } -} - -void LogFileImpl::writeBinaryImpl(const char * data, size_t size, bool flush) -{ - if (INVALID_HANDLE_VALUE == _hFile) createFile(); - - DWORD bytesWritten; - BOOL res = WriteFile(_hFile, text.data(), (DWORD) text.size(), &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - if (flush) - { - res = FlushFileBuffers(_hFile); - if (!res) throw WriteFileException(_path); - } -} - - -UInt64 LogFileImpl::sizeImpl() const -{ - if (INVALID_HANDLE_VALUE == _hFile) - { - File file(_path); - if (file.exists()) return file.getSize(); - else return 0; - } - - LARGE_INTEGER li; - li.HighPart = 0; - li.LowPart = SetFilePointer(_hFile, 0, &li.HighPart, FILE_CURRENT); - return li.QuadPart; -} - - -Timestamp LogFileImpl::creationDateImpl() const -{ - return _creationDate; -} - - -const std::string& LogFileImpl::pathImpl() const -{ - return _path; -} - - -void LogFileImpl::createFile() -{ - _hFile = CreateFileA(_path.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (_hFile == INVALID_HANDLE_VALUE) throw OpenFileException(_path); - SetFilePointer(_hFile, 0, 0, FILE_END); - // There seems to be a strange "optimization" in the Windows NTFS - // filesystem that causes it to reuse directory entries of deleted - // files. Example: - // 1. create a file named "test.dat" - // note the file's creation date - // 2. delete the file "test.dat" - // 3. wait a few seconds - // 4. create a file named "test.dat" - // the new file will have the same creation - // date as the old one. - // We work around this bug by taking the file's - // modification date as a reference when the - // file is empty. - if (sizeImpl() == 0) - _creationDate = File(_path).getLastModified(); - else - _creationDate = File(_path).created(); -} - -} // namespace Poco diff --git a/base/poco/Foundation/src/LogFile_WIN32U.cpp b/base/poco/Foundation/src/LogFile_WIN32U.cpp deleted file mode 100644 index c85e6086a4a..00000000000 --- a/base/poco/Foundation/src/LogFile_WIN32U.cpp +++ /dev/null @@ -1,130 +0,0 @@ -// -// LogFile_WIN32U.cpp -// -// Library: Foundation -// Package: Logging -// Module: LogFile -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/LogFile_WIN32U.h" -#include "Poco/File.h" -#include "Poco/Exception.h" -#include "Poco/UnicodeConverter.h" - - -namespace Poco { - - -LogFileImpl::LogFileImpl(const std::string& path): _path(path), _hFile(INVALID_HANDLE_VALUE) -{ - File file(path); - if (file.exists()) - { - if (0 == sizeImpl()) - _creationDate = file.getLastModified(); - else - _creationDate = file.created(); - } -} - - -LogFileImpl::~LogFileImpl() -{ - CloseHandle(_hFile); -} - - -void LogFileImpl::writeImpl(const std::string& text, bool flush) -{ - if (INVALID_HANDLE_VALUE == _hFile) createFile(); - - DWORD bytesWritten; - BOOL res = WriteFile(_hFile, text.data(), (DWORD) text.size(), &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - res = WriteFile(_hFile, "\r\n", 2, &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - if (flush) - { - res = FlushFileBuffers(_hFile); - if (!res) throw WriteFileException(_path); - } -} - -void LogFileImpl::writeBinaryImpl(const char * data, size_t size, bool flush) -{ - if (INVALID_HANDLE_VALUE == _hFile) createFile(); - - DWORD bytesWritten; - BOOL res = WriteFile(_hFile, data, (DWORD) size, &bytesWritten, NULL); - if (!res) throw WriteFileException(_path); - if (flush) - { - res = FlushFileBuffers(_hFile); - if (!res) throw WriteFileException(_path); - } -} - - -UInt64 LogFileImpl::sizeImpl() const -{ - if (INVALID_HANDLE_VALUE == _hFile) - { - File file(_path); - if (file.exists()) return file.getSize(); - else return 0; - } - - LARGE_INTEGER li; - li.HighPart = 0; - li.LowPart = SetFilePointer(_hFile, 0, &li.HighPart, FILE_CURRENT); - return li.QuadPart; -} - - -Timestamp LogFileImpl::creationDateImpl() const -{ - return _creationDate; -} - - -const std::string& LogFileImpl::pathImpl() const -{ - return _path; -} - - -void LogFileImpl::createFile() -{ - std::wstring upath; - FileImpl::convertPath(_path, upath); - - _hFile = CreateFileW(upath.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (_hFile == INVALID_HANDLE_VALUE) throw OpenFileException(_path); - SetFilePointer(_hFile, 0, 0, FILE_END); - // There seems to be a strange "optimization" in the Windows NTFS - // filesystem that causes it to reuse directory entries of deleted - // files. Example: - // 1. create a file named "test.dat" - // note the file's creation date - // 2. delete the file "test.dat" - // 3. wait a few seconds - // 4. create a file named "test.dat" - // the new file will have the same creation - // date as the old one. - // We work around this bug by taking the file's - // modification date as a reference when the - // file is empty. - if (sizeImpl() == 0) - _creationDate = File(_path).getLastModified(); - else - _creationDate = File(_path).created(); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/LoggingFactory.cpp b/base/poco/Foundation/src/LoggingFactory.cpp index f3e067a6111..5f8076abb5e 100644 --- a/base/poco/Foundation/src/LoggingFactory.cpp +++ b/base/poco/Foundation/src/LoggingFactory.cpp @@ -24,10 +24,6 @@ #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_NO_SYSLOGCHANNEL) #include "Poco/SyslogChannel.h" #endif -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) -#include "Poco/EventLogChannel.h" -#include "Poco/WindowsConsoleChannel.h" -#endif #include "Poco/PatternFormatter.h" @@ -84,13 +80,8 @@ LoggingFactory& LoggingFactory::defaultFactory() void LoggingFactory::registerBuiltins() { _channelFactory.registerClass("AsyncChannel", new Instantiator); -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) - _channelFactory.registerClass("ConsoleChannel", new Instantiator); - _channelFactory.registerClass("ColorConsoleChannel", new Instantiator); -#else _channelFactory.registerClass("ConsoleChannel", new Instantiator); _channelFactory.registerClass("ColorConsoleChannel", new Instantiator); -#endif #ifndef POCO_NO_FILECHANNEL _channelFactory.registerClass("FileChannel", new Instantiator); #endif @@ -105,9 +96,6 @@ void LoggingFactory::registerBuiltins() #ifndef POCO_NO_SYSLOGCHANNEL _channelFactory.registerClass("SyslogChannel", new Instantiator); #endif -#endif -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) - _channelFactory.registerClass("EventLogChannel", new Instantiator); #endif _formatterFactory.registerClass("PatternFormatter", new Instantiator); diff --git a/base/poco/Foundation/src/Message.cpp b/base/poco/Foundation/src/Message.cpp index e7e86c4b34a..0dfe4323134 100644 --- a/base/poco/Foundation/src/Message.cpp +++ b/base/poco/Foundation/src/Message.cpp @@ -14,9 +14,7 @@ #include "Poco/Message.h" #include "Poco/Exception.h" -#if !defined(POCO_VXWORKS) #include "Poco/Process.h" -#endif #include "Poco/Thread.h" #include @@ -109,9 +107,7 @@ Message::~Message() void Message::init() { -#if !defined(POCO_VXWORKS) _pid = Process::id(); -#endif Thread* pThread = Thread::current(); if (pThread) { @@ -247,10 +243,8 @@ const std::string& Message::get(const std::string& param, const std::string& def long Message::getPid() const { -#if !defined(POCO_VXWORKS) if (_pid < 0) _pid = Process::id(); -#endif return _pid; } diff --git a/base/poco/Foundation/src/Mutex.cpp b/base/poco/Foundation/src/Mutex.cpp index cb101150880..1b5cf4b7fd0 100644 --- a/base/poco/Foundation/src/Mutex.cpp +++ b/base/poco/Foundation/src/Mutex.cpp @@ -15,17 +15,7 @@ #include "Poco/Mutex.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Mutex_WINCE.cpp" -#else -#include "Mutex_WIN32.cpp" -#endif -#elif defined(POCO_VXWORKS) -#include "Mutex_VX.cpp" -#else #include "Mutex_POSIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/Mutex_POSIX.cpp b/base/poco/Foundation/src/Mutex_POSIX.cpp index 56132ef5d58..183dbdffe9b 100644 --- a/base/poco/Foundation/src/Mutex_POSIX.cpp +++ b/base/poco/Foundation/src/Mutex_POSIX.cpp @@ -18,12 +18,7 @@ #include #endif #include -#if defined(POCO_VXWORKS) -#include -#include -#else #include -#endif #if defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS - 200112L) >= 0L @@ -47,18 +42,11 @@ namespace Poco { MutexImpl::MutexImpl() { -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_mutex_init() won't properly initialize the mutex - // resulting in a subsequent freeze in pthread_mutex_destroy() - // if the mutex has never been used. - std::memset(&_mutex, 0, sizeof(_mutex)); -#endif pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); #if defined(PTHREAD_MUTEX_RECURSIVE_NP) pthread_mutexattr_settype_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP); -#elif !defined(POCO_VXWORKS) +#else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); #endif if (pthread_mutex_init(&_mutex, &attr)) @@ -72,18 +60,11 @@ MutexImpl::MutexImpl() MutexImpl::MutexImpl(bool fast) { -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_mutex_init() won't properly initialize the mutex - // resulting in a subsequent freeze in pthread_mutex_destroy() - // if the mutex has never been used. - std::memset(&_mutex, 0, sizeof(_mutex)); -#endif pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); #if defined(PTHREAD_MUTEX_RECURSIVE_NP) pthread_mutexattr_settype_np(&attr, fast ? PTHREAD_MUTEX_NORMAL_NP : PTHREAD_MUTEX_RECURSIVE_NP); -#elif !defined(POCO_VXWORKS) +#else pthread_mutexattr_settype(&attr, fast ? PTHREAD_MUTEX_NORMAL : PTHREAD_MUTEX_RECURSIVE); #endif if (pthread_mutex_init(&_mutex, &attr)) @@ -143,18 +124,10 @@ bool MutexImpl::tryLockImpl(long milliseconds) return true; else if (rc != EBUSY) throw SystemException("cannot lock mutex"); -#if defined(POCO_VXWORKS) - struct timespec ts; - ts.tv_sec = 0; - ts.tv_nsec = sleepMillis*1000000; - nanosleep(&ts, NULL); - -#else struct timeval tv; tv.tv_sec = 0; tv.tv_usec = sleepMillis * 1000; select(0, NULL, NULL, NULL, &tv); -#endif } while (!now.isElapsed(diff)); return false; diff --git a/base/poco/Foundation/src/Mutex_VX.cpp b/base/poco/Foundation/src/Mutex_VX.cpp deleted file mode 100644 index a4b32acbbf6..00000000000 --- a/base/poco/Foundation/src/Mutex_VX.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// -// Mutex_VX.cpp -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Mutex_VX.h" -#include - - -namespace Poco { - - -MutexImpl::MutexImpl() -{ - _sem = semMCreate(SEM_INVERSION_SAFE | SEM_Q_PRIORITY); - if (_sem == 0) - throw Poco::SystemException("cannot create mutex"); -} - - -MutexImpl::MutexImpl(bool fast) -{ - if (fast) - { - _sem = semBCreate(SEM_Q_PRIORITY, SEM_FULL); - } - else - { - _sem = semMCreate(SEM_INVERSION_SAFE | SEM_Q_PRIORITY); - } - if (_sem == 0) - throw Poco::SystemException("cannot create mutex"); -} - - -MutexImpl::~MutexImpl() -{ - semDelete(_sem); -} - - -bool MutexImpl::tryLockImpl(long milliseconds) -{ - int ticks = milliseconds*sysClkRateGet()/1000; - return semTake(_sem, ticks) == OK; -} - - -FastMutexImpl::FastMutexImpl(): MutexImpl(true) -{ -} - - -FastMutexImpl::~FastMutexImpl() -{ -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Mutex_WIN32.cpp b/base/poco/Foundation/src/Mutex_WIN32.cpp deleted file mode 100644 index 446f4affcef..00000000000 --- a/base/poco/Foundation/src/Mutex_WIN32.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -// Mutex_WIN32.cpp -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Mutex_WIN32.h" -#include "Poco/Timestamp.h" - - -namespace Poco { - - -MutexImpl::MutexImpl() -{ - // the fct has a boolean return value under WInnNt/2000/XP but not on Win98 - // the return only checks if the input address of &_cs was valid, so it is safe to omit it - InitializeCriticalSectionAndSpinCount(&_cs, 4000); -} - - -MutexImpl::~MutexImpl() -{ - DeleteCriticalSection(&_cs); -} - - -bool MutexImpl::tryLockImpl(long milliseconds) -{ - const int sleepMillis = 5; - Timestamp now; - Timestamp::TimeDiff diff(Timestamp::TimeDiff(milliseconds)*1000); - do - { - try - { - if (TryEnterCriticalSection(&_cs) == TRUE) - return true; - } - catch (...) - { - throw SystemException("cannot lock mutex"); - } - Sleep(sleepMillis); - } - while (!now.isElapsed(diff)); - return false; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Mutex_WINCE.cpp b/base/poco/Foundation/src/Mutex_WINCE.cpp deleted file mode 100644 index 90ea6956d88..00000000000 --- a/base/poco/Foundation/src/Mutex_WINCE.cpp +++ /dev/null @@ -1,80 +0,0 @@ -// -// Mutex_WINCE.cpp -// -// Library: Foundation -// Package: Threading -// Module: Mutex -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Mutex_WINCE.h" - - -namespace Poco { - - -MutexImpl::MutexImpl() -{ - _mutex = CreateMutexW(NULL, FALSE, NULL); - if (!_mutex) throw SystemException("cannot create mutex"); -} - - -MutexImpl::~MutexImpl() -{ - CloseHandle(_mutex); -} - - -void MutexImpl::lockImpl() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - return; - default: - throw SystemException("cannot lock mutex"); - } -} - - -bool MutexImpl::tryLockImpl() -{ - switch (WaitForSingleObject(_mutex, 0)) - { - case WAIT_TIMEOUT: - return false; - case WAIT_OBJECT_0: - return true; - default: - throw SystemException("cannot lock mutex"); - } -} - - -bool MutexImpl::tryLockImpl(long milliseconds) -{ - switch (WaitForSingleObject(_mutex, milliseconds + 1)) - { - case WAIT_TIMEOUT: - return false; - case WAIT_OBJECT_0: - return true; - default: - throw SystemException("cannot lock mutex"); - } -} - - -void MutexImpl::unlockImpl() -{ - ReleaseMutex(_mutex); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/NamedEvent.cpp b/base/poco/Foundation/src/NamedEvent.cpp index 6615ca8f048..50360e5db45 100644 --- a/base/poco/Foundation/src/NamedEvent.cpp +++ b/base/poco/Foundation/src/NamedEvent.cpp @@ -15,11 +15,7 @@ #include "Poco/NamedEvent.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#include "NamedEvent_WIN32U.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "NamedEvent_WIN32.cpp" -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID #include "NamedEvent_Android.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "NamedEvent_UNIX.cpp" diff --git a/base/poco/Foundation/src/NamedEvent_WIN32.cpp b/base/poco/Foundation/src/NamedEvent_WIN32.cpp deleted file mode 100644 index 0aee72c5fb9..00000000000 --- a/base/poco/Foundation/src/NamedEvent_WIN32.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -// NamedEvent_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: NamedEvent -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/NamedEvent_WIN32.h" -#include "Poco/Error.h" -#include "Poco/Exception.h" -#include "Poco/Format.h" - - -namespace Poco { - - -NamedEventImpl::NamedEventImpl(const std::string& name): - _name(name) -{ - _event = CreateEventA(NULL, FALSE, FALSE, _name.c_str()); - if (!_event) - { - DWORD dwRetVal = GetLastError(); - throw SystemException(format("cannot create named event %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); - } -} - - -NamedEventImpl::~NamedEventImpl() -{ - CloseHandle(_event); -} - - -void NamedEventImpl::setImpl() -{ - if (!SetEvent(_event)) - throw SystemException("cannot signal named event", _name); -} - - -void NamedEventImpl::waitImpl() -{ - switch (WaitForSingleObject(_event, INFINITE)) - { - case WAIT_OBJECT_0: - return; - default: - throw SystemException("wait for named event failed", _name); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/NamedEvent_WIN32U.cpp b/base/poco/Foundation/src/NamedEvent_WIN32U.cpp deleted file mode 100644 index 8a7ad1c1820..00000000000 --- a/base/poco/Foundation/src/NamedEvent_WIN32U.cpp +++ /dev/null @@ -1,63 +0,0 @@ -// -// NamedEvent_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: NamedEvent -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/NamedEvent_WIN32U.h" -#include "Poco/Error.h" -#include "Poco/Exception.h" -#include "Poco/Format.h" -#include "Poco/UnicodeConverter.h" - - -namespace Poco { - - -NamedEventImpl::NamedEventImpl(const std::string& name): - _name(name) -{ - UnicodeConverter::toUTF16(_name, _uname); - _event = CreateEventW(NULL, FALSE, FALSE, _uname.c_str()); - if (!_event) - { - DWORD dwRetVal = GetLastError(); - throw SystemException(format("cannot create named event %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); - } -} - - -NamedEventImpl::~NamedEventImpl() -{ - CloseHandle(_event); -} - - -void NamedEventImpl::setImpl() -{ - if (!SetEvent(_event)) - throw SystemException("cannot signal named event", _name); -} - - -void NamedEventImpl::waitImpl() -{ - switch (WaitForSingleObject(_event, INFINITE)) - { - case WAIT_OBJECT_0: - return; - default: - throw SystemException("wait for named event failed", _name); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/NamedMutex.cpp b/base/poco/Foundation/src/NamedMutex.cpp index 77fd672c640..98b2399ea6b 100644 --- a/base/poco/Foundation/src/NamedMutex.cpp +++ b/base/poco/Foundation/src/NamedMutex.cpp @@ -15,11 +15,7 @@ #include "Poco/NamedMutex.h" -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#include "NamedMutex_WIN32U.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "NamedMutex_WIN32.cpp" -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID #include "NamedMutex_Android.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "NamedMutex_UNIX.cpp" diff --git a/base/poco/Foundation/src/NamedMutex_WIN32.cpp b/base/poco/Foundation/src/NamedMutex_WIN32.cpp deleted file mode 100644 index 6d2a5c383f6..00000000000 --- a/base/poco/Foundation/src/NamedMutex_WIN32.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// NamedMutex_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: NamedMutex -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/NamedMutex_WIN32.h" -#include "Poco/Exception.h" - - -namespace Poco { - - -NamedMutexImpl::NamedMutexImpl(const std::string& name): - _name(name) -{ - _mutex = CreateMutexA(NULL, FALSE, _name.c_str()); - if (!_mutex) - throw SystemException("cannot create named mutex", _name); -} - - -NamedMutexImpl::~NamedMutexImpl() -{ - CloseHandle(_mutex); -} - - -void NamedMutexImpl::lockImpl() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - return; - case WAIT_ABANDONED: - throw SystemException("cannot lock named mutex (abadoned)", _name); - default: - throw SystemException("cannot lock named mutex", _name); - } -} - - -bool NamedMutexImpl::tryLockImpl() -{ - switch (WaitForSingleObject(_mutex, 0)) - { - case WAIT_OBJECT_0: - return true; - case WAIT_TIMEOUT: - return false; - case WAIT_ABANDONED: - throw SystemException("cannot lock named mutex (abadoned)", _name); - default: - throw SystemException("cannot lock named mutex", _name); - } -} - - -void NamedMutexImpl::unlockImpl() -{ - ReleaseMutex(_mutex); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/NamedMutex_WIN32U.cpp b/base/poco/Foundation/src/NamedMutex_WIN32U.cpp deleted file mode 100644 index 1358658b961..00000000000 --- a/base/poco/Foundation/src/NamedMutex_WIN32U.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// -// NamedMutex_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: NamedMutex -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/NamedMutex_WIN32U.h" -#include "Poco/Exception.h" -#include "Poco/UnicodeConverter.h" - - -namespace Poco { - - -NamedMutexImpl::NamedMutexImpl(const std::string& name): - _name(name) -{ - UnicodeConverter::toUTF16(_name, _uname); - _mutex = CreateMutexW(NULL, FALSE, _uname.c_str()); - if (!_mutex) - throw SystemException("cannot create named mutex", _name); -} - - -NamedMutexImpl::~NamedMutexImpl() -{ - CloseHandle(_mutex); -} - - -void NamedMutexImpl::lockImpl() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - return; - case WAIT_ABANDONED: - throw SystemException("cannot lock named mutex (abadoned)", _name); - default: - throw SystemException("cannot lock named mutex", _name); - } -} - - -bool NamedMutexImpl::tryLockImpl() -{ - switch (WaitForSingleObject(_mutex, 0)) - { - case WAIT_OBJECT_0: - return true; - case WAIT_TIMEOUT: - return false; - case WAIT_ABANDONED: - throw SystemException("cannot lock named mutex (abadoned)", _name); - default: - throw SystemException("cannot lock named mutex", _name); - } -} - - -void NamedMutexImpl::unlockImpl() -{ - ReleaseMutex(_mutex); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Path.cpp b/base/poco/Foundation/src/Path.cpp index 6b26ca04667..8be42a4bdeb 100644 --- a/base/poco/Foundation/src/Path.cpp +++ b/base/poco/Foundation/src/Path.cpp @@ -16,23 +16,11 @@ #include "Poco/File.h" #include "Poco/Exception.h" #include "Poco/StringTokenizer.h" -#if defined(_WIN32) && defined(POCO_WIN32_UTF8) -#include "Poco/UnicodeConverter.h" -#include "Poco/Buffer.h" -#endif #include #if defined(POCO_OS_FAMILY_UNIX) #include "Path_UNIX.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#if defined(_WIN32_WCE) -#include "Path_WINCE.cpp" -#else -#include "Path_WIN32U.cpp" -#endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "Path_WIN32.cpp" #endif @@ -176,11 +164,7 @@ Path& Path::assign(const Path& path) Path& Path::assign(const std::string& path) { -#if defined(POCO_OS_FAMILY_WINDOWS) - parseWindows(path); -#else parseUnix(path); -#endif return *this; } @@ -219,11 +203,7 @@ Path& Path::assign(const char* path) std::string Path::toString() const { -#if defined(POCO_OS_FAMILY_WINDOWS) - return buildWindows(); -#else return buildUnix(); -#endif } @@ -1043,20 +1023,6 @@ std::string Path::buildVMS() const std::string Path::transcode(const std::string& path) { -#if defined(_WIN32) && defined(POCO_WIN32_UTF8) - std::wstring uniPath; - UnicodeConverter::toUTF16(path, uniPath); - DWORD len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), NULL, 0, NULL, NULL); - if (len > 0) - { - Buffer buffer(len); - DWORD rc = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), buffer.begin(), static_cast(buffer.size()), NULL, NULL); - if (rc) - { - return std::string(buffer.begin(), buffer.size()); - } - } -#endif return path; } diff --git a/base/poco/Foundation/src/Path_UNIX.cpp b/base/poco/Foundation/src/Path_UNIX.cpp index a6096f89d89..957a62db180 100644 --- a/base/poco/Foundation/src/Path_UNIX.cpp +++ b/base/poco/Foundation/src/Path_UNIX.cpp @@ -19,9 +19,7 @@ #include #include #include -#if !defined(POCO_VXWORKS) #include -#endif #include @@ -49,12 +47,6 @@ std::string PathImpl::currentImpl() std::string PathImpl::homeImpl() { -#if defined(POCO_VXWORKS) - if (EnvironmentImpl::hasImpl("HOME")) - return EnvironmentImpl::getImpl("HOME"); - else - return "/"; -#else std::string path; #if defined(_POSIX_C_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_C_SOURCE) size_t buf_size = 1024; // Same as glibc use for getpwuid @@ -83,15 +75,11 @@ std::string PathImpl::homeImpl() std::string::size_type n = path.size(); if (n > 0 && path[n - 1] != '/') path.append("/"); return path; -#endif } std::string PathImpl::configHomeImpl() { -#if defined(POCO_VXWORKS) - return PathImpl::homeImpl(); -#else std::string path = PathImpl::homeImpl(); std::string::size_type n = path.size(); if (n > 0 && path[n - 1] == '/') @@ -102,15 +90,11 @@ std::string PathImpl::configHomeImpl() #endif return path; -#endif } std::string PathImpl::dataHomeImpl() { -#if defined(POCO_VXWORKS) - return PathImpl::homeImpl(); -#else std::string path = PathImpl::homeImpl(); std::string::size_type n = path.size(); if (n > 0 && path[n - 1] == '/') @@ -121,15 +105,11 @@ std::string PathImpl::dataHomeImpl() #endif return path; -#endif } std::string PathImpl::cacheHomeImpl() { -#if defined(POCO_VXWORKS) - return PathImpl::tempImpl(); -#else std::string path = PathImpl::homeImpl(); std::string::size_type n = path.size(); if (n > 0 && path[n - 1] == '/') @@ -140,15 +120,11 @@ std::string PathImpl::cacheHomeImpl() #endif return path; -#endif } std::string PathImpl::tempHomeImpl() { -#if defined(POCO_VXWORKS) - return PathImpl::tempImpl(); -#else std::string path = PathImpl::homeImpl(); std::string::size_type n = path.size(); if (n > 0 && path[n - 1] == '/') @@ -159,7 +135,6 @@ std::string PathImpl::tempHomeImpl() #endif return path; -#endif } @@ -196,11 +171,7 @@ std::string PathImpl::configImpl() std::string PathImpl::nullImpl() { -#if defined(POCO_VXWORKS) - return "/null"; -#else return "/dev/null"; -#endif } diff --git a/base/poco/Foundation/src/Path_WIN32.cpp b/base/poco/Foundation/src/Path_WIN32.cpp deleted file mode 100644 index 9d8b357a319..00000000000 --- a/base/poco/Foundation/src/Path_WIN32.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// -// Path_WIN32.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Path_WIN32.h" -#include "Poco/Environment_WIN32.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -std::string PathImpl::currentImpl() -{ - char buffer[MAX_PATH]; - DWORD n = GetCurrentDirectoryA(sizeof(buffer), buffer); - if (n > 0 && n < sizeof(buffer)) - { - std::string result(buffer, n); - if (result[n - 1] != '\\') - result.append("\\"); - return result; - } - else throw SystemException("Cannot get current directory"); -} - - -std::string PathImpl::systemImpl() -{ - char buffer[MAX_PATH]; - DWORD n = GetSystemDirectoryA(buffer, sizeof(buffer)); - if (n > 0 && n < sizeof(buffer)) - { - std::string result(buffer, n); - if (result[n - 1] != '\\') - result.append("\\"); - return result; - } - else throw SystemException("Cannot get system directory"); -} - - -std::string PathImpl::homeImpl() -{ - std::string result; - if (EnvironmentImpl::hasImpl("USERPROFILE")) - { - result = EnvironmentImpl::getImpl("USERPROFILE"); - } - else if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) - { - result = EnvironmentImpl::getImpl("HOMEDRIVE"); - result.append(EnvironmentImpl::getImpl("HOMEPATH")); - } - else - { - result = systemImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::configHomeImpl() -{ - std::string result; - - // if APPDATA environment variable not exist, return home directory instead - try - { - result = EnvironmentImpl::getImpl("APPDATA"); - } - catch (NotFoundException&) - { - result = homeImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::dataHomeImpl() -{ - std::string result; - - // if LOCALAPPDATA environment variable not exist, return config home instead - try - { - result = EnvironmentImpl::getImpl("LOCALAPPDATA"); - } - catch (NotFoundException&) - { - result = configHomeImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::cacheHomeImpl() -{ - return tempImpl(); -} - - -std::string PathImpl::tempHomeImpl() -{ - return tempImpl(); -} - - -std::string PathImpl::tempImpl() -{ - char buffer[MAX_PATH]; - DWORD n = GetTempPathA(sizeof(buffer), buffer); - if (n > 0 && n < sizeof(buffer)) - { - n = GetLongPathNameA(buffer, buffer, static_cast(sizeof buffer)); - if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); - std::string result(buffer, n); - if (result[n - 1] != '\\') - result.append("\\"); - return result; - } - else throw SystemException("Cannot get temporary directory"); -} - - -std::string PathImpl::configImpl() -{ - std::string result; - - // if PROGRAMDATA environment variable not exist, return system directory instead - try - { - result = EnvironmentImpl::getImpl("PROGRAMDATA"); - } - catch (NotFoundException&) - { - result = systemImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::nullImpl() -{ - return "NUL:"; -} - - -std::string PathImpl::expandImpl(const std::string& path) -{ - char buffer[MAX_PATH]; - DWORD n = ExpandEnvironmentStringsA(path.c_str(), buffer, sizeof(buffer)); - if (n > 0 && n < sizeof(buffer)) - return std::string(buffer, n - 1); - else - return path; -} - - -void PathImpl::listRootsImpl(std::vector& roots) -{ - roots.clear(); - char buffer[128]; - DWORD n = GetLogicalDriveStrings(sizeof(buffer) - 1, buffer); - char* it = buffer; - char* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n); - while (it < end) - { - std::string dev; - while (it < end && *it) dev += *it++; - roots.push_back(dev); - ++it; - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Path_WIN32U.cpp b/base/poco/Foundation/src/Path_WIN32U.cpp deleted file mode 100644 index ac757d6eab8..00000000000 --- a/base/poco/Foundation/src/Path_WIN32U.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// -// Path_WIN32U.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Copyright (c) 2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Path_WIN32U.h" -#include "Poco/Environment_WIN32.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Buffer.h" -#include "Poco/Exception.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -std::string PathImpl::currentImpl() -{ - std::string result; - DWORD len = GetCurrentDirectoryW(0, NULL); - if (len > 0) - { - Buffer buffer(len); - DWORD n = GetCurrentDirectoryW(len, buffer.begin()); - if (n > 0 && n <= len) - { - UnicodeConverter::toUTF8(buffer.begin(), result); - if (result[result.size() - 1] != '\\') - result.append("\\"); - return result; - } - } - throw SystemException("Cannot get current directory"); -} - - -std::string PathImpl::systemImpl() -{ - Buffer buffer(MAX_PATH_LEN); - DWORD n = GetSystemDirectoryW(buffer.begin(), static_cast(buffer.size())); - if (n > 0) - { - n = GetLongPathNameW(buffer.begin(), buffer.begin(), static_cast(buffer.size())); - if (n <= 0) throw SystemException("Cannot get system directory long path name"); - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), result); - if (result[result.size() - 1] != '\\') result.append("\\"); - return result; - } - throw SystemException("Cannot get temporary directory path"); -} - - -std::string PathImpl::homeImpl() -{ - std::string result; - if (EnvironmentImpl::hasImpl("USERPROFILE")) - { - result = EnvironmentImpl::getImpl("USERPROFILE"); - } - else if (EnvironmentImpl::hasImpl("HOMEDRIVE") && EnvironmentImpl::hasImpl("HOMEPATH")) - { - result = EnvironmentImpl::getImpl("HOMEDRIVE"); - result.append(EnvironmentImpl::getImpl("HOMEPATH")); - } - else - { - result = systemImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::configHomeImpl() -{ - std::string result; - - // if APPDATA environment variable no exist, return home directory instead - try - { - result = EnvironmentImpl::getImpl("APPDATA"); - } - catch (NotFoundException&) - { - result = homeImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::dataHomeImpl() -{ - std::string result; - - // if LOCALAPPDATA environment variable no exist, return config home instead - try - { - result = EnvironmentImpl::getImpl("LOCALAPPDATA"); - } - catch (NotFoundException&) - { - result = configHomeImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::cacheHomeImpl() -{ - return tempImpl(); -} - - -std::string PathImpl::tempHomeImpl() -{ - return tempImpl(); -} - - -std::string PathImpl::tempImpl() -{ - Buffer buffer(MAX_PATH_LEN); - DWORD n = GetTempPathW(static_cast(buffer.size()), buffer.begin()); - if (n > 0) - { - n = GetLongPathNameW(buffer.begin(), buffer.begin(), static_cast(buffer.size())); - if (n <= 0) throw SystemException("Cannot get temporary directory long path name"); - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), result); - if (result[result.size() - 1] != '\\') - result.append("\\"); - return result; - } - throw SystemException("Cannot get temporary directory path"); -} - - -std::string PathImpl::configImpl() -{ - std::string result; - - // if PROGRAMDATA environment variable not exist, return system directory instead - try - { - result = EnvironmentImpl::getImpl("PROGRAMDATA"); - } - catch (NotFoundException&) - { - result = systemImpl(); - } - - std::string::size_type n = result.size(); - if (n > 0 && result[n - 1] != '\\') - result.append("\\"); - return result; -} - - -std::string PathImpl::nullImpl() -{ - return "NUL:"; -} - - -std::string PathImpl::expandImpl(const std::string& path) -{ - std::wstring upath; - UnicodeConverter::toUTF16(path, upath); - Buffer buffer(MAX_PATH_LEN); - DWORD n = ExpandEnvironmentStringsW(upath.c_str(), buffer.begin(), static_cast(buffer.size())); - if (n > 0 && n < buffer.size() - 1) - { - buffer[n + 1] = 0; - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), result); - return result; - } - else return path; -} - - -void PathImpl::listRootsImpl(std::vector& roots) -{ - roots.clear(); - wchar_t buffer[128]; - DWORD n = GetLogicalDriveStringsW(sizeof(buffer)/sizeof(wchar_t) - 1, buffer); - wchar_t* it = buffer; - wchar_t* end = buffer + (n > sizeof(buffer) ? sizeof(buffer) : n); - while (it < end) - { - std::wstring udev; - while (it < end && *it) udev += *it++; - std::string dev; - UnicodeConverter::toUTF8(udev, dev); - roots.push_back(dev); - ++it; - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Path_WINCE.cpp b/base/poco/Foundation/src/Path_WINCE.cpp deleted file mode 100644 index 750f18dda6f..00000000000 --- a/base/poco/Foundation/src/Path_WINCE.cpp +++ /dev/null @@ -1,144 +0,0 @@ -// -// Path_WIN32U.cpp -// -// Library: Foundation -// Package: Filesystem -// Module: Path -// -// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Path_WINCE.h" -#include "Poco/Environment_WINCE.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Buffer.h" -#include "Poco/Environment.h" -#include "Poco/Exception.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -std::string PathImpl::currentImpl() -{ - return("\\"); -} - -std::string PathImpl::homeImpl() -{ - return("\\"); -} - -std::string PathImpl::configHomeImpl() -{ - return homeImpl(); -} - -std::string PathImpl::dataHomeImpl() -{ - return homeImpl(); -} - -std::string PathImpl::cacheHomeImpl() -{ - return homeImpl(); -} - - -std::string PathImpl::tempHomeImpl() -{ - return tempImpl(); -} - - -std::string PathImpl::configImpl() -{ - return("\\"); -} - -std::string PathImpl::systemImpl() -{ - return("\\"); -} - - -std::string PathImpl::nullImpl() -{ - return "NUL:"; -} - - -std::string PathImpl::tempImpl() -{ - return "\\Temp\\"; -} - - -std::string PathImpl::expandImpl(const std::string& path) -{ - std::string result; - std::string::const_iterator it = path.begin(); - std::string::const_iterator end = path.end(); - while (it != end) - { - if (*it == '%') - { - ++it; - if (it != end && *it == '%') - { - result += '%'; - } - else - { - std::string var; - while (it != end && *it != '%') var += *it++; - if (it != end) ++it; - result += Environment::get(var, ""); - } - } - else result += *it++; - } - return result; -} - - -void PathImpl::listRootsImpl(std::vector& roots) -{ - roots.clear(); - roots.push_back("\\"); - - WIN32_FIND_DATAW fd; - HANDLE hFind = FindFirstFileW(L"\\*.*", &fd); - if (hFind != INVALID_HANDLE_VALUE) - { - do - { - if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && - (fd.dwFileAttributes & FILE_ATTRIBUTE_TEMPORARY)) - { - std::wstring name(fd.cFileName); - name += L"\\Vol:"; - HANDLE h = CreateFileW(name.c_str(), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (h != INVALID_HANDLE_VALUE) - { - // its a device volume - CloseHandle(h); - std::string name; - UnicodeConverter::toUTF8(fd.cFileName, name); - std::string root = "\\" + name; - roots.push_back(root); - } - } - } - while (FindNextFileW(hFind, &fd)); - FindClose(hFind); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/PipeImpl.cpp b/base/poco/Foundation/src/PipeImpl.cpp index bafc713a10e..d17f1f41a1f 100644 --- a/base/poco/Foundation/src/PipeImpl.cpp +++ b/base/poco/Foundation/src/PipeImpl.cpp @@ -15,13 +15,7 @@ #include "Poco/PipeImpl.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -/// #include "PipeImpl_DUMMY.cpp" -#else -#include "PipeImpl_WIN32.cpp" -#endif -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include "PipeImpl_POSIX.cpp" #else #include "PipeImpl_DUMMY.cpp" diff --git a/base/poco/Foundation/src/PipeImpl_WIN32.cpp b/base/poco/Foundation/src/PipeImpl_WIN32.cpp deleted file mode 100644 index 87dbbbf3e51..00000000000 --- a/base/poco/Foundation/src/PipeImpl_WIN32.cpp +++ /dev/null @@ -1,97 +0,0 @@ -// -// PipeImpl_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: PipeImpl -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/PipeImpl_WIN32.h" -#include "Poco/Exception.h" - - -namespace Poco { - - -PipeImpl::PipeImpl() -{ - SECURITY_ATTRIBUTES attr; - attr.nLength = sizeof(attr); - attr.lpSecurityDescriptor = NULL; - attr.bInheritHandle = FALSE; - - if (!CreatePipe(&_readHandle, &_writeHandle, &attr, 0)) - throw CreateFileException("anonymous pipe"); -} - - -PipeImpl::~PipeImpl() -{ - closeRead(); - closeWrite(); -} - - -int PipeImpl::writeBytes(const void* buffer, int length) -{ - poco_assert (_writeHandle != INVALID_HANDLE_VALUE); - - DWORD bytesWritten = 0; - if (!WriteFile(_writeHandle, buffer, length, &bytesWritten, NULL)) - throw WriteFileException("anonymous pipe"); - return bytesWritten; -} - - -int PipeImpl::readBytes(void* buffer, int length) -{ - poco_assert (_readHandle != INVALID_HANDLE_VALUE); - - DWORD bytesRead = 0; - BOOL ok = ReadFile(_readHandle, buffer, length, &bytesRead, NULL); - if (ok || GetLastError() == ERROR_BROKEN_PIPE) - return bytesRead; - else - throw ReadFileException("anonymous pipe"); -} - - -PipeImpl::Handle PipeImpl::readHandle() const -{ - return _readHandle; -} - - -PipeImpl::Handle PipeImpl::writeHandle() const -{ - return _writeHandle; -} - - -void PipeImpl::closeRead() -{ - if (_readHandle != INVALID_HANDLE_VALUE) - { - CloseHandle(_readHandle); - _readHandle = INVALID_HANDLE_VALUE; - } -} - - -void PipeImpl::closeWrite() -{ - if (_writeHandle != INVALID_HANDLE_VALUE) - { - CloseHandle(_writeHandle); - _writeHandle = INVALID_HANDLE_VALUE; - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Process.cpp b/base/poco/Foundation/src/Process.cpp index 6cc0b7e6b9d..7099939926d 100644 --- a/base/poco/Foundation/src/Process.cpp +++ b/base/poco/Foundation/src/Process.cpp @@ -47,17 +47,7 @@ namespace } -#if defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#if defined(_WIN32_WCE) -#include "Process_WINCE.cpp" -#else -#include "Process_WIN32U.cpp" -#endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "Process_WIN32.cpp" -#elif defined(POCO_VXWORKS) -#include "Process_VX.cpp" -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include "Process_UNIX.cpp" #endif diff --git a/base/poco/Foundation/src/Process_UNIX.cpp b/base/poco/Foundation/src/Process_UNIX.cpp index 4671278e1d8..c470edee65f 100644 --- a/base/poco/Foundation/src/Process_UNIX.cpp +++ b/base/poco/Foundation/src/Process_UNIX.cpp @@ -25,11 +25,6 @@ #include -#if defined(__QNX__) -#include -#include -#include -#endif namespace Poco { @@ -90,59 +85,7 @@ void ProcessImpl::timesImpl(long& userTime, long& kernelTime) ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) { -#if defined(__QNX__) - if (initialDirectory.empty()) - { - /// use QNX's spawn system call which is more efficient than fork/exec. - char** argv = new char*[args.size() + 2]; - int i = 0; - argv[i++] = const_cast(command.c_str()); - for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it) - argv[i++] = const_cast(it->c_str()); - argv[i] = NULL; - struct inheritance inherit; - std::memset(&inherit, 0, sizeof(inherit)); - inherit.flags = SPAWN_ALIGN_DEFAULT | SPAWN_CHECK_SCRIPT | SPAWN_SEARCH_PATH; - int fdmap[3]; - fdmap[0] = inPipe ? inPipe->readHandle() : 0; - fdmap[1] = outPipe ? outPipe->writeHandle() : 1; - fdmap[2] = errPipe ? errPipe->writeHandle() : 2; - - char** envPtr = 0; - std::vector envChars; - std::vector envPtrs; - if (!env.empty()) - { - envChars = getEnvironmentVariablesBuffer(env); - envPtrs.reserve(env.size() + 1); - char* p = &envChars[0]; - while (*p) - { - envPtrs.push_back(p); - while (*p) ++p; - ++p; - } - envPtrs.push_back(0); - envPtr = &envPtrs[0]; - } - - int pid = spawn(command.c_str(), 3, fdmap, &inherit, argv, envPtr); - delete [] argv; - if (pid == -1) - throw SystemException("cannot spawn", command); - - if (inPipe) inPipe->close(Pipe::CLOSE_READ); - if (outPipe) outPipe->close(Pipe::CLOSE_WRITE); - if (errPipe) errPipe->close(Pipe::CLOSE_WRITE); - return new ProcessHandleImpl(pid); - } - else - { - return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env); - } -#else return launchByForkExecImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env); -#endif } diff --git a/base/poco/Foundation/src/Process_VX.cpp b/base/poco/Foundation/src/Process_VX.cpp deleted file mode 100644 index 699feb9be71..00000000000 --- a/base/poco/Foundation/src/Process_VX.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// Process_VX.cpp -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Process_VX.h" -#include "Poco/Exception.h" - - -namespace Poco { - - -// -// ProcessHandleImpl -// -ProcessHandleImpl::ProcessHandleImpl(int pid): - _pid(pid) -{ -} - - -ProcessHandleImpl::~ProcessHandleImpl() -{ -} - - -int ProcessHandleImpl::id() const -{ - return _pid; -} - - -int ProcessHandleImpl::wait() const -{ - throw Poco::NotImplementedException("Process::wait()"); -} - - -// -// ProcessImpl -// -ProcessImpl::PIDImpl ProcessImpl::idImpl() -{ - return 0; -} - - -void ProcessImpl::timesImpl(long& userTime, long& kernelTime) -{ - userTime = 0; - kernelTime = 0; -} - - -ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory,Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) -{ - throw Poco::NotImplementedException("Process::launch()"); -} - - -void ProcessImpl::killImpl(ProcessHandleImpl& handle) -{ - throw Poco::NotImplementedException("Process::kill()"); -} - - -void ProcessImpl::killImpl(PIDImpl pid) -{ - throw Poco::NotImplementedException("Process::kill()"); -} - - -bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) -{ - throw Poco::NotImplementedException("Process::is_running()"); -} - - -bool ProcessImpl::isRunningImpl(PIDImpl pid) -{ - throw Poco::NotImplementedException("Process::is_running()"); -} - - -void ProcessImpl::requestTerminationImpl(PIDImpl pid) -{ - throw Poco::NotImplementedException("Process::requestTermination()"); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Process_WIN32.cpp b/base/poco/Foundation/src/Process_WIN32.cpp deleted file mode 100644 index d698a9726e8..00000000000 --- a/base/poco/Foundation/src/Process_WIN32.cpp +++ /dev/null @@ -1,349 +0,0 @@ -// -// Process_WIN32.cpp -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Process_WIN32.h" -#include "Poco/Exception.h" -#include "Poco/NumberFormatter.h" -#include "Poco/NamedEvent.h" -#include "Poco/Pipe.h" - - -namespace Poco { - - -// -// ProcessHandleImpl -// -ProcessHandleImpl::ProcessHandleImpl(HANDLE hProcess, UInt32 pid) : - _hProcess(hProcess), - _pid(pid) -{ -} - - -ProcessHandleImpl::~ProcessHandleImpl() -{ - closeHandle(); -} - - -void ProcessHandleImpl::closeHandle() -{ - if (_hProcess) - { - CloseHandle(_hProcess); - _hProcess = NULL; - } -} - - -UInt32 ProcessHandleImpl::id() const -{ - return _pid; -} - - -HANDLE ProcessHandleImpl::process() const -{ - return _hProcess; -} - - -int ProcessHandleImpl::wait() const -{ - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); - if (rc != WAIT_OBJECT_0) - throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); - - DWORD exitCode; - if (GetExitCodeProcess(_hProcess, &exitCode) == 0) - throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid)); - - return exitCode; -} - - -// -// ProcessImpl -// -ProcessImpl::PIDImpl ProcessImpl::idImpl() -{ - return GetCurrentProcessId(); -} - - -void ProcessImpl::timesImpl(long& userTime, long& kernelTime) -{ - FILETIME ftCreation; - FILETIME ftExit; - FILETIME ftKernel; - FILETIME ftUser; - - if (GetProcessTimes(GetCurrentProcess(), &ftCreation, &ftExit, &ftKernel, &ftUser) != 0) - { - ULARGE_INTEGER time; - time.LowPart = ftKernel.dwLowDateTime; - time.HighPart = ftKernel.dwHighDateTime; - kernelTime = long(time.QuadPart / 10000000L); - time.LowPart = ftUser.dwLowDateTime; - time.HighPart = ftUser.dwHighDateTime; - userTime = long(time.QuadPart / 10000000L); - } - else - { - userTime = kernelTime = -1; - } -} - - -static bool argNeedsEscaping(const std::string& arg) -{ - bool containsQuotableChar = std::string::npos != arg.find_first_of(" \t\n\v\""); - // Assume args that start and end with quotes are already quoted and do not require further quoting. - // There is probably code out there written before launch() escaped the arguments that does its own - // escaping of arguments. This ensures we do not interfere with those arguments. - bool isAlreadyQuoted = arg.size() > 1 && '\"' == arg[0] && '\"' == arg[arg.size() - 1]; - return containsQuotableChar && !isAlreadyQuoted; -} - - -// Based on code from https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ -static std::string escapeArg(const std::string& arg) -{ - if (argNeedsEscaping(arg)) - { - std::string quotedArg("\""); - for (std::string::const_iterator it = arg.begin(); ; ++it) - { - unsigned backslashCount = 0; - while (it != arg.end() && '\\' == *it) - { - ++it; - ++backslashCount; - } - - if (it == arg.end()) - { - quotedArg.append(2 * backslashCount, '\\'); - break; - } - else if ('"' == *it) - { - quotedArg.append(2 * backslashCount + 1, '\\'); - quotedArg.push_back('"'); - } - else - { - quotedArg.append(backslashCount, '\\'); - quotedArg.push_back(*it); - } - } - quotedArg.push_back('"'); - return quotedArg; - } - else - { - return arg; - } -} - - -ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) -{ - std::string commandLine = command; - for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it) - { - commandLine.append(" "); - commandLine.append(escapeArg(*it)); - } - - STARTUPINFOA startupInfo; - GetStartupInfoA(&startupInfo); // take defaults from current process - startupInfo.cb = sizeof(STARTUPINFOA); - startupInfo.lpReserved = NULL; - startupInfo.lpDesktop = NULL; - startupInfo.lpTitle = NULL; - startupInfo.dwFlags = STARTF_FORCEOFFFEEDBACK; - startupInfo.cbReserved2 = 0; - startupInfo.lpReserved2 = NULL; - - HANDLE hProc = GetCurrentProcess(); - bool mustInheritHandles = false; - if (inPipe) - { - DuplicateHandle(hProc, inPipe->readHandle(), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - inPipe->close(Pipe::CLOSE_READ); - } - else if (GetStdHandle(STD_INPUT_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_INPUT_HANDLE), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdInput = 0; - } - // outPipe may be the same as errPipe, so we duplicate first and close later. - if (outPipe) - { - DuplicateHandle(hProc, outPipe->writeHandle(), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else if (GetStdHandle(STD_OUTPUT_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_OUTPUT_HANDLE), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdOutput = 0; - } - if (errPipe) - { - DuplicateHandle(hProc, errPipe->writeHandle(), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else if (GetStdHandle(STD_ERROR_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_ERROR_HANDLE), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdError = 0; - } - if (outPipe) outPipe->close(Pipe::CLOSE_WRITE); - if (errPipe) errPipe->close(Pipe::CLOSE_WRITE); - - if (mustInheritHandles) - { - startupInfo.dwFlags |= STARTF_USESTDHANDLES; - } - - const char* workingDirectory = initialDirectory.empty() ? 0 : initialDirectory.c_str(); - - const char* pEnv = 0; - std::vector envChars; - if (!env.empty()) - { - envChars = getEnvironmentVariablesBuffer(env); - pEnv = &envChars[0]; - } - - PROCESS_INFORMATION processInfo; - DWORD creationFlags = GetConsoleWindow() ? 0 : CREATE_NO_WINDOW; - BOOL rc = CreateProcessA( - NULL, - const_cast(commandLine.c_str()), - NULL, // processAttributes - NULL, // threadAttributes - mustInheritHandles, - creationFlags, - (LPVOID)pEnv, - workingDirectory, - &startupInfo, - &processInfo - ); - if (startupInfo.hStdInput) CloseHandle(startupInfo.hStdInput); - if (startupInfo.hStdOutput) CloseHandle(startupInfo.hStdOutput); - if (startupInfo.hStdError) CloseHandle(startupInfo.hStdError); - if (rc) - { - CloseHandle(processInfo.hThread); - return new ProcessHandleImpl(processInfo.hProcess, processInfo.dwProcessId); - } - else throw SystemException("Cannot launch process", command); -} - - -void ProcessImpl::killImpl(ProcessHandleImpl& handle) -{ - if (handle.process()) - { - if (TerminateProcess(handle.process(), 0) == 0) - { - handle.closeHandle(); - throw SystemException("cannot kill process"); - } - handle.closeHandle(); - } -} - -void ProcessImpl::killImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); - if (hProc) - { - if (TerminateProcess(hProc, 0) == 0) - { - CloseHandle(hProc); - throw SystemException("cannot kill process"); - } - CloseHandle(hProc); - } - else - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - throw NoPermissionException("cannot kill process"); - case ERROR_NOT_FOUND: - throw NotFoundException("cannot kill process"); - case ERROR_INVALID_PARAMETER: - throw NotFoundException("cannot kill process"); - default: - throw SystemException("cannot kill process"); - } - } -} - - -bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) -{ - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(handle.process(), &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result; -} - - -bool ProcessImpl::isRunningImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(hProc, &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result; -} - - -void ProcessImpl::requestTerminationImpl(PIDImpl pid) -{ - NamedEvent ev(terminationEventName(pid)); - ev.set(); -} - - -std::string ProcessImpl::terminationEventName(PIDImpl pid) -{ - std::string evName("POCOTRM"); - NumberFormatter::appendHex(evName, pid, 8); - return evName; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Process_WIN32U.cpp b/base/poco/Foundation/src/Process_WIN32U.cpp deleted file mode 100644 index 2a81a8dd468..00000000000 --- a/base/poco/Foundation/src/Process_WIN32U.cpp +++ /dev/null @@ -1,371 +0,0 @@ -// -// Process_WIN32U.cpp -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Process_WIN32U.h" -#include "Poco/Exception.h" -#include "Poco/NumberFormatter.h" -#include "Poco/NamedEvent.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Pipe.h" -#include "Poco/File.h" -#include "Poco/Path.h" -#include "Poco/String.h" - - -namespace Poco { - - -// -// ProcessHandleImpl -// -ProcessHandleImpl::ProcessHandleImpl(HANDLE hProcess, UInt32 pid) : - _hProcess(hProcess), - _pid(pid) -{ -} - - -ProcessHandleImpl::~ProcessHandleImpl() -{ - closeHandle(); -} - - -void ProcessHandleImpl::closeHandle() -{ - if (_hProcess) - { - CloseHandle(_hProcess); - _hProcess = NULL; - } -} - - -UInt32 ProcessHandleImpl::id() const -{ - return _pid; -} - - -HANDLE ProcessHandleImpl::process() const -{ - return _hProcess; -} - - -int ProcessHandleImpl::wait() const -{ - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); - if (rc != WAIT_OBJECT_0) - throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); - - DWORD exitCode; - if (GetExitCodeProcess(_hProcess, &exitCode) == 0) - throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid)); - - return exitCode; -} - - -// -// ProcessImpl -// -ProcessImpl::PIDImpl ProcessImpl::idImpl() -{ - return GetCurrentProcessId(); -} - - -void ProcessImpl::timesImpl(long& userTime, long& kernelTime) -{ - FILETIME ftCreation; - FILETIME ftExit; - FILETIME ftKernel; - FILETIME ftUser; - - if (GetProcessTimes(GetCurrentProcess(), &ftCreation, &ftExit, &ftKernel, &ftUser) != 0) - { - ULARGE_INTEGER time; - time.LowPart = ftKernel.dwLowDateTime; - time.HighPart = ftKernel.dwHighDateTime; - kernelTime = long(time.QuadPart / 10000000L); - time.LowPart = ftUser.dwLowDateTime; - time.HighPart = ftUser.dwHighDateTime; - userTime = long(time.QuadPart / 10000000L); - } - else - { - userTime = kernelTime = -1; - } -} - - -static bool argNeedsEscaping(const std::string& arg) -{ - bool containsQuotableChar = std::string::npos != arg.find_first_of(" \t\n\v\""); - // Assume args that start and end with quotes are already quoted and do not require further quoting. - // There is probably code out there written before launch() escaped the arguments that does its own - // escaping of arguments. This ensures we do not interfere with those arguments. - bool isAlreadyQuoted = arg.size() > 1 && '\"' == arg[0] && '\"' == arg[arg.size() - 1]; - return containsQuotableChar && !isAlreadyQuoted; -} - - -// Based on code from https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ -static std::string escapeArg(const std::string& arg) -{ - if (argNeedsEscaping(arg)) - { - std::string quotedArg("\""); - for (std::string::const_iterator it = arg.begin(); ; ++it) - { - unsigned backslashCount = 0; - while (it != arg.end() && '\\' == *it) - { - ++it; - ++backslashCount; - } - - if (it == arg.end()) - { - quotedArg.append(2 * backslashCount, '\\'); - break; - } - else if ('"' == *it) - { - quotedArg.append(2 * backslashCount + 1, '\\'); - quotedArg.push_back('"'); - } - else - { - quotedArg.append(backslashCount, '\\'); - quotedArg.push_back(*it); - } - } - quotedArg.push_back('"'); - return quotedArg; - } - else - { - return arg; - } -} - - -ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) -{ - std::string commandLine = escapeArg(command); - for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it) - { - commandLine.append(" "); - commandLine.append(escapeArg(*it)); - } - - std::wstring ucommandLine; - UnicodeConverter::toUTF16(commandLine, ucommandLine); - - const wchar_t* applicationName = 0; - std::wstring uapplicationName; - if (command.size() > MAX_PATH) - { - Poco::Path p(command); - if (p.isAbsolute()) - { - UnicodeConverter::toUTF16(command, uapplicationName); - if (p.getExtension().empty()) uapplicationName += L".EXE"; - applicationName = uapplicationName.c_str(); - } - } - - STARTUPINFOW startupInfo; - GetStartupInfoW(&startupInfo); // take defaults from current process - startupInfo.cb = sizeof(STARTUPINFOW); - startupInfo.lpReserved = NULL; - startupInfo.lpDesktop = NULL; - startupInfo.lpTitle = NULL; - startupInfo.dwFlags = STARTF_FORCEOFFFEEDBACK; - startupInfo.cbReserved2 = 0; - startupInfo.lpReserved2 = NULL; - - HANDLE hProc = GetCurrentProcess(); - bool mustInheritHandles = false; - if (inPipe) - { - DuplicateHandle(hProc, inPipe->readHandle(), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - inPipe->close(Pipe::CLOSE_READ); - } - else if (GetStdHandle(STD_INPUT_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_INPUT_HANDLE), hProc, &startupInfo.hStdInput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdInput = 0; - } - // outPipe may be the same as errPipe, so we duplicate first and close later. - if (outPipe) - { - DuplicateHandle(hProc, outPipe->writeHandle(), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else if (GetStdHandle(STD_OUTPUT_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_OUTPUT_HANDLE), hProc, &startupInfo.hStdOutput, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdOutput = 0; - } - if (errPipe) - { - DuplicateHandle(hProc, errPipe->writeHandle(), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else if (GetStdHandle(STD_ERROR_HANDLE)) - { - DuplicateHandle(hProc, GetStdHandle(STD_ERROR_HANDLE), hProc, &startupInfo.hStdError, 0, TRUE, DUPLICATE_SAME_ACCESS); - mustInheritHandles = true; - } - else - { - startupInfo.hStdError = 0; - } - if (outPipe) outPipe->close(Pipe::CLOSE_WRITE); - if (errPipe) errPipe->close(Pipe::CLOSE_WRITE); - - if (mustInheritHandles) - { - startupInfo.dwFlags |= STARTF_USESTDHANDLES; - } - - std::wstring uinitialDirectory; - UnicodeConverter::toUTF16(initialDirectory, uinitialDirectory); - const wchar_t* workingDirectory = uinitialDirectory.empty() ? 0 : uinitialDirectory.c_str(); - - const char* pEnv = 0; - std::vector envChars; - if (!env.empty()) - { - envChars = getEnvironmentVariablesBuffer(env); - pEnv = &envChars[0]; - } - - PROCESS_INFORMATION processInfo; - DWORD creationFlags = GetConsoleWindow() ? 0 : CREATE_NO_WINDOW; - BOOL rc = CreateProcessW( - applicationName, - const_cast(ucommandLine.c_str()), - NULL, // processAttributes - NULL, // threadAttributes - mustInheritHandles, - creationFlags, - (LPVOID)pEnv, - workingDirectory, - &startupInfo, - &processInfo - ); - if (startupInfo.hStdInput) CloseHandle(startupInfo.hStdInput); - if (startupInfo.hStdOutput) CloseHandle(startupInfo.hStdOutput); - if (startupInfo.hStdError) CloseHandle(startupInfo.hStdError); - if (rc) - { - CloseHandle(processInfo.hThread); - return new ProcessHandleImpl(processInfo.hProcess, processInfo.dwProcessId); - } - else throw SystemException("Cannot launch process", command); -} - - -void ProcessImpl::killImpl(ProcessHandleImpl& handle) -{ - if (handle.process()) - { - if (TerminateProcess(handle.process(), 0) == 0) - { - handle.closeHandle(); - throw SystemException("cannot kill process"); - } - handle.closeHandle(); - } -} - -void ProcessImpl::killImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); - if (hProc) - { - if (TerminateProcess(hProc, 0) == 0) - { - CloseHandle(hProc); - throw SystemException("cannot kill process"); - } - CloseHandle(hProc); - } - else - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - throw NoPermissionException("cannot kill process"); - case ERROR_NOT_FOUND: - throw NotFoundException("cannot kill process"); - case ERROR_INVALID_PARAMETER: - throw NotFoundException("cannot kill process"); - default: - throw SystemException("cannot kill process"); - } - } -} - - -bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) -{ - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(handle.process(), &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result; -} - - -bool ProcessImpl::isRunningImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(hProc, &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result; -} - - -void ProcessImpl::requestTerminationImpl(PIDImpl pid) -{ - NamedEvent ev(terminationEventName(pid)); - ev.set(); -} - - -std::string ProcessImpl::terminationEventName(PIDImpl pid) -{ - std::string evName("POCOTRM"); - NumberFormatter::appendHex(evName, pid, 8); - return evName; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Process_WINCE.cpp b/base/poco/Foundation/src/Process_WINCE.cpp deleted file mode 100644 index e640f3be3d5..00000000000 --- a/base/poco/Foundation/src/Process_WINCE.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// -// Process_WINCE.cpp -// -// Library: Foundation -// Package: Processes -// Module: Process -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Process_WINCE.h" -#include "Poco/Exception.h" -#include "Poco/NumberFormatter.h" -#include "Poco/NamedEvent.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Pipe.h" - - -namespace Poco { - - -// -// ProcessHandleImpl -// -ProcessHandleImpl::ProcessHandleImpl(HANDLE hProcess, UInt32 pid): - _hProcess(hProcess), - _pid(pid) -{ -} - - -ProcessHandleImpl::~ProcessHandleImpl() -{ - closeHandle(); -} - -void ProcessHandleImpl::closeHandle() -{ - if (_hProcess) - { - CloseHandle(_hProcess); - _hProcess = NULL; - } -} - -UInt32 ProcessHandleImpl::id() const -{ - return _pid; -} - - -HANDLE ProcessHandleImpl::process() const -{ - return _hProcess; -} - - -int ProcessHandleImpl::wait() const -{ - DWORD rc = WaitForSingleObject(_hProcess, INFINITE); - if (rc != WAIT_OBJECT_0) - throw SystemException("Wait failed for process", NumberFormatter::format(_pid)); - - DWORD exitCode; - if (GetExitCodeProcess(_hProcess, &exitCode) == 0) - throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid)); - - return exitCode; -} - - -// -// ProcessImpl -// -ProcessImpl::PIDImpl ProcessImpl::idImpl() -{ - return GetCurrentProcessId(); -} - - -void ProcessImpl::timesImpl(long& userTime, long& kernelTime) -{ - FILETIME ftCreation; - FILETIME ftExit; - FILETIME ftKernel; - FILETIME ftUser; - - if (GetThreadTimes(GetCurrentThread(), &ftCreation, &ftExit, &ftKernel, &ftUser) != 0) - { - ULARGE_INTEGER time; - time.LowPart = ftKernel.dwLowDateTime; - time.HighPart = ftKernel.dwHighDateTime; - kernelTime = long(time.QuadPart/10000000L); - time.LowPart = ftUser.dwLowDateTime; - time.HighPart = ftUser.dwHighDateTime; - userTime = long(time.QuadPart/10000000L); - } - else - { - userTime = kernelTime = -1; - } -} - - -ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const ArgsImpl& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const EnvImpl& env) -{ - std::wstring ucommand; - UnicodeConverter::toUTF16(command, ucommand); - - std::string commandLine; - for (ArgsImpl::const_iterator it = args.begin(); it != args.end(); ++it) - { - if (it != args.begin()) commandLine.append(" "); - commandLine.append(*it); - } - - std::wstring ucommandLine; - UnicodeConverter::toUTF16(commandLine, ucommandLine); - - PROCESS_INFORMATION processInfo; - BOOL rc = CreateProcessW( - ucommand.c_str(), - const_cast(ucommandLine.c_str()), - NULL, - NULL, - FALSE, - 0, - NULL, - NULL, - NULL/*&startupInfo*/, - &processInfo - ); - - if (rc) - { - CloseHandle(processInfo.hThread); - return new ProcessHandleImpl(processInfo.hProcess, processInfo.dwProcessId); - } - else throw SystemException("Cannot launch process", command); -} - - -void ProcessImpl::killImpl(ProcessHandleImpl& handle) -{ - if (handle.process()) - { - if (TerminateProcess(handle.process(), 0) == 0) - { - handle.closeHandle(); - throw SystemException("cannot kill process"); - } - handle.closeHandle(); - } -} - - -void ProcessImpl::killImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_TERMINATE, FALSE, pid); - if (hProc) - { - if (TerminateProcess(hProc, 0) == 0) - { - CloseHandle(hProc); - throw SystemException("cannot kill process"); - } - CloseHandle(hProc); - } - else - { - switch (GetLastError()) - { - case ERROR_ACCESS_DENIED: - throw NoPermissionException("cannot kill process"); - case ERROR_NOT_FOUND: - throw NotFoundException("cannot kill process"); - default: - throw SystemException("cannot kill process"); - } - } -} - - -bool ProcessImpl::isRunningImpl(const ProcessHandleImpl& handle) -{ - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(handle.process(), &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result; -} - - -bool ProcessImpl::isRunningImpl(PIDImpl pid) -{ - HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); - bool result = true; - DWORD exitCode; - BOOL rc = GetExitCodeProcess(hProc, &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - return result;} - - -void ProcessImpl::requestTerminationImpl(PIDImpl pid) -{ - NamedEvent ev(terminationEventName(pid)); - ev.set(); -} - - -std::string ProcessImpl::terminationEventName(PIDImpl pid) -{ - std::string evName("POCOTRM"); - NumberFormatter::appendHex(evName, pid, 8); - return evName; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/RWLock.cpp b/base/poco/Foundation/src/RWLock.cpp index ba3f7d14253..ffd0baf0e94 100644 --- a/base/poco/Foundation/src/RWLock.cpp +++ b/base/poco/Foundation/src/RWLock.cpp @@ -15,16 +15,8 @@ #include "Poco/RWLock.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "RWLock_WINCE.cpp" -#else -#include "RWLock_WIN32.cpp" -#endif -#elif POCO_OS == POCO_OS_ANDROID +#if POCO_OS == POCO_OS_ANDROID #include "RWLock_Android.cpp" -#elif defined(POCO_VXWORKS) -#include "RWLock_VX.cpp" #else #include "RWLock_POSIX.cpp" #endif diff --git a/base/poco/Foundation/src/RWLock_VX.cpp b/base/poco/Foundation/src/RWLock_VX.cpp deleted file mode 100644 index 44167d97e64..00000000000 --- a/base/poco/Foundation/src/RWLock_VX.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// RWLock_VX.cpp -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/RWLock_VX.h" -#include - - -namespace Poco { - - -RWLockImpl::RWLockImpl() -{ -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_mutex_init() won't properly initialize the mutex - // resulting in a subsequent freeze in pthread_mutex_destroy() - // if the mutex has never been used. - std::memset(&_mutex, 0, sizeof(_mutex)); -#endif - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - if (pthread_mutex_init(&_mutex, &attr)) - { - pthread_mutexattr_destroy(&attr); - throw SystemException("cannot create mutex"); - } - pthread_mutexattr_destroy(&attr); -} - - -RWLockImpl::~RWLockImpl() -{ - pthread_mutex_destroy(&_mutex); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/RWLock_WIN32.cpp b/base/poco/Foundation/src/RWLock_WIN32.cpp deleted file mode 100644 index 973b0ae3c5a..00000000000 --- a/base/poco/Foundation/src/RWLock_WIN32.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// -// RWLock_WIN32.cpp -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/RWLock_WIN32.h" - - -namespace Poco { - - -RWLockImpl::RWLockImpl(): _readers(0), _writersWaiting(0), _writers(0) -{ - _mutex = CreateMutexW(NULL, FALSE, NULL); - if (_mutex == NULL) - throw SystemException("cannot create reader/writer lock"); - - _readEvent = CreateEventW(NULL, TRUE, TRUE, NULL); - if (_readEvent == NULL) - throw SystemException("cannot create reader/writer lock"); - - _writeEvent = CreateEventW(NULL, TRUE, TRUE, NULL); - if (_writeEvent == NULL) - throw SystemException("cannot create reader/writer lock"); -} - - -RWLockImpl::~RWLockImpl() -{ - CloseHandle(_mutex); - CloseHandle(_readEvent); - CloseHandle(_writeEvent); -} - - -inline void RWLockImpl::addWriter() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - if (++_writersWaiting == 1) ResetEvent(_readEvent); - ReleaseMutex(_mutex); - break; - default: - throw SystemException("cannot lock reader/writer lock"); - } -} - - -inline void RWLockImpl::removeWriter() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - if (--_writersWaiting == 0 && _writers == 0) SetEvent(_readEvent); - ReleaseMutex(_mutex); - break; - default: - throw SystemException("cannot lock reader/writer lock"); - } -} - - -void RWLockImpl::readLockImpl() -{ - HANDLE h[2]; - h[0] = _mutex; - h[1] = _readEvent; - switch (WaitForMultipleObjects(2, h, TRUE, INFINITE)) - { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - ++_readers; - ResetEvent(_writeEvent); - ReleaseMutex(_mutex); - poco_assert_dbg(_writers == 0); - break; - default: - throw SystemException("cannot lock reader/writer lock"); - } -} - - -bool RWLockImpl::tryReadLockImpl() -{ - for (;;) - { - if (_writers != 0 || _writersWaiting != 0) - return false; - - DWORD result = tryReadLockOnce(); - switch (result) - { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - return true; - case WAIT_TIMEOUT: - continue; // try again - default: - throw SystemException("cannot lock reader/writer lock"); - } - } -} - - -void RWLockImpl::writeLockImpl() -{ - addWriter(); - HANDLE h[2]; - h[0] = _mutex; - h[1] = _writeEvent; - switch (WaitForMultipleObjects(2, h, TRUE, INFINITE)) - { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - --_writersWaiting; - ++_readers; - ++_writers; - ResetEvent(_readEvent); - ResetEvent(_writeEvent); - ReleaseMutex(_mutex); - poco_assert_dbg(_writers == 1); - break; - default: - removeWriter(); - throw SystemException("cannot lock reader/writer lock"); - } -} - - -bool RWLockImpl::tryWriteLockImpl() -{ - addWriter(); - HANDLE h[2]; - h[0] = _mutex; - h[1] = _writeEvent; - switch (WaitForMultipleObjects(2, h, TRUE, 1)) - { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - --_writersWaiting; - ++_readers; - ++_writers; - ResetEvent(_readEvent); - ResetEvent(_writeEvent); - ReleaseMutex(_mutex); - poco_assert_dbg(_writers == 1); - return true; - case WAIT_TIMEOUT: - removeWriter(); - return false; - default: - removeWriter(); - throw SystemException("cannot lock reader/writer lock"); - } -} - - -void RWLockImpl::unlockImpl() -{ - switch (WaitForSingleObject(_mutex, INFINITE)) - { - case WAIT_OBJECT_0: - _writers = 0; - if (_writersWaiting == 0) SetEvent(_readEvent); - if (--_readers == 0) SetEvent(_writeEvent); - ReleaseMutex(_mutex); - break; - default: - throw SystemException("cannot unlock reader/writer lock"); - } -} - - -DWORD RWLockImpl::tryReadLockOnce() -{ - HANDLE h[2]; - h[0] = _mutex; - h[1] = _readEvent; - DWORD result = WaitForMultipleObjects(2, h, TRUE, 1); - switch (result) - { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - ++_readers; - ResetEvent(_writeEvent); - ReleaseMutex(_mutex); - poco_assert_dbg(_writers == 0); - return result; - case WAIT_TIMEOUT: - return result; - default: - throw SystemException("cannot lock reader/writer lock"); - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/RWLock_WINCE.cpp b/base/poco/Foundation/src/RWLock_WINCE.cpp deleted file mode 100644 index f383a9da5d1..00000000000 --- a/base/poco/Foundation/src/RWLock_WINCE.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// -// RWLock_WINCE.cpp -// -// Library: Foundation -// Package: Threading -// Module: RWLock -// -// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/RWLock_WINCE.h" -#include "Poco/Thread.h" - - -namespace Poco { - - -RWLockImpl::RWLockImpl(): - _readerCount(0), - _readerWaiting(0), - _writerCount(0), - _writerWaiting(0), - _writeLock(false) - -{ - InitializeCriticalSection(&_cs); - _readerGreen = CreateEventW(NULL, FALSE, TRUE, NULL); - if (!_readerGreen) throw SystemException("Cannot create RWLock"); - _writerGreen = CreateEventW(NULL, FALSE, TRUE, NULL); - if (!_writerGreen) - { - CloseHandle(_readerGreen); - throw SystemException("Cannot create RWLock"); - } -} - - -RWLockImpl::~RWLockImpl() -{ - CloseHandle(_readerGreen); - CloseHandle(_writerGreen); - DeleteCriticalSection(&_cs); -} - - -void RWLockImpl::readLockImpl() -{ - tryReadLockImpl(INFINITE); -} - - -bool RWLockImpl::tryReadLockImpl(DWORD timeout) -{ - bool wait = false; - do - { - EnterCriticalSection(&_cs); - if (!_writerCount && !_writerWaiting) - { - if (wait) - { - _readerWaiting--; - wait = false; - } - _readerCount++; - } - else - { - if (!wait) - { - _readerWaiting++; - wait = true; - } - ResetEvent(_readerGreen); - } - LeaveCriticalSection(&_cs); - if (wait) - { - if (WaitForSingleObject(_readerGreen, timeout) != WAIT_OBJECT_0) - { - EnterCriticalSection(&_cs); - _readerWaiting--; - SetEvent(_readerGreen); - SetEvent(_writerGreen); - LeaveCriticalSection(&_cs); - return false; - } - } - } - while (wait); - - return true; -} - - -void RWLockImpl::writeLockImpl() -{ - tryWriteLockImpl(INFINITE); -} - - -bool RWLockImpl::tryWriteLockImpl(DWORD timeout) -{ - bool wait = false; - - do - { - EnterCriticalSection(&_cs); - if (!_readerCount && !_writerCount) - { - if (wait) - { - _writerWaiting--; - wait = false; - } - _writerCount++; - } - else - { - if (!wait) - { - _writerWaiting++; - wait = true; - } - ResetEvent(_writerGreen); - } - LeaveCriticalSection(&_cs); - if (wait) - { - if (WaitForSingleObject(_writerGreen, timeout) != WAIT_OBJECT_0) - { - EnterCriticalSection(&_cs); - _writerWaiting--; - SetEvent(_readerGreen); - SetEvent(_writerGreen); - LeaveCriticalSection(&_cs); - return false; - } - } - } - while (wait); - - _writeLock = true; - return true; -} - - -void RWLockImpl::unlockImpl() -{ - EnterCriticalSection(&_cs); - - if (_writeLock) - { - _writeLock = false; - _writerCount--; - } - else - { - _readerCount--; - } - if (_writerWaiting) - SetEvent(_writerGreen); - else if (_readerWaiting) - SetEvent(_readerGreen); - - LeaveCriticalSection(&_cs); -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Random.cpp b/base/poco/Foundation/src/Random.cpp index 10bf730374e..93e6bd678b1 100644 --- a/base/poco/Foundation/src/Random.cpp +++ b/base/poco/Foundation/src/Random.cpp @@ -47,9 +47,6 @@ #include "Poco/Random.h" #include "Poco/RandomStream.h" #include -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -#include "wce_time.h" -#endif /* @@ -153,11 +150,7 @@ Random::Random(int stateSize) poco_assert (BREAK_0 <= stateSize && stateSize <= BREAK_4); _pBuffer = new char[stateSize]; -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - initState((UInt32) wceex_time(NULL), _pBuffer, stateSize); -#else initState((UInt32) std::time(NULL), _pBuffer, stateSize); -#endif } diff --git a/base/poco/Foundation/src/RandomStream.cpp b/base/poco/Foundation/src/RandomStream.cpp index 7a490eb603d..568398961be 100644 --- a/base/poco/Foundation/src/RandomStream.cpp +++ b/base/poco/Foundation/src/RandomStream.cpp @@ -15,10 +15,7 @@ #include "Poco/RandomStream.h" #include "Poco/Random.h" #include "Poco/SHA1Engine.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "Poco/UnWindows.h" -#include -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #include #include #endif @@ -42,13 +39,6 @@ int RandomBuf::readFromDevice(char* buffer, std::streamsize length) { int n = 0; -#if defined(POCO_OS_FAMILY_WINDOWS) - HCRYPTPROV hProvider = 0; - CryptAcquireContext(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - CryptGenRandom(hProvider, (DWORD) length, (BYTE*) buffer); - CryptReleaseContext(hProvider, 0); - n = static_cast(length); -#else #if defined(POCO_OS_FAMILY_UNIX) int fd = open("/dev/urandom", O_RDONLY, 0); if (fd >= 0) @@ -92,7 +82,6 @@ int RandomBuf::readFromDevice(char* buffer, std::streamsize length) } } } -#endif return n; } diff --git a/base/poco/Foundation/src/Semaphore.cpp b/base/poco/Foundation/src/Semaphore.cpp index 3403125bdcc..3c80b960921 100644 --- a/base/poco/Foundation/src/Semaphore.cpp +++ b/base/poco/Foundation/src/Semaphore.cpp @@ -15,13 +15,7 @@ #include "Poco/Semaphore.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "Semaphore_WIN32.cpp" -#elif defined(POCO_VXWORKS) -#include "Semaphore_VX.cpp" -#else #include "Semaphore_POSIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/Semaphore_POSIX.cpp b/base/poco/Foundation/src/Semaphore_POSIX.cpp index f4818af2004..966aa369ed7 100644 --- a/base/poco/Foundation/src/Semaphore_POSIX.cpp +++ b/base/poco/Foundation/src/Semaphore_POSIX.cpp @@ -13,13 +13,8 @@ #include "Poco/Semaphore_POSIX.h" -#if defined(POCO_VXWORKS) -#include -#include -#else #include #include -#endif // @@ -51,13 +46,6 @@ SemaphoreImpl::SemaphoreImpl(int n, int max): _n(n), _max(max) { poco_assert (n >= 0 && max > 0 && n <= max); -#if defined(POCO_VXWORKS) - // This workaround is for VxWorks 5.x where - // pthread_mutex_init() won't properly initialize the mutex - // resulting in a subsequent freeze in pthread_mutex_destroy() - // if the mutex has never been used. - std::memset(&_mutex, 0, sizeof(_mutex)); -#endif if (pthread_mutex_init(&_mutex, NULL)) throw SystemException("cannot create semaphore (mutex)"); diff --git a/base/poco/Foundation/src/SharedLibrary.cpp b/base/poco/Foundation/src/SharedLibrary.cpp index 542f9e81029..038bc72d001 100644 --- a/base/poco/Foundation/src/SharedLibrary.cpp +++ b/base/poco/Foundation/src/SharedLibrary.cpp @@ -18,14 +18,8 @@ #if defined(hpux) || defined(_hpux) #include "SharedLibrary_HPUX.cpp" -#elif defined(POCO_VXWORKS) -#include "SharedLibrary_VX.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "SharedLibrary_UNIX.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) && defined(POCO_WIN32_UTF8) -#include "SharedLibrary_WIN32U.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "SharedLibrary_WIN32.cpp" #endif diff --git a/base/poco/Foundation/src/SharedLibrary_HPUX.cpp b/base/poco/Foundation/src/SharedLibrary_HPUX.cpp deleted file mode 100644 index 668bb5f64dd..00000000000 --- a/base/poco/Foundation/src/SharedLibrary_HPUX.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// -// SharedLibrary_HPUX.cpp -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedLibrary_HPUX.h" -#include - - -namespace Poco { - - -FastMutex SharedLibraryImpl::_mutex; - - -SharedLibraryImpl::SharedLibraryImpl() -{ - _handle = 0; -} - - -SharedLibraryImpl::~SharedLibraryImpl() -{ -} - - -void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) throw LibraryAlreadyLoadedException(path); - _handle = shl_load(path.c_str(), BIND_DEFERRED, 0); - if (!_handle) throw LibraryLoadException(path); - _path = path; -} - - -void SharedLibraryImpl::unloadImpl() -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { - shl_unload(_handle); - _handle = 0; - _path.clear(); - } -} - - -bool SharedLibraryImpl::isLoadedImpl() const -{ - return _handle != 0; -} - - -void* SharedLibraryImpl::findSymbolImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - void* result = 0; - if (_handle && shl_findsym(&_handle, name.c_str(), TYPE_UNDEFINED, &result) != -1) - return result; - else - return 0; -} - - -const std::string& SharedLibraryImpl::getPathImpl() const -{ - return _path; -} - - -std::string SharedLibraryImpl::suffixImpl() -{ -#if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) - return "d.sl"; -#else - return ".sl"; -#endif -} - - -bool SharedLibraryImpl::setSearchPathImpl(const std::string&) -{ - return false; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/SharedLibrary_UNIX.cpp b/base/poco/Foundation/src/SharedLibrary_UNIX.cpp index 4a3dc2ffb0b..9dee3577e2f 100644 --- a/base/poco/Foundation/src/SharedLibrary_UNIX.cpp +++ b/base/poco/Foundation/src/SharedLibrary_UNIX.cpp @@ -18,9 +18,6 @@ // Note: cygwin is missing RTLD_LOCAL, set it to 0 -#if defined(__CYGWIN__) && !defined(RTLD_LOCAL) -#define RTLD_LOCAL 0 -#endif namespace Poco { @@ -111,12 +108,6 @@ std::string SharedLibraryImpl::suffixImpl() #else return ".sl"; #endif -#elif defined(__CYGWIN__) - #if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) - return "d.dll"; - #else - return ".dll"; - #endif #else #if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) return "d.so"; diff --git a/base/poco/Foundation/src/SharedLibrary_VX.cpp b/base/poco/Foundation/src/SharedLibrary_VX.cpp deleted file mode 100644 index bb2b14681ed..00000000000 --- a/base/poco/Foundation/src/SharedLibrary_VX.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// -// SharedLibrary_VX.cpp -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedLibrary_VX.h" -#include "Poco/Exception.h" -#include "Poco/Format.h" -#include -#include -#include -#include -#include -#include - - -struct SymLookup -{ - const char* name; - int group; - void* addr; -}; - - -extern "C" bool lookupFunc(char* name, int val, SYM_TYPE type, int arg, UINT16 group) -{ - SymLookup* symLookup = reinterpret_cast(arg); - if (group == symLookup->group && std::strcmp(name, symLookup->name) == 0) - { - symLookup->addr = reinterpret_cast(val); - return TRUE; - } - else return FALSE; -} - - -namespace Poco { - - -FastMutex SharedLibraryImpl::_mutex; - - -SharedLibraryImpl::SharedLibraryImpl(): - _moduleId(0) -{ -} - - -SharedLibraryImpl::~SharedLibraryImpl() -{ -} - - -void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_moduleId) throw LibraryAlreadyLoadedException(path); - int fd = open(const_cast(path.c_str()), O_RDONLY, 0); - if (fd) - { - _moduleId = loadModule(fd, LOAD_GLOBAL_SYMBOLS); - if (!_moduleId) - { - int err = errno; - close(fd); - throw LibraryLoadException(Poco::format("error %d", err)); - } - } - else - { - int err = errno; - throw LibraryLoadException(Poco::format("cannot open library (error %d)", err)); - } - _path = path; -} - - -void SharedLibraryImpl::unloadImpl() -{ - FastMutex::ScopedLock lock(_mutex); - - if (_moduleId) - { - unldByModuleId(_moduleId, 0); - _moduleId = 0; - } -} - - -bool SharedLibraryImpl::isLoadedImpl() const -{ - return _moduleId != 0; -} - - -void* SharedLibraryImpl::findSymbolImpl(const std::string& name) -{ - poco_assert (_moduleId != 0); - - FastMutex::ScopedLock lock(_mutex); - - MODULE_INFO mi; - if (!moduleInfoGet(_moduleId, &mi)) return 0; - SymLookup symLookup; - symLookup.name = name.c_str(); - symLookup.group = mi.group; - symLookup.addr = 0; - symEach(sysSymTbl, reinterpret_cast(lookupFunc), reinterpret_cast(&symLookup)); - return symLookup.addr; -} - - -const std::string& SharedLibraryImpl::getPathImpl() const -{ - return _path; -} - - -std::string SharedLibraryImpl::suffixImpl() -{ - return ".out"; -} - - -bool SharedLibraryImpl::setSearchPathImpl(const std::string&) -{ - return false; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/SharedLibrary_WIN32.cpp b/base/poco/Foundation/src/SharedLibrary_WIN32.cpp deleted file mode 100644 index 340a742e8f5..00000000000 --- a/base/poco/Foundation/src/SharedLibrary_WIN32.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// -// SharedLibrary_WIN32.cpp -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedLibrary_WIN32.h" -#include "Poco/Path.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -FastMutex SharedLibraryImpl::_mutex; - - -SharedLibraryImpl::SharedLibraryImpl() -{ - _handle = 0; -} - - -SharedLibraryImpl::~SharedLibraryImpl() -{ -} - - -void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) throw LibraryAlreadyLoadedException(_path); - DWORD flags(0); - Path p(path); - if (p.isAbsolute()) flags |= LOAD_WITH_ALTERED_SEARCH_PATH; - _handle = LoadLibraryExA(path.c_str(), 0, flags); - if (!_handle) throw LibraryLoadException(path); - _path = path; -} - - -void SharedLibraryImpl::unloadImpl() -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { - FreeLibrary((HMODULE) _handle); - _handle = 0; - } - _path.clear(); -} - - -bool SharedLibraryImpl::isLoadedImpl() const -{ - return _handle != 0; -} - - -void* SharedLibraryImpl::findSymbolImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { - return (void*) GetProcAddress((HMODULE) _handle, name.c_str()); - } - else return 0; -} - - -const std::string& SharedLibraryImpl::getPathImpl() const -{ - return _path; -} - - -std::string SharedLibraryImpl::suffixImpl() -{ -#if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) - return "d.dll"; -#else - return ".dll"; -#endif -} - - -bool SharedLibraryImpl::setSearchPathImpl(const std::string& path) -{ -#if _WIN32_WINNT >= 0x0502 - return SetDllDirectoryA(path.c_str()) != 0; -#else - return false; -#endif -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/SharedLibrary_WIN32U.cpp b/base/poco/Foundation/src/SharedLibrary_WIN32U.cpp deleted file mode 100644 index b4f697ea0ac..00000000000 --- a/base/poco/Foundation/src/SharedLibrary_WIN32U.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// -// SharedLibrary_WIN32U.cpp -// -// Library: Foundation -// Package: SharedLibrary -// Module: SharedLibrary -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedLibrary_WIN32U.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Path.h" -#include "Poco/UnWindows.h" - - -namespace Poco { - - -FastMutex SharedLibraryImpl::_mutex; - - -SharedLibraryImpl::SharedLibraryImpl() -{ - _handle = 0; -} - - -SharedLibraryImpl::~SharedLibraryImpl() -{ -} - - -void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) throw LibraryAlreadyLoadedException(_path); - DWORD flags(0); -#if !defined(_WIN32_WCE) - Path p(path); - if (p.isAbsolute()) flags |= LOAD_WITH_ALTERED_SEARCH_PATH; -#endif - std::wstring upath; - UnicodeConverter::toUTF16(path, upath); - _handle = LoadLibraryExW(upath.c_str(), 0, flags); - if (!_handle) throw LibraryLoadException(path); - _path = path; -} - - -void SharedLibraryImpl::unloadImpl() -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { - FreeLibrary((HMODULE) _handle); - _handle = 0; - } - _path.clear(); -} - - -bool SharedLibraryImpl::isLoadedImpl() const -{ - return _handle != 0; -} - - -void* SharedLibraryImpl::findSymbolImpl(const std::string& name) -{ - FastMutex::ScopedLock lock(_mutex); - - if (_handle) - { -#if defined(_WIN32_WCE) - std::wstring uname; - UnicodeConverter::toUTF16(name, uname); - return (void*) GetProcAddressW((HMODULE) _handle, uname.c_str()); -#else - return (void*) GetProcAddress((HMODULE) _handle, name.c_str()); -#endif - } - else return 0; -} - - -const std::string& SharedLibraryImpl::getPathImpl() const -{ - return _path; -} - - -std::string SharedLibraryImpl::suffixImpl() -{ -#if defined(_DEBUG) && !defined(POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX) - return "d.dll"; -#else - return ".dll"; -#endif -} - - -bool SharedLibraryImpl::setSearchPathImpl(const std::string& path) -{ -#if _WIN32_WINNT >= 0x0502 - std::wstring wpath; - Poco::UnicodeConverter::toUTF16(path, wpath); - return SetDllDirectoryW(wpath.c_str()) != 0; -#else - return false; -#endif -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/SharedMemory.cpp b/base/poco/Foundation/src/SharedMemory.cpp index 154555c4fa5..6ce97618f37 100644 --- a/base/poco/Foundation/src/SharedMemory.cpp +++ b/base/poco/Foundation/src/SharedMemory.cpp @@ -16,8 +16,6 @@ #include "Poco/Exception.h" #if defined(POCO_NO_SHAREDMEMORY) /// #include "SharedMemory_DUMMY.cpp" -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "SharedMemory_WIN32.cpp" #elif defined(POCO_OS_FAMILY_UNIX) #include "SharedMemory_POSIX.cpp" #else diff --git a/base/poco/Foundation/src/SharedMemory_WIN32.cpp b/base/poco/Foundation/src/SharedMemory_WIN32.cpp deleted file mode 100644 index 1e86d7d10ed..00000000000 --- a/base/poco/Foundation/src/SharedMemory_WIN32.cpp +++ /dev/null @@ -1,168 +0,0 @@ -// -// SharedMemoryImpl.cpp -// -// Library: Foundation -// Package: Processes -// Module: SharedMemoryImpl -// -// Copyright (c) 2007, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/SharedMemory_WIN32.h" -#include "Poco/Error.h" -#include "Poco/Exception.h" -#include "Poco/File.h" -#include "Poco/Format.h" -#if defined (POCO_WIN32_UTF8) -#include "Poco/UnicodeConverter.h" -#endif -#include "Poco/UnWindows.h" - - -namespace Poco { - - -SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void*, bool): - _name(name), - _memHandle(INVALID_HANDLE_VALUE), - _fileHandle(INVALID_HANDLE_VALUE), - _size(static_cast(size)), - _mode(PAGE_READONLY), - _address(0) -{ - if (mode == SharedMemory::AM_WRITE) - _mode = PAGE_READWRITE; - -#if defined (POCO_WIN32_UTF8) - std::wstring utf16name; - UnicodeConverter::toUTF16(_name, utf16name); - _memHandle = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, _mode, 0, _size, utf16name.c_str()); -#else - _memHandle = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, _mode, 0, _size, _name.c_str()); -#endif - - if (!_memHandle) - { - DWORD dwRetVal = GetLastError(); -#if defined (_WIN32_WCE) - throw SystemException(format("Cannot create shared memory object %s [Error %d: %s]", _name, static_cast(dwRetVal), Error::getMessage(dwRetVal))); -#else - if (_mode != PAGE_READONLY || dwRetVal != 5) - throw SystemException(format("Cannot create shared memory object %s [Error %d: %s]", _name, static_cast(dwRetVal), Error::getMessage(dwRetVal))); - -#if defined (POCO_WIN32_UTF8) - _memHandle = OpenFileMappingW(PAGE_READONLY, FALSE, utf16name.c_str()); -#else - _memHandle = OpenFileMappingA(PAGE_READONLY, FALSE, _name.c_str()); -#endif - if (!_memHandle) - { - dwRetVal = GetLastError(); - throw SystemException(format("Cannot open shared memory object %s [Error %d: %s]", _name, static_cast(dwRetVal), Error::getMessage(dwRetVal))); - } -#endif - } - map(); -} - - -SharedMemoryImpl::SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void*): - _name(file.path()), - _memHandle(INVALID_HANDLE_VALUE), - _fileHandle(INVALID_HANDLE_VALUE), - _size(0), - _mode(PAGE_READONLY), - _address(0) -{ - if (!file.exists() || !file.isFile()) - throw FileNotFoundException(_name); - - _size = static_cast(file.getSize()); - - DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - DWORD fileMode = GENERIC_READ; - - if (mode == SharedMemory::AM_WRITE) - { - _mode = PAGE_READWRITE; - fileMode |= GENERIC_WRITE; - } - -#if defined (POCO_WIN32_UTF8) - std::wstring utf16name; - UnicodeConverter::toUTF16(_name, utf16name); - _fileHandle = CreateFileW(utf16name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -#else - _fileHandle = CreateFileA(_name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -#endif - - if (_fileHandle == INVALID_HANDLE_VALUE) - throw OpenFileException("Cannot open memory mapped file", _name); - - _memHandle = CreateFileMapping(_fileHandle, NULL, _mode, 0, 0, NULL); - if (!_memHandle) - { - DWORD dwRetVal = GetLastError(); - CloseHandle(_fileHandle); - _fileHandle = INVALID_HANDLE_VALUE; - throw SystemException(format("Cannot map file into shared memory %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); - } - map(); -} - - -SharedMemoryImpl::~SharedMemoryImpl() -{ - unmap(); - close(); -} - - -void SharedMemoryImpl::map() -{ - DWORD access = FILE_MAP_READ; - if (_mode == PAGE_READWRITE) - access = FILE_MAP_WRITE; - LPVOID addr = MapViewOfFile(_memHandle, access, 0, 0, _size); - if (!addr) - { - DWORD dwRetVal = GetLastError(); - throw SystemException(format("Cannot map shared memory object %s [Error %d: %s]", _name, (int)dwRetVal, Error::getMessage(dwRetVal))); - } - - _address = static_cast(addr); -} - - -void SharedMemoryImpl::unmap() -{ - if (_address) - { - UnmapViewOfFile(_address); - _address = 0; - return; - } -} - - -void SharedMemoryImpl::close() -{ - if (_memHandle != INVALID_HANDLE_VALUE) - { - CloseHandle(_memHandle); - _memHandle = INVALID_HANDLE_VALUE; - } - - if (_fileHandle != INVALID_HANDLE_VALUE) - { - CloseHandle(_fileHandle); - _fileHandle = INVALID_HANDLE_VALUE; - } -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/TemporaryFile.cpp b/base/poco/Foundation/src/TemporaryFile.cpp index e89c970f337..da0e1aab6ad 100644 --- a/base/poco/Foundation/src/TemporaryFile.cpp +++ b/base/poco/Foundation/src/TemporaryFile.cpp @@ -15,9 +15,7 @@ #include "Poco/TemporaryFile.h" #include "Poco/Path.h" #include "Poco/Exception.h" -#if !defined(POCO_VXWORKS) #include "Poco/Process.h" -#endif #include "Poco/Mutex.h" #include #include @@ -150,11 +148,7 @@ std::string TemporaryFile::tempName(const std::string& tempDir) { name << Path::separator(); } -#if defined(POCO_VXWORKS) - name << "tmp"; -#else name << "tmp" << Process::id(); -#endif for (int i = 0; i < 6; ++i) { name << char('a' + (n % 26)); diff --git a/base/poco/Foundation/src/Thread.cpp b/base/poco/Foundation/src/Thread.cpp index 2f16bbed7f6..e4d16495ba3 100644 --- a/base/poco/Foundation/src/Thread.cpp +++ b/base/poco/Foundation/src/Thread.cpp @@ -20,17 +20,7 @@ #include -#if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Thread_WINCE.cpp" -#else -#include "Thread_WIN32.cpp" -#endif -#elif defined(POCO_VXWORKS) -#include "Thread_VX.cpp" -#else #include "Thread_POSIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/ThreadPool.cpp b/base/poco/Foundation/src/ThreadPool.cpp index 39846945042..6335ee82b47 100644 --- a/base/poco/Foundation/src/ThreadPool.cpp +++ b/base/poco/Foundation/src/ThreadPool.cpp @@ -20,9 +20,6 @@ #include "Poco/ErrorHandler.h" #include #include -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -#include "wce_time.h" -#endif namespace Poco { @@ -67,11 +64,7 @@ PooledThread::PooledThread(const std::string& name, int stackSize): { poco_assert_dbg (stackSize >= 0); _thread.setStackSize(stackSize); -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - _idleTime = wceex_time(NULL); -#else _idleTime = std::time(NULL); -#endif } @@ -135,11 +128,7 @@ int PooledThread::idleTime() { FastMutex::ScopedLock lock(_mutex); -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - return (int) (wceex_time(NULL) - _idleTime); -#else return (int) (time(NULL) - _idleTime); -#endif } @@ -212,11 +201,7 @@ void PooledThread::run() } FastMutex::ScopedLock lock(_mutex); _pTarget = 0; -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 - _idleTime = wceex_time(NULL); -#else _idleTime = time(NULL); -#endif _idle = true; _targetCompleted.set(); ThreadLocalStorage::clear(); diff --git a/base/poco/Foundation/src/Thread_POSIX.cpp b/base/poco/Foundation/src/Thread_POSIX.cpp index ac3eefdeb70..7b1efe7a191 100644 --- a/base/poco/Foundation/src/Thread_POSIX.cpp +++ b/base/poco/Foundation/src/Thread_POSIX.cpp @@ -141,8 +141,6 @@ int ThreadImpl::getMinOSPriorityImpl(int policy) { #if defined(POCO_THREAD_PRIORITY_MIN) return POCO_THREAD_PRIORITY_MIN; -#elif defined(__digital__) - return PRI_OTHER_MIN; #else return sched_get_priority_min(policy); #endif @@ -153,8 +151,6 @@ int ThreadImpl::getMaxOSPriorityImpl(int policy) { #if defined(POCO_THREAD_PRIORITY_MAX) return POCO_THREAD_PRIORITY_MAX; -#elif defined(__digital__) - return PRI_OTHER_MAX; #else return sched_get_priority_max(policy); #endif @@ -268,13 +264,7 @@ ThreadImpl::TIDImpl ThreadImpl::currentTidImpl() void ThreadImpl::sleepImpl(long milliseconds) { -#if defined(__digital__) - // This is specific to DECThreads - struct timespec interval; - interval.tv_sec = milliseconds / 1000; - interval.tv_nsec = (milliseconds % 1000)*1000000; - pthread_delay_np(&interval); -#elif POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX || POCO_OS == POCO_OS_VXWORKS +#if POCO_OS == POCO_OS_LINUX || POCO_OS == POCO_OS_ANDROID || POCO_OS == POCO_OS_MAC_OS_X || POCO_OS == POCO_OS_QNX || POCO_OS == POCO_OS_VXWORKS Poco::Timespan remainingTime(1000*Poco::Timespan::TimeDiff(milliseconds)); int rc; do diff --git a/base/poco/Foundation/src/Thread_VX.cpp b/base/poco/Foundation/src/Thread_VX.cpp deleted file mode 100644 index d1883bf9156..00000000000 --- a/base/poco/Foundation/src/Thread_VX.cpp +++ /dev/null @@ -1,273 +0,0 @@ -// -// Thread_VX.cpp -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Copyright (c) 2004-2011, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Thread_VX.h" -#include "Poco/ErrorHandler.h" -#include "Poco/Exception.h" -#include "Poco/Timestamp.h" -#include "Poco/Timespan.h" -#include - - -namespace Poco { - - -ThreadImpl* ThreadImpl::_pCurrent(0); - - -ThreadImpl::ThreadImpl(): - _pData(new ThreadData) -{ -} - - -ThreadImpl::~ThreadImpl() -{ -} - - -void ThreadImpl::setPriorityImpl(int prio) -{ - if (prio != _pData->prio) - { - _pData->prio = prio; - _pData->osPrio = mapPrio(_pData->prio); - if (isRunningImpl()) - { - if (taskPrioritySet(_pData->task, _pData->osPrio) != OK) - throw SystemException("cannot set task priority"); - } - } -} - - -void ThreadImpl::setOSPriorityImpl(int prio, int /* policy */) -{ - if (prio != _pData->osPrio) - { - _pData->prio = reverseMapPrio(prio); - _pData->osPrio = prio; - if (_pData->pRunnableTarget || _pData->pCallbackTarget) - { - if (taskPrioritySet(_pData->task, prio) != OK) - throw SystemException("cannot set task priority"); - } - } -} - - -int ThreadImpl::getMinOSPriorityImpl(int /* policy */) -{ - return 255; -} - - -int ThreadImpl::getMaxOSPriorityImpl(int /* policy */) -{ - return 0; -} - - -void ThreadImpl::setStackSizeImpl(int size) -{ - _pData->stackSize = size; -} - - -void ThreadImpl::startImpl(Runnable& target) -{ - if (_pData->pRunnableTarget) - throw SystemException("thread already running"); - - _pData->pRunnableTarget = ⌖ - - int stackSize = _pData->stackSize == 0 ? DEFAULT_THREAD_STACK_SIZE : _pData->stackSize; - int id = taskSpawn(NULL, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(runnableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); - if (id == ERROR) - throw SystemException("cannot spawn task"); - - _pData->task = id; -} - - -void ThreadImpl::startImpl(Callable target, void* pData) -{ - if (_pData->pCallbackTarget && _pData->pCallbackTarget->callback) - throw SystemException("thread already running"); - - if (0 == _pData->pCallbackTarget.get()) - _pData->pCallbackTarget = new CallbackData; - - _pData->pCallbackTarget->callback = target; - _pData->pCallbackTarget->pData = pData; - - int stackSize = _pData->stackSize == 0 ? DEFAULT_THREAD_STACK_SIZE : _pData->stackSize; - int id = taskSpawn(NULL, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(callableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); - if (id == ERROR) - throw SystemException("cannot spawn task"); - - _pData->task = id; -} - - -void ThreadImpl::joinImpl() -{ - _pData->done.wait(); -} - - -bool ThreadImpl::joinImpl(long milliseconds) -{ - return _pData->done.tryWait(milliseconds); -} - - -ThreadImpl* ThreadImpl::currentImpl() -{ - return _pCurrent; -} - - -ThreadImpl::TIDImpl ThreadImpl::currentTidImpl() -{ - return taskIdSelf(); -} - - -void ThreadImpl::sleepImpl(long milliseconds) -{ - Poco::Timespan remainingTime(1000*Poco::Timespan::TimeDiff(milliseconds)); - int rc; - do - { - struct timespec ts; - ts.tv_sec = (long) remainingTime.totalSeconds(); - ts.tv_nsec = (long) remainingTime.useconds()*1000; - Poco::Timestamp start; - rc = ::nanosleep(&ts, 0); - if (rc < 0 && errno == EINTR) - { - Poco::Timestamp end; - Poco::Timespan waited = start.elapsed(); - if (waited < remainingTime) - remainingTime -= waited; - else - remainingTime = 0; - } - } - while (remainingTime > 0 && rc < 0 && errno == EINTR); - if (rc < 0 && remainingTime > 0) throw Poco::SystemException("Thread::sleep(): nanosleep() failed"); -} - - -void ThreadImpl::runnableEntry(void* pThread, int, int, int, int, int, int, int, int, int) -{ - taskVarAdd(0, reinterpret_cast(&_pCurrent)); - _pCurrent = reinterpret_cast(pThread); - - AutoPtr pData = _pCurrent->_pData; - try - { - pData->pRunnableTarget->run(); - } - catch (Exception& exc) - { - ErrorHandler::handle(exc); - } - catch (std::exception& exc) - { - ErrorHandler::handle(exc); - } - catch (...) - { - ErrorHandler::handle(); - } - - pData->pRunnableTarget = 0; - pData->done.set(); -} - - -void ThreadImpl::callableEntry(void* pThread, int, int, int, int, int, int, int, int, int) -{ - taskVarAdd(0, reinterpret_cast(&_pCurrent)); - _pCurrent = reinterpret_cast(pThread); - - AutoPtr pData = _pCurrent->_pData; - try - { - pData->pCallbackTarget->callback(pData->pCallbackTarget->pData); - } - catch (Exception& exc) - { - ErrorHandler::handle(exc); - } - catch (std::exception& exc) - { - ErrorHandler::handle(exc); - } - catch (...) - { - ErrorHandler::handle(); - } - - pData->pCallbackTarget->callback = 0; - pData->pCallbackTarget->pData = 0; - pData->done.set(); -} - - -int ThreadImpl::mapPrio(int prio) -{ - int pmin = getMinOSPriorityImpl(); - int pmax = getMaxOSPriorityImpl(); - - switch (prio) - { - case PRIO_LOWEST_IMPL: - return pmin; - case PRIO_LOW_IMPL: - return pmin + (pmax - pmin)/4; - case PRIO_NORMAL_IMPL: - return pmin + (pmax - pmin)/2; - case PRIO_HIGH_IMPL: - return pmin + 3*(pmax - pmin)/4; - case PRIO_HIGHEST_IMPL: - return pmax; - default: - poco_bugcheck_msg("invalid thread priority"); - } - return -1; // just to satisfy compiler - we'll never get here anyway -} - - -int ThreadImpl::reverseMapPrio(int prio) -{ - int pmin = getMinOSPriorityImpl(); - int pmax = getMaxOSPriorityImpl(); - int normal = pmin + (pmax - pmin)/2; - if (prio == pmax) - return PRIO_HIGHEST_IMPL; - if (prio > normal) - return PRIO_HIGH_IMPL; - else if (prio == normal) - return PRIO_NORMAL_IMPL; - else if (prio > pmin) - return PRIO_LOW_IMPL; - else - return PRIO_LOWEST_IMPL; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Thread_WIN32.cpp b/base/poco/Foundation/src/Thread_WIN32.cpp deleted file mode 100644 index 9bd6d25b976..00000000000 --- a/base/poco/Foundation/src/Thread_WIN32.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// -// Thread_WIN32.h -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Thread_WIN32.h" -#include "Poco/Exception.h" -#include "Poco/ErrorHandler.h" -#include - - -#if defined(POCO_WIN32_DEBUGGER_THREAD_NAMES) - - -namespace -{ - /// See - /// and for - /// more information on the code below. - - const DWORD MS_VC_EXCEPTION = 0x406D1388; - - #pragma pack(push,8) - typedef struct tagTHREADNAME_INFO - { - DWORD dwType; // Must be 0x1000. - LPCSTR szName; // Pointer to name (in user addr space). - DWORD dwThreadID; // Thread ID (-1=caller thread). - DWORD dwFlags; // Reserved for future use, must be zero. - } THREADNAME_INFO; - #pragma pack(pop) - - void setThreadName(DWORD dwThreadID, const char* threadName) - { - THREADNAME_INFO info; - info.dwType = 0x1000; - info.szName = threadName; - info.dwThreadID = dwThreadID; - info.dwFlags = 0; - - __try - { - RaiseException(MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info); - } - __except (EXCEPTION_CONTINUE_EXECUTION) - { - } - } -} - - -#endif - - -namespace Poco { - - -ThreadImpl::CurrentThreadHolder ThreadImpl::_currentThreadHolder; - - -ThreadImpl::ThreadImpl(): - _thread(0), - _threadId(0), - _prio(PRIO_NORMAL_IMPL), - _stackSize(POCO_THREAD_STACK_SIZE) -{ -} - - -ThreadImpl::~ThreadImpl() -{ - if (_thread) CloseHandle(_thread); -} - - -void ThreadImpl::setPriorityImpl(int prio) -{ - if (prio != _prio) - { - _prio = prio; - if (_thread) - { - if (SetThreadPriority(_thread, _prio) == 0) - throw SystemException("cannot set thread priority"); - } - } -} - - -void ThreadImpl::setOSPriorityImpl(int prio, int /* policy */) -{ - setPriorityImpl(prio); -} - - -void ThreadImpl::startImpl(SharedPtr pTarget) -{ - if (isRunningImpl()) - throw SystemException("thread already running"); - - _pRunnableTarget = pTarget; - createImpl(runnableEntry, this); -} - - -void ThreadImpl::createImpl(Entry ent, void* pData) -{ -#if defined(_DLL) - _thread = CreateThread(NULL, _stackSize, ent, pData, 0, &_threadId); -#else - unsigned threadId; - _thread = (HANDLE) _beginthreadex(NULL, _stackSize, ent, this, 0, &threadId); - _threadId = static_cast(threadId); -#endif - if (!_thread) - throw SystemException("cannot create thread"); - if (_prio != PRIO_NORMAL_IMPL && !SetThreadPriority(_thread, _prio)) - throw SystemException("cannot set thread priority"); -} - - -void ThreadImpl::joinImpl() -{ - if (!_thread) return; - - switch (WaitForSingleObject(_thread, INFINITE)) - { - case WAIT_OBJECT_0: - threadCleanup(); - return; - default: - throw SystemException("cannot join thread"); - } -} - - -bool ThreadImpl::joinImpl(long milliseconds) -{ - if (!_thread) return true; - - switch (WaitForSingleObject(_thread, milliseconds + 1)) - { - case WAIT_TIMEOUT: - return false; - case WAIT_OBJECT_0: - threadCleanup(); - return true; - default: - throw SystemException("cannot join thread"); - } -} - - -bool ThreadImpl::isRunningImpl() const -{ - if (_thread) - { - DWORD ec = 0; - return GetExitCodeThread(_thread, &ec) && ec == STILL_ACTIVE; - } - return false; -} - - -void ThreadImpl::threadCleanup() -{ - if (!_thread) return; - if (CloseHandle(_thread)) _thread = 0; -} - - -ThreadImpl* ThreadImpl::currentImpl() -{ - return _currentThreadHolder.get(); -} - - -ThreadImpl::TIDImpl ThreadImpl::currentTidImpl() -{ - return GetCurrentThreadId(); -} - - -#if defined(_DLL) -DWORD WINAPI ThreadImpl::runnableEntry(LPVOID pThread) -#else -unsigned __stdcall ThreadImpl::runnableEntry(void* pThread) -#endif -{ - _currentThreadHolder.set(reinterpret_cast(pThread)); -#if defined(POCO_WIN32_DEBUGGER_THREAD_NAMES) - setThreadName(-1, reinterpret_cast(pThread)->getName().c_str()); -#endif - try - { - reinterpret_cast(pThread)->_pRunnableTarget->run(); - } - catch (Exception& exc) - { - ErrorHandler::handle(exc); - } - catch (std::exception& exc) - { - ErrorHandler::handle(exc); - } - catch (...) - { - ErrorHandler::handle(); - } - return 0; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Thread_WINCE.cpp b/base/poco/Foundation/src/Thread_WINCE.cpp deleted file mode 100644 index d769f88354c..00000000000 --- a/base/poco/Foundation/src/Thread_WINCE.cpp +++ /dev/null @@ -1,169 +0,0 @@ -// -// Thread_WINCE.h -// -// Library: Foundation -// Package: Threading -// Module: Thread -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Thread_WINCE.h" -#include "Poco/Exception.h" -#include "Poco/ErrorHandler.h" - - -namespace Poco { - - -ThreadImpl::CurrentThreadHolder ThreadImpl::_currentThreadHolder; - - -ThreadImpl::ThreadImpl(): - _pRunnableTarget(0), - _thread(0), - _threadId(0), - _prio(PRIO_NORMAL_IMPL), - _stackSize(POCO_THREAD_STACK_SIZE) -{ -} - - -ThreadImpl::~ThreadImpl() -{ - if (_thread) CloseHandle(_thread); -} - - -void ThreadImpl::setPriorityImpl(int prio) -{ - if (prio != _prio) - { - _prio = prio; - if (_thread) - { - if (SetThreadPriority(_thread, _prio) == 0) - throw SystemException("cannot set thread priority"); - } - } -} - - -void ThreadImpl::setOSPriorityImpl(int prio, int /* policy */) -{ - setPriorityImpl(prio); -} - - -void ThreadImpl::startImpl(SharedPtr pTarget) -{ - if (isRunningImpl()) - throw SystemException("thread already running"); - - _pRunnableTarget = pTarget; - - createImpl(runnableEntry, this); -} - - -void ThreadImpl::createImpl(Entry ent, void* pData) -{ - _thread = CreateThread(NULL, _stackSize, ent, pData, 0, &_threadId); - - if (!_thread) - throw SystemException("cannot create thread"); - if (_prio != PRIO_NORMAL_IMPL && !SetThreadPriority(_thread, _prio)) - throw SystemException("cannot set thread priority"); -} - - -void ThreadImpl::joinImpl() -{ - if (!_thread) return; - - switch (WaitForSingleObject(_thread, INFINITE)) - { - case WAIT_OBJECT_0: - threadCleanup(); - return; - default: - throw SystemException("cannot join thread"); - } -} - - -bool ThreadImpl::joinImpl(long milliseconds) -{ - if (!_thread) return true; - - switch (WaitForSingleObject(_thread, milliseconds + 1)) - { - case WAIT_TIMEOUT: - return false; - case WAIT_OBJECT_0: - threadCleanup(); - return true; - default: - throw SystemException("cannot join thread"); - } -} - - -bool ThreadImpl::isRunningImpl() const -{ - if (_thread) - { - DWORD ec = 0; - return GetExitCodeThread(_thread, &ec) && ec == STILL_ACTIVE; - } - return false; -} - - -void ThreadImpl::threadCleanup() -{ - if (!_thread) return; - if (CloseHandle(_thread)) _thread = 0; -} - - -ThreadImpl* ThreadImpl::currentImpl() -{ - return _currentThreadHolder.get(); -} - - -ThreadImpl::TIDImpl ThreadImpl::currentTidImpl() -{ - return GetCurrentThreadId(); -} - - -DWORD WINAPI ThreadImpl::runnableEntry(LPVOID pThread) -{ - _currentThreadHolder.set(reinterpret_cast(pThread)); - try - { - reinterpret_cast(pThread)->_pRunnableTarget->run(); - } - catch (Exception& exc) - { - ErrorHandler::handle(exc); - } - catch (std::exception& exc) - { - ErrorHandler::handle(exc); - } - catch (...) - { - ErrorHandler::handle(); - } - return 0; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Timestamp.cpp b/base/poco/Foundation/src/Timestamp.cpp index aca1e3494a3..be9c32d5607 100644 --- a/base/poco/Foundation/src/Timestamp.cpp +++ b/base/poco/Foundation/src/Timestamp.cpp @@ -22,18 +22,9 @@ #if defined(POCO_OS_FAMILY_UNIX) #include #include -#if defined(POCO_VXWORKS) -#include -#else #include #include #endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -#include "Poco/UnWindows.h" -#if defined(_WIN32_WCE) -#include -#endif -#endif #ifndef POCO_HAVE_CLOCK_GETTIME @@ -45,107 +36,6 @@ #endif -#if defined(_WIN32_WCE) && defined(POCO_WINCE_TIMESTAMP_HACK) - - -// -// See -// for an explanation of the following code. -// -// In short: Windows CE system time in most cases only has a resolution of one second. -// But we want millisecond resolution. -// - - -namespace { - - -class TickOffset -{ -public: - TickOffset() - { - SYSTEMTIME st1, st2; - std::memset(&st1, 0, sizeof(SYSTEMTIME)); - std::memset(&st2, 0, sizeof(SYSTEMTIME)); - GetSystemTime(&st1); - while (true) - { - GetSystemTime(&st2); - - // wait for a rollover - if (st1.wSecond != st2.wSecond) - { - _offset = GetTickCount() % 1000; - break; - } - } - } - - void calibrate(int seconds) - { - SYSTEMTIME st1, st2; - systemTime(&st1); - - WORD s = st1.wSecond; - int sum = 0; - int remaining = seconds; - while (remaining > 0) - { - systemTime(&st2); - WORD s2 = st2.wSecond; - - if (s != s2) - { - remaining--; - // store the offset from zero - sum += (st2.wMilliseconds > 500) ? (st2.wMilliseconds - 1000) : st2.wMilliseconds; - s = st2.wSecond; - } - } - - // adjust the offset by the average deviation from zero (round to the integer farthest from zero) - if (sum < 0) - _offset += (int) std::floor(sum / (float)seconds); - else - _offset += (int) std::ceil(sum / (float)seconds); - } - - void systemTime(SYSTEMTIME* pST) - { - std::memset(pST, 0, sizeof(SYSTEMTIME)); - - WORD tick = GetTickCount() % 1000; - GetSystemTime(pST); - WORD ms = (tick >= _offset) ? (tick - _offset) : (1000 - (_offset - tick)); - pST->wMilliseconds = ms; - } - - void systemTimeAsFileTime(FILETIME* pFT) - { - SYSTEMTIME st; - systemTime(&st); - SystemTimeToFileTime(&st, pFT); - } - -private: - WORD _offset; -}; - - -static TickOffset offset; - - -void GetSystemTimeAsFileTimeWithMillisecondResolution(FILETIME* pFT) -{ - offset.systemTimeAsFileTime(pFT); -} - - -} // namespace - - -#endif // defined(_WIN32_WCE) && defined(POCO_WINCE_TIMESTAMP_HACK) namespace Poco { @@ -214,26 +104,7 @@ Timestamp Timestamp::fromUtcTime(UtcTimeVal val) void Timestamp::update() { -#if defined(POCO_OS_FAMILY_WINDOWS) - - FILETIME ft; -#if defined(_WIN32_WCE) && defined(POCO_WINCE_TIMESTAMP_HACK) - GetSystemTimeAsFileTimeWithMillisecondResolution(&ft); -#else - GetSystemTimeAsFileTime(&ft); -#endif - - ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME - epoch.LowPart = 0xD53E8000; - epoch.HighPart = 0x019DB1DE; - - ULARGE_INTEGER ts; - ts.LowPart = ft.dwLowDateTime; - ts.HighPart = ft.dwHighDateTime; - ts.QuadPart -= epoch.QuadPart; - _ts = ts.QuadPart/10; - -#elif defined(POCO_HAVE_CLOCK_GETTIME) +#if defined(POCO_HAVE_CLOCK_GETTIME) struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts)) @@ -275,39 +146,6 @@ Timestamp& Timestamp::operator -= (const Timespan& span) } -#if defined(_WIN32) - - -Timestamp Timestamp::fromFileTimeNP(UInt32 fileTimeLow, UInt32 fileTimeHigh) -{ - ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME - epoch.LowPart = 0xD53E8000; - epoch.HighPart = 0x019DB1DE; - - ULARGE_INTEGER ts; - ts.LowPart = fileTimeLow; - ts.HighPart = fileTimeHigh; - ts.QuadPart -= epoch.QuadPart; - - return Timestamp(ts.QuadPart/10); -} - - -void Timestamp::toFileTimeNP(UInt32& fileTimeLow, UInt32& fileTimeHigh) const -{ - ULARGE_INTEGER epoch; // UNIX epoch (1970-01-01 00:00:00) expressed in Windows NT FILETIME - epoch.LowPart = 0xD53E8000; - epoch.HighPart = 0x019DB1DE; - - ULARGE_INTEGER ts; - ts.QuadPart = _ts*10; - ts.QuadPart += epoch.QuadPart; - fileTimeLow = ts.LowPart; - fileTimeHigh = ts.HighPart; -} - - -#endif } // namespace Poco diff --git a/base/poco/Foundation/src/Timezone.cpp b/base/poco/Foundation/src/Timezone.cpp index fa229cbb221..267d3c26a3d 100644 --- a/base/poco/Foundation/src/Timezone.cpp +++ b/base/poco/Foundation/src/Timezone.cpp @@ -16,17 +16,7 @@ #include -#if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Timezone_WINCE.cpp" -#else -#include "Timezone_WIN32.cpp" -#endif -#elif defined(POCO_VXWORKS) -#include "Timezone_VX.cpp" -#else #include "Timezone_UNIX.cpp" -#endif namespace Poco { diff --git a/base/poco/Foundation/src/Timezone_UNIX.cpp b/base/poco/Foundation/src/Timezone_UNIX.cpp index 118b43465ec..152c91121ec 100644 --- a/base/poco/Foundation/src/Timezone_UNIX.cpp +++ b/base/poco/Foundation/src/Timezone_UNIX.cpp @@ -39,9 +39,6 @@ public: gmtime_r(&now, &t); std::time_t utc = std::mktime(&t); return now - utc; - #elif defined(__CYGWIN__) - tzset(); - return -_timezone; #else tzset(); return -timezone; diff --git a/base/poco/Foundation/src/Timezone_WIN32.cpp b/base/poco/Foundation/src/Timezone_WIN32.cpp deleted file mode 100644 index 45be02e0a0b..00000000000 --- a/base/poco/Foundation/src/Timezone_WIN32.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// -// Timezone_WIN32.cpp -// -// Library: Foundation -// Package: DateTime -// Module: Timezone -// -// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Timezone.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Exception.h" -#include "Poco/UnWindows.h" -#include - - -namespace Poco { - - -int Timezone::utcOffset() -{ - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - return -tzInfo.Bias*60; -} - - -int Timezone::dst() -{ - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - return dstFlag == TIME_ZONE_ID_DAYLIGHT ? -tzInfo.DaylightBias*60 : 0; -} - - -bool Timezone::isDst(const Timestamp& timestamp) -{ - std::time_t time = timestamp.epochTime(); - struct std::tm* tms = std::localtime(&time); - if (!tms) throw Poco::SystemException("cannot get local time DST flag"); - return tms->tm_isdst > 0; -} - - -std::string Timezone::name() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = dstFlag == TIME_ZONE_ID_DAYLIGHT ? tzInfo.DaylightName : tzInfo.StandardName; -#if defined(POCO_WIN32_UTF8) - UnicodeConverter::toUTF8(ptr, result); -#else - char buffer[256]; - DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL); - if (rc) result = buffer; -#endif - return result; -} - - -std::string Timezone::standardName() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = tzInfo.StandardName; -#if defined(POCO_WIN32_UTF8) - UnicodeConverter::toUTF8(ptr, result); -#else - char buffer[256]; - DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL); - if (rc) result = buffer; -#endif - return result; -} - - -std::string Timezone::dstName() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = tzInfo.DaylightName; -#if defined(POCO_WIN32_UTF8) - UnicodeConverter::toUTF8(ptr, result); -#else - char buffer[256]; - DWORD rc = WideCharToMultiByte(CP_ACP, 0, ptr, -1, buffer, sizeof(buffer), NULL, NULL); - if (rc) result = buffer; -#endif - return result; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/Timezone_WINCE.cpp b/base/poco/Foundation/src/Timezone_WINCE.cpp deleted file mode 100644 index fb794f58b4e..00000000000 --- a/base/poco/Foundation/src/Timezone_WINCE.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// Timezone_WINCE.cpp -// -// Library: Foundation -// Package: DateTime -// Module: Timezone -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "Poco/Timezone.h" -#include "Poco/UnicodeConverter.h" -#include "Poco/Exception.h" -#include "Poco/UnWindows.h" -#include -#if _WIN32_WCE >= 0x800 -#include "time.h" -#else -#include "wce_time.h" -#endif - - -namespace Poco { - - -int Timezone::utcOffset() -{ - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - return -tzInfo.Bias*60; -} - - -int Timezone::dst() -{ - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - return dstFlag == TIME_ZONE_ID_DAYLIGHT ? -tzInfo.DaylightBias*60 : 0; -} - - -bool Timezone::isDst(const Timestamp& timestamp) -{ - std::time_t time = timestamp.epochTime(); -#if _WIN32_WCE >= 0x800 - struct std::tm* tms = localtime(&time); -#else - struct std::tm* tms = wceex_localtime(&time); -#endif - if (!tms) throw SystemException("cannot get local time DST flag"); - return tms->tm_isdst > 0; -} - - -std::string Timezone::name() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = dstFlag == TIME_ZONE_ID_DAYLIGHT ? tzInfo.DaylightName : tzInfo.StandardName; - UnicodeConverter::toUTF8(ptr, result); - return result; -} - - -std::string Timezone::standardName() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = tzInfo.StandardName; - UnicodeConverter::toUTF8(ptr, result); - return result; -} - - -std::string Timezone::dstName() -{ - std::string result; - TIME_ZONE_INFORMATION tzInfo; - DWORD dstFlag = GetTimeZoneInformation(&tzInfo); - WCHAR* ptr = tzInfo.DaylightName; - UnicodeConverter::toUTF8(ptr, result); - return result; -} - - -} // namespace Poco diff --git a/base/poco/Foundation/src/WindowsConsoleChannel.cpp b/base/poco/Foundation/src/WindowsConsoleChannel.cpp index 07e352935f2..48665bb178a 100644 --- a/base/poco/Foundation/src/WindowsConsoleChannel.cpp +++ b/base/poco/Foundation/src/WindowsConsoleChannel.cpp @@ -14,9 +14,6 @@ #include "Poco/WindowsConsoleChannel.h" #include "Poco/Message.h" -#if defined(POCO_WIN32_UTF8) -#include "Poco/UnicodeConverter.h" -#endif #include "Poco/String.h" #include "Poco/Exception.h" @@ -45,23 +42,8 @@ void WindowsConsoleChannel::log(const Message& msg) std::string text = msg.getText(); text += "\r\n"; -#if defined(POCO_WIN32_UTF8) - if (_isFile) - { - DWORD written; - WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, NULL); - } - else - { - std::wstring utext; - UnicodeConverter::toUTF16(text, utext); - DWORD written; - WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, NULL); - } -#else DWORD written; WriteFile(_hConsole, text.data(), text.size(), &written, NULL); -#endif } @@ -96,23 +78,8 @@ void WindowsColorConsoleChannel::log(const Message& msg) SetConsoleTextAttribute(_hConsole, attr); } -#if defined(POCO_WIN32_UTF8) - if (_isFile) - { - DWORD written; - WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, NULL); - } - else - { - std::wstring utext; - UnicodeConverter::toUTF16(text, utext); - DWORD written; - WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, NULL); - } -#else DWORD written; WriteFile(_hConsole, text.data(), text.size(), &written, NULL); -#endif if (_enableColors && !_isFile) { diff --git a/base/poco/Foundation/src/gzguts.h b/base/poco/Foundation/src/gzguts.h index 2cbe1e4baec..1b964756065 100644 --- a/base/poco/Foundation/src/gzguts.h +++ b/base/poco/Foundation/src/gzguts.h @@ -31,15 +31,10 @@ #endif #include -#ifdef _WIN32 -# include -#endif -#ifndef _WIN32_WCE # if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) # include # endif -#endif #if defined(_WIN32) || defined(__CYGWIN__) # define WIDECHAR #endif @@ -61,11 +56,6 @@ # endif #endif -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif #ifndef HAVE_VSNPRINTF # ifdef __TURBOC__ @@ -74,9 +64,7 @@ # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) -# if !defined(_MSC_VER) || (defined(_MSC_VER) && _MSC_VER < 1500) # define vsnprintf _vsnprintf -# endif # endif # endif # ifdef __SASC @@ -96,9 +84,6 @@ /* unlike snprintf (which is required in C99), _snprintf does not guarantee null termination of the result -- however this is only used in gzlib.c where the result is assured to fit in the space provided */ -#if defined(_MSC_VER) && _MSC_VER < 1900 -# define snprintf _snprintf -#endif #ifndef local # define local static diff --git a/base/poco/Foundation/src/pcre.h b/base/poco/Foundation/src/pcre.h index 763465e25df..82dd7850391 100644 --- a/base/poco/Foundation/src/pcre.h +++ b/base/poco/Foundation/src/pcre.h @@ -51,19 +51,6 @@ imported have to be identified as such. When building PCRE, the appropriate export setting is defined in pcre_internal.h, which includes this file. So we don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */ -#if defined(_WIN32) && !defined(PCRE_STATIC) -# ifndef PCRE_EXP_DECL -# define PCRE_EXP_DECL extern __declspec(dllimport) -# endif -# ifdef __cplusplus -# ifndef PCRECPP_EXP_DECL -# define PCRECPP_EXP_DECL extern __declspec(dllimport) -# endif -# ifndef PCRECPP_EXP_DEFN -# define PCRECPP_EXP_DEFN __declspec(dllimport) -# endif -# endif -#endif /* By default, we use the standard "extern" declarations. */ diff --git a/base/poco/Foundation/src/pcre_internal.h b/base/poco/Foundation/src/pcre_internal.h index 6310e0010b3..360ddd87673 100644 --- a/base/poco/Foundation/src/pcre_internal.h +++ b/base/poco/Foundation/src/pcre_internal.h @@ -146,17 +146,6 @@ exported symbols. That's why, in the non-Windows case, we set PCRE_EXP_DEFN and PCRE_EXP_DATA_DEFN only if they are not already set. */ # ifndef PCRE_EXP_DECL -# ifdef _WIN32 -# ifndef PCRE_STATIC -# define PCRE_EXP_DECL extern __declspec(dllexport) -# define PCRE_EXP_DEFN __declspec(dllexport) -# define PCRE_EXP_DATA_DEFN __declspec(dllexport) -# else -# define PCRE_EXP_DECL extern -# define PCRE_EXP_DEFN -# define PCRE_EXP_DATA_DEFN -# endif -# else # ifdef __cplusplus # define PCRE_EXP_DECL extern "C" # else @@ -168,7 +157,6 @@ PCRE_EXP_DATA_DEFN only if they are not already set. */ # ifndef PCRE_EXP_DATA_DEFN # define PCRE_EXP_DATA_DEFN # endif -# endif # endif /* When compiling with the MSVC compiler, it is sometimes necessary to include diff --git a/base/poco/Foundation/src/utils.h b/base/poco/Foundation/src/utils.h index 4f33d7c3ba3..bdfdaed9833 100644 --- a/base/poco/Foundation/src/utils.h +++ b/base/poco/Foundation/src/utils.h @@ -59,12 +59,7 @@ || defined(__nios2__) # define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) -# if defined(_WIN32) -// Windows uses a 64bit wide floating point stack. -# define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 -# else # undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS -# endif // _WIN32 #else # error Target architecture was not detected as supported by Double-Conversion. #endif @@ -75,23 +70,9 @@ # define DOUBLE_CONVERSION_UNUSED #endif -#if defined(_WIN32) && !defined(__MINGW32__) - -typedef signed char int8_t; -typedef unsigned char uint8_t; -typedef short int16_t; // NOLINT -typedef unsigned short uint16_t; // NOLINT -typedef int int32_t; -typedef unsigned int uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -// intptr_t and friends are defined in crtdefs.h through stdio.h. - -#else # include -#endif // The following macro works on both 32 and 64-bit platforms. // Usage: instead of writing 0x1234567890123456 diff --git a/base/poco/Foundation/src/zutil.h b/base/poco/Foundation/src/zutil.h index 48dd5f69293..4deb4ec0db1 100644 --- a/base/poco/Foundation/src/zutil.h +++ b/base/poco/Foundation/src/zutil.h @@ -22,9 +22,7 @@ #include "zlib.h" #if defined(STDC) && !defined(Z_SOLO) -# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) # include -# endif # include # include #endif @@ -117,9 +115,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ # define OS_CODE 0x0b -# endif #endif #ifdef __50SERIES /* Prime/PRIMOS */ @@ -130,17 +126,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define fdopen(fd, mode) NULL /* No fdopen() */ #endif -#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX -# if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -# define fdopen(fd, mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED -typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd, type) _fdopen(fd, type) -# endif -#endif /* provide prototypes for these when building zlib without LFS */ #if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE - 0 == 0) diff --git a/base/poco/JSON/include/Poco/JSON/JSON.h b/base/poco/JSON/include/Poco/JSON/JSON.h index f0bef787be0..984aafd8649 100644 --- a/base/poco/JSON/include/Poco/JSON/JSON.h +++ b/base/poco/JSON/include/Poco/JSON/JSON.h @@ -31,13 +31,6 @@ // JSON_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(JSON_EXPORTS) -# define JSON_API __declspec(dllexport) -# else -# define JSON_API __declspec(dllimport) -# endif -#endif #if !defined(JSON_API) @@ -52,11 +45,6 @@ // // Automatically link JSON library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(JSON_EXPORTS) -# pragma comment(lib, "PocoJSON" POCO_LIB_SUFFIX) -# endif -#endif #endif // JSON_JSON_INCLUDED diff --git a/base/poco/MongoDB/include/Poco/MongoDB/MongoDB.h b/base/poco/MongoDB/include/Poco/MongoDB/MongoDB.h index de246ddc9dd..253f1f8ab27 100644 --- a/base/poco/MongoDB/include/Poco/MongoDB/MongoDB.h +++ b/base/poco/MongoDB/include/Poco/MongoDB/MongoDB.h @@ -33,13 +33,6 @@ // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(MongoDB_EXPORTS) -# define MongoDB_API __declspec(dllexport) -# else -# define MongoDB_API __declspec(dllimport) -# endif -#endif #if !defined(MongoDB_API) @@ -54,11 +47,6 @@ // // Automatically link MongoDB library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(MongoDB_EXPORTS) -# pragma comment(lib, "PocoMongoDB" POCO_LIB_SUFFIX) -# endif -#endif #endif // MongoDBMongoDB_INCLUDED diff --git a/base/poco/Net/include/Poco/Net/HostEntry.h b/base/poco/Net/include/Poco/Net/HostEntry.h index 98a441e56bd..f2b8a6c09c0 100644 --- a/base/poco/Net/include/Poco/Net/HostEntry.h +++ b/base/poco/Net/include/Poco/Net/HostEntry.h @@ -50,9 +50,6 @@ namespace Net /// Creates the HostEntry from the data in an addrinfo structure. #endif -#if defined(POCO_VXWORKS) - HostEntry(const std::string & name, const IPAddress & addr); -#endif HostEntry(const HostEntry & entry); /// Creates the HostEntry by copying another one. diff --git a/base/poco/Net/include/Poco/Net/IPAddress.h b/base/poco/Net/include/Poco/Net/IPAddress.h index c059f39f457..8f8b6fc1834 100644 --- a/base/poco/Net/include/Poco/Net/IPAddress.h +++ b/base/poco/Net/include/Poco/Net/IPAddress.h @@ -109,10 +109,6 @@ namespace Net IPAddress(unsigned prefix, Family family); /// Creates an IPAddress mask with the given length of prefix. -#if defined(_WIN32) - IPAddress(const SOCKET_ADDRESS & socket_address); - /// Creates an IPAddress from Windows SOCKET_ADDRESS structure. -#endif IPAddress(const struct sockaddr & sockaddr); /// Same for struct sock_addr on POSIX. diff --git a/base/poco/Net/include/Poco/Net/Net.h b/base/poco/Net/include/Poco/Net/Net.h index 6d9a6f6b4ac..1a5bb3ac1df 100644 --- a/base/poco/Net/include/Poco/Net/Net.h +++ b/base/poco/Net/include/Poco/Net/Net.h @@ -31,13 +31,6 @@ // Net_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(Net_EXPORTS) -# define Net_API __declspec(dllexport) -# else -# define Net_API __declspec(dllimport) -# endif -#endif #if !defined(Net_API) @@ -52,11 +45,6 @@ // // Automatically link Net library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Net_EXPORTS) -# pragma comment(lib, "PocoNet" POCO_LIB_SUFFIX) -# endif -#endif // Default to enabled IPv6 support if not explicitly disabled @@ -91,27 +79,6 @@ namespace Net // Automate network initialization (only relevant on Windows). // -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) && !defined(__GNUC__) - -extern "C" const struct Net_API NetworkInitializer pocoNetworkInitializer; - -# if defined(Net_EXPORTS) -# if defined(_WIN64) || defined(_WIN32_WCE) -# define POCO_NET_FORCE_SYMBOL(s) __pragma(comment(linker, "/export:" # s)) -# elif defined(_WIN32) -# define POCO_NET_FORCE_SYMBOL(s) __pragma(comment(linker, "/export:_" # s)) -# endif -# else // !Net_EXPORTS -# if defined(_WIN64) || defined(_WIN32_WCE) -# define POCO_NET_FORCE_SYMBOL(s) __pragma(comment(linker, "/include:" # s)) -# elif defined(_WIN32) -# define POCO_NET_FORCE_SYMBOL(s) __pragma(comment(linker, "/include:_" # s)) -# endif -# endif // Net_EXPORTS - -POCO_NET_FORCE_SYMBOL(pocoNetworkInitializer) - -#endif // POCO_OS_FAMILY_WINDOWS // diff --git a/base/poco/Net/include/Poco/Net/NetworkInterface.h b/base/poco/Net/include/Poco/Net/NetworkInterface.h index 58685786c88..11a7eca116e 100644 --- a/base/poco/Net/include/Poco/Net/NetworkInterface.h +++ b/base/poco/Net/include/Poco/Net/NetworkInterface.h @@ -100,11 +100,7 @@ namespace Net }; static const unsigned NO_INDEX = ~0; -# if defined(POCO_OS_FAMILY_WINDOWS) - static const char MAC_SEPARATOR = '-'; -# else static const char MAC_SEPARATOR = ':'; -# endif NetworkInterface(unsigned index = NO_INDEX); /// Creates a NetworkInterface representing the diff --git a/base/poco/Net/include/Poco/Net/SocketDefs.h b/base/poco/Net/include/Poco/Net/SocketDefs.h index 83694ffba8c..5571633e91c 100644 --- a/base/poco/Net/include/Poco/Net/SocketDefs.h +++ b/base/poco/Net/include/Poco/Net/SocketDefs.h @@ -21,113 +21,7 @@ #define POCO_ENOERR 0 -#if defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/UnWindows.h" -# include -# include -# define POCO_INVALID_SOCKET INVALID_SOCKET -# define poco_socket_t SOCKET -# define poco_socklen_t int -# define poco_ioctl_request_t int -# define poco_closesocket(s) closesocket(s) -# define POCO_EINTR WSAEINTR -# define POCO_EACCES WSAEACCES -# define POCO_EFAULT WSAEFAULT -# define POCO_EINVAL WSAEINVAL -# define POCO_EMFILE WSAEMFILE -# define POCO_EAGAIN WSAEWOULDBLOCK -# define POCO_EWOULDBLOCK WSAEWOULDBLOCK -# define POCO_EINPROGRESS WSAEINPROGRESS -# define POCO_EALREADY WSAEALREADY -# define POCO_ENOTSOCK WSAENOTSOCK -# define POCO_EDESTADDRREQ WSAEDESTADDRREQ -# define POCO_EMSGSIZE WSAEMSGSIZE -# define POCO_EPROTOTYPE WSAEPROTOTYPE -# define POCO_ENOPROTOOPT WSAENOPROTOOPT -# define POCO_EPROTONOSUPPORT WSAEPROTONOSUPPORT -# define POCO_ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT -# define POCO_ENOTSUP WSAEOPNOTSUPP -# define POCO_EPFNOSUPPORT WSAEPFNOSUPPORT -# define POCO_EAFNOSUPPORT WSAEAFNOSUPPORT -# define POCO_EADDRINUSE WSAEADDRINUSE -# define POCO_EADDRNOTAVAIL WSAEADDRNOTAVAIL -# define POCO_ENETDOWN WSAENETDOWN -# define POCO_ENETUNREACH WSAENETUNREACH -# define POCO_ENETRESET WSAENETRESET -# define POCO_ECONNABORTED WSAECONNABORTED -# define POCO_ECONNRESET WSAECONNRESET -# define POCO_ENOBUFS WSAENOBUFS -# define POCO_EISCONN WSAEISCONN -# define POCO_ENOTCONN WSAENOTCONN -# define POCO_ESHUTDOWN WSAESHUTDOWN -# define POCO_ETIMEDOUT WSAETIMEDOUT -# define POCO_ECONNREFUSED WSAECONNREFUSED -# define POCO_EHOSTDOWN WSAEHOSTDOWN -# define POCO_EHOSTUNREACH WSAEHOSTUNREACH -# define POCO_ESYSNOTREADY WSASYSNOTREADY -# define POCO_ENOTINIT WSANOTINITIALISED -# define POCO_HOST_NOT_FOUND WSAHOST_NOT_FOUND -# define POCO_TRY_AGAIN WSATRY_AGAIN -# define POCO_NO_RECOVERY WSANO_RECOVERY -# define POCO_NO_DATA WSANO_DATA -# ifndef ADDRESS_FAMILY -# define ADDRESS_FAMILY USHORT -# endif -#elif defined(POCO_VXWORKS) -# include -# include -# include -# include -# include -# include -# include -# include -# define POCO_INVALID_SOCKET -1 -# define poco_socket_t int -# define poco_socklen_t int -# define poco_ioctl_request_t int -# define poco_closesocket(s) ::close(s) -# define POCO_EINTR EINTR -# define POCO_EACCES EACCES -# define POCO_EFAULT EFAULT -# define POCO_EINVAL EINVAL -# define POCO_EMFILE EMFILE -# define POCO_EAGAIN EAGAIN -# define POCO_EWOULDBLOCK EWOULDBLOCK -# define POCO_EINPROGRESS EINPROGRESS -# define POCO_EALREADY EALREADY -# define POCO_ENOTSOCK ENOTSOCK -# define POCO_EDESTADDRREQ EDESTADDRREQ -# define POCO_EMSGSIZE EMSGSIZE -# define POCO_EPROTOTYPE EPROTOTYPE -# define POCO_ENOPROTOOPT ENOPROTOOPT -# define POCO_EPROTONOSUPPORT EPROTONOSUPPORT -# define POCO_ESOCKTNOSUPPORT ESOCKTNOSUPPORT -# define POCO_ENOTSUP ENOTSUP -# define POCO_EPFNOSUPPORT EPFNOSUPPORT -# define POCO_EAFNOSUPPORT EAFNOSUPPORT -# define POCO_EADDRINUSE EADDRINUSE -# define POCO_EADDRNOTAVAIL EADDRNOTAVAIL -# define POCO_ENETDOWN ENETDOWN -# define POCO_ENETUNREACH ENETUNREACH -# define POCO_ENETRESET ENETRESET -# define POCO_ECONNABORTED ECONNABORTED -# define POCO_ECONNRESET ECONNRESET -# define POCO_ENOBUFS ENOBUFS -# define POCO_EISCONN EISCONN -# define POCO_ENOTCONN ENOTCONN -# define POCO_ESHUTDOWN ESHUTDOWN -# define POCO_ETIMEDOUT ETIMEDOUT -# define POCO_ECONNREFUSED ECONNREFUSED -# define POCO_EHOSTDOWN EHOSTDOWN -# define POCO_EHOSTUNREACH EHOSTUNREACH -# define POCO_ESYSNOTREADY -4 -# define POCO_ENOTINIT -5 -# define POCO_HOST_NOT_FOUND HOST_NOT_FOUND -# define POCO_TRY_AGAIN TRY_AGAIN -# define POCO_NO_RECOVERY NO_RECOVERY -# define POCO_NO_DATA NO_DATA -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) # include # include # include @@ -328,11 +222,7 @@ extern "C" { #if !defined(s6_addr16) -# if defined(POCO_OS_FAMILY_WINDOWS) -# define s6_addr16 u.Word -# else # define s6_addr16 __u6_addr.__u6_addr16 -# endif #endif diff --git a/base/poco/Net/include/Poco/Net/SocketImpl.h b/base/poco/Net/include/Poco/Net/SocketImpl.h index 3f7337af63b..e08d49be7a2 100644 --- a/base/poco/Net/include/Poco/Net/SocketImpl.h +++ b/base/poco/Net/include/Poco/Net/SocketImpl.h @@ -485,11 +485,7 @@ namespace Net inline int SocketImpl::lastError() { -#if defined(_WIN32) - return WSAGetLastError(); -#else return errno; -#endif } diff --git a/base/poco/Net/src/DNS.cpp b/base/poco/Net/src/DNS.cpp index 9ed5a49cef2..fdcc7782406 100644 --- a/base/poco/Net/src/DNS.cpp +++ b/base/poco/Net/src/DNS.cpp @@ -87,12 +87,6 @@ HostEntry DNS::hostByName(const std::string& hostname, unsigned { aierror(rc, hostname); } -#elif defined(POCO_VXWORKS) - int addr = hostGetByName(const_cast(hostname.c_str())); - if (addr != ERROR) - { - return HostEntry(hostname, IPAddress(&addr, sizeof(addr))); - } #else struct hostent* he = gethostbyname(hostname.c_str()); if (he) @@ -141,12 +135,6 @@ HostEntry DNS::hostByAddress(const IPAddress& address, unsigned { aierror(rc, address.toString()); } -#elif defined(POCO_VXWORKS) - char name[MAXHOSTNAMELEN + 1]; - if (hostGetByAddr(*reinterpret_cast(address.addr()), name) == OK) - { - return HostEntry(std::string(name), address); - } #else struct hostent* he = gethostbyaddr(reinterpret_cast(address.addr()), address.length(), address.af()); if (he) @@ -330,13 +318,7 @@ std::string DNS::decodeIDNLabel(const std::string& encodedIDN) int DNS::lastError() { -#if defined(_WIN32) - return GetLastError(); -#elif defined(POCO_VXWORKS) - return errno; -#else return h_errno; -#endif } @@ -371,11 +353,9 @@ void DNS::aierror(int code, const std::string& arg) throw DNSException("Temporary DNS error while resolving", arg); case EAI_FAIL: throw DNSException("Non recoverable DNS error while resolving", arg); -#if !defined(_WIN32) // EAI_NODATA and EAI_NONAME have the same value #if defined(EAI_NODATA) // deprecated in favor of EAI_NONAME on FreeBSD case EAI_NODATA: throw NoAddressFoundException(arg); -#endif #endif case EAI_NONAME: throw HostNotFoundException(arg); @@ -383,10 +363,6 @@ void DNS::aierror(int code, const std::string& arg) case EAI_SYSTEM: error(lastError(), arg); break; -#endif -#if defined(_WIN32) - case WSANO_DATA: // may happen on XP - throw HostNotFoundException(arg); #endif default: throw DNSException("EAI", gai_strerror(code)); diff --git a/base/poco/Net/src/HTTPServerConnection.cpp b/base/poco/Net/src/HTTPServerConnection.cpp index a6c27ce8c9e..c57984b0162 100644 --- a/base/poco/Net/src/HTTPServerConnection.cpp +++ b/base/poco/Net/src/HTTPServerConnection.cpp @@ -148,11 +148,7 @@ void HTTPServerConnection::onServerStopped(const bool& abortCurrent) // Note: On Windows, select() will not return if one of its socket is being // shut down. Therefore we have to call close(), which works better. // On other platforms, we do the more graceful thing. -#if defined(_WIN32) - socket().close(); -#else socket().shutdown(); -#endif } catch (...) { @@ -164,11 +160,7 @@ void HTTPServerConnection::onServerStopped(const bool& abortCurrent) try { -#if defined(_WIN32) - socket().close(); -#else socket().shutdown(); -#endif } catch (...) { diff --git a/base/poco/Net/src/HostEntry.cpp b/base/poco/Net/src/HostEntry.cpp index 3257c703113..19d8d2ed73d 100644 --- a/base/poco/Net/src/HostEntry.cpp +++ b/base/poco/Net/src/HostEntry.cpp @@ -86,17 +86,6 @@ HostEntry::HostEntry(struct addrinfo* ainfo) #endif // POCO_HAVE_IPv6 -#if defined(POCO_VXWORKS) - - -HostEntry::HostEntry(const std::string& name, const IPAddress& addr): - _name(name) -{ - _addresses.push_back(addr); -} - - -#endif // POCO_VXWORKS HostEntry::HostEntry(const HostEntry& entry): diff --git a/base/poco/Net/src/ICMPv4PacketImpl.cpp b/base/poco/Net/src/ICMPv4PacketImpl.cpp index 7df987a6fdd..f38e4ad1ea0 100644 --- a/base/poco/Net/src/ICMPv4PacketImpl.cpp +++ b/base/poco/Net/src/ICMPv4PacketImpl.cpp @@ -17,9 +17,7 @@ #include "Poco/Timestamp.h" #include "Poco/Timespan.h" #include "Poco/NumberFormatter.h" -#if !defined(POCO_VXWORKS) #include "Poco/Process.h" -#endif #include @@ -131,11 +129,7 @@ void ICMPv4PacketImpl::initPacket() icp->code = 0; icp->checksum = 0; icp->seq = ++_seq; -#if defined(POCO_VXWORKS) - icp->id = 0; -#else icp->id = static_cast(Poco::Process::id()); -#endif struct timeval* ptp = (struct timeval *) (icp + 1); *ptp = time(); @@ -185,11 +179,7 @@ Poco::UInt8* ICMPv4PacketImpl::data(Poco::UInt8* buffer, int length) const bool ICMPv4PacketImpl::validReplyID(Poco::UInt8* buffer, int length) const { Header *icp = header(buffer, length); -#if defined(POCO_VXWORKS) - return icp && icp->id == 0; -#else return icp && (static_cast(Process::id()) == icp->id); -#endif } diff --git a/base/poco/Net/src/IPAddress.cpp b/base/poco/Net/src/IPAddress.cpp index e34a02181b2..5a7281e4be4 100644 --- a/base/poco/Net/src/IPAddress.cpp +++ b/base/poco/Net/src/IPAddress.cpp @@ -42,14 +42,12 @@ namespace Poco { namespace Net { -#if !defined(_MSC_VER) || defined(__STDC__) // Go home MSVC, you're drunk... // See http://stackoverflow.com/questions/5899857/multiple-definition-error-for-static-const-class-members const IPAddress::Family IPAddress::IPv4; #if defined(POCO_HAVE_IPv6) const IPAddress::Family IPAddress::IPv6; #endif -#endif IPAddress::IPAddress() @@ -184,21 +182,6 @@ IPAddress::IPAddress(unsigned prefix, Family family) } -#if defined(_WIN32) -IPAddress::IPAddress(const SOCKET_ADDRESS& socket_address) - : _pImpl(0) -{ - ADDRESS_FAMILY family = socket_address.lpSockaddr->sa_family; - if (family == AF_INET) - newIPv4(&reinterpret_cast(socket_address.lpSockaddr)->sin_addr); -#if defined(POCO_HAVE_IPv6) - else if (family == AF_INET6) - newIPv6(&reinterpret_cast(socket_address.lpSockaddr)->sin6_addr, - reinterpret_cast(socket_address.lpSockaddr)->sin6_scope_id); -#endif - else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); -} -#endif IPAddress::IPAddress(const struct sockaddr& sockaddr) diff --git a/base/poco/Net/src/IPAddressImpl.cpp b/base/poco/Net/src/IPAddressImpl.cpp index f867acf8906..ec789bdd64d 100644 --- a/base/poco/Net/src/IPAddressImpl.cpp +++ b/base/poco/Net/src/IPAddressImpl.cpp @@ -256,14 +256,6 @@ bool IPv4AddressImpl::isGlobalMC() const IPv4AddressImpl IPv4AddressImpl::parse(const std::string& addr) { if (addr.empty()) return IPv4AddressImpl(); -#if defined(_WIN32) - struct in_addr ia; - ia.s_addr = inet_addr(addr.c_str()); - if (ia.s_addr == INADDR_NONE && addr != "255.255.255.255") - return IPv4AddressImpl(); - else - return IPv4AddressImpl(&ia); -#else #if __GNUC__ < 3 || defined(POCO_VXWORKS) struct in_addr ia; ia.s_addr = inet_addr(const_cast(addr.c_str())); @@ -278,7 +270,6 @@ IPv4AddressImpl IPv4AddressImpl::parse(const std::string& addr) else return IPv4AddressImpl(); #endif -#endif } @@ -388,20 +379,6 @@ IPv6AddressImpl::IPv6AddressImpl(unsigned prefix): _scope(0) { unsigned i = 0; -#ifdef POCO_OS_FAMILY_WINDOWS - for (; prefix >= 16; ++i, prefix -= 16) - { - _addr.s6_addr16[i] = 0xffff; - } - if (prefix > 0) - { - _addr.s6_addr16[i++] = ByteOrder::toNetwork(static_cast(~(0xffff >> prefix))); - } - while (i < 8) - { - _addr.s6_addr16[i++] = 0; - } -#else for (; prefix >= 32; ++i, prefix -= 32) { _addr.s6_addr32[i] = 0xffffffff; @@ -414,7 +391,6 @@ IPv6AddressImpl::IPv6AddressImpl(unsigned prefix): { _addr.s6_addr32[i++] = 0; } -#endif } @@ -467,9 +443,6 @@ std::string IPv6AddressImpl::toString() const if (_scope > 0) { result.append("%"); -#if defined(_WIN32) - NumberFormatter::append(result, _scope); -#else char buffer[IFNAMSIZ]; if (if_indextoname(_scope, buffer)) { @@ -479,7 +452,6 @@ std::string IPv6AddressImpl::toString() const { NumberFormatter::append(result, _scope); } -#endif } return toLower(result); } @@ -522,14 +494,6 @@ unsigned IPv6AddressImpl::prefixLength() const bitPos -= 32; } return 0; -#elif defined(POCO_OS_FAMILY_WINDOWS) - for (int i = 7; i >= 0; --i) - { - unsigned short addr = ByteOrder::fromNetwork(_addr.s6_addr16[i]); - if ((bits = maskBits(addr, 16))) return (bitPos - (16 - bits)); - bitPos -= 16; - } - return 0; #else #warning prefixLength() not implemented throw NotImplementedException("prefixLength() not implemented"); @@ -645,20 +609,6 @@ bool IPv6AddressImpl::isGlobalMC() const IPv6AddressImpl IPv6AddressImpl::parse(const std::string& addr) { if (addr.empty()) return IPv6AddressImpl(); -#if defined(_WIN32) - struct addrinfo* pAI; - struct addrinfo hints; - std::memset(&hints, 0, sizeof(hints)); - hints.ai_flags = AI_NUMERICHOST; - int rc = getaddrinfo(addr.c_str(), NULL, &hints, &pAI); - if (rc == 0) - { - IPv6AddressImpl result = IPv6AddressImpl(&reinterpret_cast(pAI->ai_addr)->sin6_addr, static_cast(reinterpret_cast(pAI->ai_addr)->sin6_scope_id)); - freeaddrinfo(pAI); - return result; - } - else return IPv6AddressImpl(); -#else struct in6_addr ia; std::string::size_type pos = addr.find('%'); if (std::string::npos != pos) @@ -681,7 +631,6 @@ IPv6AddressImpl IPv6AddressImpl::parse(const std::string& addr) else return IPv6AddressImpl(); } -#endif } @@ -703,21 +652,10 @@ IPv6AddressImpl IPv6AddressImpl::operator & (const IPv6AddressImpl& addr) const throw Poco::InvalidArgumentException("Scope ID of passed IPv6 address does not match with the source one."); IPv6AddressImpl result(*this); -#ifdef POCO_OS_FAMILY_WINDOWS - result._addr.s6_addr16[0] &= addr._addr.s6_addr16[0]; - result._addr.s6_addr16[1] &= addr._addr.s6_addr16[1]; - result._addr.s6_addr16[2] &= addr._addr.s6_addr16[2]; - result._addr.s6_addr16[3] &= addr._addr.s6_addr16[3]; - result._addr.s6_addr16[4] &= addr._addr.s6_addr16[4]; - result._addr.s6_addr16[5] &= addr._addr.s6_addr16[5]; - result._addr.s6_addr16[6] &= addr._addr.s6_addr16[6]; - result._addr.s6_addr16[7] &= addr._addr.s6_addr16[7]; -#else result._addr.s6_addr32[0] &= addr._addr.s6_addr32[0]; result._addr.s6_addr32[1] &= addr._addr.s6_addr32[1]; result._addr.s6_addr32[2] &= addr._addr.s6_addr32[2]; result._addr.s6_addr32[3] &= addr._addr.s6_addr32[3]; -#endif return result; } @@ -728,21 +666,10 @@ IPv6AddressImpl IPv6AddressImpl::operator | (const IPv6AddressImpl& addr) const throw Poco::InvalidArgumentException("Scope ID of passed IPv6 address does not match with the source one."); IPv6AddressImpl result(*this); -#ifdef POCO_OS_FAMILY_WINDOWS - result._addr.s6_addr16[0] |= addr._addr.s6_addr16[0]; - result._addr.s6_addr16[1] |= addr._addr.s6_addr16[1]; - result._addr.s6_addr16[2] |= addr._addr.s6_addr16[2]; - result._addr.s6_addr16[3] |= addr._addr.s6_addr16[3]; - result._addr.s6_addr16[4] |= addr._addr.s6_addr16[4]; - result._addr.s6_addr16[5] |= addr._addr.s6_addr16[5]; - result._addr.s6_addr16[6] |= addr._addr.s6_addr16[6]; - result._addr.s6_addr16[7] |= addr._addr.s6_addr16[7]; -#else result._addr.s6_addr32[0] |= addr._addr.s6_addr32[0]; result._addr.s6_addr32[1] |= addr._addr.s6_addr32[1]; result._addr.s6_addr32[2] |= addr._addr.s6_addr32[2]; result._addr.s6_addr32[3] |= addr._addr.s6_addr32[3]; -#endif return result; } @@ -754,21 +681,10 @@ IPv6AddressImpl IPv6AddressImpl::operator ^ (const IPv6AddressImpl& addr) const IPv6AddressImpl result(*this); -#ifdef POCO_OS_FAMILY_WINDOWS - result._addr.s6_addr16[0] ^= addr._addr.s6_addr16[0]; - result._addr.s6_addr16[1] ^= addr._addr.s6_addr16[1]; - result._addr.s6_addr16[2] ^= addr._addr.s6_addr16[2]; - result._addr.s6_addr16[3] ^= addr._addr.s6_addr16[3]; - result._addr.s6_addr16[4] ^= addr._addr.s6_addr16[4]; - result._addr.s6_addr16[5] ^= addr._addr.s6_addr16[5]; - result._addr.s6_addr16[6] ^= addr._addr.s6_addr16[6]; - result._addr.s6_addr16[7] ^= addr._addr.s6_addr16[7]; -#else result._addr.s6_addr32[0] ^= addr._addr.s6_addr32[0]; result._addr.s6_addr32[1] ^= addr._addr.s6_addr32[1]; result._addr.s6_addr32[2] ^= addr._addr.s6_addr32[2]; result._addr.s6_addr32[3] ^= addr._addr.s6_addr32[3]; -#endif return result; } @@ -776,21 +692,10 @@ IPv6AddressImpl IPv6AddressImpl::operator ^ (const IPv6AddressImpl& addr) const IPv6AddressImpl IPv6AddressImpl::operator ~ () const { IPv6AddressImpl result(*this); -#ifdef POCO_OS_FAMILY_WINDOWS - result._addr.s6_addr16[0] ^= 0xffff; - result._addr.s6_addr16[1] ^= 0xffff; - result._addr.s6_addr16[2] ^= 0xffff; - result._addr.s6_addr16[3] ^= 0xffff; - result._addr.s6_addr16[4] ^= 0xffff; - result._addr.s6_addr16[5] ^= 0xffff; - result._addr.s6_addr16[6] ^= 0xffff; - result._addr.s6_addr16[7] ^= 0xffff; -#else result._addr.s6_addr32[0] ^= 0xffffffff; result._addr.s6_addr32[1] ^= 0xffffffff; result._addr.s6_addr32[2] ^= 0xffffffff; result._addr.s6_addr32[3] ^= 0xffffffff; -#endif return result; } diff --git a/base/poco/Net/src/Net.cpp b/base/poco/Net/src/Net.cpp index e81b4b54590..2ddf8196563 100644 --- a/base/poco/Net/src/Net.cpp +++ b/base/poco/Net/src/Net.cpp @@ -25,52 +25,14 @@ namespace Net { void Net_API initializeNetwork() { -#if defined(POCO_OS_FAMILY_WINDOWS) - WORD version = MAKEWORD(2, 2); - WSADATA data; - if (WSAStartup(version, &data) != 0) - throw NetException("Failed to initialize network subsystem"); -#endif } void Net_API uninitializeNetwork() { -#if defined(POCO_OS_FAMILY_WINDOWS) - WSACleanup(); -#endif } } } // namespace Poco::Net -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) - - struct NetworkInitializer - /// Network initializer for windows statically - /// linked library. - { - NetworkInitializer() - /// Calls Poco::Net::initializeNetwork(); - { - Poco::Net::initializeNetwork(); - } - - ~NetworkInitializer() - /// Calls Poco::Net::uninitializeNetwork(); - { - try - { - Poco::Net::uninitializeNetwork(); - } - catch (...) - { - poco_unexpected(); - } - } - }; - - const NetworkInitializer pocoNetworkInitializer; - -#endif diff --git a/base/poco/Net/src/NetworkInterface.cpp b/base/poco/Net/src/NetworkInterface.cpp index e6279040e6e..0540c32b436 100644 --- a/base/poco/Net/src/NetworkInterface.cpp +++ b/base/poco/Net/src/NetworkInterface.cpp @@ -25,15 +25,6 @@ #include "Poco/StringTokenizer.h" #include "Poco/RefCountedObject.h" #include "Poco/Format.h" -#if defined(POCO_OS_FAMILY_WINDOWS) - #if defined(POCO_WIN32_UTF8) - #include "Poco/UnicodeConverter.h" - #endif - #include "Poco/Error.h" - #include - #include - #include -#endif #include #include #include @@ -123,12 +114,7 @@ public: bool running() const; bool up() const; -#if defined(POCO_OS_FAMILY_WINDOWS) - void setFlags(DWORD flags, DWORD iftype); - void setRunning(bool running); -#else void setFlags(short flags); -#endif void setUp(bool up); void setMTU(unsigned mtu); @@ -443,40 +429,6 @@ inline bool NetworkInterfaceImpl::up() const } -#if defined(POCO_OS_FAMILY_WINDOWS) - - -void NetworkInterfaceImpl::setFlags(DWORD flags, DWORD iftype) -{ - _running = _up = false; - switch (iftype) { - case IF_TYPE_ETHERNET_CSMACD: - case IF_TYPE_ISO88025_TOKENRING: - case IF_TYPE_IEEE80211: - _multicast = _broadcast = true; - break; - case IF_TYPE_SOFTWARE_LOOPBACK: - _loopback = true; - break; - case IF_TYPE_PPP: - case IF_TYPE_ATM: - case IF_TYPE_TUNNEL: - case IF_TYPE_IEEE1394: - _pointToPoint = true; - break; - } - if (!(flags & IP_ADAPTER_NO_MULTICAST)) - _multicast = true; -} - - -void NetworkInterfaceImpl::setRunning(bool running) -{ - _running = running; -} - - -#else void NetworkInterfaceImpl::setFlags(short flags) @@ -492,7 +444,6 @@ void NetworkInterfaceImpl::setFlags(short flags) } -#endif inline void NetworkInterfaceImpl::setUp(bool up) @@ -927,423 +878,7 @@ NetworkInterface::List NetworkInterface::list(bool ipOnly, bool upOnly) // -#if defined(POCO_OS_FAMILY_WINDOWS) -// -// Windows -// - - -#include "Poco/Buffer.h" -#include - - -namespace Poco { -namespace Net { - - -namespace { - - -IPAddress getBroadcastAddress(PIP_ADAPTER_PREFIX pPrefix, const IPAddress& addr, ULONG* pprefix = 0) - /// This function relies on (1) subnet prefix being at the position - /// immediately preceding and (2) broadcast address being at the position - /// immediately succeeding the IPv4 unicast address. - /// - /// Since there is no explicit guarantee on order, to ensure correctness, - /// the above constraints are checked prior to returning the result. - /// Additionally, on pre-Vista versions on Windows, the main structure does - /// not contain prefix length; for those platforms, this function - /// returns prefix through pprefix argument. -{ - PIP_ADAPTER_PREFIX pPrev = 0; - for (int i = 0; pPrefix; pPrefix = pPrefix->Next, ++i) - { - ADDRESS_FAMILY family = pPrefix->Address.lpSockaddr->sa_family; - if ((family == AF_INET) && (addr == IPAddress(pPrefix->Address))) - break; - pPrev = pPrefix; - } - - if (pPrefix && pPrefix->Next && pPrev) - { - IPAddress ipPrefix(pPrev->PrefixLength, IPAddress::IPv4); - IPAddress mask(pPrefix->Next->Address); - if ((ipPrefix & mask) == (ipPrefix & addr)) - { - if (pprefix) *pprefix = pPrefix->PrefixLength; - return IPAddress(pPrefix->Next->Address); - } - } - - return IPAddress(IPAddress::IPv4); -} - - -NetworkInterface::Type fromNative(DWORD type) -{ - switch (type) - { - case IF_TYPE_ETHERNET_CSMACD: return NetworkInterface::NI_TYPE_ETHERNET_CSMACD; - case IF_TYPE_ISO88025_TOKENRING: return NetworkInterface::NI_TYPE_ISO88025_TOKENRING; - case IF_TYPE_FRAMERELAY: return NetworkInterface::NI_TYPE_FRAMERELAY; - case IF_TYPE_PPP: return NetworkInterface::NI_TYPE_PPP; - case IF_TYPE_SOFTWARE_LOOPBACK: return NetworkInterface::NI_TYPE_SOFTWARE_LOOPBACK; - case IF_TYPE_ATM: return NetworkInterface::NI_TYPE_ATM; - case IF_TYPE_IEEE80211: return NetworkInterface::NI_TYPE_IEEE80211; - case IF_TYPE_TUNNEL: return NetworkInterface::NI_TYPE_TUNNEL; - case IF_TYPE_IEEE1394: return NetworkInterface::NI_TYPE_IEEE1394; - default: return NetworkInterface::NI_TYPE_OTHER; - } -} - - -IPAddress subnetMaskForInterface(const std::string& name, bool isLoopback) -{ - if (isLoopback) - { - return IPAddress::parse("255.0.0.0"); - } - else - { -#if !defined(_WIN32_WCE) - std::string subKey("SYSTEM\\CurrentControlSet\\services\\Tcpip\\Parameters\\Interfaces\\"); - subKey += name; - std::string netmask; - HKEY hKey; -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - std::wstring usubKey; - Poco::UnicodeConverter::toUTF16(subKey, usubKey); - if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, usubKey.c_str(), 0, KEY_READ, &hKey) != ERROR_SUCCESS) - return IPAddress(); - wchar_t unetmask[16]; - DWORD size = sizeof(unetmask); - if (RegQueryValueExW(hKey, L"DhcpSubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) - { - if (RegQueryValueExW(hKey, L"SubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) - { - RegCloseKey(hKey); - return IPAddress(); - } - } - Poco::UnicodeConverter::toUTF8(unetmask, netmask); -#else - if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKey.c_str(), 0, KEY_READ, &hKey) != ERROR_SUCCESS) - return IPAddress(); - char unetmask[16]; - DWORD size = sizeof(unetmask); - if (RegQueryValueExA(hKey, "DhcpSubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) - { - if (RegQueryValueExA(hKey, "SubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) - { - RegCloseKey(hKey); - return IPAddress(); - } - } - netmask = unetmask; -#endif - RegCloseKey(hKey); - return IPAddress::parse(netmask); -#else - return IPAddress(); -#endif // !defined(_WIN32_WCE) - } -} - - -} /// namespace - - -NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) -{ - OSVERSIONINFO osvi; - ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&osvi); - - FastMutex::ScopedLock lock(_mutex); - Map result; - ULONG outBufLen = 16384; - Poco::Buffer memory(outBufLen); - ULONG flags = (GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER | GAA_FLAG_INCLUDE_PREFIX); -#ifdef GAA_FLAG_INCLUDE_ALL_INTERFACES - flags |= GAA_FLAG_INCLUDE_ALL_INTERFACES; -#endif -#if defined(POCO_HAVE_IPv6) - const unsigned family = AF_UNSPEC; //IPv4 and IPv6 -#else - const unsigned family = AF_INET; //IPv4 only -#endif - DWORD dwRetVal = 0; - ULONG iterations = 0; - PIP_ADAPTER_ADDRESSES pAddress = 0; - do - { - pAddress = reinterpret_cast(memory.begin()); // leave in the loop, begin may change after resize - poco_assert (memory.capacity() >= outBufLen); - if (ERROR_BUFFER_OVERFLOW == (dwRetVal = GetAdaptersAddresses(family, flags, 0, pAddress, &outBufLen))) - memory.resize(outBufLen, false); // adjust size and try again - else if (ERROR_NO_DATA == dwRetVal) // no network interfaces found - return result; - else if (NO_ERROR != dwRetVal) // error occurred - throw SystemException(format("An error occurred while trying to obtain list of network interfaces: [%s]", Error::getMessage(dwRetVal))); - else - break; - } - while ((ERROR_BUFFER_OVERFLOW == dwRetVal) && (++iterations <= 2)); - - poco_assert (NO_ERROR == dwRetVal); - for (; pAddress; pAddress = pAddress->Next) - { - IPAddress address; - IPAddress subnetMask; - IPAddress broadcastAddress; - unsigned ifIndex = 0; - -#if defined(POCO_HAVE_IPv6) - #if defined(_WIN32_WCE) - ifIndex = pAddress->Ipv6IfIndex; - #elif (_WIN32_WINNT >= 0x0501) && (NTDDI_VERSION >= 0x05010100) // Win XP SP1 - #if defined (IP_ADAPTER_IPV6_ENABLED) // Vista - if(osvi.dwMajorVersion>=6)//vista - { - if ((pAddress->Flags & IP_ADAPTER_IPV6_ENABLED) && - (osvi.dwMajorVersion >= 5) && - (osvi.dwMinorVersion >= 1) && - (osvi.dwBuildNumber >=1)) - { - ifIndex = pAddress->Ipv6IfIndex; - } - } - else - { - if ((osvi.dwMajorVersion >= 5) && - (osvi.dwMinorVersion >= 1) && - (osvi.dwBuildNumber >= 1)) - { - ifIndex = pAddress->Ipv6IfIndex; - } - } - #else // !defined(IP_ADAPTER_IPV6_ENABLED) - if ((osvi.dwMajorVersion >= 5) && - (osvi.dwMinorVersion >= 1) && - (osvi.dwBuildNumber >= 1)) - { - ifIndex = pAddress->Ipv6IfIndex; - } - #endif // defined(IP_ADAPTER_IPV6_ENABLED) - #endif // (_WIN32_WINNT >= 0x0501) && (NTDDI_VERSION >= 0x05010100) -#endif // POCO_HAVE_IPv6 - -#if defined (IP_ADAPTER_IPV4_ENABLED) - if(osvi.dwMajorVersion>=6) - {//vista - if (pAddress->Flags & IP_ADAPTER_IPV4_ENABLED) - { - ifIndex = pAddress->IfIndex; - } - } - else - { - ifIndex = pAddress->IfIndex; - } -#else // !IP_ADAPTER_IPV4_ENABLED - ifIndex = pAddress->IfIndex; -#endif - if (ifIndex == 0) continue; - - std::string name; - std::string displayName; - std::string adapterName(pAddress->AdapterName); -#ifdef POCO_WIN32_UTF8 - Poco::UnicodeConverter::toUTF8(pAddress->FriendlyName, name); - Poco::UnicodeConverter::toUTF8(pAddress->Description, displayName); -#else - char nameBuffer[1024]; - int rc = WideCharToMultiByte(CP_ACP, 0, pAddress->FriendlyName, -1, nameBuffer, sizeof(nameBuffer), NULL, NULL); - if (rc) name = nameBuffer; - char displayNameBuffer[1024]; - rc = WideCharToMultiByte(CP_ACP, 0, pAddress->Description, -1, displayNameBuffer, sizeof(displayNameBuffer), NULL, NULL); - if (rc) displayName = displayNameBuffer; -#endif - - bool isUp = (pAddress->OperStatus == IfOperStatusUp); - bool isIP = (0 != pAddress->FirstUnicastAddress); - if (((ipOnly && isIP) || !ipOnly) && ((upOnly && isUp) || !upOnly)) - { - NetworkInterface ni(name, displayName, adapterName, ifIndex); - // Create interface even if it has an empty list of addresses; also, set - // physical attributes which are protocol independent (name, media type, - // MAC address, MTU, operational status, etc). - Map::iterator ifIt = result.find(ifIndex); - if (ifIt == result.end()) - ifIt = result.insert(Map::value_type(ifIndex, ni)).first; - - ifIt->second.impl().setFlags(pAddress->Flags, pAddress->IfType); - ifIt->second.impl().setMTU(pAddress->Mtu); - ifIt->second.impl().setUp(pAddress->OperStatus == IfOperStatusUp); -#if (_WIN32_WINNT >= 0x0600) // Vista and newer only - if ((osvi.dwMajorVersion >= 6) && - (osvi.dwMinorVersion >= 0) && - (osvi.dwBuildNumber >= 0)) - { - ifIt->second.impl().setRunning(pAddress->ReceiveLinkSpeed > 0 || pAddress->TransmitLinkSpeed > 0); - } -#endif - ifIt->second.impl().setType(fromNative(pAddress->IfType)); - if (pAddress->PhysicalAddressLength) - ifIt->second.impl().setMACAddress(pAddress->PhysicalAddress, pAddress->PhysicalAddressLength); - - for (PIP_ADAPTER_UNICAST_ADDRESS pUniAddr = pAddress->FirstUnicastAddress; - pUniAddr; - pUniAddr = pUniAddr->Next) - { - address = IPAddress(pUniAddr->Address); - ADDRESS_FAMILY family = pUniAddr->Address.lpSockaddr->sa_family; - switch (family) - { - case AF_INET: - { - // Windows lists broadcast address on localhost - bool hasBroadcast = (pAddress->IfType == IF_TYPE_ETHERNET_CSMACD) || (pAddress->IfType == IF_TYPE_SOFTWARE_LOOPBACK) || (pAddress->IfType == IF_TYPE_IEEE80211); - if (hasBroadcast) - { - // On Windows, a valid broadcast address will be all 1's (== address | ~subnetMask); additionally, on pre-Vista versions of - // OS, master address structure does not contain member for prefix length; we go an extra mile here in order to make sure - // we reflect the actual values held by system and protect against misconfiguration (e.g. bad DHCP config entry) - ULONG prefixLength = 0; -#if defined(_WIN32_WCE) - #if _WIN32_WCE >= 0x0800 - prefixLength = pUniAddr->OnLinkPrefixLength; - broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address); - #else - broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address, &prefixLength); - #endif - // if previous call did not do it, make last-ditch attempt for prefix and broadcast - if (prefixLength == 0 && pAddress->FirstPrefix) - prefixLength = pAddress->FirstPrefix->PrefixLength; - poco_assert (prefixLength <= 32); - if (broadcastAddress.isWildcard()) - { - IPAddress mask(static_cast(prefixLength), IPAddress::IPv4); - IPAddress host(mask & address); - broadcastAddress = host | ~mask; - } -#elif (_WIN32_WINNT >= 0x0501) && (NTDDI_VERSION >= 0x05010100) // Win XP SP1 - #if (_WIN32_WINNT >= 0x0600) // Vista and newer - if (osvi.dwMajorVersion >= 6) - { - prefixLength = pUniAddr->OnLinkPrefixLength; - broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address); - } - else - { - broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address, &prefixLength); - } - #else - broadcastAddress = getBroadcastAddress(pAddress->FirstPrefix, address, &prefixLength); - #endif - poco_assert (prefixLength <= 32); - if (broadcastAddress.isWildcard()) - { - IPAddress mask(static_cast(prefixLength), IPAddress::IPv4); - IPAddress host(mask & address); - broadcastAddress = host | ~mask; - } -#endif // (_WIN32_WINNT >= 0x0501) && (NTDDI_VERSION >= 0x05010100) - if (prefixLength) - { - subnetMask = IPAddress(static_cast(prefixLength), IPAddress::IPv4); - } - else // if all of the above fails, look up the subnet mask in the registry - { - address = IPAddress(&reinterpret_cast(pUniAddr->Address.lpSockaddr)->sin_addr, sizeof(in_addr)); - subnetMask = subnetMaskForInterface(name, address.isLoopback()); - if (!address.isLoopback()) - { - broadcastAddress = address; - broadcastAddress.mask(subnetMask, IPAddress::broadcast()); - } - } - ifIt->second.addAddress(address, subnetMask, broadcastAddress); - } - else - { - ifIt->second.addAddress(address); - } - } - break; -#if defined(POCO_HAVE_IPv6) - case AF_INET6: - ifIt->second.addAddress(address); - break; -#endif - } // switch family - } // for addresses - } // if ipOnly/upOnly - } // for adapters - return result; -} - - -} } // namespace Poco::Net - - -#elif defined(POCO_VXWORKS) -// -// VxWorks -// - -#error TODO - -/* -namespace Poco { -namespace Net { - - -NetworkInterface::NetworkInterfaceList NetworkInterface::list() -{ - FastMutex::ScopedLock lock(_mutex); - NetworkInterfaceList result; - - int ifIndex = 1; - char ifName[32]; - char ifAddr[INET_ADDR_LEN]; - - for (;;) - { - if (ifIndexToIfName(ifIndex, ifName) == OK) - { - std::string name(ifName); - IPAddress addr; - IPAddress mask; - IPAddress bcst; - if (ifAddrGet(ifName, ifAddr) == OK) - { - addr = IPAddress(std::string(ifAddr)); - } - int ifMask; - if (ifMaskGet(ifName, &ifMask) == OK) - { - mask = IPAddress(&ifMask, sizeof(ifMask)); - } - if (ifBroadcastGet(ifName, ifAddr) == OK) - { - bcst = IPAddress(std::string(ifAddr)); - } - result.push_back(NetworkInterface(name, name, name, addr, mask, bcst)); - ifIndex++; - } - else break; - } - - return result; -} - - -} } // namespace Poco::Net -*/ - -#elif defined(POCO_OS_FAMILY_BSD) || (POCO_OS == POCO_OS_QNX) || (POCO_OS == POCO_OS_SOLARIS) +#if defined(POCO_OS_FAMILY_BSD) || (POCO_OS == POCO_OS_QNX) || (POCO_OS == POCO_OS_SOLARIS) // // BSD variants, QNX(?) and Solaris // diff --git a/base/poco/Net/src/PollSet.cpp b/base/poco/Net/src/PollSet.cpp index ff580fc39cb..36acc912990 100644 --- a/base/poco/Net/src/PollSet.cpp +++ b/base/poco/Net/src/PollSet.cpp @@ -21,11 +21,7 @@ #include #endif -#if defined(_WIN32) && _WIN32_WINNT >= 0x0600 -#ifndef POCO_HAVE_FD_POLL -#define POCO_HAVE_FD_POLL 1 -#endif -#elif defined(POCO_OS_FAMILY_BSD) +#if defined(POCO_OS_FAMILY_BSD) #ifndef POCO_HAVE_FD_POLL #define POCO_HAVE_FD_POLL 1 #endif @@ -35,10 +31,8 @@ #if defined(POCO_HAVE_FD_EPOLL) #include #elif defined(POCO_HAVE_FD_POLL) -#ifndef _WIN32 #include #endif -#endif namespace Poco { @@ -296,11 +290,7 @@ public: do { Poco::Timestamp start; -#ifdef _WIN32 - rc = WSAPoll(&_pollfds[0], _pollfds.size(), static_cast(timeout.totalMilliseconds())); -#else rc = ::poll(&_pollfds[0], _pollfds.size(), timeout.totalMilliseconds()); -#endif if (rc < 0 && SocketImpl::lastError() == POCO_EINTR) { Poco::Timestamp end; @@ -330,10 +320,6 @@ public: result[its->second] |= PollSet::POLL_WRITE; if (it->revents & POLLERR) result[its->second] |= PollSet::POLL_ERROR; -#ifdef _WIN32 - if (it->revents & POLLHUP) - result[its->second] |= PollSet::POLL_READ; -#endif } it->revents = 0; } diff --git a/base/poco/Net/src/SocketAddress.cpp b/base/poco/Net/src/SocketAddress.cpp index 0782ca3eea3..fb7c39373d6 100644 --- a/base/poco/Net/src/SocketAddress.cpp +++ b/base/poco/Net/src/SocketAddress.cpp @@ -56,7 +56,6 @@ struct AFLT // -#if !defined(_MSC_VER) || defined(__STDC__) // Go home MSVC, you're drunk... // See http://stackoverflow.com/questions/5899857/multiple-definition-error-for-static-const-class-members const SocketAddress::Family SocketAddress::IPv4; @@ -66,7 +65,6 @@ const SocketAddress::Family SocketAddress::IPv6; #if defined(POCO_OS_FAMILY_UNIX) const SocketAddress::Family SocketAddress::UNIX_LOCAL; #endif -#endif SocketAddress::SocketAddress() @@ -393,15 +391,11 @@ Poco::UInt16 SocketAddress::resolveService(const std::string& service) } else { -#if defined(POCO_VXWORKS) - throw ServiceNotFoundException(service); -#else struct servent* se = getservbyname(service.c_str(), NULL); if (se) return ntohs(se->s_port); else throw ServiceNotFoundException(service); -#endif } } diff --git a/base/poco/Net/src/SocketImpl.cpp b/base/poco/Net/src/SocketImpl.cpp index 160ff6bd62b..2aba413b322 100644 --- a/base/poco/Net/src/SocketImpl.cpp +++ b/base/poco/Net/src/SocketImpl.cpp @@ -20,11 +20,7 @@ #include // FD_SET needs memset on some platforms, so we can't use -#if defined(_WIN32) && _WIN32_WINNT >= 0x0600 -#ifndef POCO_HAVE_FD_POLL -#define POCO_HAVE_FD_POLL 1 -#endif -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) #ifndef POCO_HAVE_FD_POLL #define POCO_HAVE_FD_POLL 1 #endif @@ -32,10 +28,8 @@ #if defined(POCO_HAVE_FD_POLL) -#ifndef _WIN32 #include #endif -#endif #if defined(sun) || defined(__sun) || defined(__sun__) @@ -44,9 +38,6 @@ #endif -#ifdef POCO_OS_FAMILY_WINDOWS -#include -#endif using Poco::IOException; @@ -64,13 +55,6 @@ bool checkIsBrokenTimeout() { #if defined(POCO_BROKEN_TIMEOUTS) return true; -#elif defined(POCO_OS_FAMILY_WINDOWS) - // on Windows 7 and lower, socket timeouts have a minimum of 500ms, use poll for timeouts on this case - // https://social.msdn.microsoft.com/Forums/en-US/76620f6d-22b1-4872-aaf0-833204f3f867/minimum-timeout-value-for-sorcvtimeo - OSVERSIONINFO vi; - vi.dwOSVersionInfoSize = sizeof(vi); - if (GetVersionEx(&vi) == 0) return true; //throw SystemException("Cannot get OS version information"); - return vi.dwMajorVersion < 6 || (vi.dwMajorVersion == 6 && vi.dwMinorVersion < 2); #endif return false; } @@ -130,11 +114,7 @@ void SocketImpl::connect(const SocketAddress& address) int rc; do { -#if defined(POCO_VXWORKS) - rc = ::connect(_sockfd, (sockaddr*) address.addr(), address.length()); -#else rc = ::connect(_sockfd, address.addr(), address.length()); -#endif } while (rc != 0 && lastError() == POCO_EINTR); if (rc != 0) @@ -154,11 +134,7 @@ void SocketImpl::connect(const SocketAddress& address, const Poco::Timespan& tim setBlocking(false); try { -#if defined(POCO_VXWORKS) - int rc = ::connect(_sockfd, (sockaddr*) address.addr(), address.length()); -#else int rc = ::connect(_sockfd, address.addr(), address.length()); -#endif if (rc != 0) { int err = lastError(); @@ -186,11 +162,7 @@ void SocketImpl::connectNB(const SocketAddress& address) init(address.af()); } setBlocking(false); -#if defined(POCO_VXWORKS) - int rc = ::connect(_sockfd, (sockaddr*) address.addr(), address.length()); -#else int rc = ::connect(_sockfd, address.addr(), address.length()); -#endif if (rc != 0) { int err = lastError(); @@ -216,11 +188,7 @@ void SocketImpl::bind(const SocketAddress& address, bool reuseAddress, bool reus setReuseAddress(true); if (reusePort) setReusePort(true); -#if defined(POCO_VXWORKS) - int rc = ::bind(_sockfd, (sockaddr*) address.addr(), address.length()); -#else int rc = ::bind(_sockfd, address.addr(), address.length()); -#endif if (rc != 0) error(address.toString()); } @@ -373,11 +341,7 @@ int SocketImpl::sendTo(const void* buffer, int length, const SocketAddress& addr do { if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException(); -#if defined(POCO_VXWORKS) - rc = ::sendto(_sockfd, (char*) buffer, length, flags, (sockaddr*) address.addr(), address.length()); -#else rc = ::sendto(_sockfd, reinterpret_cast(buffer), length, flags, address.addr(), address.length()); -#endif } while (_blocking && rc < 0 && lastError() == POCO_EINTR); if (rc < 0) error(); @@ -465,11 +429,7 @@ bool SocketImpl::pollImpl(Poco::Timespan& remainingTime, int mode) do { Poco::Timestamp start; -#ifdef _WIN32 - rc = WSAPoll(&pollBuf, 1, static_cast(remainingTime.totalMilliseconds())); -#else rc = ::poll(&pollBuf, 1, remainingTime.totalMilliseconds()); -#endif /// Decrease timeout in case of retriable error. /// /// But do this only if the timeout is positive, @@ -570,12 +530,7 @@ int SocketImpl::getReceiveBufferSize() void SocketImpl::setSendTimeout(const Poco::Timespan& timeout) { -#if defined(_WIN32) - int value = (int) timeout.totalMilliseconds(); - setOption(SOL_SOCKET, SO_SNDTIMEO, value); -#else setOption(SOL_SOCKET, SO_SNDTIMEO, timeout); -#endif _sndTimeout = timeout; } @@ -583,11 +538,7 @@ void SocketImpl::setSendTimeout(const Poco::Timespan& timeout) Poco::Timespan SocketImpl::getSendTimeout() { Timespan result; -#if defined(_WIN32) && !defined(POCO_BROKEN_TIMEOUTS) - int value; - getOption(SOL_SOCKET, SO_SNDTIMEO, value); - result = Timespan::TimeDiff(value)*1000; -#elif !defined(POCO_BROKEN_TIMEOUTS) +#if !defined(POCO_BROKEN_TIMEOUTS) getOption(SOL_SOCKET, SO_SNDTIMEO, result); #endif if (_isBrokenTimeout) @@ -598,12 +549,7 @@ Poco::Timespan SocketImpl::getSendTimeout() void SocketImpl::setReceiveTimeout(const Poco::Timespan& timeout) { -#if defined(_WIN32) - int value = (int) timeout.totalMilliseconds(); - setOption(SOL_SOCKET, SO_RCVTIMEO, value); -#else setOption(SOL_SOCKET, SO_RCVTIMEO, timeout); -#endif _recvTimeout = timeout; } @@ -611,11 +557,7 @@ void SocketImpl::setReceiveTimeout(const Poco::Timespan& timeout) Poco::Timespan SocketImpl::getReceiveTimeout() { Timespan result; -#if defined(_WIN32) && !defined(POCO_BROKEN_TIMEOUTS) - int value; - getOption(SOL_SOCKET, SO_RCVTIMEO, value); - result = Timespan::TimeDiff(value)*1000; -#elif !defined(POCO_BROKEN_TIMEOUTS) +#if !defined(POCO_BROKEN_TIMEOUTS) getOption(SOL_SOCKET, SO_RCVTIMEO, result); #endif if (_isBrokenTimeout) @@ -694,11 +636,7 @@ void SocketImpl::setRawOption(int level, int option, const void* value, poco_soc { if (_sockfd == POCO_INVALID_SOCKET) throw InvalidSocketException(); -#if defined(POCO_VXWORKS) - int rc = ::setsockopt(_sockfd, level, option, (char*) value, length); -#else int rc = ::setsockopt(_sockfd, level, option, reinterpret_cast(value), length); -#endif if (rc == -1) error(); } @@ -929,26 +867,14 @@ void SocketImpl::initSocket(int af, int type, int proto) void SocketImpl::ioctl(poco_ioctl_request_t request, int& arg) { -#if defined(_WIN32) - int rc = ioctlsocket(_sockfd, request, reinterpret_cast(&arg)); -#elif defined(POCO_VXWORKS) - int rc = ::ioctl(_sockfd, request, (int) &arg); -#else int rc = ::ioctl(_sockfd, request, &arg); -#endif if (rc != 0) error(); } void SocketImpl::ioctl(poco_ioctl_request_t request, void* arg) { -#if defined(_WIN32) - int rc = ioctlsocket(_sockfd, request, reinterpret_cast(arg)); -#elif defined(POCO_VXWORKS) - int rc = ::ioctl(_sockfd, request, (int) arg); -#else int rc = ::ioctl(_sockfd, request, arg); -#endif if (rc != 0) error(); } diff --git a/base/poco/Net/src/TCPServer.cpp b/base/poco/Net/src/TCPServer.cpp index 7a7282f785c..9bdae900bd6 100644 --- a/base/poco/Net/src/TCPServer.cpp +++ b/base/poco/Net/src/TCPServer.cpp @@ -225,16 +225,8 @@ void TCPServer::setConnectionFilter(const TCPServerConnectionFilter::Ptr& pConne std::string TCPServer::threadName(const ServerSocket& socket) { -#if _WIN32_WCE == 0x0800 - // Workaround for WEC2013: only the first call to getsockname() - // succeeds. To mitigate the impact of this bug, do not call - // socket.address(), which calls getsockname(), here. - std::string name("TCPServer"); - #pragma message("Using WEC2013 getsockname() workaround in TCPServer::threadName(). Remove when no longer needed.") -#else std::string name("TCPServer: "); name.append(socket.address().toString()); -#endif return name; } diff --git a/base/poco/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h b/base/poco/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h index abf9ca5c604..5c3b45be8c6 100644 --- a/base/poco/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h +++ b/base/poco/NetSSL_OpenSSL/include/Poco/Net/NetSSL.h @@ -32,13 +32,6 @@ // NetSSL_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(POCO_DLL) -# if defined(NetSSL_EXPORTS) -# define NetSSL_API __declspec(dllexport) -# else -# define NetSSL_API __declspec(dllimport) -# endif -#endif #if !defined(NetSSL_API) @@ -53,13 +46,6 @@ // // Automatically link NetSSL and OpenSSL libraries. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) -# if !defined(NetSSL_EXPORTS) -# pragma comment(lib, "PocoNetSSL" POCO_LIB_SUFFIX) -# endif -# endif // POCO_NO_AUTOMATIC_LIBS -#endif namespace Poco diff --git a/base/poco/Redis/include/Poco/Redis/Redis.h b/base/poco/Redis/include/Poco/Redis/Redis.h index 3ba1660cebf..0cd55263c3f 100644 --- a/base/poco/Redis/include/Poco/Redis/Redis.h +++ b/base/poco/Redis/include/Poco/Redis/Redis.h @@ -31,13 +31,6 @@ // Redis_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(Redis_EXPORTS) -# define Redis_API __declspec(dllexport) -# else -# define Redis_API __declspec(dllimport) -# endif -#endif #if !defined(Redis_API) @@ -52,11 +45,6 @@ // // Automatically link Redis library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Redis_EXPORTS) -# pragma comment(lib, "PocoRedis" POCO_LIB_SUFFIX) -# endif -#endif #endif // RedisRedis_INCLUDED diff --git a/base/poco/Util/include/Poco/Util/Application.h b/base/poco/Util/include/Poco/Util/Application.h index e9a82f359c5..c8d18e1bce9 100644 --- a/base/poco/Util/include/Poco/Util/Application.h +++ b/base/poco/Util/include/Poco/Util/Application.h @@ -27,9 +27,6 @@ #include "Poco/Util/OptionSet.h" #include "Poco/Util/Subsystem.h" #include "Poco/Util/Util.h" -#if defined(POCO_VXWORKS) -# include -#endif #include #include @@ -141,18 +138,6 @@ namespace Util /// Note that as of release 1.3.7, init() no longer /// calls initialize(). This is now called from run(). -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - void init(int argc, wchar_t * argv[]); - /// Processes the application's command line arguments - /// and sets the application's properties (e.g., - /// "application.path", "application.name", etc.). - /// - /// Note that as of release 1.3.7, init() no longer - /// calls initialize(). This is now called from run(). - /// - /// This Windows-specific version of init is used for passing - /// Unicode command line arguments from wmain(). -#endif void init(const ArgVec & args); /// Processes the application's command line arguments @@ -485,50 +470,6 @@ namespace Util // // Macro to implement main() // -#if defined(_WIN32) && defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -# define POCO_APP_MAIN(App) \ - int wmain(int argc, wchar_t ** argv) \ - { \ - Poco::AutoPtr pApp = new App; \ - try \ - { \ - pApp->init(argc, argv); \ - } \ - catch (Poco::Exception & exc) \ - { \ - pApp->logger().log(exc); \ - return Poco::Util::Application::EXIT_CONFIG; \ - } \ - return pApp->run(); \ - } -#elif defined(POCO_VXWORKS) -# define POCO_APP_MAIN(App) \ - int pocoAppMain(const char * appName, ...) \ - { \ - std::vector args; \ - args.push_back(std::string(appName)); \ - va_list vargs; \ - va_start(vargs, appName); \ - const char * arg = va_arg(vargs, const char *); \ - while (arg) \ - { \ - args.push_back(std::string(arg)); \ - arg = va_arg(vargs, const char *); \ - } \ - va_end(vargs); \ - Poco::AutoPtr pApp = new App; \ - try \ - { \ - pApp->init(args); \ - } \ - catch (Poco::Exception & exc) \ - { \ - pApp->logger().log(exc); \ - return Poco::Util::Application::EXIT_CONFIG; \ - } \ - return pApp->run(); \ - } -#else # define POCO_APP_MAIN(App) \ int main(int argc, char ** argv) \ { \ @@ -544,7 +485,6 @@ namespace Util } \ return pApp->run(); \ } -#endif #endif // Util_Application_INCLUDED diff --git a/base/poco/Util/include/Poco/Util/ServerApplication.h b/base/poco/Util/include/Poco/Util/ServerApplication.h index b125cc1901b..5df4c28538a 100644 --- a/base/poco/Util/include/Poco/Util/ServerApplication.h +++ b/base/poco/Util/include/Poco/Util/ServerApplication.h @@ -21,9 +21,6 @@ #include "Poco/Event.h" #include "Poco/Util/Application.h" #include "Poco/Util/Util.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -# include "Poco/NamedEvent.h" -#endif namespace Poco @@ -146,14 +143,6 @@ namespace Util /// Runs the application by performing additional initializations /// and calling the main() method. -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - int run(int argc, wchar_t ** argv); - /// Runs the application by performing additional initializations - /// and calling the main() method. - /// - /// This Windows-specific version of init is used for passing - /// Unicode command line arguments from wmain(). -#endif static void terminate(); /// Sends a friendly termination request to the application. @@ -164,14 +153,10 @@ namespace Util protected: int run(); virtual void waitForTerminationRequest(); -#if !defined(_WIN32_WCE) void defineOptions(OptionSet & options); -#endif private: -#if defined(POCO_VXWORKS) - static Poco::Event _terminate; -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) void handleDaemon(const std::string & name, const std::string & value); void handleUMask(const std::string & name, const std::string & value); void handlePidFile(const std::string & name, const std::string & value); @@ -180,43 +165,6 @@ namespace Util # if POCO_OS == POCO_OS_ANDROID static Poco::Event _terminate; # endif -#elif defined(POCO_OS_FAMILY_WINDOWS) -# if !defined(_WIN32_WCE) - enum Action - { - SRV_RUN, - SRV_REGISTER, - SRV_UNREGISTER - }; - static BOOL __stdcall ConsoleCtrlHandler(DWORD ctrlType); - static void __stdcall ServiceControlHandler(DWORD control); -# if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - static void __stdcall ServiceMain(DWORD argc, LPWSTR * argv); -# else - static void __stdcall ServiceMain(DWORD argc, LPTSTR * argv); -# endif - - bool hasConsole(); - bool isService(); - void beService(); - void registerService(); - void unregisterService(); - void handleRegisterService(const std::string & name, const std::string & value); - void handleUnregisterService(const std::string & name, const std::string & value); - void handleDisplayName(const std::string & name, const std::string & value); - void handleDescription(const std::string & name, const std::string & value); - void handleStartup(const std::string & name, const std::string & value); - - Action _action; - std::string _displayName; - std::string _description; - std::string _startup; - - static Poco::Event _terminated; - static SERVICE_STATUS _serviceStatus; - static SERVICE_STATUS_HANDLE _serviceStatusHandle; -# endif // _WIN32_WCE - static Poco::NamedEvent _terminate; #endif }; @@ -228,48 +176,6 @@ namespace Util // // Macro to implement main() // -#if defined(_WIN32) && defined(POCO_WIN32_UTF8) -# define POCO_SERVER_MAIN(App) \ - int wmain(int argc, wchar_t ** argv) \ - { \ - try \ - { \ - App app; \ - return app.run(argc, argv); \ - } \ - catch (Poco::Exception & exc) \ - { \ - std::cerr << exc.displayText() << std::endl; \ - return Poco::Util::Application::EXIT_SOFTWARE; \ - } \ - } -#elif defined(POCO_VXWORKS) -# define POCO_SERVER_MAIN(App) \ - int pocoSrvMain(const char * appName, ...) \ - { \ - std::vector args; \ - args.push_back(std::string(appName)); \ - va_list vargs; \ - va_start(vargs, appName); \ - const char * arg = va_arg(vargs, const char *); \ - while (arg) \ - { \ - args.push_back(std::string(arg)); \ - arg = va_arg(vargs, const char *); \ - } \ - va_end(vargs); \ - try \ - { \ - App app; \ - return app.run(args); \ - } \ - catch (Poco::Exception & exc) \ - { \ - std::cerr << exc.displayText() << std::endl; \ - return Poco::Util::Application::EXIT_SOFTWARE; \ - } \ - } -#else # define POCO_SERVER_MAIN(App) \ int main(int argc, char ** argv) \ { \ @@ -284,7 +190,6 @@ namespace Util return Poco::Util::Application::EXIT_SOFTWARE; \ } \ } -#endif #endif // Util_ServerApplication_INCLUDED diff --git a/base/poco/Util/include/Poco/Util/SystemConfiguration.h b/base/poco/Util/include/Poco/Util/SystemConfiguration.h index 3ebd7f80a13..a61a325b886 100644 --- a/base/poco/Util/include/Poco/Util/SystemConfiguration.h +++ b/base/poco/Util/include/Poco/Util/SystemConfiguration.h @@ -88,9 +88,7 @@ namespace Util static const std::string TEMPDIR; static const std::string CONFIGDIR; static const std::string DATETIME; -#if !defined(POCO_VXWORKS) static const std::string PID; -#endif static const std::string ENV; }; diff --git a/base/poco/Util/include/Poco/Util/Util.h b/base/poco/Util/include/Poco/Util/Util.h index 0116b06c2a5..d168a5e8f25 100644 --- a/base/poco/Util/include/Poco/Util/Util.h +++ b/base/poco/Util/include/Poco/Util/Util.h @@ -31,13 +31,6 @@ // Util_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(Util_EXPORTS) -# define Util_API __declspec(dllexport) -# else -# define Util_API __declspec(dllimport) -# endif -#endif #if !defined(Util_API) @@ -52,11 +45,6 @@ // // Automatically link Util library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(Util_EXPORTS) -# pragma comment(lib, "PocoUtil" POCO_LIB_SUFFIX) -# endif -#endif #endif // Util_Util_INCLUDED diff --git a/base/poco/Util/include/Poco/Util/WinService.h b/base/poco/Util/include/Poco/Util/WinService.h index a0f3d1c5796..52377dfb67b 100644 --- a/base/poco/Util/include/Poco/Util/WinService.h +++ b/base/poco/Util/include/Poco/Util/WinService.h @@ -22,11 +22,7 @@ #include "Poco/Util/Util.h" -#if defined(POCO_WIN32_UTF8) -# define POCO_LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGW -#else # define POCO_LPQUERY_SERVICE_CONFIG LPQUERY_SERVICE_CONFIGA -#endif namespace Poco diff --git a/base/poco/Util/src/Application.cpp b/base/poco/Util/src/Application.cpp index c7a64eb7dba..483315fda60 100644 --- a/base/poco/Util/src/Application.cpp +++ b/base/poco/Util/src/Application.cpp @@ -35,15 +35,9 @@ #include "Poco/String.h" #include "Poco/ConsoleChannel.h" #include "Poco/AutoPtr.h" -#if defined(POCO_OS_FAMILY_WINDOWS) -#include "Poco/UnWindows.h" -#endif #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_VXWORKS) #include "Poco/SignalHandler.h" #endif -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -#include "Poco/UnicodeConverter.h" -#endif using Poco::Logger; @@ -134,19 +128,6 @@ void Application::init(int argc, char* argv[]) } -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -void Application::init(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - std::string arg; - Poco::UnicodeConverter::toUTF8(argv[i], arg); - args.push_back(arg); - } - init(args); -} -#endif void Application::init(const ArgVec& args) @@ -436,25 +417,6 @@ void Application::getApplicationPath(Poco::Path& appPath) const appPath = Path(_workingDirAtLaunch, _command); appPath.makeAbsolute(); } -#elif defined(POCO_OS_FAMILY_WINDOWS) - #if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - wchar_t path[1024]; - int n = GetModuleFileNameW(0, path, sizeof(path)/sizeof(wchar_t)); - if (n > 0) - { - std::string p; - Poco::UnicodeConverter::toUTF8(path, p); - appPath = p; - } - else throw SystemException("Cannot get application file name."); - #else - char path[1024]; - int n = GetModuleFileNameA(0, path, sizeof(path)); - if (n > 0) - appPath = path; - else - throw SystemException("Cannot get application file name."); - #endif #else appPath = _command; #endif diff --git a/base/poco/Util/src/ServerApplication.cpp b/base/poco/Util/src/ServerApplication.cpp index dbfa5d703d9..091263ed34b 100644 --- a/base/poco/Util/src/ServerApplication.cpp +++ b/base/poco/Util/src/ServerApplication.cpp @@ -18,10 +18,8 @@ #include "Poco/Util/OptionException.h" #include "Poco/FileStream.h" #include "Poco/Exception.h" -#if !defined(POCO_VXWORKS) #include "Poco/Process.h" #include "Poco/NamedEvent.h" -#endif #include "Poco/NumberFormatter.h" #include "Poco/Logger.h" #include "Poco/String.h" @@ -33,16 +31,6 @@ #include #include #include -#elif defined(POCO_OS_FAMILY_WINDOWS) -#if !defined(_WIN32_WCE) -#include "Poco/Util/WinService.h" -#include "Poco/Util/WinRegistryKey.h" -#endif -#include "Poco/UnWindows.h" -#include -#endif -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -#include "Poco/UnicodeConverter.h" #endif @@ -55,14 +43,6 @@ namespace Poco { namespace Util { -#if defined(POCO_OS_FAMILY_WINDOWS) -Poco::NamedEvent ServerApplication::_terminate(Poco::ProcessImpl::terminationEventName(Poco::Process::id())); -#if !defined(_WIN32_WCE) -Poco::Event ServerApplication::_terminated; -SERVICE_STATUS ServerApplication::_serviceStatus; -SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0; -#endif -#endif #if defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID Poco::Event ServerApplication::_terminate; #endif @@ -70,12 +50,6 @@ Poco::Event ServerApplication::_terminate; ServerApplication::ServerApplication() { -#if defined(POCO_OS_FAMILY_WINDOWS) -#if !defined(_WIN32_WCE) - _action = SRV_RUN; - std::memset(&_serviceStatus, 0, sizeof(_serviceStatus)); -#endif -#endif } @@ -99,9 +73,7 @@ int ServerApplication::run() void ServerApplication::terminate() { -#if defined(POCO_OS_FAMILY_WINDOWS) - _terminate.set(); -#elif defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID +#if defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID _terminate.set(); #else Poco::Process::requestTermination(Process::id()); @@ -109,459 +81,7 @@ void ServerApplication::terminate() } -#if defined(POCO_OS_FAMILY_WINDOWS) -#if !defined(_WIN32_WCE) - - -// -// Windows specific code -// -BOOL ServerApplication::ConsoleCtrlHandler(DWORD ctrlType) -{ - switch (ctrlType) - { - case CTRL_C_EVENT: - case CTRL_CLOSE_EVENT: - case CTRL_BREAK_EVENT: - terminate(); - return _terminated.tryWait(10000) ? TRUE : FALSE; - default: - return FALSE; - } -} - - -void ServerApplication::ServiceControlHandler(DWORD control) -{ - switch (control) - { - case SERVICE_CONTROL_STOP: - case SERVICE_CONTROL_SHUTDOWN: - terminate(); - _serviceStatus.dwCurrentState = SERVICE_STOP_PENDING; - break; - case SERVICE_CONTROL_INTERROGATE: - break; - } - SetServiceStatus(_serviceStatusHandle, &_serviceStatus); -} - - -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -void ServerApplication::ServiceMain(DWORD argc, LPWSTR* argv) -#else -void ServerApplication::ServiceMain(DWORD argc, LPTSTR* argv) -#endif -{ - ServerApplication& app = static_cast(Application::instance()); - - app.config().setBool("application.runAsService", true); - -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - _serviceStatusHandle = RegisterServiceCtrlHandlerW(L"", ServiceControlHandler); -#else - _serviceStatusHandle = RegisterServiceCtrlHandlerA("", ServiceControlHandler); -#endif - if (!_serviceStatusHandle) - throw SystemException("cannot register service control handler"); - - _serviceStatus.dwServiceType = SERVICE_WIN32; - _serviceStatus.dwCurrentState = SERVICE_START_PENDING; - _serviceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; - _serviceStatus.dwWin32ExitCode = 0; - _serviceStatus.dwServiceSpecificExitCode = 0; - _serviceStatus.dwCheckPoint = 0; - _serviceStatus.dwWaitHint = 0; - SetServiceStatus(_serviceStatusHandle, &_serviceStatus); - - try - { -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - std::vector args; - for (DWORD i = 0; i < argc; ++i) - { - std::string arg; - Poco::UnicodeConverter::toUTF8(argv[i], arg); - args.push_back(arg); - } - app.init(args); -#else - app.init(argc, argv); -#endif - _serviceStatus.dwCurrentState = SERVICE_RUNNING; - SetServiceStatus(_serviceStatusHandle, &_serviceStatus); - int rc = app.run(); - _serviceStatus.dwWin32ExitCode = rc ? ERROR_SERVICE_SPECIFIC_ERROR : 0; - _serviceStatus.dwServiceSpecificExitCode = rc; - } - catch (Exception& exc) - { - app.logger().log(exc); - _serviceStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; - _serviceStatus.dwServiceSpecificExitCode = EXIT_CONFIG; - } - catch (...) - { - app.logger().error("fatal error - aborting"); - _serviceStatus.dwWin32ExitCode = ERROR_SERVICE_SPECIFIC_ERROR; - _serviceStatus.dwServiceSpecificExitCode = EXIT_SOFTWARE; - } - _serviceStatus.dwCurrentState = SERVICE_STOPPED; - SetServiceStatus(_serviceStatusHandle, &_serviceStatus); -} - - -void ServerApplication::waitForTerminationRequest() -{ - SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE); - _terminate.wait(); - _terminated.set(); -} - - -int ServerApplication::run(int argc, char** argv) -{ - if (!hasConsole() && isService()) - { - return 0; - } - else - { - int rc = EXIT_OK; - try - { - init(argc, argv); - switch (_action) - { - case SRV_REGISTER: - registerService(); - rc = EXIT_OK; - break; - case SRV_UNREGISTER: - unregisterService(); - rc = EXIT_OK; - break; - default: - rc = run(); - } - } - catch (Exception& exc) - { - logger().log(exc); - rc = EXIT_SOFTWARE; - } - return rc; - } -} - - -int ServerApplication::run(const std::vector& args) -{ - if (!hasConsole() && isService()) - { - return 0; - } - else - { - int rc = EXIT_OK; - try - { - init(args); - switch (_action) - { - case SRV_REGISTER: - registerService(); - rc = EXIT_OK; - break; - case SRV_UNREGISTER: - unregisterService(); - rc = EXIT_OK; - break; - default: - rc = run(); - } - } - catch (Exception& exc) - { - logger().log(exc); - rc = EXIT_SOFTWARE; - } - return rc; - } -} - - -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -int ServerApplication::run(int argc, wchar_t** argv) -{ - if (!hasConsole() && isService()) - { - return 0; - } - else - { - int rc = EXIT_OK; - try - { - init(argc, argv); - switch (_action) - { - case SRV_REGISTER: - registerService(); - rc = EXIT_OK; - break; - case SRV_UNREGISTER: - unregisterService(); - rc = EXIT_OK; - break; - default: - rc = run(); - } - } - catch (Exception& exc) - { - logger().log(exc); - rc = EXIT_SOFTWARE; - } - return rc; - } -} -#endif - - -bool ServerApplication::isService() -{ -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) - SERVICE_TABLE_ENTRYW svcDispatchTable[2]; - svcDispatchTable[0].lpServiceName = L""; - svcDispatchTable[0].lpServiceProc = ServiceMain; - svcDispatchTable[1].lpServiceName = NULL; - svcDispatchTable[1].lpServiceProc = NULL; - return StartServiceCtrlDispatcherW(svcDispatchTable) != 0; -#else - SERVICE_TABLE_ENTRY svcDispatchTable[2]; - svcDispatchTable[0].lpServiceName = ""; - svcDispatchTable[0].lpServiceProc = ServiceMain; - svcDispatchTable[1].lpServiceName = NULL; - svcDispatchTable[1].lpServiceProc = NULL; - return StartServiceCtrlDispatcherA(svcDispatchTable) != 0; -#endif -} - - -bool ServerApplication::hasConsole() -{ - HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); - return hStdOut != INVALID_HANDLE_VALUE && hStdOut != NULL; -} - - -void ServerApplication::registerService() -{ - std::string name = config().getString("application.baseName"); - std::string path = config().getString("application.path"); - - WinService service(name); - if (_displayName.empty()) - service.registerService(path); - else - service.registerService(path, _displayName); - if (_startup == "auto") - service.setStartup(WinService::SVC_AUTO_START); - else if (_startup == "manual") - service.setStartup(WinService::SVC_MANUAL_START); - if (!_description.empty()) - service.setDescription(_description); - logger().information("The application has been successfully registered as a service."); -} - - -void ServerApplication::unregisterService() -{ - std::string name = config().getString("application.baseName"); - - WinService service(name); - service.unregisterService(); - logger().information("The service has been successfully unregistered."); -} - - -void ServerApplication::defineOptions(OptionSet& options) -{ - Application::defineOptions(options); - - options.addOption( - Option("registerService", "", "Register the application as a service.") - .required(false) - .repeatable(false) - .callback(OptionCallback(this, &ServerApplication::handleRegisterService))); - - options.addOption( - Option("unregisterService", "", "Unregister the application as a service.") - .required(false) - .repeatable(false) - .callback(OptionCallback(this, &ServerApplication::handleUnregisterService))); - - options.addOption( - Option("displayName", "", "Specify a display name for the service (only with /registerService).") - .required(false) - .repeatable(false) - .argument("name") - .callback(OptionCallback(this, &ServerApplication::handleDisplayName))); - - options.addOption( - Option("description", "", "Specify a description for the service (only with /registerService).") - .required(false) - .repeatable(false) - .argument("text") - .callback(OptionCallback(this, &ServerApplication::handleDescription))); - - options.addOption( - Option("startup", "", "Specify the startup mode for the service (only with /registerService).") - .required(false) - .repeatable(false) - .argument("automatic|manual") - .callback(OptionCallback(this, &ServerApplication::handleStartup))); -} - - -void ServerApplication::handleRegisterService(const std::string& name, const std::string& value) -{ - _action = SRV_REGISTER; -} - - -void ServerApplication::handleUnregisterService(const std::string& name, const std::string& value) -{ - _action = SRV_UNREGISTER; -} - - -void ServerApplication::handleDisplayName(const std::string& name, const std::string& value) -{ - _displayName = value; -} - - -void ServerApplication::handleDescription(const std::string& name, const std::string& value) -{ - _description = value; -} - - -void ServerApplication::handleStartup(const std::string& name, const std::string& value) -{ - if (Poco::icompare(value, 4, std::string("auto")) == 0) - _startup = "auto"; - else if (Poco::icompare(value, std::string("manual")) == 0) - _startup = "manual"; - else - throw InvalidArgumentException("argument to startup option must be 'auto[matic]' or 'manual'"); -} - - -#else // _WIN32_WCE -void ServerApplication::waitForTerminationRequest() -{ - _terminate.wait(); -} - - -int ServerApplication::run(int argc, char** argv) -{ - try - { - init(argc, argv); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} - - -int ServerApplication::run(const std::vector& args) -{ - try - { - init(args); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} - - -#if defined(POCO_WIN32_UTF8) && !defined(POCO_NO_WSTRING) -int ServerApplication::run(int argc, wchar_t** argv) -{ - try - { - init(argc, argv); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} -#endif - - -#endif // _WIN32_WCE -#elif defined(POCO_VXWORKS) -// -// VxWorks specific code -// -void ServerApplication::waitForTerminationRequest() -{ - _terminate.wait(); -} - - -int ServerApplication::run(int argc, char** argv) -{ - try - { - init(argc, argv); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} - - -int ServerApplication::run(const std::vector& args) -{ - try - { - init(args); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} - - -void ServerApplication::defineOptions(OptionSet& options) -{ - Application::defineOptions(options); -} - - -#elif defined(POCO_OS_FAMILY_UNIX) +#if defined(POCO_OS_FAMILY_UNIX) // diff --git a/base/poco/Util/src/SystemConfiguration.cpp b/base/poco/Util/src/SystemConfiguration.cpp index c53952ada11..04b36878a94 100644 --- a/base/poco/Util/src/SystemConfiguration.cpp +++ b/base/poco/Util/src/SystemConfiguration.cpp @@ -19,9 +19,7 @@ #include "Poco/DateTimeFormatter.h" #include "Poco/DateTimeFormat.h" #include "Poco/NumberFormatter.h" -#if !defined(POCO_VXWORKS) #include "Poco/Process.h" -#endif #include "Poco/Exception.h" #include @@ -48,9 +46,7 @@ const std::string SystemConfiguration::TEMPHOMEDIR = "system.tempHomeDir"; const std::string SystemConfiguration::TEMPDIR = "system.tempDir"; const std::string SystemConfiguration::CONFIGDIR = "system.configDir"; const std::string SystemConfiguration::DATETIME = "system.dateTime"; -#if !defined(POCO_VXWORKS) const std::string SystemConfiguration::PID = "system.pid"; -#endif const std::string SystemConfiguration::ENV = "system.env."; @@ -142,13 +138,11 @@ bool SystemConfiguration::getRaw(const std::string& key, std::string& value) con { value = Poco::DateTimeFormatter::format(Poco::DateTime(), Poco::DateTimeFormat::ISO8601_FORMAT); } -#if !defined(POCO_VXWORKS) else if (key == PID) { value = "0"; value = Poco::NumberFormatter::format(Poco::Process::id()); } -#endif else if (key.compare(0, ENV.size(), ENV) == 0) { return getEnv(key.substr(ENV.size()), value); @@ -186,9 +180,7 @@ void SystemConfiguration::enumerate(const std::string& key, Keys& range) const range.push_back("tempDir"); range.push_back("configDir"); range.push_back("dateTime"); -#if !defined(POCO_VXWORKS) range.push_back("pid"); -#endif range.push_back("env"); } } diff --git a/base/poco/XML/include/Poco/XML/XML.h b/base/poco/XML/include/Poco/XML/XML.h index a5b611a76dd..982c9839555 100644 --- a/base/poco/XML/include/Poco/XML/XML.h +++ b/base/poco/XML/include/Poco/XML/XML.h @@ -31,13 +31,6 @@ // XML_API functions as being imported from a DLL, whereas this DLL sees symbols // defined with this macro as being exported. // -#if defined(_WIN32) && defined(POCO_DLL) -# if defined(XML_EXPORTS) -# define XML_API __declspec(dllexport) -# else -# define XML_API __declspec(dllimport) -# endif -#endif #if !defined(XML_API) @@ -52,11 +45,6 @@ // // Automatically link XML library. // -#if defined(_MSC_VER) -# if !defined(POCO_NO_AUTOMATIC_LIBS) && !defined(XML_EXPORTS) -# pragma comment(lib, "PocoXML" POCO_LIB_SUFFIX) -# endif -#endif #endif // XML_XML_INCLUDED diff --git a/base/poco/XML/include/Poco/XML/expat_external.h b/base/poco/XML/include/Poco/XML/expat_external.h index cb5905c7b04..6a846ba9e00 100644 --- a/base/poco/XML/include/Poco/XML/expat_external.h +++ b/base/poco/XML/include/Poco/XML/expat_external.h @@ -65,9 +65,7 @@ system headers may assume the cdecl convention. */ #ifndef XMLCALL -# if defined(_MSC_VER) -# define XMLCALL __cdecl -# elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) +# if defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER) # define XMLCALL __attribute__((cdecl)) # else /* For any platform which uses this definition and supports more than diff --git a/base/poco/XML/src/XMLWriter.cpp b/base/poco/XML/src/XMLWriter.cpp index dba21692f0d..41831f48e67 100644 --- a/base/poco/XML/src/XMLWriter.cpp +++ b/base/poco/XML/src/XMLWriter.cpp @@ -151,11 +151,7 @@ void XMLWriter::setNewLine(const std::string& newLineCharacters) { if (newLineCharacters.empty()) { -#if defined(_WIN32) - _newLine = NEWLINE_CRLF; -#else _newLine = NEWLINE_LF; -#endif } else _newLine = newLineCharacters; } diff --git a/base/poco/XML/src/expat_config.h b/base/poco/XML/src/expat_config.h index 14383d0b261..bab3747f66b 100644 --- a/base/poco/XML/src/expat_config.h +++ b/base/poco/XML/src/expat_config.h @@ -17,9 +17,7 @@ #include "Poco/Platform.h" -#if !defined(POCO_VXWORKS) # include -#endif #include diff --git a/base/poco/XML/src/internal.h b/base/poco/XML/src/internal.h index c34e3ae3f83..9b93cec58f2 100644 --- a/base/poco/XML/src/internal.h +++ b/base/poco/XML/src/internal.h @@ -107,16 +107,6 @@ #include // ULONG_MAX -#if defined(_WIN32) && !defined(__USE_MINGW_ANSI_STDIO) -# define EXPAT_FMT_ULL(midpart) "%" midpart "I64u" -# if defined(_WIN64) // Note: modifiers "td" and "zu" do not work for MinGW -# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "I64d" -# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "I64u" -# else -# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d" -# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u" -# endif -#else # define EXPAT_FMT_ULL(midpart) "%" midpart "llu" # if !defined(ULONG_MAX) # error Compiler did not define ULONG_MAX for us @@ -127,7 +117,6 @@ # define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d" # define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u" # endif -#endif #ifndef UNUSED_P # define UNUSED_P(p) (void)p diff --git a/base/poco/XML/src/xmlparse.cpp b/base/poco/XML/src/xmlparse.cpp index 3207ac3ddbd..dcd9d0facc6 100644 --- a/base/poco/XML/src/xmlparse.cpp +++ b/base/poco/XML/src/xmlparse.cpp @@ -61,16 +61,7 @@ # define _GNU_SOURCE 1 /* syscall prototype */ #endif -#ifdef _WIN32 -/* force stdlib to define rand_s() */ -# if ! defined(_CRT_RAND_S) -# define _CRT_RAND_S -# endif -#endif -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif #include #include /* memset(), memcpy() */ @@ -86,8 +77,6 @@ #if defined(EXPAT_POCO) # include "Poco/RandomStream.h" # include "Poco/BinaryReader.h" -#elif defined(_WIN32) -# define getpid GetCurrentProcessId #else # include /* gettimeofday() */ # include /* getpid() */ @@ -125,9 +114,6 @@ # include #endif -#if defined(_WIN32) && ! defined(LOAD_LIBRARY_SEARCH_SYSTEM32) -# define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 -#endif #if ! defined(HAVE_GETRANDOM) && ! defined(HAVE_SYSCALL_GETRANDOM) \ && ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) \ @@ -836,52 +822,11 @@ writeRandomBytes_arc4random(void *target, size_t count) { #endif /* defined(HAVE_ARC4RANDOM) && ! defined(HAVE_ARC4RANDOM_BUF) */ -#ifdef _WIN32 - -/* Provide declaration of rand_s() for MinGW-32 (not 64, which has it), - as it didn't declare it in its header prior to version 5.3.0 of its - runtime package (mingwrt, containing stdlib.h). The upstream fix - was introduced at https://osdn.net/projects/mingw/ticket/39658 . */ -# if defined(__MINGW32__) && defined(__MINGW32_VERSION) \ - && __MINGW32_VERSION < 5003000L && ! defined(__MINGW64_VERSION_MAJOR) -__declspec(dllimport) int rand_s(unsigned int *); -# endif - -/* Obtain entropy on Windows using the rand_s() function which - * generates cryptographically secure random numbers. Internally it - * uses RtlGenRandom API which is present in Windows XP and later. - */ -static int -writeRandomBytes_rand_s(void *target, size_t count) { - size_t bytesWrittenTotal = 0; - - while (bytesWrittenTotal < count) { - unsigned int random32 = 0; - size_t i = 0; - - if (rand_s(&random32)) - return 0; /* failure */ - - for (; (i < sizeof(random32)) && (bytesWrittenTotal < count); - i++, bytesWrittenTotal++) { - const uint8_t random8 = (uint8_t)(random32 >> (i * 8)); - ((uint8_t *)target)[bytesWrittenTotal] = random8; - } - } - return 1; /* success */ -} - -#endif /* _WIN32 */ #if ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) static unsigned long gather_time_entropy(void) { -# ifdef _WIN32 - FILETIME ft; - GetSystemTimeAsFileTime(&ft); /* never fails */ - return ft.dwHighDateTime ^ ft.dwLowDateTime; -# else struct timeval tv; int gettimeofday_res; @@ -895,7 +840,6 @@ gather_time_entropy(void) { /* Microseconds time is <20 bits entropy */ return tv.tv_usec; -# endif } #endif /* ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM) */ @@ -930,11 +874,7 @@ generate_hash_secret_salt(XML_Parser parser) { return ENTROPY_DEBUG("arc4random", entropy); #else /* Try high quality providers first .. */ -# ifdef _WIN32 - if (writeRandomBytes_rand_s((void *)&entropy, sizeof(entropy))) { - return ENTROPY_DEBUG("rand_s", entropy); - } -# elif defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM) +# if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM) if (writeRandomBytes_getrandom_nonblock((void *)&entropy, sizeof(entropy))) { return ENTROPY_DEBUG("getrandom", entropy); } diff --git a/base/poco/XML/src/xmlrole.h b/base/poco/XML/src/xmlrole.h index f33f859b2c4..11f0fca2232 100644 --- a/base/poco/XML/src/xmlrole.h +++ b/base/poco/XML/src/xmlrole.h @@ -36,11 +36,6 @@ #ifndef XmlRole_INCLUDED #define XmlRole_INCLUDED 1 -#ifdef __VMS -/* 0 1 2 3 0 1 2 3 - 1234567890123456789012345678901 1234567890123456789012345678901 */ -# define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt -#endif #include "xmltok.h" diff --git a/docker/test/performance-comparison/perf.py b/docker/test/performance-comparison/perf.py index c2d61ae0f89..65bf49c2914 100755 --- a/docker/test/performance-comparison/perf.py +++ b/docker/test/performance-comparison/perf.py @@ -366,6 +366,7 @@ for query_index in queries_to_run: settings={ "max_execution_time": args.prewarm_max_query_seconds, "query_profiler_real_time_period_ns": 10000000, + "query_profiler_cpu_time_period_ns": 10000000, "memory_profiler_step": "4Mi", }, ) @@ -497,7 +498,10 @@ for query_index in queries_to_run: res = c.execute( q, query_id=run_id, - settings={"query_profiler_real_time_period_ns": 10000000}, + settings={ + "query_profiler_real_time_period_ns": 10000000, + "query_profiler_cpu_time_period_ns": 10000000, + }, ) print( f"profile\t{query_index}\t{run_id}\t{conn_index}\t{c.last_query.elapsed}" diff --git a/docs/en/getting-started/install.md b/docs/en/getting-started/install.md index 0e0f54a62fe..7ae25e7f779 100644 --- a/docs/en/getting-started/install.md +++ b/docs/en/getting-started/install.md @@ -15,15 +15,7 @@ You have three options for getting up and running with ClickHouse: ## ClickHouse Cloud -The quickest and easiest way to get up and running with ClickHouse is to create a new service in [ClickHouse Cloud](https://clickhouse.cloud/): - -
- -![Create a ClickHouse Cloud service](@site/docs/en/_snippets/images/createservice1.png) -
- -Once your Cloud service is provisioned, you will be able to [connect to it](/docs/en/integrations/connect-a-client.md) and start [inserting data](/docs/en/integrations/data-ingestion.md). - +The quickest and easiest way to get up and running with ClickHouse is to create a new service in [ClickHouse Cloud](https://clickhouse.cloud/). ## Self-Managed Install @@ -73,6 +65,7 @@ The [Quick Start](/docs/en/quick-start.mdx/#step-1-get-clickhouse) walks through It is recommended to use official pre-compiled `deb` packages for Debian or Ubuntu. Run these commands to install packages: +#### Setup the Debian repository ``` bash sudo apt-get install -y apt-transport-https ca-certificates dirmngr sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754 @@ -80,9 +73,16 @@ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D7 echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee \ /etc/apt/sources.list.d/clickhouse.list sudo apt-get update +``` +#### Install ClickHouse server and client +```bash sudo apt-get install -y clickhouse-server clickhouse-client +``` +#### Start ClickHouse server + +```bash sudo service clickhouse-server start clickhouse-client # or "clickhouse-client --password" if you've set up a password. ``` @@ -128,12 +128,32 @@ You can replace `stable` with `lts` to use different [release kinds](/docs/en/fa You can also download and install packages manually from [here](https://packages.clickhouse.com/deb/pool/main/c/). +#### Install standalone ClickHouse Keeper + +:::tip +If you are going to run ClickHouse Keeper on the same server as ClickHouse server you +do not need to install ClickHouse Keeper as it is included with ClickHouse server. This command is only needed on standalone ClickHouse Keeper servers. +::: + +```bash +sudo apt-get install -y clickhouse-keeper +``` + +#### Enable and start ClickHouse Keeper + +```bash +sudo systemctl enable clickhouse-keeper +sudo systemctl start clickhouse-keeper +sudo systemctl status clickhouse-keeper +``` + #### Packages {#packages} - `clickhouse-common-static` — Installs ClickHouse compiled binary files. - `clickhouse-server` — Creates a symbolic link for `clickhouse-server` and installs the default server configuration. - `clickhouse-client` — Creates a symbolic link for `clickhouse-client` and other client-related tools. and installs client configuration files. - `clickhouse-common-static-dbg` — Installs ClickHouse compiled binary files with debug info. +- `clickhouse-keeper` - Used to install ClickHouse Keeper on dedicated ClickHouse Keeper nodes. If you are running ClickHouse Keeper on the same server as ClickHouse server, then you do not need to install this package. Installs ClickHouse Keeper and the default ClickHouse Keeper configuration files. :::info If you need to install specific version of ClickHouse you have to install all packages with the same version: diff --git a/programs/diagnostics/go.mod b/programs/diagnostics/go.mod index 0a8bd007627..58487fced80 100644 --- a/programs/diagnostics/go.mod +++ b/programs/diagnostics/go.mod @@ -7,6 +7,7 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/Masterminds/semver v1.5.0 github.com/bmatcuk/doublestar/v4 v4.0.2 + github.com/docker/go-connections v0.4.0 github.com/elastic/gosigar v0.14.2 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/jaypipes/ghw v0.8.0 @@ -18,8 +19,8 @@ require ( github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.10.1 - github.com/stretchr/testify v1.8.0 - github.com/testcontainers/testcontainers-go v0.15.0 + github.com/stretchr/testify v1.8.1 + github.com/testcontainers/testcontainers-go v0.18.0 github.com/yargevad/filepathx v1.0.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -27,23 +28,19 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/Microsoft/hcsshim v0.9.4 // indirect github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/andybalholm/brotli v1.0.4 // indirect - github.com/cenkalti/backoff/v4 v4.1.3 // indirect - github.com/containerd/cgroups v1.0.4 // indirect - github.com/containerd/containerd v1.6.8 // indirect + github.com/cenkalti/backoff/v4 v4.2.0 // indirect + github.com/containerd/containerd v1.6.17 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/distribution v2.8.1+incompatible // indirect - github.com/docker/docker v20.10.17+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/docker v23.0.0+incompatible // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dsnet/compress v0.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/ghodss/yaml v1.0.0 // indirect github.com/go-ole/go-ole v1.2.4 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/uuid v1.3.0 // indirect @@ -52,36 +49,36 @@ require ( github.com/jaypipes/pcidb v0.6.0 // indirect github.com/klauspost/compress v1.13.6 // indirect github.com/klauspost/pgzip v1.2.5 // indirect - github.com/magiconair/properties v1.8.6 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/moby/sys/mount v0.3.3 // indirect - github.com/moby/sys/mountinfo v0.6.2 // indirect - github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect + github.com/moby/patternmatcher v0.5.0 // indirect + github.com/moby/sys/sequential v0.5.0 // indirect + github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/nwaples/rardecode/v2 v2.0.0-beta.2 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 // indirect + github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/opencontainers/runc v1.1.3 // indirect github.com/paulmach/orb v0.4.0 // indirect - github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pelletier/go-toml v1.9.5 // indirect github.com/pierrec/lz4/v4 v4.1.14 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect - github.com/sirupsen/logrus v1.8.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect github.com/spf13/afero v1.8.0 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/therootcompany/xz v1.0.1 // indirect github.com/ulikunitz/xz v0.5.10 // indirect - go.opencensus.io v0.23.0 // indirect go.opentelemetry.io/otel v1.4.1 // indirect go.opentelemetry.io/otel/trace v1.4.1 // indirect - golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - golang.org/x/text v0.3.8 // indirect + golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad // indirect google.golang.org/grpc v1.47.0 // indirect google.golang.org/protobuf v1.28.0 // indirect diff --git a/programs/diagnostics/go.sum b/programs/diagnostics/go.sum index 1ee2e09f81c..71c3cbcd2d6 100644 --- a/programs/diagnostics/go.sum +++ b/programs/diagnostics/go.sum @@ -1,4 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -50,20 +49,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.5.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= @@ -74,92 +61,42 @@ github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= -github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= -github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= -github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= -github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= -github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= -github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I= -github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= -github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/Microsoft/hcsshim v0.9.6 h1:VwnDOgLeoi2du6dAznfmspNqTiwczvjv4K7NxuY9jsY= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= -github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar/v4 v4.0.2 h1:X0krlUVAVmtr2cRoTqR8aDMrDqnB36ht8wpWTiQ3jsA= github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= @@ -175,166 +112,34 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= -github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= -github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= -github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E= -github.com/containerd/btrfs v0.0.0-20210316141732-918d888fb676/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= -github.com/containerd/cgroups v0.0.0-20190717030353-c4b9ac5c7601/go.mod h1:X9rLEHIqSf/wfK8NsPqxJmeZgW4pcfzdXITDrUSJ6uI= -github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo= -github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= -github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.4 h1:jN/mbWBEaz+T1pi5OFtnkQ+8qnmEbAr1Oo1FRm5B0dA= -github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.1-0.20191213020239-082f7e3aed57/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.0-beta.2.0.20200729163537-40b22ef07410/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.1/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.4.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7V960Tmcumvqn8Mc+pCYQ= -github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= -github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= -github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= -github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= -github.com/containerd/containerd v1.6.8 h1:h4dOFDwzHmqFEP754PgfgTeVXFnLiRc6kiqC7tplDJs= -github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= -github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= +github.com/containerd/containerd v1.6.17 h1:XDnJIeJW0cLf6v7/+N+6L9kGrChHeXekZp2VHu6OpiY= +github.com/containerd/containerd v1.6.17/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20201026212402-0724c46b320c/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= -github.com/containerd/fifo v0.0.0-20210316144830-115abcc95a1d/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.0.1/go.mod h1:+vUpYxKvAF72G9i1WoDOiPGRtQpqsNW/ZHtSlv++smU= -github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20190911050354-e029b79d8cda/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328/go.mod h1:PpyHrqVs8FTi9vpyHwPwiNEGaACDxT/N/pLcvMSRA9g= -github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.0.1/go.mod h1:mdd8cEPW7TPgNG4FpuP3sGBiQ7Yi/zak9TYCG3juvb0= -github.com/containerd/imgcrypt v1.0.4-0.20210301171431-0ae5c75f59ba/go.mod h1:6TNsg0ctmizkrOgXRNQjAPFWpMYRWuiB6dSF4Pfa5SA= -github.com/containerd/imgcrypt v1.1.1-0.20210312161619-7ed62a527887/go.mod h1:5AZJNI6sLHJljKuI9IHnw1pWqo/F0nGDOuR9zgTs7ow= -github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= -github.com/containerd/nri v0.0.0-20201007170849-eb1350a75164/go.mod h1:+2wGSDGFYfE5+So4M5syatU0N0f0LbWpuqyMi4/BE8c= -github.com/containerd/nri v0.0.0-20210316161719-dbaa18c31c14/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20190828172938-92c8520ef9f8/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/ttrpc v0.0.0-20191028202541-4f1b8fe65a5c/go.mod h1:LPm1u0xBw8r8NOKoOdNMeVHSawSsltak+Ihv+etqsE8= -github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= -github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= -github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= -github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= -github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= -github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= -github.com/containerd/zfs v0.0.0-20210315114300-dde8f0fda960/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= -github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= -github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= -github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= -github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= -github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20161114122254-48702e0da86b/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= -github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= -github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= -github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.17+incompatible h1:JYCuMrWaVNophQTOrMMoSwudOVEfcegoZZrleKc1xwE= -github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/docker v23.0.0+incompatible h1:L6c28tNyqZ4/ub9AZC9d5QUuunoHHfEH4/Ue+h/E5nE= +github.com/docker/docker v23.0.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -347,73 +152,37 @@ github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPO github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= -github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= -github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -461,9 +230,7 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -486,37 +253,19 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -526,7 +275,6 @@ github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39E github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= @@ -547,75 +295,48 @@ github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOn github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jaypipes/ghw v0.8.0 h1:02q1pTm9CD83vuhBsEZZhOCS128pq87uyaQeJZkp3sQ= github.com/jaypipes/ghw v0.8.0/go.mod h1:+gR9bjm3W/HnFi90liF+Fj9GpCe/Dsibl9Im8KmC7c4= github.com/jaypipes/pcidb v0.6.0 h1:VIM7GKVaW4qba30cvB67xSCgJPTzkG8Kzw/cbs5PHWU= github.com/jaypipes/pcidb v0.6.0/go.mod h1:L2RGk04sfRhp5wvHO0gfRAMoLY/F3PKv/nwJeVoho0o= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= -github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f h1:B0OD7nYl2FPQEVrw8g2uyc1lGEzNbvrKh7fspGZcbvY= github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f/go.mod h1:aEt7p9Rvh67BYApmZwNDPpgircTO2kgdmDUoF/1QmwA= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -624,28 +345,20 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/mholt/archiver/v4 v4.0.0-alpha.4 h1:QJ4UuWgavPynEX3LXxClHDRGzYcgcvTtAMp8az7spuw= github.com/mholt/archiver/v4 v4.0.0-alpha.4/go.mod h1:J7SYS/UTAtnO3I49RQEf+2FYZVwo7XBOh9Im43VrjNs= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -655,20 +368,14 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mkevac/debugcharts v0.0.0-20191222103121-ae1c48aa8615/go.mod h1:Ad7oeElCZqA1Ufj0U9/liOF4BtVepxRcTvr2ey7zTvM= -github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/sys/mount v0.3.3 h1:fX1SVkXFJ47XWDoeFW4Sq7PdQJnV2QIDZAqjNqgEjUs= -github.com/moby/sys/mount v0.3.3/go.mod h1:PBaEorSNTLG5t/+4EgukEQVlAvVEc6ZjTySwKdqp5K0= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= +github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78= -github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= -github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= +github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= +github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f h1:J/7hjLaHLD7epG0m6TBMGmp4NQ+ibBYLfeyJWdAIFLA= +github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f/go.mod h1:15ce4BGCFxt7I5NQKT+HV0yEDxmf6fSysfEDiVo3zFM= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -677,80 +384,31 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nwaples/rardecode/v2 v2.0.0-beta.2 h1:e3mzJFJs4k83GXBEiTaQ5HgSc/kOK8q0rDaRO0MPaOk= github.com/nwaples/rardecode/v2 v2.0.0-beta.2/go.mod h1:yntwv/HfMc/Hbvtq9I19D1n58te3h6KsqCf3GxyfBGY= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0-rc1.0.20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/paulmach/orb v0.4.0 h1:ilp1MQjRapLJ1+qcays1nZpe0mvkCY+b8JU/qBKRZ1A= github.com/paulmach/orb v0.4.0/go.mod h1:FkcWtplUAIVqAuhAOV2d3rpbnQyliDOjOcLW9dUrfdU= github.com/paulmach/protoscan v0.2.1-0.20210522164731-4e53c6875432/go.mod h1:2sV+uZ/oQh66m4XJVZm5iqUZ62BN88Ex1E+TTS0nLzI= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.14 h1:+fL8AQEZtz/ijeNnpduH0bROTu0O3NZAlPjQxGn8LwE= github.com/pierrec/lz4/v4 v4.1.14/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -760,107 +418,63 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc= github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/shirou/gopsutil v2.19.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.3.0 h1:R7cSvGu+Vv+qX0gW5R/85dx2kmmJT5z5NM8ifdYjdn0= github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= -github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -868,42 +482,23 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/testcontainers/testcontainers-go v0.15.0 h1:3Ex7PUGFv0b2bBsdOv6R42+SK2qoZnWBd21LvZYhUtQ= -github.com/testcontainers/testcontainers-go v0.15.0/go.mod h1:PkohMRH2X8Hib0IWtifVexDfLPVT+tb5E9hsf7cW12w= +github.com/testcontainers/testcontainers-go v0.18.0 h1:8RXrcIQv5xX/uBOSmZd297gzvA7F0yuRA37/918o7Yg= +github.com/testcontainers/testcontainers-go v0.18.0/go.mod h1:rLC7hR2SWRjJZZNrUYiTKvUXCziNxzZiYtz9icTWYNQ= github.com/therootcompany/xz v1.0.1 h1:CmOtsn1CbtmyYiusbfmhmkpAAETj0wBIH6kCYaX+xzw= github.com/therootcompany/xz v1.0.1/go.mod h1:3K3UH1yCKgBneZYhuQUvJ9HPD19UEXEI0BWbMn8qNMY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -912,54 +507,33 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/otel v1.4.1 h1:QbINgGDDcoQUoMJa2mMaWno49lja9sHwp6aoa2n3a4g= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= go.opentelemetry.io/otel/trace v1.4.1 h1:O+16qcdTrT7zxv2J6GejTPFinSwA++cYerC5iSiF8EQ= go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1002,28 +576,20 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1038,7 +604,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1052,9 +617,8 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9 h1:Yqz/iviulwKwAREEeUd3nbBFn0XuyJqkoft2IlrvOhc= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220906165146-f3363e06e74c h1:yKufUcDwucU5urd+50/Opbt4AYpqthk7wHpHok8f1lo= +golang.org/x/net v0.0.0-20220906165146-f3363e06e74c/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1087,9 +651,7 @@ golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1098,42 +660,25 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190522044717-8097e1b27ff5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220220014-0732a990476f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1142,22 +687,11 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1167,12 +701,10 @@ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1192,11 +724,10 @@ golang.org/x/sys v0.0.0-20211110154304-99a53858aa08/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1207,34 +738,24 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1258,17 +779,14 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1286,7 +804,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1326,13 +843,11 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1341,7 +856,6 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1355,14 +869,12 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1398,14 +910,10 @@ google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad h1:kqrS+lhvaMHCxul6sKQvKJ8nAAhlVItmZV822hYFH/U= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -1447,46 +955,27 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1496,43 +985,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb h1:jhnBjNi9UFpfpl8YZhA9CrOqpnJdvzuiHsl/dnxl11M= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= -k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= -k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= -k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= -k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= -k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.4/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= -k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/src/Analyzer/ColumnTransformers.cpp b/src/Analyzer/ColumnTransformers.cpp index 27466ce5c27..cc037fb2a99 100644 --- a/src/Analyzer/ColumnTransformers.cpp +++ b/src/Analyzer/ColumnTransformers.cpp @@ -347,7 +347,7 @@ ASTPtr ReplaceColumnTransformerNode::toASTImpl() const { auto replacement_ast = std::make_shared(); replacement_ast->name = replacements_names[i]; - replacement_ast->expr = replacement_expressions_nodes[i]->toAST(); + replacement_ast->children.push_back(replacement_expressions_nodes[i]->toAST()); ast_replace_transformer->children.push_back(replacement_ast); } diff --git a/src/Analyzer/QueryTreeBuilder.cpp b/src/Analyzer/QueryTreeBuilder.cpp index 0d270c41bdf..1d1ac1fe944 100644 --- a/src/Analyzer/QueryTreeBuilder.cpp +++ b/src/Analyzer/QueryTreeBuilder.cpp @@ -886,7 +886,7 @@ ColumnTransformersNodes QueryTreeBuilder::buildColumnTransformers(const ASTPtr & for (const auto & replace_transformer_child : replace_transformer->children) { auto & replacement = replace_transformer_child->as(); - replacements.emplace_back(ReplaceColumnTransformerNode::Replacement{replacement.name, buildExpression(replacement.expr, context)}); + replacements.emplace_back(ReplaceColumnTransformerNode::Replacement{replacement.name, buildExpression(replacement.children[0], context)}); } column_transformers.emplace_back(std::make_shared(replacements, replace_transformer->is_strict)); diff --git a/src/IO/S3/copyS3File.cpp b/src/IO/S3/copyS3File.cpp index 7f48c338d06..6972e9f1c82 100644 --- a/src/IO/S3/copyS3File.cpp +++ b/src/IO/S3/copyS3File.cpp @@ -66,17 +66,7 @@ namespace { } - virtual ~UploadHelper() - { - try - { - waitForAllBackGroundTasks(); - } - catch (...) - { - tryLogCurrentException(__PRETTY_FUNCTION__); - } - } + virtual ~UploadHelper() = default; protected: std::shared_ptr client_ptr; @@ -219,17 +209,29 @@ namespace size_t position = start_offset; size_t end_position = start_offset + size; - for (size_t part_number = 1; position < end_position; ++part_number) + try { - if (multipart_upload_aborted) - break; /// No more part uploads. + for (size_t part_number = 1; position < end_position; ++part_number) + { + if (multipart_upload_aborted) + break; /// No more part uploads. - size_t next_position = std::min(position + normal_part_size, end_position); - size_t part_size = next_position - position; /// `part_size` is either `normal_part_size` or smaller if it's the final part. + size_t next_position = std::min(position + normal_part_size, end_position); + size_t part_size = next_position - position; /// `part_size` is either `normal_part_size` or smaller if it's the final part. - uploadPart(part_number, position, part_size); + uploadPart(part_number, position, part_size); - position = next_position; + position = next_position; + } + } + catch (...) + { + tryLogCurrentException(__PRETTY_FUNCTION__); + // Multipart upload failed because it wasn't possible to schedule all the tasks. + // To avoid execution of already scheduled tasks we abort MultipartUpload. + abortMultipartUpload(); + waitForAllBackGroundTasks(); + throw; } waitForAllBackGroundTasks(); diff --git a/src/Interpreters/ReplaceQueryParameterVisitor.cpp b/src/Interpreters/ReplaceQueryParameterVisitor.cpp index 6f7a0b83128..f271de26ca4 100644 --- a/src/Interpreters/ReplaceQueryParameterVisitor.cpp +++ b/src/Interpreters/ReplaceQueryParameterVisitor.cpp @@ -24,6 +24,10 @@ namespace ErrorCodes extern const int BAD_QUERY_PARAMETER; } +/// It is important to keep in mind that in the case of ASTIdentifier, we are changing the shared object itself, +/// and all shared_ptr's that pointed to the original object will now point to the new replaced value. +/// However, with ASTQueryParameter, we are only assigning a new value to the passed shared_ptr, while +/// all other shared_ptr's still point to the old ASTQueryParameter. void ReplaceQueryParameterVisitor::visit(ASTPtr & ast) { diff --git a/src/Parsers/ASTColumnsTransformers.cpp b/src/Parsers/ASTColumnsTransformers.cpp index 769503fb7fe..fec80f0a3c7 100644 --- a/src/Parsers/ASTColumnsTransformers.cpp +++ b/src/Parsers/ASTColumnsTransformers.cpp @@ -290,22 +290,28 @@ bool ASTColumnsExceptTransformer::isColumnMatching(const String & column_name) c void ASTColumnsReplaceTransformer::Replacement::formatImpl( const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const { - expr->formatImpl(settings, state, frame); + assert(children.size() == 1); + + children[0]->formatImpl(settings, state, frame); settings.ostr << (settings.hilite ? hilite_keyword : "") << " AS " << (settings.hilite ? hilite_none : "") << backQuoteIfNeed(name); } void ASTColumnsReplaceTransformer::Replacement::appendColumnName(WriteBuffer & ostr) const { - expr->appendColumnName(ostr); + assert(children.size() == 1); + + children[0]->appendColumnName(ostr); writeCString(" AS ", ostr); writeProbablyBackQuotedString(name, ostr); } void ASTColumnsReplaceTransformer::Replacement::updateTreeHashImpl(SipHash & hash_state) const { + assert(children.size() == 1); + hash_state.update(name.size()); hash_state.update(name); - expr->updateTreeHashImpl(hash_state); + children[0]->updateTreeHashImpl(hash_state); IAST::updateTreeHashImpl(hash_state); } @@ -377,7 +383,7 @@ void ASTColumnsReplaceTransformer::transform(ASTs & nodes) const if (replace_map.find(replacement.name) != replace_map.end()) throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Expressions in columns transformer REPLACE should not contain the same replacement more than once"); - replace_map.emplace(replacement.name, replacement.expr); + replace_map.emplace(replacement.name, replacement.children[0]); } for (auto & column : nodes) diff --git a/src/Parsers/ASTColumnsTransformers.h b/src/Parsers/ASTColumnsTransformers.h index f67993724c1..e42949ebfd8 100644 --- a/src/Parsers/ASTColumnsTransformers.h +++ b/src/Parsers/ASTColumnsTransformers.h @@ -98,7 +98,7 @@ public: ASTPtr clone() const override { auto replacement = std::make_shared(*this); - replacement->expr = expr->clone(); + replacement->cloneChildren(); return replacement; } @@ -106,7 +106,6 @@ public: void updateTreeHashImpl(SipHash & hash_state) const override; String name; - ASTPtr expr; protected: void formatImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override; diff --git a/src/Parsers/ExpressionElementParsers.cpp b/src/Parsers/ExpressionElementParsers.cpp index 855e452e3c7..f2660e5a40c 100644 --- a/src/Parsers/ExpressionElementParsers.cpp +++ b/src/Parsers/ExpressionElementParsers.cpp @@ -1619,7 +1619,7 @@ bool ParserColumnsTransformers::parseImpl(Pos & pos, ASTPtr & node, Expected & e auto replacement = std::make_shared(); replacement->name = getIdentifierName(ident); - replacement->expr = std::move(expr); + replacement->children.push_back(std::move(expr)); replacements.emplace_back(std::move(replacement)); return true; }; diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp index 1f69fcae8dc..882d0ed90a6 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.cpp @@ -158,6 +158,17 @@ MergeTreeReadTask::MergeTreeReadTask( { } +MergeTreeReadTask::~MergeTreeReadTask() +{ + if (reader.valid()) + reader.wait(); + + for (const auto & pre_reader : pre_reader_for_step) + { + if (pre_reader.valid()) + pre_reader.wait(); + } +} MergeTreeBlockSizePredictor::MergeTreeBlockSizePredictor( const DataPartPtr & data_part_, const Names & columns, const Block & sample_block) diff --git a/src/Storages/MergeTree/MergeTreeBlockReadUtils.h b/src/Storages/MergeTree/MergeTreeBlockReadUtils.h index 91c895c197e..2eb69a57d9c 100644 --- a/src/Storages/MergeTree/MergeTreeBlockReadUtils.h +++ b/src/Storages/MergeTree/MergeTreeBlockReadUtils.h @@ -91,6 +91,8 @@ struct MergeTreeReadTask int64_t priority_ = 0, std::future reader_ = {}, std::vector> && pre_reader_for_step_ = {}); + + ~MergeTreeReadTask(); }; diff --git a/src/Storages/MergeTree/MergeTreePrefetchedReadPool.cpp b/src/Storages/MergeTree/MergeTreePrefetchedReadPool.cpp index 7ef1e436ec8..0d8f144acca 100644 --- a/src/Storages/MergeTree/MergeTreePrefetchedReadPool.cpp +++ b/src/Storages/MergeTree/MergeTreePrefetchedReadPool.cpp @@ -540,24 +540,6 @@ MergeTreePrefetchedReadPool::ThreadsTasks MergeTreePrefetchedReadPool::createThr return result_threads_tasks; } -MergeTreePrefetchedReadPool::~MergeTreePrefetchedReadPool() -{ - for (const auto & [_, thread_tasks] : threads_tasks) - { - for (const auto & task : thread_tasks) - { - if (task->reader.valid()) - task->reader.wait(); - - for (const auto & pre_reader : task->pre_reader_for_step) - { - if (pre_reader.valid()) - pre_reader.wait(); - } - } - } -} - std::string MergeTreePrefetchedReadPool::dumpTasks(const ThreadsTasks & tasks) { WriteBufferFromOwnString result; diff --git a/src/Storages/MergeTree/MergeTreePrefetchedReadPool.h b/src/Storages/MergeTree/MergeTreePrefetchedReadPool.h index 8f46593a3c6..09c9974502a 100644 --- a/src/Storages/MergeTree/MergeTreePrefetchedReadPool.h +++ b/src/Storages/MergeTree/MergeTreePrefetchedReadPool.h @@ -34,8 +34,6 @@ public: bool is_remote_read_, const MergeTreeSettings & storage_settings_); - ~MergeTreePrefetchedReadPool() override; - MergeTreeReadTaskPtr getTask(size_t thread) override; void profileFeedback(ReadBufferFromFileBase::ProfileInfo) override {} diff --git a/tests/ci/workflow_approve_rerun_lambda/app.py b/tests/ci/workflow_approve_rerun_lambda/app.py index b563a9786c4..fb14dfd2258 100644 --- a/tests/ci/workflow_approve_rerun_lambda/app.py +++ b/tests/ci/workflow_approve_rerun_lambda/app.py @@ -123,7 +123,7 @@ TRUSTED_CONTRIBUTORS = { "BoloniniD", # Seasoned contributor, HSE "tonickkozlov", # Cloudflare "tylerhannan", # ClickHouse Employee - "myrrc", # Mike Kot, DoubleCloud + "myrrc", # Mike Kot, DoubleCloud ] } diff --git a/tests/queries/0_stateless/02661_parameterized_replace.reference b/tests/queries/0_stateless/02661_parameterized_replace.reference new file mode 100644 index 00000000000..285b16f691a --- /dev/null +++ b/tests/queries/0_stateless/02661_parameterized_replace.reference @@ -0,0 +1,2 @@ +30 +30 diff --git a/tests/queries/0_stateless/02661_parameterized_replace.sql b/tests/queries/0_stateless/02661_parameterized_replace.sql new file mode 100644 index 00000000000..b710a6cae8c --- /dev/null +++ b/tests/queries/0_stateless/02661_parameterized_replace.sql @@ -0,0 +1,2 @@ +SET param_test_a=30; +SELECT * REPLACE({test_a:UInt32} as number) FROM numbers(2);