From 708a5d830713f5aa46440eac7a53ee8398dfeee3 Mon Sep 17 00:00:00 2001 From: Kari Argillander Date: Thu, 14 Dec 2023 01:25:04 +0200 Subject: [PATCH] RFC: Remove Windows CE support (#4342) * Remove _WIN32_WCE macro Poco now use C++17 and Windows CE does not support it and VS2017 does also not support it so we can just remove Windows CE code. First remove all macro usages from our own files. * Remove WinCE support from build files Poco now use C++17 and Windows CE does not support it and VS2017 does also not support it so we can just remove Windows CE code. Remove all references from build systems / scripts. * Remove Windows CE related source and header files Poco now use C++17 and Windows CE does not support it and VS2017 does also not support it so we can just remove Windows CE code. First remove all macro usages from our own files. * Remove wcelibcex folder Poco now use C++17 and Windows CE does not support it and VS2017 does also not support it so we can just remove Windows CE code. First remove all macro usages from our own files. * Remove rest Windows CE mentions There where some Windows CE mentions left. Remove those. * Update Windows CE documentation We should keep documentation some time so people can find reason for remove. --------- Co-authored-by: Kari Argillander --- ActiveRecord/testsuite/CMakeLists.txt | 4 - ActiveRecord/testsuite/src/WinCEDriver.cpp | 30 - CppUnit/src/TextTestResult.cpp | 3 - Crypto/testsuite/CMakeLists.txt | 4 - Crypto/testsuite/src/WinCEDriver.cpp | 48 - Data/CMakeLists.txt | 2 +- Data/SQLite/CMakeLists.txt | 3 - Data/SQLite/testsuite/CMakeLists.txt | 4 - Data/SQLite/testsuite/src/WinCEDriver.cpp | 30 - Data/testsuite/CMakeLists.txt | 4 - Data/testsuite/src/WinCEDriver.cpp | 30 - Data/testsuite/testsuite.cmake | 4 - Encodings/testsuite/CMakeLists.txt | 4 - Encodings/testsuite/src/WinCEDriver.cpp | 30 - Foundation/CMakeLists.txt | 8 - Foundation/extradirs | 1 - Foundation/include/Poco/Config.h | 8 +- Foundation/include/Poco/Environment_WINCE.h | 59 -- Foundation/include/Poco/File.h | 4 - Foundation/include/Poco/File_WINCE.h | 95 -- Foundation/include/Poco/Foundation.h | 2 +- Foundation/include/Poco/Mutex.h | 4 - Foundation/include/Poco/Mutex_WINCE.h | 50 -- Foundation/include/Poco/Path_WINCE.h | 55 -- Foundation/include/Poco/PipeImpl.h | 4 - Foundation/include/Poco/Platform.h | 6 +- Foundation/include/Poco/Process.h | 4 - Foundation/include/Poco/Process_WINCE.h | 85 -- Foundation/include/Poco/RWLock.h | 4 - Foundation/include/Poco/RWLock_WINCE.h | 61 -- Foundation/include/Poco/Thread.h | 4 - Foundation/include/Poco/Thread_WINCE.h | 194 ----- Foundation/src/Debugger.cpp | 15 +- Foundation/src/DirectoryIterator_WIN32U.cpp | 4 - Foundation/src/Environment.cpp | 4 - Foundation/src/Environment_WINCE.cpp | 244 ------ Foundation/src/File.cpp | 4 - Foundation/src/File_WINCE.cpp | 447 ---------- Foundation/src/LocalDateTime.cpp | 14 +- Foundation/src/LoggingFactory.cpp | 6 +- Foundation/src/Mutex.cpp | 4 - Foundation/src/Mutex_WINCE.cpp | 80 -- Foundation/src/Path.cpp | 4 - Foundation/src/Path_WINCE.cpp | 148 ---- Foundation/src/PipeImpl.cpp | 4 - Foundation/src/Process.cpp | 4 - Foundation/src/Process_WINCE.cpp | 244 ------ Foundation/src/RWLock.cpp | 4 - Foundation/src/RWLock_WINCE.cpp | 174 ---- Foundation/src/Random.cpp | 8 +- Foundation/src/SharedLibrary_WIN32U.cpp | 10 +- Foundation/src/SharedMemory_WIN32.cpp | 6 +- Foundation/src/Thread.cpp | 4 - Foundation/src/ThreadPool.cpp | 15 - Foundation/src/Thread_WINCE.cpp | 201 ----- Foundation/src/Timestamp.cpp | 110 --- Foundation/src/Timezone.cpp | 4 - Foundation/src/Timezone_WINCE.cpp | 104 --- Foundation/testsuite/CMakeLists.txt | 12 +- Foundation/testsuite/src/CoreTest.cpp | 4 +- Foundation/testsuite/src/FileTest.cpp | 13 +- Foundation/testsuite/src/GlobTest.cpp | 2 - .../testsuite/src/LocalDateTimeTest.cpp | 7 - .../testsuite/src/LoggingFactoryTest.cpp | 2 +- Foundation/testsuite/src/PathTest.cpp | 7 - .../testsuite/src/ProcessRunnerTest.cpp | 4 - Foundation/testsuite/src/ProcessTest.cpp | 20 +- Foundation/testsuite/src/TestApp_WINCE.cpp | 33 - Foundation/testsuite/src/WinCEDriver.cpp | 30 - Foundation/wcelibcex-1.0/AUTHORS.txt | 13 - Foundation/wcelibcex-1.0/BUILD.txt | 41 - Foundation/wcelibcex-1.0/COPYING.txt | 9 - Foundation/wcelibcex-1.0/LICENSE.txt | 24 - Foundation/wcelibcex-1.0/README.txt | 22 - .../wcelibcex-1.0/msvc80/wcelibcex.vsprops | 15 - .../wcelibcex-1.0/msvc80/wcelibcex_lib.sln | 46 - .../wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj | 817 ------------------ Foundation/wcelibcex-1.0/src/errno.h | 49 -- Foundation/wcelibcex-1.0/src/fcntl.h | 48 - Foundation/wcelibcex-1.0/src/wce_abort.c | 62 -- Foundation/wcelibcex-1.0/src/wce_access.c | 101 --- Foundation/wcelibcex-1.0/src/wce_asctime.c | 138 --- Foundation/wcelibcex-1.0/src/wce_bsearch.c | 90 -- Foundation/wcelibcex-1.0/src/wce_clock.c | 87 -- Foundation/wcelibcex-1.0/src/wce_ctime.c | 100 --- Foundation/wcelibcex-1.0/src/wce_direct.h | 58 -- .../src/wce_directorymanagement.c | 227 ----- Foundation/wcelibcex-1.0/src/wce_errno.c | 42 - Foundation/wcelibcex-1.0/src/wce_errno.h | 105 --- Foundation/wcelibcex-1.0/src/wce_fcntl.h | 79 -- Foundation/wcelibcex-1.0/src/wce_findfile.c | 183 ---- Foundation/wcelibcex-1.0/src/wce_getenv.c | 53 -- Foundation/wcelibcex-1.0/src/wce_getopt.c | 154 ---- .../wcelibcex-1.0/src/wce_gettimeofday.c | 83 -- Foundation/wcelibcex-1.0/src/wce_io.h | 110 --- Foundation/wcelibcex-1.0/src/wce_lfind.c | 81 -- Foundation/wcelibcex-1.0/src/wce_localtime.c | 228 ----- Foundation/wcelibcex-1.0/src/wce_mkdir.c | 112 --- Foundation/wcelibcex-1.0/src/wce_mktime.c | 155 ---- Foundation/wcelibcex-1.0/src/wce_path.c | 479 ---------- Foundation/wcelibcex-1.0/src/wce_rename.c | 91 -- Foundation/wcelibcex-1.0/src/wce_rewind.c | 100 --- Foundation/wcelibcex-1.0/src/wce_rmdir.c | 92 -- Foundation/wcelibcex-1.0/src/wce_setlocale.c | 56 -- Foundation/wcelibcex-1.0/src/wce_stat.c | 233 ----- Foundation/wcelibcex-1.0/src/wce_stat.h | 142 --- Foundation/wcelibcex-1.0/src/wce_stdio.h | 61 -- Foundation/wcelibcex-1.0/src/wce_stdlib.h | 102 --- Foundation/wcelibcex-1.0/src/wce_strerror.c | 58 -- Foundation/wcelibcex-1.0/src/wce_string.h | 59 -- Foundation/wcelibcex-1.0/src/wce_time.c | 126 --- Foundation/wcelibcex-1.0/src/wce_time.h | 156 ---- Foundation/wcelibcex-1.0/src/wce_timesys.c | 138 --- Foundation/wcelibcex-1.0/src/wce_timesys.h | 59 -- Foundation/wcelibcex-1.0/src/wce_types.h | 62 -- Foundation/wcelibcex-1.0/src/wce_unistd.h | 72 -- Foundation/wcelibcex-1.0/src/wce_unlink.c | 100 --- Foundation/wcelibcex-1.0/src/wce_winbase.c | 38 - Foundation/wcelibcex-1.0/src/wce_winbase.h | 54 -- JSON/testsuite/CMakeLists.txt | 4 - JSON/testsuite/src/WinCEDriver.cpp | 30 - JWT/testsuite/CMakeLists.txt | 4 - JWT/testsuite/src/WinCEDriver.cpp | 30 - MongoDB/testsuite/CMakeLists.txt | 4 - MongoDB/testsuite/src/WinCEDriver.cpp | 30 - Net/CMakeLists.txt | 8 +- Net/include/Poco/Net/Net.h | 4 +- Net/include/Poco/Net/SocketDefs.h | 2 +- Net/samples/WebSocketServer/CMakeLists.txt | 4 +- Net/src/NetworkInterface.cpp | 28 +- Net/src/TCPServer.cpp | 10 +- Net/testsuite/CMakeLists.txt | 4 - Net/testsuite/src/SocketAddressTest.cpp | 2 - Net/testsuite/src/WinCEDriver.cpp | 30 - NetSSL_OpenSSL/testsuite/CMakeLists.txt | 4 - NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp | 88 -- NetSSL_Win/src/SSLManager.cpp | 8 - NetSSL_Win/src/SecureSocketImpl.cpp | 5 +- NetSSL_Win/testsuite/CMakeLists.txt | 4 - NetSSL_Win/testsuite/src/WinCEDriver.cpp | 89 -- Prometheus/testsuite/CMakeLists.txt | 4 - Prometheus/testsuite/src/WinCEDriver.cpp | 30 - Redis/testsuite/CMakeLists.txt | 4 - Redis/testsuite/src/WinCEDriver.cpp | 30 - Util/include/Poco/Util/ServerApplication.h | 4 - Util/samples/SampleApp/CMakeLists.txt | 4 +- Util/samples/SampleServer/CMakeLists.txt | 4 +- Util/samples/pkill/CMakeLists.txt | 4 +- Util/src/ServerApplication.cpp | 60 -- Util/src/WinRegistryConfiguration.cpp | 7 - Util/src/WinRegistryKey.cpp | 10 +- Util/src/WinService.cpp | 6 - Util/testsuite/CMakeLists.txt | 4 - .../testsuite/src/LoggingConfiguratorTest.cpp | 2 +- Util/testsuite/src/UtilTestSuite.cpp | 4 +- Util/testsuite/src/WinCEDriver.cpp | 30 - Util/testsuite/src/WinConfigurationTest.cpp | 9 +- XML/testsuite/CMakeLists.txt | 4 - XML/testsuite/src/WinCEDriver.cpp | 30 - Zip/samples/unzip/CMakeLists.txt | 4 +- Zip/samples/zip/CMakeLists.txt | 4 +- Zip/testsuite/CMakeLists.txt | 4 - Zip/testsuite/src/WinCEDriver.cpp | 30 - buildwin.ps1 | 6 +- doc/99200-WinCEPlatformNotes.page | 131 +-- packaging/Windows/WiX/Poco.wxs | 5 - progen.ps1 | 4 +- 167 files changed, 55 insertions(+), 9233 deletions(-) delete mode 100644 ActiveRecord/testsuite/src/WinCEDriver.cpp delete mode 100644 Crypto/testsuite/src/WinCEDriver.cpp delete mode 100644 Data/SQLite/testsuite/src/WinCEDriver.cpp delete mode 100644 Data/testsuite/src/WinCEDriver.cpp delete mode 100644 Encodings/testsuite/src/WinCEDriver.cpp delete mode 100644 Foundation/extradirs delete mode 100644 Foundation/include/Poco/Environment_WINCE.h delete mode 100644 Foundation/include/Poco/File_WINCE.h delete mode 100644 Foundation/include/Poco/Mutex_WINCE.h delete mode 100644 Foundation/include/Poco/Path_WINCE.h delete mode 100644 Foundation/include/Poco/Process_WINCE.h delete mode 100644 Foundation/include/Poco/RWLock_WINCE.h delete mode 100644 Foundation/include/Poco/Thread_WINCE.h delete mode 100644 Foundation/src/Environment_WINCE.cpp delete mode 100644 Foundation/src/File_WINCE.cpp delete mode 100644 Foundation/src/Mutex_WINCE.cpp delete mode 100644 Foundation/src/Path_WINCE.cpp delete mode 100644 Foundation/src/Process_WINCE.cpp delete mode 100644 Foundation/src/RWLock_WINCE.cpp delete mode 100644 Foundation/src/Thread_WINCE.cpp delete mode 100644 Foundation/src/Timezone_WINCE.cpp delete mode 100644 Foundation/testsuite/src/TestApp_WINCE.cpp delete mode 100644 Foundation/testsuite/src/WinCEDriver.cpp delete mode 100644 Foundation/wcelibcex-1.0/AUTHORS.txt delete mode 100644 Foundation/wcelibcex-1.0/BUILD.txt delete mode 100644 Foundation/wcelibcex-1.0/COPYING.txt delete mode 100644 Foundation/wcelibcex-1.0/LICENSE.txt delete mode 100644 Foundation/wcelibcex-1.0/README.txt delete mode 100644 Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops delete mode 100644 Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln delete mode 100644 Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj delete mode 100644 Foundation/wcelibcex-1.0/src/errno.h delete mode 100644 Foundation/wcelibcex-1.0/src/fcntl.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_abort.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_access.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_asctime.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_bsearch.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_clock.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_ctime.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_direct.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_directorymanagement.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_errno.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_errno.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_fcntl.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_findfile.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_getenv.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_getopt.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_gettimeofday.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_io.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_lfind.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_localtime.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_mkdir.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_mktime.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_path.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_rename.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_rewind.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_rmdir.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_setlocale.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_stat.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_stat.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_stdio.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_stdlib.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_strerror.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_string.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_time.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_time.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_timesys.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_timesys.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_types.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_unistd.h delete mode 100644 Foundation/wcelibcex-1.0/src/wce_unlink.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_winbase.c delete mode 100644 Foundation/wcelibcex-1.0/src/wce_winbase.h delete mode 100644 JSON/testsuite/src/WinCEDriver.cpp delete mode 100644 JWT/testsuite/src/WinCEDriver.cpp delete mode 100644 MongoDB/testsuite/src/WinCEDriver.cpp delete mode 100644 Net/testsuite/src/WinCEDriver.cpp delete mode 100644 NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp delete mode 100644 NetSSL_Win/testsuite/src/WinCEDriver.cpp delete mode 100644 Prometheus/testsuite/src/WinCEDriver.cpp delete mode 100644 Redis/testsuite/src/WinCEDriver.cpp delete mode 100644 Util/testsuite/src/WinCEDriver.cpp delete mode 100644 XML/testsuite/src/WinCEDriver.cpp delete mode 100644 Zip/testsuite/src/WinCEDriver.cpp diff --git a/ActiveRecord/testsuite/CMakeLists.txt b/ActiveRecord/testsuite/CMakeLists.txt index bfbe34d48..73b774060 100644 --- a/ActiveRecord/testsuite/CMakeLists.txt +++ b/ActiveRecord/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(ActiveRecord-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/ActiveRecord/testsuite/src/WinCEDriver.cpp b/ActiveRecord/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 54d2eaa95..000000000 --- a/ActiveRecord/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2020, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "ActiveRecordTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("ActiveRecordTestSuite", ActiveRecordTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/CppUnit/src/TextTestResult.cpp b/CppUnit/src/TextTestResult.cpp index 6b88f4dc2..f70ed82bf 100644 --- a/CppUnit/src/TextTestResult.cpp +++ b/CppUnit/src/TextTestResult.cpp @@ -104,15 +104,12 @@ void TextTestResult::ignoring(const std::string ignore) void TextTestResult::setup() { -#if !defined(_WIN32_WCE) const char* env = std::getenv("CPPUNIT_IGNORE"); if (env) { std::string ignored = env; ignoring(ignored); } - -#endif } diff --git a/Crypto/testsuite/CMakeLists.txt b/Crypto/testsuite/CMakeLists.txt index a7ae3e990..1a25fd3dd 100644 --- a/Crypto/testsuite/CMakeLists.txt +++ b/Crypto/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Crypto-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Crypto/testsuite/src/WinCEDriver.cpp b/Crypto/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 6f0530a76..000000000 --- a/Crypto/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "CryptoTestSuite.h" -#include "Poco/Crypto/Crypto.h" -#include - - -class CryptoInitializer -{ -public: - CryptoInitializer() - { - Poco::Crypto::initializeCrypto(); - } - - ~CryptoInitializer() - { - Poco::Crypto::uninitializeCrypto(); - } -}; - - -int _tmain(int argc, wchar_t* argv[]) -{ - CryptoInitializer ci; - - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("CryptoTestSuite", CryptoTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index 5542b7e94..5f02248aa 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -72,7 +72,7 @@ else() message(STATUS "PostgreSQL Support Disabled") endif() -if(ODBC_FOUND AND ENABLE_DATA_ODBC AND NOT WINCE) +if(ODBC_FOUND AND ENABLE_DATA_ODBC) message(STATUS "ODBC Support Enabled") add_subdirectory(ODBC) else() diff --git a/Data/SQLite/CMakeLists.txt b/Data/SQLite/CMakeLists.txt index 3a176d744..e62fcf23d 100644 --- a/Data/SQLite/CMakeLists.txt +++ b/Data/SQLite/CMakeLists.txt @@ -49,9 +49,6 @@ if(POCO_UNBUNDLED) SQLITE_THREADSAFE=1 ) else() - if(WINCE) - target_compile_definitions(DataSQLite PRIVATE SQLITE_MSVC_LOCALTIME_API) - endif(WINCE) target_compile_definitions(DataSQLite PRIVATE SQLITE_THREADSAFE=1 SQLITE_DISABLE_LFS diff --git a/Data/SQLite/testsuite/CMakeLists.txt b/Data/SQLite/testsuite/CMakeLists.txt index 2c04c2212..c8d1785e8 100644 --- a/Data/SQLite/testsuite/CMakeLists.txt +++ b/Data/SQLite/testsuite/CMakeLists.txt @@ -11,10 +11,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(DataSQLite-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Data/SQLite/testsuite/src/WinCEDriver.cpp b/Data/SQLite/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 8fd5bc023..000000000 --- a/Data/SQLite/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "SQLiteTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("SQLiteTestSuite", SQLiteTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Data/testsuite/CMakeLists.txt b/Data/testsuite/CMakeLists.txt index c368fc77e..af3119ef1 100644 --- a/Data/testsuite/CMakeLists.txt +++ b/Data/testsuite/CMakeLists.txt @@ -11,10 +11,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Data-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Data/testsuite/src/WinCEDriver.cpp b/Data/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 422f789ce..000000000 --- a/Data/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "DataTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("DataTestSuite", DataTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Data/testsuite/testsuite.cmake b/Data/testsuite/testsuite.cmake index 5e7334dea..c800fb031 100644 --- a/Data/testsuite/testsuite.cmake +++ b/Data/testsuite/testsuite.cmake @@ -11,10 +11,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS WIN src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Data-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Encodings/testsuite/CMakeLists.txt b/Encodings/testsuite/CMakeLists.txt index 7f68ab71f..8be3bafa0 100644 --- a/Encodings/testsuite/CMakeLists.txt +++ b/Encodings/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Encodings-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Encodings/testsuite/src/WinCEDriver.cpp b/Encodings/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 6a5d85ca2..000000000 --- a/Encodings/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "EncodingsTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("EncodingsTestSuite", EncodingsTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index 748b30b8b..18fa814af 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -10,18 +10,10 @@ POCO_HEADERS_AUTO(SRCS ${HDRS_G}) POCO_SOURCES_AUTO_PLAT(SRCS UNIX src/SyslogChannel.cpp) POCO_HEADERS_AUTO(SRCS include/Poco/SyslogChannel.h) -# For Windows CE we need to disable these -if(WINCE) -POCO_SOURCES_AUTO_PLAT(SRCS OFF - src/WindowsConsoleChannel.cpp - src/EventLogChannel.cpp - ) -else() POCO_SOURCES_AUTO_PLAT(SRCS WIN32 src/WindowsConsoleChannel.cpp src/EventLogChannel.cpp ) -endif() # Version Resource if(MSVC AND BUILD_SHARED_LIBS) diff --git a/Foundation/extradirs b/Foundation/extradirs deleted file mode 100644 index 9cc510422..000000000 --- a/Foundation/extradirs +++ /dev/null @@ -1 +0,0 @@ -wcelibcex-1.0 \ No newline at end of file diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h index 99463f58d..66a50fdd1 100644 --- a/Foundation/include/Poco/Config.h +++ b/Foundation/include/Poco/Config.h @@ -42,7 +42,7 @@ // #define POCO_NO_SHAREDMEMORY -// Define if no header is available (such as on WinCE) +// Define if no header is available // #define POCO_NO_LOCALE @@ -165,12 +165,6 @@ #endif -// Windows CE has no locale support -#if defined(_WIN32_WCE) - #define POCO_NO_LOCALE -#endif - - // Enable the poco_debug_* and poco_trace_* macros // even if the _DEBUG variable is not set. // This allows the use of these macros in a release version. diff --git a/Foundation/include/Poco/Environment_WINCE.h b/Foundation/include/Poco/Environment_WINCE.h deleted file mode 100644 index b513682f6..000000000 --- a/Foundation/include/Poco/Environment_WINCE.h +++ /dev/null @@ -1,59 +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/Foundation/include/Poco/File.h b/Foundation/include/Poco/File.h index 2ba1e964c..c13159da2 100644 --- a/Foundation/include/Poco/File.h +++ b/Foundation/include/Poco/File.h @@ -24,11 +24,7 @@ #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "File_WINCE.h" -#else #include "Poco/File_WIN32U.h" -#endif #elif defined(POCO_VXWORKS) #include "Poco/File_VX.h" #elif defined(POCO_OS_FAMILY_UNIX) diff --git a/Foundation/include/Poco/File_WINCE.h b/Foundation/include/Poco/File_WINCE.h deleted file mode 100644 index 336ff6ef3..000000000 --- a/Foundation/include/Poco/File_WINCE.h +++ /dev/null @@ -1,95 +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: - - enum Options { - OPT_FAIL_ON_OVERWRITE_IMPL = 0x01 - }; - - 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, int options = 0) const; - void renameToImpl(const std::string& path, int options = 0); - 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/Foundation/include/Poco/Foundation.h b/Foundation/include/Poco/Foundation.h index a217ecef9..83133af79 100644 --- a/Foundation/include/Poco/Foundation.h +++ b/Foundation/include/Poco/Foundation.h @@ -44,7 +44,7 @@ // Foundation_API functions as being imported from a DLL, wheras this DLL sees symbols // defined with this macro as being exported. // -#if (defined(_WIN32) || defined(_WIN32_WCE)) && defined(POCO_DLL) +#if defined(_WIN32) && defined(POCO_DLL) #if defined(Foundation_EXPORTS) #define Foundation_API __declspec(dllexport) #else diff --git a/Foundation/include/Poco/Mutex.h b/Foundation/include/Poco/Mutex.h index 5b926ceea..a7a4100fa 100644 --- a/Foundation/include/Poco/Mutex.h +++ b/Foundation/include/Poco/Mutex.h @@ -28,11 +28,7 @@ #include "Poco/Mutex_STD.h" #else #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 diff --git a/Foundation/include/Poco/Mutex_WINCE.h b/Foundation/include/Poco/Mutex_WINCE.h deleted file mode 100644 index 27f93a72a..000000000 --- a/Foundation/include/Poco/Mutex_WINCE.h +++ /dev/null @@ -1,50 +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/Foundation.h" -#include "Poco/Exception.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/Foundation/include/Poco/Path_WINCE.h b/Foundation/include/Poco/Path_WINCE.h deleted file mode 100644 index 32677150d..000000000 --- a/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 "Poco/Foundation.h" -#include - - -namespace Poco { - - -class Foundation_API PathImpl -{ -public: - static std::string selfImpl(); - 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/Foundation/include/Poco/PipeImpl.h b/Foundation/include/Poco/PipeImpl.h index b0b718370..1d94003a1 100644 --- a/Foundation/include/Poco/PipeImpl.h +++ b/Foundation/include/Poco/PipeImpl.h @@ -22,11 +22,7 @@ #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) #include "Poco/PipeImpl_POSIX.h" #else diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h index 97ffacd2b..81c483b67 100644 --- a/Foundation/include/Poco/Platform.h +++ b/Foundation/include/Poco/Platform.h @@ -41,7 +41,6 @@ #define POCO_OS_ANDROID 0x000f #define POCO_OS_UNKNOWN_UNIX 0x00ff #define POCO_OS_WINDOWS_NT 0x1001 -#define POCO_OS_WINDOWS_CE 0x1011 #define POCO_OS_VMS 0x2001 @@ -101,9 +100,6 @@ #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 @@ -212,7 +208,7 @@ #define POCO_ARCH_BIG_ENDIAN 1 #elif defined(__sh__) || defined(__sh) || defined(SHx) || defined(_SHX_) #define POCO_ARCH POCO_ARCH_SH - #if defined(__LITTLE_ENDIAN__) || (POCO_OS == POCO_OS_WINDOWS_CE) + #if defined(__LITTLE_ENDIAN__) #define POCO_ARCH_LITTLE_ENDIAN 1 #else #define POCO_ARCH_BIG_ENDIAN 1 diff --git a/Foundation/include/Poco/Process.h b/Foundation/include/Poco/Process.h index e1aa2afd9..717040444 100644 --- a/Foundation/include/Poco/Process.h +++ b/Foundation/include/Poco/Process.h @@ -22,11 +22,7 @@ #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Process_WINCE.h" -#else #include "Poco/Process_WIN32U.h" -#endif #elif defined(POCO_VXWORKS) #include "Poco/Process_VX.h" #elif defined(POCO_OS_FAMILY_UNIX) diff --git a/Foundation/include/Poco/Process_WINCE.h b/Foundation/include/Poco/Process_WINCE.h deleted file mode 100644 index 045329e63..000000000 --- a/Foundation/include/Poco/Process_WINCE.h +++ /dev/null @@ -1,85 +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 "Poco/Foundation.h" -#include "Poco/RefCountedObject.h" -#include -#include -#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; - int tryWait() 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, - int options = 0); - 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/Foundation/include/Poco/RWLock.h b/Foundation/include/Poco/RWLock.h index 60ce8bf9c..b0ea3e456 100644 --- a/Foundation/include/Poco/RWLock.h +++ b/Foundation/include/Poco/RWLock.h @@ -23,11 +23,7 @@ #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 #include "Poco/RWLock_Android.h" #elif defined(POCO_VXWORKS) diff --git a/Foundation/include/Poco/RWLock_WINCE.h b/Foundation/include/Poco/RWLock_WINCE.h deleted file mode 100644 index 13d080654..000000000 --- a/Foundation/include/Poco/RWLock_WINCE.h +++ /dev/null @@ -1,61 +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/Foundation.h" -#include "Poco/Exception.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/Foundation/include/Poco/Thread.h b/Foundation/include/Poco/Thread.h index 30eaa2d51..56f45e561 100644 --- a/Foundation/include/Poco/Thread.h +++ b/Foundation/include/Poco/Thread.h @@ -26,11 +26,7 @@ #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 diff --git a/Foundation/include/Poco/Thread_WINCE.h b/Foundation/include/Poco/Thread_WINCE.h deleted file mode 100644 index e998e8d32..000000000 --- a/Foundation/include/Poco/Thread_WINCE.h +++ /dev/null @@ -1,194 +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 setNameImpl(const std::string& threadName); - std::string getNameImpl() const; - std::string getOSThreadNameImpl(); - /// Returns the thread's name, expressed as an operating system - /// specific name value. Return empty string if thread is not running. - /// For test used only. - 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 yieldImpl(); - static ThreadImpl* currentImpl(); - static TIDImpl currentTidImpl(); - static long currentOsTidImpl(); - bool setAffinityImpl(int); - int getAffinityImpl() const; - -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; - std::string _name; - - 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::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; -} - - -inline bool ThreadImpl::setAffinityImpl(int) -{ - return false; -} - - -inline int ThreadImpl::getAffinityImpl() const -{ - return -1; -} - - -} // namespace Poco - - -#endif // Foundation_Thread_WINCE_INCLUDED diff --git a/Foundation/src/Debugger.cpp b/Foundation/src/Debugger.cpp index f50a7f75b..3e9915fd1 100644 --- a/Foundation/src/Debugger.cpp +++ b/Foundation/src/Debugger.cpp @@ -37,20 +37,7 @@ 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 + return IsDebuggerPresent() ? true : false; #elif defined(POCO_VXWORKS) return false; #elif defined(POCO_OS_FAMILY_UNIX) diff --git a/Foundation/src/DirectoryIterator_WIN32U.cpp b/Foundation/src/DirectoryIterator_WIN32U.cpp index 7289016ee..7655ac3fa 100644 --- a/Foundation/src/DirectoryIterator_WIN32U.cpp +++ b/Foundation/src/DirectoryIterator_WIN32U.cpp @@ -13,11 +13,7 @@ #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 diff --git a/Foundation/src/Environment.cpp b/Foundation/src/Environment.cpp index 5a1e3ec53..d59ef409e 100644 --- a/Foundation/src/Environment.cpp +++ b/Foundation/src/Environment.cpp @@ -28,12 +28,8 @@ #elif 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_WIN32U.cpp" #endif -#endif namespace Poco { diff --git a/Foundation/src/Environment_WINCE.cpp b/Foundation/src/Environment_WINCE.cpp deleted file mode 100644 index 6c8b8f4a8..000000000 --- a/Foundation/src/Environment_WINCE.cpp +++ /dev/null @@ -1,244 +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) - { - delete[] reinterpret_cast(pAdapterInfo); - 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/Foundation/src/File.cpp b/Foundation/src/File.cpp index 7f96d5df7..9fe69ee2d 100644 --- a/Foundation/src/File.cpp +++ b/Foundation/src/File.cpp @@ -18,11 +18,7 @@ #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "File_WINCE.cpp" -#else #include "File_WIN32U.cpp" -#endif #elif defined(POCO_VXWORKS) #include "File_VX.cpp" #elif defined(POCO_OS_FAMILY_UNIX) diff --git a/Foundation/src/File_WINCE.cpp b/Foundation/src/File_WINCE.cpp deleted file mode 100644 index c894d3196..000000000 --- a/Foundation/src/File_WINCE.cpp +++ /dev/null @@ -1,447 +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, int options) const -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (CopyFileW(_upath.c_str(), upath.c_str(), (options & OPT_FAIL_ON_OVERWRITE_IMPL) != 0) == 0) - handleLastErrorImpl(_path); -} - - -void FileImpl::renameToImpl(const std::string& path, int options) -{ - poco_assert (!_path.empty()); - - std::wstring upath; - convertPath(path, upath); - if (options & OPT_FAIL_ON_OVERWRITE_IMPL) { - if (MoveFileW(_upath.c_str(), upath.c_str()) == 0) - handleLastErrorImpl(_path); - } else { - if (MoveFileW(_upath.c_str(), upath.c_str(), MOVEFILE_REPLACE_EXISTING) == 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/Foundation/src/LocalDateTime.cpp b/Foundation/src/LocalDateTime.cpp index 846ebc7fc..7449d901f 100644 --- a/Foundation/src/LocalDateTime.cpp +++ b/Foundation/src/LocalDateTime.cpp @@ -23,9 +23,7 @@ #include "Poco/Exception.h" #include #include -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -#include "wce_time.h" -#elif defined(_WIN32) +#if defined(_WIN32) #include #endif @@ -268,14 +266,11 @@ 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 brokenBuf; std::tm* broken = &brokenBuf; errno_t err = localtime_s(broken, &epochTime); if (err) broken = nullptr; -#endif + if (!broken) throw Poco::SystemException("cannot get local time"); _tzd = Timezone::utcOffset() + Timezone::dst(_dateTime.timestamp()); #else @@ -312,11 +307,8 @@ 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) ? Timezone::dst(_dateTime.timestamp()) : 0; return local; diff --git a/Foundation/src/LoggingFactory.cpp b/Foundation/src/LoggingFactory.cpp index 267e4dd4d..3b6edc3f3 100644 --- a/Foundation/src/LoggingFactory.cpp +++ b/Foundation/src/LoggingFactory.cpp @@ -25,7 +25,7 @@ #if defined(POCO_OS_FAMILY_UNIX) && !defined(POCO_NO_SYSLOGCHANNEL) #include "Poco/SyslogChannel.h" #endif -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) +#if defined(POCO_OS_FAMILY_WINDOWS) #include "Poco/EventLogChannel.h" #include "Poco/WindowsConsoleChannel.h" #endif @@ -85,7 +85,7 @@ LoggingFactory& LoggingFactory::defaultFactory() void LoggingFactory::registerBuiltins() { _channelFactory.registerClass("AsyncChannel", new Instantiator); -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) +#if defined(POCO_OS_FAMILY_WINDOWS) _channelFactory.registerClass("ConsoleChannel", new Instantiator); _channelFactory.registerClass("ColorConsoleChannel", new Instantiator); #else @@ -110,7 +110,7 @@ void LoggingFactory::registerBuiltins() #endif #endif -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) +#if defined(POCO_OS_FAMILY_WINDOWS) _channelFactory.registerClass("EventLogChannel", new Instantiator); #endif diff --git a/Foundation/src/Mutex.cpp b/Foundation/src/Mutex.cpp index 939e7afb4..aa8fb2c26 100644 --- a/Foundation/src/Mutex.cpp +++ b/Foundation/src/Mutex.cpp @@ -17,11 +17,7 @@ #if defined(POCO_ENABLE_STD_MUTEX) #include "Mutex_STD.cpp" #elif 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 diff --git a/Foundation/src/Mutex_WINCE.cpp b/Foundation/src/Mutex_WINCE.cpp deleted file mode 100644 index 927d98d99..000000000 --- a/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/Foundation/src/Path.cpp b/Foundation/src/Path.cpp index 23e83aeb8..d69c40318 100644 --- a/Foundation/src/Path.cpp +++ b/Foundation/src/Path.cpp @@ -26,12 +26,8 @@ #if defined(POCO_OS_FAMILY_UNIX) #include "Path_UNIX.cpp" #elif defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Path_WINCE.cpp" -#else #include "Path_WIN32U.cpp" #endif -#endif namespace Poco { diff --git a/Foundation/src/Path_WINCE.cpp b/Foundation/src/Path_WINCE.cpp deleted file mode 100644 index 7f2ba0739..000000000 --- a/Foundation/src/Path_WINCE.cpp +++ /dev/null @@ -1,148 +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::selfImpl() -{ - return(""); -} - -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/Foundation/src/PipeImpl.cpp b/Foundation/src/PipeImpl.cpp index 0f43b45ba..1922bee48 100644 --- a/Foundation/src/PipeImpl.cpp +++ b/Foundation/src/PipeImpl.cpp @@ -16,11 +16,7 @@ #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) #include "PipeImpl_POSIX.cpp" #else diff --git a/Foundation/src/Process.cpp b/Foundation/src/Process.cpp index f31a0ecbb..506890857 100644 --- a/Foundation/src/Process.cpp +++ b/Foundation/src/Process.cpp @@ -48,11 +48,7 @@ namespace #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Process_WINCE.cpp" -#else #include "Process_WIN32U.cpp" -#endif #elif defined(POCO_VXWORKS) #include "Process_VX.cpp" #elif defined(POCO_OS_FAMILY_UNIX) diff --git a/Foundation/src/Process_WINCE.cpp b/Foundation/src/Process_WINCE.cpp deleted file mode 100644 index 96b26c946..000000000 --- a/Foundation/src/Process_WINCE.cpp +++ /dev/null @@ -1,244 +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; -} - - -int ProcessHandleImpl::tryWait() const -{ - DWORD exitCode; - if (GetExitCodeProcess(_hProcess, &exitCode) == 0) - throw SystemException("Cannot get exit code for process", NumberFormatter::format(_pid)); - if (exitCode == STILL_ACTIVE) - return -1; - else - 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, int options) -{ - 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; - if (hProc) - { - DWORD exitCode; - BOOL rc = GetExitCodeProcess(hProc, &exitCode); - if (!rc || exitCode != STILL_ACTIVE) result = false; - CloseHandle(hProc); - } - else - { - 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/Foundation/src/RWLock.cpp b/Foundation/src/RWLock.cpp index 2937a5798..9bf18cc65 100644 --- a/Foundation/src/RWLock.cpp +++ b/Foundation/src/RWLock.cpp @@ -16,11 +16,7 @@ #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 #include "RWLock_Android.cpp" #elif defined(POCO_VXWORKS) diff --git a/Foundation/src/RWLock_WINCE.cpp b/Foundation/src/RWLock_WINCE.cpp deleted file mode 100644 index f669605da..000000000 --- a/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/Foundation/src/Random.cpp b/Foundation/src/Random.cpp index 59df7122f..51d027c96 100644 --- a/Foundation/src/Random.cpp +++ b/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,8 @@ 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/Foundation/src/SharedLibrary_WIN32U.cpp b/Foundation/src/SharedLibrary_WIN32U.cpp index 6ecd4e953..4432fbc8f 100644 --- a/Foundation/src/SharedLibrary_WIN32U.cpp +++ b/Foundation/src/SharedLibrary_WIN32U.cpp @@ -44,10 +44,10 @@ void SharedLibraryImpl::loadImpl(const std::string& path, int /*flags*/) 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); @@ -88,13 +88,7 @@ void* SharedLibraryImpl::findSymbolImpl(const std::string& name) 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; } diff --git a/Foundation/src/SharedMemory_WIN32.cpp b/Foundation/src/SharedMemory_WIN32.cpp index 6d35611cd..f653eddf0 100644 --- a/Foundation/src/SharedMemory_WIN32.cpp +++ b/Foundation/src/SharedMemory_WIN32.cpp @@ -55,10 +55,7 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh { DWORD dwRetVal = GetLastError(); int retVal = static_cast(dwRetVal); -#if defined (_WIN32_WCE) - throw SystemException(Poco::format("Cannot create shared memory object %s [Error %d: %s]", - _name, retVal, Error::getMessage(dwRetVal))); -#else + if (_mode != PAGE_READONLY || dwRetVal != 5) { throw SystemException(Poco::format("Cannot create shared memory object %s [Error %d: %s]", @@ -72,7 +69,6 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh throw SystemException(Poco::format("Cannot open shared memory object %s [Error %d: %s]", _name, retVal, Error::getMessage(dwRetVal)), retVal); } -#endif } map(); } diff --git a/Foundation/src/Thread.cpp b/Foundation/src/Thread.cpp index fdc2b3bae..19171262b 100644 --- a/Foundation/src/Thread.cpp +++ b/Foundation/src/Thread.cpp @@ -21,11 +21,7 @@ #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 diff --git a/Foundation/src/ThreadPool.cpp b/Foundation/src/ThreadPool.cpp index 028370f66..bb3f59600 100644 --- a/Foundation/src/ThreadPool.cpp +++ b/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/Foundation/src/Thread_WINCE.cpp b/Foundation/src/Thread_WINCE.cpp deleted file mode 100644 index 84544bbdf..000000000 --- a/Foundation/src/Thread_WINCE.cpp +++ /dev/null @@ -1,201 +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::setNameImpl(const std::string& threadName) -{ - std::string realName = threadName; - if (threadName.size() > POCO_MAX_THREAD_NAME_LEN) - { - int half = (POCO_MAX_THREAD_NAME_LEN - 1) / 2; - std::string truncName(threadName, 0, half); - truncName.append("~"); - truncName.append(threadName, threadName.size() - half); - realName = truncName; - } - - if (realName != _name) - { - _name = realName; - } -} - - -std::string ThreadImpl::getNameImpl() const -{ - return _name; -} - -std::string ThreadImpl::getOSThreadNameImpl() -{ - // return fake thread name; - return isRunningImpl() ? _name : ""; -} - -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(); -} - -long ThreadImpl::currentOsTidImpl() -{ - 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/Foundation/src/Timestamp.cpp b/Foundation/src/Timestamp.cpp index da05a56bf..1bfccf613 100644 --- a/Foundation/src/Timestamp.cpp +++ b/Foundation/src/Timestamp.cpp @@ -30,9 +30,6 @@ #endif #elif defined(POCO_OS_FAMILY_WINDOWS) #include "Poco/UnWindows.h" -#if defined(_WIN32_WCE) -#include -#endif #endif @@ -45,109 +42,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 { @@ -217,11 +111,7 @@ 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; diff --git a/Foundation/src/Timezone.cpp b/Foundation/src/Timezone.cpp index a70a0cfe8..550824f3d 100644 --- a/Foundation/src/Timezone.cpp +++ b/Foundation/src/Timezone.cpp @@ -22,11 +22,7 @@ #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 diff --git a/Foundation/src/Timezone_WINCE.cpp b/Foundation/src/Timezone_WINCE.cpp deleted file mode 100644 index 99ae9ce3f..000000000 --- a/Foundation/src/Timezone_WINCE.cpp +++ /dev/null @@ -1,104 +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; -} - - -int Timezone::dst(const Poco::Timestamp& timestamp) -{ - if (isDst(timestamp)) - { - TIME_ZONE_INFORMATION tzInfo; - GetTimeZoneInformation(&tzInfo); - return -tzInfo.DaylightBias*60; - } - else return 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/Foundation/testsuite/CMakeLists.txt b/Foundation/testsuite/CMakeLists.txt index 7e2c9b526..d421ae94a 100644 --- a/Foundation/testsuite/CMakeLists.txt +++ b/Foundation/testsuite/CMakeLists.txt @@ -4,7 +4,6 @@ set(TESTUNIT "Foundation-testrunner") file(GLOB SRCS_G "src/*.cpp") file(GLOB SRCS_G_REMOVE src/TestApp.cpp - src/TestApp_WINCE.cpp src/TestLibrary.cpp src/TestPlugin.cpp ) @@ -20,10 +19,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Foundation-testrunner ${TEST_SRCS}) if(ANDROID) add_test( @@ -53,12 +48,7 @@ if(UNIX AND NOT ANDROID) endif(UNIX AND NOT ANDROID) # TestApp -if(WINCE) -add_executable(TestApp src/TestApp_WINCE.cpp) - set_target_properties(TestApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -else() - add_executable(TestApp src/TestApp.cpp) -endif() +add_executable(TestApp src/TestApp.cpp) # The test is run in the runtime directory. So the TestApp is built there too because it is used by the tests set_target_properties(TestApp PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) target_link_libraries(TestApp PUBLIC Poco::Foundation) diff --git a/Foundation/testsuite/src/CoreTest.cpp b/Foundation/testsuite/src/CoreTest.cpp index 7c61c0ec1..234d5071f 100644 --- a/Foundation/testsuite/src/CoreTest.cpp +++ b/Foundation/testsuite/src/CoreTest.cpp @@ -181,11 +181,11 @@ void CoreTest::testBugcheck() void CoreTest::testEnvironment() { -#if !defined(_WIN32_WCE) + Environment::set("FOO", "BAR"); assertTrue (Environment::has("FOO")); assertTrue (Environment::get("FOO") == "BAR"); -#endif + try { std::string v = Environment::get("THISONEDOESNOTEXIST123"); diff --git a/Foundation/testsuite/src/FileTest.cpp b/Foundation/testsuite/src/FileTest.cpp index a42899cc8..5b8b996eb 100644 --- a/Foundation/testsuite/src/FileTest.cpp +++ b/Foundation/testsuite/src/FileTest.cpp @@ -231,15 +231,13 @@ void FileTest::testFileAttributes3() #else File f("/dev/console"); #endif -#elif defined(POCO_OS_FAMILY_WINDOWS) && !defined(_WIN32_WCE) +#elif defined(POCO_OS_FAMILY_WINDOWS) File f("CON"); #endif -#if !defined(_WIN32_WCE) assertTrue (f.isDevice()); assertTrue (!f.isFile()); assertTrue (!f.isDirectory()); -#endif } @@ -271,12 +269,6 @@ void FileTest::testCompare() void FileTest::testRootDir() { #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) - File f1("\\"); - File f2("/"); - assertTrue (f1.exists()); - assertTrue (f2.exists()); -#else File f1("/"); File f2("c:/"); File f3("c:\\"); @@ -285,7 +277,6 @@ void FileTest::testRootDir() assertTrue (f2.exists()); assertTrue (f3.exists()); assertTrue (f4.exists()); -#endif #else File f1("/"); assertTrue (f1.exists()); @@ -588,7 +579,7 @@ void FileTest::testRenameFailIfExists() { void FileTest::testLongPath() { -#if defined(_WIN32) && !defined(_WIN32_WCE) +#if defined(_WIN32) Poco::Path p("longpathtest"); p.makeAbsolute(); std::string longpath(p.toString()); diff --git a/Foundation/testsuite/src/GlobTest.cpp b/Foundation/testsuite/src/GlobTest.cpp index 529fe8851..368d2ab89 100644 --- a/Foundation/testsuite/src/GlobTest.cpp +++ b/Foundation/testsuite/src/GlobTest.cpp @@ -456,13 +456,11 @@ void GlobTest::testGlob() assertTrue (files.find("globtest/testsuite/src/test.c") != files.end()); assertTrue (files.find("globtest/testsuite/src/main.c") != files.end()); -#if !defined(_WIN32_WCE) // won't work if current directory is root dir files.clear(); Glob::glob("globtest/../*/testsuite/*/", files); translatePaths(files); assertTrue (files.size() == 1); -#endif File dir("globtest"); dir.remove(true); diff --git a/Foundation/testsuite/src/LocalDateTimeTest.cpp b/Foundation/testsuite/src/LocalDateTimeTest.cpp index c1b8d4f08..c0f040273 100644 --- a/Foundation/testsuite/src/LocalDateTimeTest.cpp +++ b/Foundation/testsuite/src/LocalDateTimeTest.cpp @@ -25,9 +25,6 @@ #include "Poco/DateTimeFormatter.h" #include #include -#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800 -#include "wce_time.h" -#endif using Poco::LocalDateTime; @@ -35,9 +32,7 @@ using Poco::DateTime; using Poco::Timestamp; using Poco::Timespan; using Poco::Timezone; -#ifndef _WIN32_WCE using std::strftime; -#endif LocalDateTimeTest::LocalDateTimeTest(const std::string& name): CppUnit::TestCase(name) @@ -368,7 +363,6 @@ void LocalDateTimeTest::testSwap() void LocalDateTimeTest::testTimezone() { -#if !defined(_WIN32_WCE) std::time_t tINCREMENT = (30 * 24 * 60 * 60); // 30 days Timespan tsINCREMENT(30*Timespan::DAYS); LocalDateTime now; @@ -450,7 +444,6 @@ void LocalDateTimeTest::testTimezone() << " - failed to locate DST boundary, timezone test skipped." << std::endl; } -#endif } diff --git a/Foundation/testsuite/src/LoggingFactoryTest.cpp b/Foundation/testsuite/src/LoggingFactoryTest.cpp index 2cb53b87b..7775d8fb2 100644 --- a/Foundation/testsuite/src/LoggingFactoryTest.cpp +++ b/Foundation/testsuite/src/LoggingFactoryTest.cpp @@ -80,7 +80,7 @@ void LoggingFactoryTest::testBuiltins() LoggingFactory& fact = LoggingFactory::defaultFactory(); Channel::Ptr pConsoleChannel = fact.createChannel("ConsoleChannel"); -#if defined(_WIN32) && !defined(_WIN32_WCE) +#if defined(_WIN32) assertTrue (!pConsoleChannel.cast().isNull()); #else assertTrue (!pConsoleChannel.cast().isNull()); diff --git a/Foundation/testsuite/src/PathTest.cpp b/Foundation/testsuite/src/PathTest.cpp index fc0af6844..86145e9b3 100644 --- a/Foundation/testsuite/src/PathTest.cpp +++ b/Foundation/testsuite/src/PathTest.cpp @@ -19,12 +19,8 @@ #if defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) -#include "Poco/Path_WINCE.h" -#else #include "Poco/Path_WIN32U.h" #endif -#endif using Poco::Path; @@ -1549,9 +1545,6 @@ void PathTest::testFind() bool found = Path::find(Environment::get("PATH"), "ls", p); bool notfound = Path::find(Environment::get("PATH"), "xxxyyy123", p); #elif defined(POCO_OS_FAMILY_WINDOWS) -#if defined(_WIN32_WCE) - return; -#endif bool found = Path::find(Environment::get("PATH"), "cmd.exe", p); bool notfound = Path::find(Environment::get("PATH"), "xxxyyy123.zzz", p); #else diff --git a/Foundation/testsuite/src/ProcessRunnerTest.cpp b/Foundation/testsuite/src/ProcessRunnerTest.cpp index fad57fb7b..e564a33c8 100644 --- a/Foundation/testsuite/src/ProcessRunnerTest.cpp +++ b/Foundation/testsuite/src/ProcessRunnerTest.cpp @@ -97,10 +97,6 @@ void ProcessRunnerTest::testProcessRunner() #if defined(POCO_OS_FAMILY_UNIX) cmd += name; -#elif defined(_WIN32_WCE) - cmd = "\\"; - cmd += name; - cmd += ".EXE"; #else cmd = name; #endif diff --git a/Foundation/testsuite/src/ProcessTest.cpp b/Foundation/testsuite/src/ProcessTest.cpp index f66fac4e5..b70e157ba 100644 --- a/Foundation/testsuite/src/ProcessTest.cpp +++ b/Foundation/testsuite/src/ProcessTest.cpp @@ -65,10 +65,6 @@ void ProcessTest::testLaunch() #if defined(POCO_OS_FAMILY_UNIX) cmd += name; -#elif defined(_WIN32_WCE) - cmd = "\\"; - cmd += name; - cmd += ".EXE"; #else cmd = name; #endif @@ -85,7 +81,6 @@ void ProcessTest::testLaunch() void ProcessTest::testLaunchRedirectIn() { -#if !defined(_WIN32_WCE) std::string name("TestApp"); std::string cmd; #if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID) @@ -107,13 +102,11 @@ void ProcessTest::testLaunchRedirectIn() ostr.close(); int rc = ph.wait(); assertTrue (rc == 100); -#endif // !defined(_WIN32_WCE) } void ProcessTest::testLaunchRedirectOut() { -#if !defined(_WIN32_WCE) std::string name("TestApp"); std::string cmd; #if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID) @@ -137,13 +130,11 @@ void ProcessTest::testLaunchRedirectOut() assertTrue (s == "Hello, world!"); int rc = ph.wait(); assertTrue (rc == 1); -#endif // !defined(_WIN32_WCE) } void ProcessTest::testLaunchEnv() { -#if !defined(_WIN32_WCE) std::string name("TestApp"); std::string cmd; #if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID) @@ -169,13 +160,12 @@ void ProcessTest::testLaunchEnv() assertTrue (s == "test"); int rc = ph.wait(); assertTrue (rc == 0); -#endif // !defined(_WIN32_WCE) } void ProcessTest::testLaunchArgs() { -#if defined (_WIN32) && !defined(_WIN32_WCE) +#if defined (_WIN32) std::string name("TestApp"); #if defined(_DEBUG) name += 'd'; @@ -225,7 +215,7 @@ void ProcessTest::testLaunchArgs() assertTrue (argNumber == args.size()); int rc = ph.wait(); assertTrue (rc == args.size()); -#endif // !defined(_WIN32_WCE) +#endif // defined (_WIN32) } @@ -239,10 +229,6 @@ void ProcessTest::testLaunchInvalidCommand() #if defined(POCO_OS_FAMILY_UNIX) cmd += name; -#elif defined(_WIN32_WCE) - cmd = "\\"; - cmd += name; - cmd += ".EXE"; #else cmd = name; #endif @@ -269,7 +255,6 @@ void ProcessTest::testLaunchInvalidCommand() void ProcessTest::testIsRunning() { -#if !defined(_WIN32_WCE) std::string name("TestApp"); std::string cmd; #if defined(_DEBUG) && (POCO_OS != POCO_OS_ANDROID) @@ -295,7 +280,6 @@ void ProcessTest::testIsRunning() int POCO_UNUSED rc = ph.wait(); assertTrue (!Process::isRunning(ph)); assertTrue (!Process::isRunning(id)); -#endif // !defined(_WIN32_WCE) } diff --git a/Foundation/testsuite/src/TestApp_WINCE.cpp b/Foundation/testsuite/src/TestApp_WINCE.cpp deleted file mode 100644 index a41b8c1ed..000000000 --- a/Foundation/testsuite/src/TestApp_WINCE.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// -// TestApp_WINCE.cpp -// -// Copyright (c) 2005-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - if (argc > 1) - { - std::wstring arg(argv[1]); - if (arg == L"-hello") - { - std::cout << "Hello, world!"; - } - else if (arg == L"-count") - { - int n = 0; - int c = std::cin.get(); - while (c != -1) { ++n; c = std::cin.get(); } - return n; - } - } - return argc - 1; -} diff --git a/Foundation/testsuite/src/WinCEDriver.cpp b/Foundation/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 9c5104c8c..000000000 --- a/Foundation/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "FoundationTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("FoundationTestSuite", FoundationTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Foundation/wcelibcex-1.0/AUTHORS.txt b/Foundation/wcelibcex-1.0/AUTHORS.txt deleted file mode 100644 index 7b5400993..000000000 --- a/Foundation/wcelibcex-1.0/AUTHORS.txt +++ /dev/null @@ -1,13 +0,0 @@ -List of WCELIBCEX authors: - -Active developers ------------------ - -* Mateusz Loskot (mateusz@loskot.net) - -* Stéphane Dunand (sdunand@sirap.fr) - -Previously contributed ----------------------- - -* Piotr Wisniewski (pwisniewski@taxussi.com.pl) diff --git a/Foundation/wcelibcex-1.0/BUILD.txt b/Foundation/wcelibcex-1.0/BUILD.txt deleted file mode 100644 index d6e224f9c..000000000 --- a/Foundation/wcelibcex-1.0/BUILD.txt +++ /dev/null @@ -1,41 +0,0 @@ -$Id: BUILD.txt 50 2007-01-08 12:16:50Z mloskot $ --------------------------------------------------------------------------------- - Building WCELIBCEX library --------------------------------------------------------------------------------- - -*** IMPORTANT *** -Remember to build WCELIBCEX as a static library, not DLL. -Provided project for Visual C++ 2005 is configured to -build WCELIBCEX as a static library -***************** - -Supported and tested platforms: - -- Windows CE 4.x - - Pocket PC 2003 - - Smartphone 2003 -- Windows CE 5.0 - - Windows Mobile 5.0 - - other custom operating systems based on Windows CE 5.0 - -If you've used WCELIBCEX on Windows CE OS not listed here, -please drop me a message on mateusz@loskot.net. - -Supported compilers: - -- Microsoft Visual C++ 2005 Standard or Professional -- Microsoft eMbedded Visual C++ 4.0 - -At the moment, there is no project file available for eVC++ 4.0. -The process of creating new project file for WCELIBCEX is pretty easy, -so there should be no problem with creating it for eVC++ 4.0. -In case of problems, write to wcelibcex-devel@lists.sourceforge.net. - -Building the library - -1. Go to 'msvc80' directory -2. Open 'wcelibcex_lib.sln' project in Visual C++ 2005 IDE -3. From the main toolbar, select prefered 'Solution Configuration' - and 'Solution Platform' -4. Run Build -> Build Solution -5. If no errors occured, the library is ready to use diff --git a/Foundation/wcelibcex-1.0/COPYING.txt b/Foundation/wcelibcex-1.0/COPYING.txt deleted file mode 100644 index 3ea708b2e..000000000 --- a/Foundation/wcelibcex-1.0/COPYING.txt +++ /dev/null @@ -1,9 +0,0 @@ -Note about WCELIBCEX files copyright. - -File copyright is held by a file author. - -Files created for the first version of the WCELIBCEX project are -copyrighted by (c) 2006 Taxus SI Ltd., http://www.taxussi.com.pl - -See comment in header of source files for more details. -See LICENSE.txt for license agreement. diff --git a/Foundation/wcelibcex-1.0/LICENSE.txt b/Foundation/wcelibcex-1.0/LICENSE.txt deleted file mode 100644 index 8e0f7fb8a..000000000 --- a/Foundation/wcelibcex-1.0/LICENSE.txt +++ /dev/null @@ -1,24 +0,0 @@ -WCELIBCEX - Windows CE C Library Extensions - -The source code of the WCELIBCEX library is -licensed under MIT License: - -http://opensource.org/licenses/mit-license.php - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH -THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Foundation/wcelibcex-1.0/README.txt b/Foundation/wcelibcex-1.0/README.txt deleted file mode 100644 index 326673833..000000000 --- a/Foundation/wcelibcex-1.0/README.txt +++ /dev/null @@ -1,22 +0,0 @@ -$Id: README.txt 50 2007-01-08 12:16:50Z mloskot $ -------------------------------------------------------------------------------- -WCELIBCEX - Windows CE C Library Extensions -------------------------------------------------------------------------------- - -The WCELIBCEX is a package of C library extensions for Windows CE -operating system. It is a supplement to standard C library -available on Windows CE system. - -Project developer: Mateusz Loskot - -Homepage: http://sourceforge.net/projects/wcelibcex -Wiki: http://wcelibcex.sourceforge.net - -For details, check following files: -AUTHORS.txt - list of developers and contributors -LICENSE.txt - license agreement -COPYING.txt - copyright and provenience notice -BUILD.txt - building instructions - -Initial version of WCELIBCEX was founded and copyrighted by Taxus SI Ltd., -http://www.taxussi.com.pl diff --git a/Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops b/Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops deleted file mode 100644 index 85d5e0fe8..000000000 --- a/Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln b/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln deleted file mode 100644 index a31f5c2f9..000000000 --- a/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wcelibcex_lib", "wcelibcex_lib.vcproj", "{55190080-FEA8-4B07-83E1-A26E6937982A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4) - Debug|Smartphone 2003 (ARMV4) = Debug|Smartphone 2003 (ARMV4) - Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4) - Release|Smartphone 2003 (ARMV4) = Release|Smartphone 2003 (ARMV4) - Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - {55190080-FEA8-4B07-83E1-A26E6937982A}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj b/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj deleted file mode 100644 index fe453ff46..000000000 --- a/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj +++ /dev/null @@ -1,817 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Foundation/wcelibcex-1.0/src/errno.h b/Foundation/wcelibcex-1.0/src/errno.h deleted file mode 100644 index e67313b78..000000000 --- a/Foundation/wcelibcex-1.0/src/errno.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * $Id: errno.h 20 2006-11-18 17:00:30Z mloskot $ - * - * errno.h - system error numbers - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot (mateusz@loskot.net) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_ERRNO_WRAPPER_H -#define WCEEX_ERRNO_WRAPPER_H 1 - -/* - * Windows CE SDK does not provide errno.h file. - * In order to simplify usage of wce_errno.h extension, this header is provided. - * It directly includes wce_errno.h file. - */ - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#else -# include "wce_errno.h" -#endif - - -#endif /* #ifndef WCEEX_ERRNO_WRAPPER_H */ - diff --git a/Foundation/wcelibcex-1.0/src/fcntl.h b/Foundation/wcelibcex-1.0/src/fcntl.h deleted file mode 100644 index 7756f1c46..000000000 --- a/Foundation/wcelibcex-1.0/src/fcntl.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * $Id$ - * - * fcntl.h - wrapper on wce_fcntl.h header - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot (mateusz@loskot.net) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_FCNTL_WRAPPER_H -#define WCEEX_FCNTL_WRAPPER_H 1 - -/* - * Windows CE SDK does not provide fcntl.h file. - * In order to simplify usage of wce_fcntl.h extension, this header is provided. - * It directly includes wce_fcntl.h file. - */ - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#else -# include "wce_fcntl.h" -#endif - - -#endif /* #ifndef WCEEX_FCNTL_WRAPPER_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_abort.c b/Foundation/wcelibcex-1.0/src/wce_abort.c deleted file mode 100644 index 1fcb02a33..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_abort.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * $Id: wce_abort.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines abort() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include - -/******************************************************************************* -* wceex_abort - Generate abnormal process termination. -* -* Description: -* -* The abort() function shall cause abnormal process termination to occur. -* Internally, mkdir() function wraps TerminateProcess call from -* Windows CE API. -* -* Return: -* -* The abort() function shall not return.* -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -void wceex_abort(void) -{ - /* No return */ - TerminateProcess(GetCurrentProcess(), 0); -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_access.c b/Foundation/wcelibcex-1.0/src/wce_access.c deleted file mode 100644 index 993ae72f8..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_access.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * $Id: wce_access.c,v 1.0 2006/11/29 16:37:06 stephaned Exp $ - * - * Defines _access(), _waccess() functions. - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_waccess - Determine file-access permission -* -* Description: -* -* Return: -* 0 if the file has the given mode -* –1 if the named file does not exist or is not accessible in the given mode -* and errno set as : -* EACCES file's permission setting does not allow specified access -* ENOENT filename or path not found -* -* Reference: -* -*******************************************************************************/ - -int wceex_waccess( const wchar_t *path, int mode ) -{ - SHFILEINFO fi; - if( !SHGetFileInfo( path, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES ) ) - { - errno = ENOENT; - return -1; - } - // existence ? - if( mode == 0 ) - return 0; - // write permission ? - if( mode & 2 ) - { - if( fi.dwAttributes & SFGAO_READONLY ) - { - errno = EACCES; - return -1; - } - } - return 0; -} - -/******************************************************************************* -* wceex_access - Determine file-access permission -* -* Description: -* -* Return: -* 0 if the file has the given mode -* –1 if the named file does not exist or is not accessible in the given mode -* and errno set as : -* EACCES file's permission setting does not allow specified access -* ENOENT filename or path not found -* -* Reference: -* -*******************************************************************************/ - -int wceex_access( const char *path, int mode ) -{ - wchar_t wpath[_MAX_PATH]; - if( !MultiByteToWideChar( CP_ACP, 0, path, -1, wpath, _MAX_PATH ) ) - { - errno = ENOENT; - return -1; - } - return wceex_waccess( wpath, mode ); -} diff --git a/Foundation/wcelibcex-1.0/src/wce_asctime.c b/Foundation/wcelibcex-1.0/src/wce_asctime.c deleted file mode 100644 index 562feaf52..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_asctime.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * $Id: wce_asctime.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines asctime() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* Internal definitions -*******************************************************************************/ - -/* Buffer to store string representation of tm struct. */ -#define TIME_STRING_SIZE 26 - -/* Buffer to store string representation of tm struct. */ -static char __wce_asc_result[TIME_STRING_SIZE]; - -/* Format of string returned. */ -static const char __wce_asc_format[] = "%.3s %.3s %02d %.2d:%.2d:%.2d %d\n"; - - -/******************************************************************************* -* wceex_asctime - Convert date and time to a string -* -* Description: -* -* The asctime function converts the broken-down time value that -* brokentime points to into a string in a standard format: -* "Mon Jan 30 13:46:22 2006\n" -* -* The abbreviations for the days of week are: -* Sun, Mon, Tue, Wed, Thu, Fri, and Sat. -* -* The abbreviations for the months are: -* Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec. -* -* The asctime() is not required to be thread-safe. -* -* Reference: -* -* IEEE Std 1003.1-2001 -* The GNU C Library Manual -* -*******************************************************************************/ -char * wceex_asctime(const struct tm *tmbuff) -{ - return wceex_asctime_r(tmbuff, __wce_asc_result); -} - - -/******************************************************************************* -* wceex_asctime_r - Convert date and time to a string -* -* Description: -* -* This function is similar to asctime but instead of placing the result -* in a static buffer it writes the string in the buffer pointed to by -* the parameter buffer. This buffer should have room for at least 26 bytes, -* including the terminating null. -* -* The asctime_r() is not required to be thread-safe. -* -* Return value: -* -* Upon success the function returns a pointer to the string the result was written into. -* Otherwise return NULL. -* -* Reference: -* -* IEEE Std 1003.1-2001 -* The GNU C Library Manual -* -*******************************************************************************/ -char * wceex_asctime_r(const struct tm *tmbuff, char *buff) -{ - int res; - static char wday_short[7][3] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - }; - static char mon_short[12][3] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - - if (tmbuff == NULL) - { - // XXX - mloskot - set errno with EINVAL - return NULL; - } - - /* Format: "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n" */ - res = sprintf(buff, __wce_asc_format, - wday_short[tmbuff->tm_wday], - mon_short[tmbuff->tm_mon], - tmbuff->tm_mday, - tmbuff->tm_hour, - tmbuff->tm_min, - tmbuff->tm_sec, - 1900 + tmbuff->tm_year); - - if (res < 0) - return NULL; - else - return buff; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_bsearch.c b/Foundation/wcelibcex-1.0/src/wce_bsearch.c deleted file mode 100644 index b43dcfa76..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_bsearch.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * $Id: wce_bsearch.c 20 2006-11-18 17:00:30Z mloskot $ - * - * Defines bsearch() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_bsearch - TODO -* -* Description: -* -* Return: -* -* -* Reference: -* IEEE 1003.1, 2004 Edition -*******************************************************************************/ - -void* wceex_bsearch(const void *key, const void *base, size_t num, size_t width, - int (*compare)(const void *, const void *)) -{ - size_t left; - size_t middle; - size_t right; - int res; - - /* input parameters validation */ - assert(key != NULL); - assert(base != NULL); - assert(compare != NULL); - - res = 0; - left = 0; - right = num - 1; - - while (left <= right) - { - middle = (left + right) / 2; - - res = compare(((char*) base + (width * middle)), key); - if (res > 0) - { - /* search from middle to left */ - right = middle - 1; - } - else if (res < 0) - { - /* search from middle to right */ - left = middle + 1; - } - else if (res == 0) - { - /* middle points to the key element. */ - return ((char*) base + (width * middle)); - } - } - - /* key not found */ - return NULL; -} \ No newline at end of file diff --git a/Foundation/wcelibcex-1.0/src/wce_clock.c b/Foundation/wcelibcex-1.0/src/wce_clock.c deleted file mode 100644 index 7aac06fc5..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_clock.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * $Id: wce_clock.c 20 2006-11-18 17:00:30Z mloskot $ - * - * Defines clock() function. - * - * Created by hav (TODO: Full name of hav) - * - * Copyright (c) 2006 (TODO: Full name of hav) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include -#include - -/******************************************************************************* -* wceex_clock - report CPU time used -* -* Description: -* -* The clock() function shall return the implementation's best approximation to -* the processor time used by the process since the beginning of -* an implementation-defined era related only to the process invocation. -* -* Windows CE specific: -* CLOCKS_PER_SEC is defined in available in Windows CE SDK. -* -* Return value: -* -* To determine the time in seconds, the value returned by clock() should be -* divided by the value of the macro CLOCKS_PER_SEC. -* CLOCKS_PER_SEC is defined to be one million in . -* If the processor time used is not available or its value cannot be represented, -* the function shall return the value ( clock_t)-1. -* -* Reference: -* -* IEEE Std 1003.1-2001 -* The GNU C Library Manual -* -*******************************************************************************/ - - - -clock_t wceex_clock() -{ - __int64 ticks; - SYSTEMTIME stCurrent; - FILETIME ftCurrent; - - GetSystemTime(&stCurrent); - - if (SystemTimeToFileTime(&stCurrent, &ftCurrent)) - { - ticks = *(__int64*)&ftCurrent; - } - else - { - /* The processor time used is not available or - * its value cannot be represented. - */ - ticks = -1; - } - - return (clock_t)ticks; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_ctime.c b/Foundation/wcelibcex-1.0/src/wce_ctime.c deleted file mode 100644 index 3af45bb71..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_ctime.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * $Id: wce_ctime.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines ctime() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* wceex_ctime - Convert a time value to a date and time string -* -* Description: -* -* The ctime function is similar to asctime, except that you specify -* the calendar time argument as a time_t simple time value rather -* than in broken-down local time format. -* It shall be equivalent to: asctime(localtime(clock)) -* -* The ctime() is not required to be thread-safe. -* -* Windows CE specific: -* ctime does not set the variable tzname. -* -* Reference: -* -* IEEE Std 1003.1-2001 -* The GNU C Library Manual -* -*******************************************************************************/ -char * wceex_ctime(const time_t *timer) -{ - return wceex_asctime(wceex_localtime(timer)); -} - - -/******************************************************************************* -* wceex_ctime_r - Convert a time value to a date and time string -* -* Description: -* -* This function is similar to ctime, but places the result in the string -* pointed to by buffer. -* -* The ctime() is not required to be thread-safe. -* -* Windows CE specific: -* ctime does not set the variable tzname. -* -* Return value: -* -* Upon success the function returns a pointer to the string the result was written into. -* Otherwise return NULL. -* -* Reference: -* -* IEEE Std 1003.1-2001 -* The GNU C Library Manual -* -*******************************************************************************/ -char * wceex_ctime_r(const time_t *timer, char *buf) -{ - /* - XXX - mloskot - it's waiting for localtime_r function. - - ({ struct tm tm; asctime_r (localtime_r (time, &tm), buf); }) - */ - return NULL; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_direct.h b/Foundation/wcelibcex-1.0/src/wce_direct.h deleted file mode 100644 index deab69f61..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_direct.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * $Id: wce_direct.h,v 1.0 2006/11/29 16:38:05 stephaned Exp $ - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_DIRECT_H -#define WCEEX_DIRECT_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -int wceex_wmkdir( const wchar_t* dirname ); - -char* wceex_getcwd( char *buffer, int maxlen ); -wchar_t* wceex_wgetcwd( wchar_t *buffer, int maxlen ); - -int wceex_chdir( const char *dirname ); -int wceex_wchdir( const wchar_t *dirname ); - -DWORD wceex_GetCurrentDirectoryW( DWORD nBufferLength, LPWSTR lpBuffer ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_DIRECT_H */ - diff --git a/Foundation/wcelibcex-1.0/src/wce_directorymanagement.c b/Foundation/wcelibcex-1.0/src/wce_directorymanagement.c deleted file mode 100644 index 18d879499..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_directorymanagement.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * $Id: wce_directorymanagement.c,v 1.0 2006/11/29 17:00:28 stephaned Exp $ - * - * Defines _getcwd(), GetCurrentDirectoryW() _wgetcwd(), - * _chdir(), _wchdir functions. - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include -#include -#include -#include - -/******************************************************************************* -* InitCwd - Init the current directory with the path for the file used to create -* the calling process -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -static wchar_t Cwd[_MAX_PATH] = { '\0' }; - -static int InitCwd() -{ - if( Cwd[0] ) - return 0; - if( !GetModuleFileName( NULL, Cwd, _MAX_PATH ) ) - return errno = GetLastError(); - else - { - wchar_t* slash = wcsrchr( Cwd, '\\' ); - if( !slash ) - slash = wcsrchr( Cwd, '/' ); - if( slash ) - { - if( slash == Cwd ) - slash++; - *slash = 0; - } - return 0; - } -} - -/******************************************************************************* -* wceex_getcwd - Get the current working directory -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -char* wceex_getcwd( char *buffer, int maxlen ) -{ - if( !buffer && (buffer = (char*)malloc(maxlen)) == NULL ) - { - errno = ENOMEM; - return NULL; - } - if( InitCwd() ) - return NULL; - if( !WideCharToMultiByte( CP_ACP, 0, Cwd, -1, buffer, maxlen, NULL, NULL ) ) - { - errno = GetLastError(); - return NULL; - } - return buffer; -} - -/******************************************************************************* -* wceex_GetCurrentDirectoryW - Get the current working directory -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -DWORD wceex_GetCurrentDirectoryW( DWORD nBufferLength, LPWSTR lpBuffer ) -{ - *lpBuffer = 0; - if( InitCwd() ) - { - SetLastError( errno ); - return 0; - } - else - { - size_t slen = wcslen( Cwd ); - if( slen >= (size_t)nBufferLength ) - return slen + 1; - wcscpy( lpBuffer, Cwd ); - return slen; - } -} - -/******************************************************************************* -* wceex_wgetcwd - Get the current working directory -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -wchar_t* wceex_wgetcwd( wchar_t *buffer, int maxlen ) -{ - if( !buffer && (buffer = (wchar_t*)malloc(maxlen * sizeof(wchar_t))) == NULL ) - { - errno = ENOMEM; - return NULL; - } - else - { - DWORD slen = wceex_GetCurrentDirectoryW( maxlen, buffer ); - if( !slen ) - return NULL; - if( slen >= (DWORD)maxlen ) - { - errno = ERANGE; - return NULL; - } - return buffer; - } -} - -/******************************************************************************* -* wceex_wchdir - Change the current working directory -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -int wceex_wchdir( const wchar_t *dirname ) -{ - if( !dirname || *dirname == 0 ) - { - errno = ENOENT; - return -1; - } - else - { - SHFILEINFO fi; - if( !SHGetFileInfo( dirname, 0, &fi, sizeof(fi), SHGFI_ATTRIBUTES ) ) - { - errno = ENOENT; - return -1; - } - if( !(fi.dwAttributes & SFGAO_FOLDER) ) - { - errno = ENOENT; - return -1; - } - wcscpy( Cwd, dirname ); - return 0; - } -} - -/******************************************************************************* -* wceex_chdir - Change the current working directory -* -* Description: -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -int wceex_chdir( const char *dirname ) -{ - if( !dirname || *dirname == 0 ) - { - errno = ENOENT; - return -1; - } - else - { - wchar_t wdirname[_MAX_PATH]; - if( !MultiByteToWideChar( CP_ACP, 0, dirname, -1, wdirname, _MAX_PATH ) ) - { - errno = ENOENT; - return -1; - } - return wceex_wchdir( wdirname ); - } -} diff --git a/Foundation/wcelibcex-1.0/src/wce_errno.c b/Foundation/wcelibcex-1.0/src/wce_errno.c deleted file mode 100644 index 96f005ccf..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_errno.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id: wce_errno.c,v 1.1 2006/02/19 22:04:53 mloskot Exp $ - * - * Global errno variable. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -/* - * XXX - mloskot - errno is required to be thread-safe - */ - -int errno; - diff --git a/Foundation/wcelibcex-1.0/src/wce_errno.h b/Foundation/wcelibcex-1.0/src/wce_errno.h deleted file mode 100644 index 683fe4502..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_errno.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * $Id: wce_errno.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * errno.h - system error numbers - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_ERRNO_H -#define WCEEX_ERRNO_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* -#if defined(_MT) -# error "errno as global variable does not work with multi threads" -#endif -*/ -/* XXX - mloskot - make it thread-safe by calling (*_errno()) */ -extern int errno; - - -/* Error Codes */ - -#define EPERM 1 -#define ENOENT 2 -#define ESRCH 3 -#define EINTR 4 -#define EIO 5 -#define ENXIO 6 -#define E2BIG 7 -#define ENOEXEC 8 -#define EBADF 9 -#define ECHILD 10 -#define EAGAIN 11 -#define ENOMEM 12 -#define EACCES 13 -#define EFAULT 14 -#define EBUSY 16 -#define EEXIST 17 -#define EXDEV 18 -#define ENODEV 19 -#define ENOTDIR 20 -#define EISDIR 21 -#define EINVAL 22 -#define ENFILE 23 -#define EMFILE 24 -#define ENOTTY 25 -#define EFBIG 27 -#define ENOSPC 28 -#define ESPIPE 29 -#define EROFS 30 -#define EMLINK 31 -#define EPIPE 32 -#define EDOM 33 -#define ERANGE 34 -#define EDEADLK 36 -#define ENAMETOOLONG 38 -#define ENOLCK 39 -#define ENOSYS 40 -#define ENOTEMPTY 41 -#define EILSEQ 42 - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_ERRNO_H */ - diff --git a/Foundation/wcelibcex-1.0/src/wce_fcntl.h b/Foundation/wcelibcex-1.0/src/wce_fcntl.h deleted file mode 100644 index 22667a3b5..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_fcntl.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * $Id: wce_fcntl.h 20 2006-11-18 17:00:30Z mloskot $ - * - * fcntl.h - file control options - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_FCNTL_H -#define WCEEX_FCNTL_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - -/* File control flags and functions - * - * Implementation based on the Open Group Base Specifications Issue 6, - * IEEE Std 1003.1, 2004 Edition - * - * Windows CE Notes: - * - * Mostly, these flags are not used, but defined to feed compiler. - * Also, some programs (ie. libtiff) translate textual file flags (r, rw, etc.) - * file control flags. - * Functions fcntl() and open() are not implemented. - */ - -/* File creation flags */ - -#define O_CREAT 0x0100 /* Open or create file if it does not exist. */ -#define O_EXCL 0x0200 /* Exclusive file use. */ -#define O_NOCTTY 0x0400 /* Do not assign controlling terminal. */ -#define O_TRUNC 0x1000 /* Open and truncate file. */ - -/* File access and status flags */ - -#define O_RDONLY 0x0000 /* Open for read only. */ -#define O_WRONLY 0x0001 /* Open for write only. */ -#define O_RDWR 0x0002 /* Open for reading and writing. */ -#define O_APPEND 0x2000 /* Set append mode. */ - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_FCNTL_H */ \ No newline at end of file diff --git a/Foundation/wcelibcex-1.0/src/wce_findfile.c b/Foundation/wcelibcex-1.0/src/wce_findfile.c deleted file mode 100644 index c44f05e0d..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_findfile.c +++ /dev/null @@ -1,183 +0,0 @@ -/* - * $Id: wce_findfile.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines functions to find files. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_findclose - XXX -* -* Description: -* -* XXX -* -* Return: -* -* XXX -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_findclose(intptr_t hFile) -{ - if(!FindClose((HANDLE)hFile)) - { - //errno = EINVAL; - return (-1); - } - return (0); - -} - -/******************************************************************************* -* wceex_findfirst - XXX -* -* Description: -* -* XXX -* -* Return: -* -* XXX -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -intptr_t wceex_findfirst(const char *filespec, struct _finddata_t *fileinfo) -{ - WIN32_FIND_DATA wfd; - HANDLE hFile; - DWORD err; - wchar_t wfilename[MAX_PATH]; - - mbstowcs(wfilename, filespec, strlen(filespec) + 1); - - /* XXX - mloskot - set errno values! */ - - hFile = FindFirstFile(wfilename, &wfd); - if(hFile == INVALID_HANDLE_VALUE) - { - err = GetLastError(); - switch (err) - { - case ERROR_NO_MORE_FILES: - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - //errno = ENOENT; - break; - - case ERROR_NOT_ENOUGH_MEMORY: - //errno = ENOMEM; - break; - - default: - //errno = EINVAL; - break; - } - return (-1); - } - - fileinfo->attrib = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL) ? 0 : wfd.dwFileAttributes; - fileinfo->time_create = wceex_filetime_to_time(&wfd.ftCreationTime); - fileinfo->time_access = wceex_filetime_to_time(&wfd.ftLastAccessTime); - fileinfo->time_write = wceex_filetime_to_time(&wfd.ftLastWriteTime); - - fileinfo->size = wfd.nFileSizeLow; - wcstombs(fileinfo->name, wfd.cFileName, wcslen(wfd.cFileName) + 1); - - return (intptr_t)hFile; -} - -/******************************************************************************* -* wceex_findnext - XXX -* -* Description: -* -* XXX -* -* Return: -* -* XXX -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_findnext(intptr_t handle, struct _finddata_t *fileinfo) -{ - WIN32_FIND_DATA wfd; - DWORD err; - - /* XXX - mloskot - set errno values! */ - - if (!FindNextFile((HANDLE)handle, &wfd)) - { - err = GetLastError(); - switch (err) { - case ERROR_NO_MORE_FILES: - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - //errno = ENOENT; - break; - - case ERROR_NOT_ENOUGH_MEMORY: - //errno = ENOMEM; - break; - - default: - //errno = EINVAL; - break; - } - return (-1); - } - - fileinfo->attrib = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL)? 0 : wfd.dwFileAttributes; - fileinfo->time_create = wceex_filetime_to_time(&wfd.ftCreationTime); - fileinfo->time_access = wceex_filetime_to_time(&wfd.ftLastAccessTime); - fileinfo->time_write = wceex_filetime_to_time(&wfd.ftLastWriteTime); - - fileinfo->size = wfd.nFileSizeLow; - wcstombs(fileinfo->name, wfd.cFileName, wcslen(wfd.cFileName)+1); - - return 0; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_getenv.c b/Foundation/wcelibcex-1.0/src/wce_getenv.c deleted file mode 100644 index ad5cef03c..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_getenv.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * $Id: wce_getenv.c 20 2006-11-18 17:00:30Z mloskot $ - * - * Defines getenv() function with dummy implementation. - * - * Created by Mateusz Loskot (mloskot@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot (mloskot@loskot.net) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - - -/******************************************************************************* -* wceex_getenv - dummy getenv() function -* -* Description: -* -* There is no concept of environment variable in Windows CE operating system. -* This function acts as a dummy compilation enabler and ALWAYS returns NULL. -* -* Return: -* -* The wceex_getenv() function ALWAYS returns NULL.* -* -*******************************************************************************/ - -#include - -char* wceex_getenv(const char* varname) -{ - return NULL; -} diff --git a/Foundation/wcelibcex-1.0/src/wce_getopt.c b/Foundation/wcelibcex-1.0/src/wce_getopt.c deleted file mode 100644 index 415e031a1..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_getopt.c +++ /dev/null @@ -1,154 +0,0 @@ -/* - * $Id$ - * - * Copyright (c) 1987, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ -#if 0 -static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; -__RCSID("$NetBSD: getopt.c,v 1.26 2003/08/07 16:43:40 agc Exp $"); -#endif - -#include -#include - -/* - * Declared in - */ -char *optarg; /* argument associated with option */ -int opterr = 1; /* if error message should be printed */ -int optind = 1; /* index into parent argv vector */ -int optopt; /* character checked for validity */ - -int optreset; /* reset getopt */ - -#define BADCH (int)'?' -#define BADARG (int)':' -#define EMSG "" - -/******************************************************************************* -* wceex_getopt - function is a command-line parser -* -* Description: -* -* The parameters argc and argv are the argument count and argument array as -* passed to main(). The argument optstring is a string of recognised option -* characters. If a character is followed by a colon, the option takes an argument. -* -* The variable optind is the index of the next element of the argv[] vector to be -* processed. It is initialised to 1 by the system, and getopt() updates it when it -* finishes with each element of argv[]. -* -* NOTE: Implementation of the getopt() function was grabbed from NetBSD -* operating system sources. See copyright note in the file header. -* -* Return: -* -* Returns the next option character specified on the command line. -* A colon (:) is returned if getopt() detects a missing argument and -* the first character of optstring was a colon (:). -* A question mark (?) is returned if getopt() encounters an option -* character not in optstring or detects a missing argument and the first -* character of optstring was not a colon (:). -* Otherwise getopt() returns -1 when all command line options are parsed. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ - -int wceex_getopt(int argc, char * const argv[], const char *optstring) -{ - static char *place = EMSG; /* option letter processing */ - char *oli; /* option letter list index */ - - if (optreset || *place == 0) { /* update scanning pointer */ - optreset = 0; - place = argv[optind]; - if (optind >= argc || *place++ != '-') { - /* Argument is absent or is not an option */ - place = EMSG; - return (-1); - } - optopt = *place++; - if (optopt == '-' && *place == 0) { - /* "--" => end of options */ - ++optind; - place = EMSG; - return (-1); - } - if (optopt == 0) { - /* Solitary '-', treat as a '-' option - if the program (eg su) is looking for it. */ - place = EMSG; - if (strchr(optstring, '-') == NULL) - return -1; - optopt = '-'; - } - } else - optopt = *place++; - - /* See if option letter is one the caller wanted... */ - if (optopt == ':' || (oli = strchr(optstring, optopt)) == NULL) { - if (*place == 0) - ++optind; - if (opterr && *optstring != ':') - (void)fprintf(stderr, - "unknown option -- %c\n", optopt); - return (BADCH); - } - - /* Does this option need an argument? */ - if (oli[1] != ':') { - /* don't need argument */ - optarg = NULL; - if (*place == 0) - ++optind; - } else { - /* Option-argument is either the rest of this argument or the - entire next argument. */ - if (*place) - optarg = place; - else if (argc > ++optind) - optarg = argv[optind]; - else { - /* option-argument absent */ - place = EMSG; - if (*optstring == ':') - return (BADARG); - if (opterr) - (void)fprintf(stderr, - "option requires an argument -- %c\n", - optopt); - return (BADCH); - } - place = EMSG; - ++optind; - } - return (optopt); /* return option letter */ -} diff --git a/Foundation/wcelibcex-1.0/src/wce_gettimeofday.c b/Foundation/wcelibcex-1.0/src/wce_gettimeofday.c deleted file mode 100644 index 1b03214d7..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_gettimeofday.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * $Id$ - * - * Defines gettimeofday function. - * - * Author of first version (timeval.h): by Wu Yongwei - * Author of Windows CE version: Mateusz Loskot (mateusz@loskot.net) - * - * All code here is considered in the public domain though we do wish our names - * could be retained if anyone uses them. - */ - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include - -/******************************************************************************* -* wceex_gettimeofday - get the date and time -* -* Description: -* -* The gettimeofday() function shall obtain the current time, -* expressed as seconds and microseconds since the Epoch, -* and store it in the timeval structure pointed to by tp. -* The resolution of the system clock is unspecified. -* -* Return value: -* -* The gettimeofday() function shall return 0 and -* no value shall be reserved to indicate an error. -* -* Reference: -* -* IEEE Standard and an Open Group Technical Standard 1003.1, 2004 Edition -* -*******************************************************************************/ - -int wceex_gettimeofday(struct timeval *tp, struct timezone *tzp) -{ - SYSTEMTIME st; - FILETIME ft; - LARGE_INTEGER li; - TIME_ZONE_INFORMATION tzi; - __int64 t; - static int tzflag; - - if (NULL != tp) - { - GetSystemTime(&st); - SystemTimeToFileTime(&st, &ft); - li.LowPart = ft.dwLowDateTime; - li.HighPart = ft.dwHighDateTime; - t = li.QuadPart; /* In 100-nanosecond intervals */ - t -= EPOCHFILETIME; /* Offset to the Epoch time */ - t /= 10; /* In microseconds */ - tp->tv_sec = (long)(t / 1000000); - tp->tv_usec = (long)(t % 1000000); - } - - if (NULL != tzp) - { - GetTimeZoneInformation(&tzi); - - tzp->tz_minuteswest = tzi.Bias; - if (tzi.StandardDate.wMonth != 0) - { - tzp->tz_minuteswest += tzi.StandardBias * 60; - } - - if (tzi.DaylightDate.wMonth != 0) - { - tzp->tz_dsttime = 1; - } - else - { - tzp->tz_dsttime = 0; - } - } - - return 0; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_io.h b/Foundation/wcelibcex-1.0/src/wce_io.h deleted file mode 100644 index 5859657d6..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_io.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * $Id: wce_io.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * io.h - file handling functions - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_IO_H -#define WCEEX_IO_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/******************************************************************************* - I/O Types and Structures -*******************************************************************************/ - -#ifndef _INTPTR_T_DEFINED -typedef long intptr_t; -# define _INTPTR_T_DEFINED -#endif - -#ifndef _FSIZE_T_DEFINED -typedef unsigned long fsize_t; -# define _FSIZE_T_DEFINED -#endif - -#define MAX_PATH 260 - -#ifndef _FINDDATA_T_DEFINED -struct _finddata_t -{ - unsigned attrib; /* File attributes */ - time_t time_create; /* -1L for FAT file systems */ - time_t time_access; /* -1L for FAT file systems */ - time_t time_write; /* Time of last modification */ - fsize_t size; /* Size of file in bytes */ - char name[MAX_PATH]; /* Name of file witout complete path */ -}; -# define _FINDDATA_T_DEFINED -#endif - -/* File attribute constants for _findfirst() */ - -/* XXX - mloskot - macra IS_xxx */ -#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */ -#define _A_RDONLY 0x01 /* Read only file */ -#define _A_HIDDEN 0x02 /* Hidden file */ -#define _A_SYSTEM 0x04 /* System file */ -#define _A_SUBDIR 0x10 /* Subdirectory */ -#define _A_ARCH 0x20 /* Archive file */ - - -/******************************************************************************* - I/O Functions -*******************************************************************************/ - -intptr_t wceex_findfirst(const char *filespec, struct _finddata_t *fileinfo); -int wceex_findnext(intptr_t handle, struct _finddata_t *fileinfo); -int wceex_findclose(intptr_t hFile); - -/******************************************************************************* - File-access permission functions -*******************************************************************************/ - -int wceex_waccess( const wchar_t *path, int mode ); -int wceex_access( const char *path, int mode ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_IO_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_lfind.c b/Foundation/wcelibcex-1.0/src/wce_lfind.c deleted file mode 100644 index 6d49af41c..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_lfind.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * $Id: wce_lfind.c 20 2006-11-18 17:00:30Z mloskot $ - * - * Defines lfind() function. - * - * Created by Mateusz Loskot (mloskot@loskot.net) - * - * Implementation of this function was taken from LibTIFF - * project, http://www.remotesensing.org/libtiff/ - * The copyright note below has been copied without any changes. - * - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Roger L. Snyder. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_lfind - TODO -* -* Description: -* -* Return: -* -* Reference: -* IEEE 1003.1, 2004 Edition -*******************************************************************************/ - -void* wceex_lfind(const void *key, const void *base, size_t *nmemb, size_t size, - int(*compar)(const void *, const void *)) -{ - char *element, *end; - - assert(key != NULL); - assert(base != NULL); - assert(compar != NULL); - - element = NULL; - end = (char *)base + (*nmemb * size); - - for (element = (char *)base; element < end; element += size) - { - if (!compar(element, key)) - { - /* key found */ - return element; - } - } - - return NULL; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_localtime.c b/Foundation/wcelibcex-1.0/src/wce_localtime.c deleted file mode 100644 index 066e11d72..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_localtime.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * $Id: wce_localtime.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines localtime() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include -#include - -/******************************************************************************* - Constants and macros used internally -*******************************************************************************/ - -#define SECS_PER_MIN 60 -#define MINS_PER_HOUR 60 -#define HOURS_PER_DAY 24 -#define DAYS_PER_WEEK 7 -#define DAYS_PER_NYEAR 365 -#define DAYS_PER_LYEAR 366 -#define SECS_PER_HOUR (SECS_PER_MIN * MINS_PER_HOUR) -#define SECS_PER_DAY ((long) SECS_PER_HOUR * HOURS_PER_DAY) -#define MONS_PER_YEAR 12 - -#define TM_SUNDAY 0 -#define TM_MONDAY 1 -#define TM_TUESDAY 2 -#define TM_WEDNESDAY 3 -#define TM_THURSDAY 4 -#define TM_FRIDAY 5 -#define TM_SATURDAY 6 - -#define TM_JANUARY 0 -#define TM_FEBRUARY 1 -#define TM_MARCH 2 -#define TM_APRIL 3 -#define TM_MAY 4 -#define TM_JUNE 5 -#define TM_JULY 6 -#define TM_AUGUST 7 -#define TM_SEPTEMBER 8 -#define TM_OCTOBER 9 -#define TM_NOVEBER 10 -#define TM_DECEMBER 11 -#define TM_SUNDAY 0 - -#define TM_YEAR_BASE 1900 - -#define EPOCH_YEAR 1970 -#define EPOCH_WDAY TM_THURSDAY - -#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) - -/******************************************************************************* - Local time functions -*******************************************************************************/ - -struct tm * __wceex_offtime(const time_t *timer, long tzoffset); - -/******************************************************************************* -* wceex_localtime - Convert time_t value to tm struct. -* -* Description: -* Use offset as difference in seconds between local time and UTC time. -* -*******************************************************************************/ -struct tm * wceex_localtime(const time_t *timer) -{ - register struct tm *tmp; - - long tzoffset; - TIME_ZONE_INFORMATION tzi; - - // Retrive timezone offset in seconds - tzoffset = 0; - if (GetTimeZoneInformation(&tzi) != 0xFFFFFFFF) - { - tzoffset += (tzi.Bias * 60); - if (tzi.StandardDate.wMonth != 0) - { - tzoffset += (tzi.StandardBias * 60); - } - } - - tzoffset *= -1; - tmp = __wceex_offtime(timer, tzoffset); - - return tmp; -} - -/******************************************************************************* -* wceex_gmtime - Convert time_t value to tm struct. -* -* Description: -* This function is similar to localtime, except that the broken-down -* time is expressed as Coordinated Universal Time (UTC) -* rather than relative to a local time zone. -* -*******************************************************************************/ -struct tm * wceex_gmtime(const time_t *timer) -{ - register struct tm *tmp; - - tmp = __wceex_offtime(timer, 0L); - - return tmp; -} - -/******************************************************************************* -* __wceex_offtime - Convert time_t value to tm struct. -* -* Description: -* Use offset as difference in seconds between local time and UTC time. -* -*******************************************************************************/ -static int mon_lengths[2][MONS_PER_YEAR] = -{ - 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, - 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 -}; - -static int year_lengths[2] = { DAYS_PER_NYEAR, DAYS_PER_LYEAR }; - - -struct tm * __wceex_offtime(const time_t *timer, long tzoffset) -{ - register struct tm *tmp; - register long days; - register long rem; - register int y; - register int yleap; - register int *ip; - static struct tm tm; - - tmp = &tm; - days = *timer / SECS_PER_DAY; - rem = *timer % SECS_PER_DAY; - rem += tzoffset; - while (rem < 0) - { - rem += SECS_PER_DAY; - --days; - } - - while (rem >= SECS_PER_DAY) - { - rem -= SECS_PER_DAY; - ++days; - } - tmp->tm_hour = (int) (rem / SECS_PER_HOUR); - - rem = rem % SECS_PER_HOUR; - tmp->tm_min = (int) (rem / SECS_PER_MIN); - tmp->tm_sec = (int) (rem % SECS_PER_MIN); - tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYS_PER_WEEK); - - if (tmp->tm_wday < 0) - tmp->tm_wday += DAYS_PER_WEEK; - - y = EPOCH_YEAR; - - if (days >= 0) - { - for ( ; ; ) - { - yleap = isleap(y); - if (days < (long) year_lengths[yleap]) - break; - - ++y; - days = days - (long) year_lengths[yleap]; - } - } - else - { - do - { - --y; - yleap = isleap(y); - days = days + (long) year_lengths[yleap]; - } while (days < 0); - } - - tmp->tm_year = y - TM_YEAR_BASE; - tmp->tm_yday = (int) days; - ip = mon_lengths[yleap]; - - for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon)) - { - days = days - (long) ip[tmp->tm_mon]; - } - - tmp->tm_mday = (int) (days + 1); - tmp->tm_isdst = 0; - - return tmp; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_mkdir.c b/Foundation/wcelibcex-1.0/src/wce_mkdir.c deleted file mode 100644 index 3fa7e4c3f..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_mkdir.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * $Id: wce_mkdir.c,v 1.3 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines wmkdir, mkdir() functions. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* wceex_mkdir - Make a directory. -* -* Description: -* -* The mkdir() function shall create a new directory with name path. -* Internally, mkdir() function wraps CreateDirectory call from -* Windows CE API. -* -* Return: -* -* Upon successful completion, mkdir() shall return 0. -* Otherwise, -1 shall be returned, no directory shall be created, -* and errno shall be set with the error returned by CreateDirectory. -* -* Reference: -* IEEE 1003.1, 2004 Edition -*******************************************************************************/ -int wceex_mkdir(const char *filename) -{ - int res; - size_t len; - wchar_t *widestr; - - /* Covert filename buffer to Unicode. */ - len = MultiByteToWideChar (CP_ACP, 0, filename, -1, NULL, 0) ; - widestr = (wchar_t*)malloc(sizeof(wchar_t) * len); - - MultiByteToWideChar( CP_ACP, 0, filename, -1, widestr, len); - - /* Delete file using Win32 CE API call */ - res = CreateDirectory(widestr, NULL); - - /* Free wide-char string */ - free(widestr); - - if (res) - return 0; /* success */ - else - { - errno = GetLastError(); - return -1; - } -} - -/******************************************************************************* -* wceex_mkdir - Make a directory. -* -* Description: -* -* The wmkdir() function shall create a new directory with name path. -* Internally, wmkdir() function wraps CreateDirectory call from -* Windows CE API. -* -* Return: -* -* Upon successful completion, wmkdir() shall return 0. -* Otherwise, -1 shall be returned, no directory shall be created, -* and errno shall be set with the error returned by CreateDirectory. -* -* Reference: -* IEEE 1003.1, 2004 Edition -*******************************************************************************/ - -int wceex_wmkdir( const wchar_t* dirname ) -{ - if( !CreateDirectory( dirname, NULL ) ) - { - errno = GetLastError(); - return -1; - } - return 0; -} diff --git a/Foundation/wcelibcex-1.0/src/wce_mktime.c b/Foundation/wcelibcex-1.0/src/wce_mktime.c deleted file mode 100644 index 312068c45..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_mktime.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * $Id: wce_mktime.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines functions to convert struct tm to time_t value. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/* Function used intenally to convert struct tm to a time_t value. */ -static time_t __wceex_mktime_internal(struct tm *tmbuff, time_t _loctime_offset); - -/******************************************************************************* -* wceex_mktime - Convert local time to calendar value in seconds since epoch. -*******************************************************************************/ -time_t wceex_mktime(struct tm *tmbuff) -{ - time_t offset; - TIME_ZONE_INFORMATION tzi; - - offset = 0; - - // Retrive timezone offset in seconds - if (GetTimeZoneInformation(&tzi) != 0xFFFFFFFF) - { - offset += (tzi.Bias * 60); - if (tzi.StandardDate.wMonth != 0) - { - offset += (tzi.StandardBias * 60); - } - } - - return __wceex_mktime_internal(tmbuff, offset); -} - - -/******************************************************************************* -* wceex_gmmktime - Get Unix timestamp for a GMT date -* -* Description: -* Given a struct tm representing a calendar time in UTC, convert it to -* seconds since epoch. -* Note that this function does not canonicalize the provided -* struct tm, nor does it allow out of range values or years before 1970. -* The tm struct values of tm_wday and tm_yday are ignored. -* -* Return: -* Value of time if success, otherwise (time_t)-1 is returned. -* -*******************************************************************************/ -time_t wceex_gmmktime(struct tm *tmbuff) -{ - return __wceex_mktime_internal(tmbuff, 0); -} - -/******************************************************************************* -* __wceex_mktime_internal - Convert struct tm to a time_t value. -* -* Description: -* Use offset as difference in seconds between local time and UTC time. -* -/*******************************************************************************/ - -/* The number of days in each month. */ -#define MONTHS_NUMBER 12 - -static const int MONTHDAYS[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; - -static time_t __wceex_mktime_internal(struct tm *tmbuff, time_t _loctime_offset) -{ - time_t tres; - int doy; - int i; - - /* We do allow some ill-formed dates, but we don't do anything special - with them and our callers really shouldn't pass them to us. Do - explicitly disallow the ones that would cause invalid array accesses - or other algorithm problems. */ - if (tmbuff->tm_mon < 0 || tmbuff->tm_mon > 11 || tmbuff->tm_year < (EPOCH_YEAR - TM_YEAR_BASE)) - { - return (time_t) -1; - } - - /* Convert calender time to a time_t value. */ - tres = 0; - - /* Sum total amount of days from the Epoch with respect to leap years. */ - for (i = EPOCH_YEAR; i < tmbuff->tm_year + TM_YEAR_BASE; i++) - { - tres += 365 + IS_LEAP_YEAR(i); - } - - /* Add days of months before current month. */ - doy = 0; - for (i = 0; i < tmbuff->tm_mon; i++) - { - doy += MONTHDAYS[i]; - } - tres += doy; - - /* Day of year */ - tmbuff->tm_yday = doy + tmbuff->tm_mday; - - if (tmbuff->tm_mon > 1 && IS_LEAP_YEAR(tmbuff->tm_year + TM_YEAR_BASE)) - { - tres++; - } - - /* Add days of current month and convert to total to hours. */ - tres = 24 * (tres + tmbuff->tm_mday - 1) + tmbuff->tm_hour; - - /* Add minutes part and convert total to minutes. */ - tres = 60 * tres + tmbuff->tm_min; - - /* Add seconds part and convert total to seconds. */ - tres = 60 * tres + tmbuff->tm_sec; - - /* For offset > 0 adjust time value for timezone - given as local to UTC time difference in seconds). */ - tres += _loctime_offset; - - return tres; -} - - diff --git a/Foundation/wcelibcex-1.0/src/wce_path.c b/Foundation/wcelibcex-1.0/src/wce_path.c deleted file mode 100644 index 7fa304cd8..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_path.c +++ /dev/null @@ -1,479 +0,0 @@ -/* - * $Id: wce_path.c,v 1.0 2006/11/29 16:56:01 sdunand Exp $ - * - * Defines _splitpath, _wsplitpath, _makepath, _wmakepath, - * wceex_GetFullPathNameW, _fullpath, _wfullpath functions - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include -#include -#include -#include - -/******************************************************************************* -* wceex_splitpath -* -* Description: -* Break a path name into components. -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -void wceex_splitpath( const char *path, - char *drive, char *dir, char *name, char *ext ) -{ - char *slash, *bslash; - if( drive ) - *drive = 0; - if( dir ) - *dir = 0; - if( name ) - *name = 0; - if( ext ) - *ext = 0; - if( !path || *path == 0 ) - return; - slash = strrchr( path, '/' ); - bslash = strrchr( path, '\\' ); - if( slash > bslash ) - bslash = slash; - if( bslash ) - { - if( dir ) - { - size_t count = (bslash - path); - if( count >= _MAX_DIR ) - count = _MAX_DIR - 1; - strncat( dir, path, count ); - } - bslash++; - } - else - bslash = (char*)path; - if( name ) - { - char* dot; - strncat( name, bslash, _MAX_FNAME - 1 ); - dot = strrchr( name, '.' ); - if( dot ) - *dot = 0; - } - if( ext ) - { - char* dot = strrchr( bslash, '.' ); - if( dot ) - strncat( ext, dot, _MAX_EXT - 1 ); - } -} - -/******************************************************************************* -* wceex_wsplitpath -* -* Description: -* Break a path name into components. -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -void wceex_wsplitpath( const wchar_t *path, - wchar_t *drive, wchar_t *dir, wchar_t *name, wchar_t *ext ) -{ - wchar_t *slash, *bslash; - if( drive ) - *drive = 0; - if( dir ) - *dir = 0; - if( name ) - *name = 0; - if( ext ) - *ext = 0; - if( !path || *path == 0 ) - return; - slash = wcsrchr( path, '/' ); - bslash = wcsrchr( path, '\\' ); - if( slash > bslash ) - bslash = slash; - if( bslash ) - { - if( dir ) - { - size_t count = (bslash - path) / sizeof(wchar_t); - if( count >= _MAX_DIR ) - count = _MAX_DIR - 1; - wcsncat( dir, path, count ); - } - bslash++; - } - else - bslash = (wchar_t*)path; - if( name ) - { - wchar_t* dot; - wcsncat( name, bslash, _MAX_FNAME - 1 ); - dot = wcsrchr( name, '.' ); - if( dot ) - *dot = 0; - } - if( ext ) - { - wchar_t* dot = wcsrchr( bslash, '.' ); - if( dot ) - wcsncat( ext, dot, _MAX_EXT - 1 ); - } -} - -/******************************************************************************* -* wceex_makepath -* -* Description: -* Create a path name from components -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -void wceex_makepath( char *path, - const char *drive, const char *dir, - const char *name, const char *ext ) -{ - char* ptr = path; - size_t slen, sbuf = _MAX_PATH - 1; - *path = 0; - if( drive && *drive ) - { - strncat( ptr, drive, sbuf ); - slen = strlen( ptr ); - ptr += slen; - sbuf -= slen; - } - if( dir && *dir && sbuf ) - { - strncat( ptr, dir, sbuf ); - slen = strlen( ptr ); - ptr += slen - 1; - sbuf -= slen; - // backslash ? - if( sbuf && *ptr != '\\' && *ptr != '/' ) - { - char* slash = strchr( path, '/' ); - if( !slash ) - slash = strchr( path, '\\' ); - ptr++; - if( slash ) - *ptr = *slash; - else - *ptr = '\\'; - ptr++; - *ptr = 0; - sbuf--; - } - ptr++; - } - if( name && *name && sbuf ) - { - strncat( ptr, name, sbuf ); - slen = strlen( ptr ); - ptr += slen; - sbuf -= slen; - } - if( ext && *ext && sbuf ) - { - if( *ext != '.' ) - { - *ptr = '.'; - ptr++; - *ptr = 0; - sbuf--; - } - if( sbuf ) - strncat( ptr, ext, sbuf ); - } -} - -/******************************************************************************* -* wceex_wmakepath -* -* Description: -* Create a path name from components -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -void wceex_wmakepath( wchar_t *path, - const wchar_t *drive, const wchar_t *dir, - const wchar_t *name, const wchar_t *ext ) -{ - wchar_t* ptr = path; - size_t slen, sbuf = _MAX_PATH - 1; - *path = 0; - if( drive && *drive ) - { - wcsncat( ptr, drive, sbuf ); - slen = wcslen( ptr ); - ptr += slen; - sbuf -= slen; - } - if( dir && *dir && sbuf ) - { - wcsncat( ptr, dir, sbuf ); - slen = wcslen( ptr ); - ptr += slen - 1; - sbuf -= slen; - // backslash ? - if( sbuf && *ptr != '\\' && *ptr != '/' ) - { - wchar_t* slash = wcschr( path, '/' ); - if( !slash ) - slash = wcschr( path, '\\' ); - ptr++; - if( slash ) - *ptr = *slash; - else - *ptr = '\\'; - ptr++; - *ptr = 0; - sbuf--; - } - ptr++; - } - if( name && *name && sbuf ) - { - wcsncat( ptr, name, sbuf ); - slen = wcslen( ptr ); - ptr += slen; - sbuf -= slen; - } - if( ext && *ext && sbuf ) - { - if( *ext != '.' ) - { - *ptr = '.'; - ptr++; - *ptr = 0; - sbuf--; - } - if( sbuf ) - wcsncat( ptr, ext, sbuf ); - } -} - -/******************************************************************************* -* wceex_GetFullPathNameW -* -* Description: -* retrieves the full path and file name of a specified file. -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -DWORD wceex_GetFullPathNameW( LPCWSTR lpFileName, DWORD nBufferLength, - LPWSTR lpBuffer, LPWSTR *lpFilePart ) -{ - int up = 0, down = 0; - size_t len_tot, len_buf = 0; - LPWSTR file; - - // reference to current working directory ? - if( wcsncmp( lpFileName, L".\\", 2 ) == 0 ) - down = 1; - else if( wcsncmp( lpFileName, L"./", 2 ) == 0 ) - down = 2; - if( wcsncmp( lpFileName, L"..\\", 3 ) == 0 ) - up = 1; - else if( wcsncmp( lpFileName, L"../", 3 ) == 0 ) - up = 2; - if( down || up ) - { - LPWSTR last; - len_buf = wceex_GetCurrentDirectoryW( nBufferLength, lpBuffer ); - if( !len_buf ) - return 0; - // backslash at the end ? - last = lpBuffer + len_buf - 1; - if( *last != '\\' && *last != '/' ) - { - // test sufficient buffer before add - len_buf++; - if( len_buf >= nBufferLength ) - return len_buf + wcslen( lpFileName ) + 1; - last++; - if( down == 1 || up == 1 ) - *last = '\\'; - else - *last = '/'; - *(last + 1) = 0; - } - if( down ) - { - lpBuffer = last + 1; - lpFileName += 2; - } - else if( up ) - { - LPWSTR fname = (LPWSTR)lpFileName; - for(;;) - { - // root ? - if( last == lpBuffer ) - { - errno = ERROR_BAD_PATHNAME; - return 0; - } - // erase last backslash - *last = 0; - // parent directory - if( up == 1 ) - last = wcsrchr( lpBuffer, '\\' ); - else - last = wcsrchr( lpBuffer, '/' ); - if( !last ) - { - errno = ERROR_BAD_PATHNAME; - return 0; - } - *(last + 1) = 0; - // next parent directory ? - fname += 3; - if( up == 1 ) - { - if( wcsncmp( fname, L"..\\", 3 ) ) - break; - } - else - { - if( wcsncmp( fname, L"../", 3 ) ) - break; - } - } - len_buf = wcslen( lpBuffer ); - lpBuffer = last + 1; - lpFileName = fname; - } - } - len_tot = len_buf + wcslen( lpFileName ); - if( len_tot >= nBufferLength ) - return len_tot + 1; - wcscpy( lpBuffer, lpFileName ); - // delimiter of file name ? - file = wcsrchr( lpBuffer, '\\' ); - if( !file ) - file = wcsrchr( lpBuffer, '/' ); - if( file ) - { - file++; - if( *file == 0 ) - *lpFilePart = NULL; - else - *lpFilePart = file; - } - else - *lpFilePart = lpBuffer; - return len_tot; -} - -/******************************************************************************* -* wceex_wfullpath -* -* Description: -* Create an absolute or full path name for the specified relative path name. -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -wchar_t* wceex_wfullpath( wchar_t *absPath, const wchar_t *relPath, size_t maxLength ) -{ - wchar_t* lpFilePart; - DWORD ret = wceex_GetFullPathNameW( relPath, maxLength, absPath, &lpFilePart ); - if( !ret || ret > maxLength ) - { - *absPath = 0; - return NULL; - } - return absPath; -} - -/******************************************************************************* -* wceex_fullpath -* -* Description: -* Create an absolute or full path name for the specified relative path name. -* -* Return: -* -* Reference: -* -*******************************************************************************/ - -char* wceex_fullpath( char *absPath, const char *relPath, size_t maxLength ) -{ - wchar_t wrelPath[_MAX_PATH*2], *wabsPath, *wret; - if( !MultiByteToWideChar( CP_ACP, 0, relPath, -1, wrelPath, _MAX_PATH*2 ) ) - { - errno = ENOMEM; - *absPath = 0; - return NULL; - } - if( (wabsPath = (wchar_t*)malloc( maxLength * sizeof(wchar_t) )) == NULL ) - { - errno = ENOMEM; - *absPath = 0; - return NULL; - } - wret = wceex_wfullpath( wabsPath, wrelPath, maxLength ); - if( wret && !WideCharToMultiByte( CP_ACP, 0, wabsPath, -1, absPath, - maxLength, NULL, NULL ) ) - { - errno = GetLastError(); - wret = NULL; - } - free( wabsPath ); - if( !wret ) - { - *absPath = 0; - return NULL; - } - return absPath; -} diff --git a/Foundation/wcelibcex-1.0/src/wce_rename.c b/Foundation/wcelibcex-1.0/src/wce_rename.c deleted file mode 100644 index 3cb750bc5..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_rename.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * $Id: wce_rename.c,v 1.3 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines rename() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include - -/******************************************************************************* -* wceex_rename - rename a file -* -* Description: -* -* The rename() function changes the name of a file. -* The oldfile argument points to the pathname of the file to be renamed. -* The newfile argument points to the new pathname of the file. -* -* XXX - mloskot - function does not set errno value yet. -* -* Return: -* -* Upon successful completion, rename() returns 0. Otherwise, -1 is returned. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_rename(const char *oldfile, const char *newfile) -{ - int res; - size_t lenold; - size_t lennew; - wchar_t *wsold; - wchar_t *wsnew; - - /* Covert filename buffer to Unicode. */ - - /* Old filename */ - lenold = MultiByteToWideChar (CP_ACP, 0, oldfile, -1, NULL, 0) ; - wsold = (wchar_t*)malloc(sizeof(wchar_t) * lenold); - MultiByteToWideChar( CP_ACP, 0, oldfile, -1, wsold, lenold); - - /* New filename */ - lennew = MultiByteToWideChar (CP_ACP, 0, newfile, -1, NULL, 0) ; - wsnew = (wchar_t*)malloc(sizeof(wchar_t) * lennew); - MultiByteToWideChar(CP_ACP, 0, newfile, -1, wsnew, lennew); - - /* Delete file using Win32 CE API call */ - res = MoveFile(wsold, wsnew); - - /* Free wide-char string */ - free(wsold); - free(wsnew); - - if (res) - return 0; /* success */ - else - return -1; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_rewind.c b/Foundation/wcelibcex-1.0/src/wce_rewind.c deleted file mode 100644 index 083eb8738..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_rewind.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * $Id: wce_rewind.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines rewind() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* wceex_rewind - Reset the file position indicator in a stream -* -* Description: -* -* The call rewind(stream) shall be equivalent to: -* (void) fseek(stream, 0L, SEEK_SET) -* -* Internally, rewind() function uses SetFilePointer call from -* Windows CE API. -* -* Windows CE specific: -* On Windows CE HANDLE type is defined as typedef void *HANDLE -* and FILE type is declared as typedef void FILE. -* -* Return: -* -* No return value. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -void wceex_rewind(FILE * fp) -{ - int ret; - - /* TODO - mloskot: WARNING! - * fseek() does not clear error and end-of-file indicators for the stream - * So, that's why dirty asserts are used to get informed about potential problems. - */ - ret = fseek(fp, 0L, SEEK_SET); - - assert(0 == ret); - assert(0 == ferror(fp)); - assert(!feof(fp)); - - /* - - // XXX - mloskot: - // FILE* to HANDLE conversion needs hacks like _get_osfhandle() - // which are not available on Windows CE. - // Simple cast does not work. - // - // TODO: Does anyone know how to convert FILE* to HANDLE? - - DWORD dwError; - HANDLE hFile; - - hFile = (void*)fp; - - if (0xFFFFFFFF == SetFilePointer(hFile, 0, NULL, FILE_BEGIN)) - { - dwError = GetLastError(); - assert(NO_ERROR == dwError); - } - - */ -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_rmdir.c b/Foundation/wcelibcex-1.0/src/wce_rmdir.c deleted file mode 100644 index 71fdab48f..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_rmdir.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * $Id: wce_rmdir.c,v 1.3 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines rmdir() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_rmdir - Remove empty directory from filesystem. -* -* Description: -* -* The rmdir() function shall remove a directory whose name is given by path. -* The directory shall be removed only if it is an empty directory. -* Internally, mkdir() function wraps RemoveDirectory call from -* Windows CE API. -* -* Return: -* -* Upon successful completion, rmdir() shall return 0. -* Otherwise, -1 shall be returned. If -1 is returned, the named directory -* shall not be changed. -* -* XXX - mloskot - errno is not set - todo. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_rmdir(const char *filename) -{ - int res; - size_t len; - wchar_t *widestr; - - /* Covert filename buffer to Unicode. */ - len = MultiByteToWideChar (CP_ACP, 0, filename, -1, NULL, 0) ; - widestr = (wchar_t*)malloc(sizeof(wchar_t) * len); - MultiByteToWideChar( CP_ACP, 0, filename, -1, widestr, len); - - /* Delete file using Win32 CE API call */ - res = RemoveDirectory(widestr); - - /* Free wide-char string */ - free(widestr); - - /* XXX - Consider following recommendations: */ - /* XXX - mloskot - update the st_ctime and st_mtime fields of the parent directory. */ - /* XXX - mloskot - set errno to [EEXIST] or [ENOTEMPTY] if function failed. */ - - if (res) - return 0; /* success */ - else - return -1; - -} - - diff --git a/Foundation/wcelibcex-1.0/src/wce_setlocale.c b/Foundation/wcelibcex-1.0/src/wce_setlocale.c deleted file mode 100644 index 9e024ad92..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_setlocale.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * $Id: wce_setlocale.c 20 2006-11-18 17:00:30Z mloskot $ - * - * Defines setlocale() function with dummy implementation. - * - * Created by Mateusz Loskot (mloskot@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot (mloskot@loskot.net) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - - -/******************************************************************************* -* wceex_setlocale - dummy setlocale() function -* -* Description: -* -* C library on Windows CE includes file with prototype of -* setlocale() function but no implementation is available. -* -* Currently, wceex_setlocale() function does not provide any implementation. -* It does ALWAYS return empty string. -* -* TODO: Consider to implement working version of setlocale() based on -* GetLocaleInfo and SetLocaleInfo() calls from Windows CE API. -* Return: -* -* The wceex_setlocale() function ALWAYS returns empty string.* -* -*******************************************************************************/ - -char* wceex_setlocale(int category, const char* locale) -{ - return ""; -} diff --git a/Foundation/wcelibcex-1.0/src/wce_stat.c b/Foundation/wcelibcex-1.0/src/wce_stat.c deleted file mode 100644 index fd219870a..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_stat.c +++ /dev/null @@ -1,233 +0,0 @@ -/* - * $Id: wce_stat.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines stat() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include -#include -#include - -/******************************************************************************* -* Forward declarations. -********************************************************************************/ - -/* Return mode of file. */ -static unsigned short __wceex_get_file_mode(const char* name, int attr); - - -/******************************************************************************* -* wceex_stat - Get file attributes for file and store them in buffer. -* -* Description: -* -* File times on Windows CE: Windows CE object store keeps track of only -* one time, the time the file was last written to. -* -* Return value: -* -* Upon successful completion, 0 shall be returned. -* Otherwise, -1 shall be returned and errno set to indicate the error. -* -* XXX - mloskot - errno is not yet implemented -* -* Reference: -* IEEE Std 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_stat(const char* filename, struct stat *buffer) -{ - HANDLE findhandle; - WIN32_FIND_DATA findbuf; - wchar_t pathWCE[MAX_PATH]; - - //Don't allow wildcards to be interpreted by system - if(strpbrk(filename, "?*")) - //if(wcspbrk(path, L"?*")) - { - //errno = ENOENT; - return(-1); - } - - //search file/dir - mbstowcs(pathWCE, filename, strlen(filename) + 1); - findhandle = FindFirstFile(pathWCE, &findbuf); - if(findhandle == INVALID_HANDLE_VALUE) - { - //is root - if(_stricmp(filename, ".\\")==0) - { - findbuf.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; - - //dummy values - findbuf.nFileSizeHigh = 0; - findbuf.nFileSizeLow = 0; - findbuf.cFileName[0] = '\0'; - - buffer->st_mtime = wceex_local_to_time_r(1980 - TM_YEAR_BASE, 0, 1, 0, 0, 0); - buffer->st_atime = buffer->st_mtime; - buffer->st_ctime = buffer->st_mtime; - } - - //treat as an error - else - { - //errno = ENOENT; - return(-1); - } - } - else - { - /* File is found*/ - - SYSTEMTIME SystemTime; - FILETIME LocalFTime; - - //Time of last modification - if(!FileTimeToLocalFileTime( &findbuf.ftLastWriteTime, &LocalFTime) || - !FileTimeToSystemTime(&LocalFTime, &SystemTime)) - { - //errno = ::GetLastError(); - FindClose( findhandle ); - return( -1 ); - } - - buffer->st_mtime = wceex_local_to_time(&SystemTime); - - //Time od last access of file - if(findbuf.ftLastAccessTime.dwLowDateTime || findbuf.ftLastAccessTime.dwHighDateTime) - { - if(!FileTimeToLocalFileTime(&findbuf.ftLastAccessTime, &LocalFTime) || - !FileTimeToSystemTime(&LocalFTime, &SystemTime)) - { - //errno = ::GetLastError(); - FindClose( findhandle ); - return( -1 ); - } - buffer->st_atime = wceex_local_to_time(&SystemTime); - } - else - { - buffer->st_atime = buffer->st_mtime; - } - - - //Time of creation of file - if(findbuf.ftCreationTime.dwLowDateTime || findbuf.ftCreationTime.dwHighDateTime) - { - if(!FileTimeToLocalFileTime(&findbuf.ftCreationTime, &LocalFTime) || - !FileTimeToSystemTime(&LocalFTime, &SystemTime)) - { - //errno = ::GetLastError(); - FindClose( findhandle ); - return( -1 ); - } - buffer->st_ctime = wceex_local_to_time(&SystemTime); - } - else - { - buffer->st_ctime = buffer->st_mtime; - } - - //close handle - FindClose(findhandle); - } - - //file mode - buffer->st_mode = __wceex_get_file_mode(filename, findbuf.dwFileAttributes); - - //file size - buffer->st_size = findbuf.nFileSizeLow; - - //drive letter 0 - buffer->st_rdev = buffer->st_dev = 0; - - //set the common fields - buffer->st_gid = 0; - buffer->st_ino = 0; - buffer->st_uid = 0; - - //1 dla nlink - buffer->st_nlink = 1; - - - return 0; -} - -/******************************************************************************* -* Return mode of file. -********************************************************************************/ - -/* Test path for presence of slach at the end. */ -#define IS_SLASH(a) ((a) =='\\' || (a) == '/') - -#define __DOSMODE_MASK 0xff - -static unsigned short __wceex_get_file_mode(const char* filename, int attr) -{ - unsigned short file_mode; - unsigned mode; - const char *p; - - mode = attr & __DOSMODE_MASK; - - /* XXX - mloskot - remove it */ - if ((p = filename)[1] == ':') - p += 2; - - /* Check to see if this is a directory. */ - file_mode = (unsigned short) - (((IS_SLASH(*p) && !p[1]) || (mode & FILE_ATTRIBUTE_DIRECTORY) || !*p) - ? S_IFDIR | S_IEXEC : S_IFREG); - - /* Check if attribute byte does have read-only bit, otherwise it is read-write. */ - file_mode |= (mode & FILE_ATTRIBUTE_READONLY) ? S_IREAD : (S_IREAD | S_IWRITE); - - /* See if file appears to be executable by the extension. */ - if (p = strrchr(filename, '.')) - { - if (!_stricmp(p, ".exe") || - !_stricmp(p, ".cmd") || - !_stricmp(p, ".bat") || - !_stricmp(p, ".com")) - file_mode |= S_IEXEC; - } - - /* Propagate user read/write/execute bits to group/other fields. */ - file_mode |= (file_mode & 0700) >> 3; - file_mode |= (file_mode & 0700) >> 6; - - return(file_mode); -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_stat.h b/Foundation/wcelibcex-1.0/src/wce_stat.h deleted file mode 100644 index c68546a56..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_stat.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * $Id: wce_stat.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * sys/stat.h - data returned by the stat() function - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_STAT_H -#define WCEEX_STAT_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#ifndef _STAT_T_DEFINED -struct stat -{ - /* Drive number of the disk containing the file (same as st_rdev). */ - unsigned int st_dev; - - /* - * Number of the information node (the inode) for the file (UNIX-specific). - * On UNIX file systems, the inode describes the file date and time stamps, permissions, and content. - * When files are hard-linked to one another, they share the same inode. - * The inode, and therefore st_ino, has no meaning in the FAT, HPFS, or NTFS file systems. - */ - unsigned short st_ino; - - /* - * Bit mask for file-mode information. The _S_IFDIR bit is set if path specifies a directory; - * the _S_IFREG bit is set if path specifies an ordinary file or a device. - * User read/write bits are set according to the file's permission mode; - * user execute bits are set according to the filename extension. - */ - unsigned short st_mode; - - /* Always 1 on non-NTFS file systems. */ - short st_nlink; - - /* - * Numeric identifier of user who owns file (UNIX-specific). - * This field will always be zero on Windows NT systems. - * A redirected file is classified as a Windows NT file. - */ - short st_uid; - - /* - * Numeric identifier of group that owns file (UNIX-specific). - * This field will always be zero on Windows NT systems. - * A redirected file is classified as a Windows NT file - */ - short st_gid; - - /* Drive number of the disk containing the file (same as st_dev) */ - unsigned int st_rdev; - - long st_size; /* Size of the file in bytes */ - time_t st_atime; /* Time of last access of file */ - time_t st_mtime; /* Time of last modification of file */ - time_t st_ctime; /* Time of creation of file */ -}; -# define _STAT_T_DEFINED -#endif - -/* Encoding of the file mode. */ -#define __S_IFMT 0170000 /* These bits determine file type. */ - -/* File types. */ -#define S_IFDIR 0040000 /* Directory. */ -#define S_IFCHR 0020000 /* Character device. */ -#define S_IFREG 0100000 /* Regular file. */ -#define S_IFIFO 0010000 /* FIFO. */ - -/* Permission bits */ -#define S_ISUID 04000 /* Set user ID on execution. */ -#define S_ISGID 02000 /* Set group ID on execution. */ -#define S_IREAD 0000400 /* Read permission, owner */ -#define S_IWRITE 0000200 /* Write permission, owner */ -#define S_IEXEC 0000100 /* Execute/search permission, owner */ - -/* Macros to test file types masks.*/ - -#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask)) - -#define S_ISDIR(mode) __S_ISTYPE((mode), S_IFDIR) /* Test for a directory. */ -#define S_ISCHR(mode) __S_ISTYPE((mode), S_IFCHR) /* Test for a character special file. */ -#define S_ISREG(mode) __S_ISTYPE((mode), S_IFREG) /* Test for a regular file. */ -#define S_ISFIFO(mode) __S_ISTYPE((mode), S_IFIFO) /* Test for a pipe or FIFO special file. */ - - -/* - * File functions declarations. - */ - -int wceex_stat(const char *filename, struct stat *buf); -/* XXX - mloskot - int wceex_fstat(int filedes, struct stat *buf); */ - -int wceex_mkdir(const char *filename); -int wceex_rmdir(const char *filename); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_STAT_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_stdio.h b/Foundation/wcelibcex-1.0/src/wce_stdio.h deleted file mode 100644 index f60c81981..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_stdio.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * $Id: wce_stdio.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * stdio.h - standard buffered input/output - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_STDIO_H -#define WCEEX_STDIO_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Functions declarations */ - -int wceex_rename(const char *oldfile, const char *newfile); -int wceex_unlink(const char *filename); -int wceex_wunlink(const wchar_t *filename); -void wceex_rewind(FILE *stream); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_STDIO_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_stdlib.h b/Foundation/wcelibcex-1.0/src/wce_stdlib.h deleted file mode 100644 index 2087a4af6..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_stdlib.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * $Id: wce_stdlib.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * stdlib.h - standard library definitions - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_STDLIB_H -#define WCEEX_STDLIB_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - -/* - * Minimal set of required declarations to avoid inclusion of , - * because it defines 'LP' type and other which conflict with some libraries, - * like PROJ.4. - */ -typedef unsigned long DWORD; -typedef wchar_t *LPWSTR, *PWSTR; -typedef const wchar_t *LPCWSTR, *PCWSTR; - -#define _MAX_DIR 256 -#define _MAX_FNAME 256 -#define _MAX_EXT 256 - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Generate an abnormal process abort. */ - -void wceex_abort(void); - -/* Searching and sorting utilities. */ - -void* wceex_bsearch(const void *key, const void *base, size_t nmemb, size_t size, - int (*compar)(const void *, const void *)); - -void* wceex_lfind(const void *key, const void *base, size_t *nmemb, size_t size, - int(*compar)(const void *, const void *)); - -/* File Management Functions */ - -void wceex_splitpath( const char *path, - char *drive, char *dir, char *name, char *ext ); -void wceex_wsplitpath( const wchar_t *path, - wchar_t *drive, wchar_t *dir, wchar_t *name, wchar_t *ext ); - -void wceex_makepath( char *path, - const char *drive, const char *dir, - const char *name, const char *ext ); -void wceex_wmakepath( wchar_t *path, - const wchar_t *drive, const wchar_t *dir, - const wchar_t *name, const wchar_t *ext ); - -char* wceex_fullpath( char *absPath, const char *relPath, size_t maxLength ); -wchar_t* wceex_wfullpath( wchar_t *absPath, const wchar_t *relPath, size_t maxLength ); - -DWORD wceex_GetFullPathNameW( LPCWSTR lpFileName, DWORD nBufferLength, - LPWSTR lpBuffer, LPWSTR *lpFilePart ); - -/* Dummy compilation enablers - functions that do not provide any implementation. */ - -char* wceex_getenv(const char* varname); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - - -#endif /* #ifndef WCEEX_STDLIB_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_strerror.c b/Foundation/wcelibcex-1.0/src/wce_strerror.c deleted file mode 100644 index 90b7ae908..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_strerror.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * $Id: wce_strerror.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defined strerror() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -/******************************************************************** -* strerror - get error message string -* -* Description: -* -* The strerror() function shall map the error number in errnum -* to a locale-dependent error message string and shall return -* a pointer to it. Typically, the values for errnum come -* from errno, but strerror() shall map any value of type -* int to a message. -* -* Return value: -* -* Upon successful completion, strerror_r() shall return 0. -* Otherwise, an error number shall be returned to indicate -* the error. -********************************************************************/ -char * wceex_strerror(int errnum) -{ - return ""; /* dummy error message */ -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_string.h b/Foundation/wcelibcex-1.0/src/wce_string.h deleted file mode 100644 index 0bdbd5ac2..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_string.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * $Id: wce_string.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * string.h - string operations - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_STRING_H -#define WCEEX_STRING_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Function declarations */ - -char * wceex_strerror(int errnum); - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_STRING_H */ - diff --git a/Foundation/wcelibcex-1.0/src/wce_time.c b/Foundation/wcelibcex-1.0/src/wce_time.c deleted file mode 100644 index b976cdd53..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_time.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * $Id: wce_time.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines time() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* wceex_time - Return the value of time in seconds since the Epoch. -* -* Description: -* The timer argument points to an area where the return value is also stored. -* If timer is a null pointer, no value is stored. -* -* Return: -* Value of time if success, otherwise (time_t)-1 is returned. -* -* Reference: -* IEEE Standard and an Open Group Technical Standard 1003.1, 2004 Edition -*******************************************************************************/ -time_t wceex_time(time_t *timer) -{ - time_t t; - struct tm tmbuff; - SYSTEMTIME st; - - /* Retrive current system date time as UTC */ - GetSystemTime(&st); - - /* Build tm struct based on SYSTEMTIME values */ - - /* Date values */ - tmbuff.tm_year = st.wYear - TM_YEAR_BASE; - tmbuff.tm_mon = st.wMonth - 1; /* wMonth value 1-12 */ - tmbuff.tm_mday = st.wDay; - - /* Time values */ - tmbuff.tm_hour = st.wHour; - tmbuff.tm_min = st.wMinute; - tmbuff.tm_sec = st.wSecond; - tmbuff.tm_isdst = 0; /* Always 0 for UTC time. */ - tmbuff.tm_wday = st.wDayOfWeek; - tmbuff.tm_yday = 0; /* Value is set by wceex_gmmktime */ - - /* Convert tm struct to time_tUTC */ - t = wceex_gmmktime(&tmbuff); - - /* Assign time value. */ - if (timer != NULL) - { - *timer = t; - } - - return t; -} -/******************************************************************************* -* _wceex_tm_to_time_t - Convert time from tm struct format to time_t value. -* -* Description: -* The tmbuff points to structure that contains broken-down time. -* Input and output times are encoded as UTC. -* -* Return: -* Specified time since the Epoch encoded as a value of type time_t. -* (time_t)-1 is returned if time can not be represented by time_t. -* -* Reference: -* IEEE Standard and an Open Group Technical Standard 1003.1, 2004 Edition -*******************************************************************************/ -time_t __wceex_tm_to_time_t(const struct tm *tmbuff) -{ - time_t timer; - - /* If the year is <1970 or the value is negative, the relationship is undefined */ - if (tmbuff->tm_year < 70) - { - return (time_t) -1; - } - - /* If the year is >=1970 */ - /* Each and every day shall be accounted for by exactly 86400 seconds */ - - timer = tmbuff->tm_sec - + tmbuff->tm_min * 60 /* convert minutes to seconds */ - + tmbuff->tm_hour * 3600 /* convert hours to seconds */ - + tmbuff->tm_yday * 86400 /* convert day of year to seconds */ - + (tmbuff->tm_year - 70) * 31536000 /* convert year to seconds */ - + ((tmbuff->tm_year - 69) / 4) * 86400 /* add a day (seconds) every 4 years starting in 1973 */ - - ((tmbuff->tm_year - 1) / 100) * 86400 /* subtract a day back out every 100 years starting in 2001 */ - + ((tmbuff->tm_year + 299) / 400) * 86400; /* add a day back in every 400 years starting in 2001 */ - - return timer; -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_time.h b/Foundation/wcelibcex-1.0/src/wce_time.h deleted file mode 100644 index 4b9720ea9..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_time.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * $Id: wce_time.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * time.h and sys/time.h - time types and functions - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ -#ifndef WCEEX_TIME_H -#define WCEEX_TIME_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/******************************************************************************* - Types and macros definition -*******************************************************************************/ - -#ifndef _TIME_T_DEFINED -typedef long time_t; /* time value as number of seconds of the Epoch */ -#define _TIME_T_DEFINED -#endif /* _TIME_T_DEFINED */ - -#ifndef _TM_DEFINED -struct tm -{ - int tm_sec; /* seconds after the minute - [0,59] */ - int tm_min; /* minutes after the hour - [0,59] */ - int tm_hour; /* hours since midnight - [0,23] */ - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - int tm_wday; /* days since Sunday - [0,6] */ - int tm_yday; /* days since January 1 - [0,365] */ - int tm_isdst; /* daylight savings time flag */ -}; -#define _TM_DEFINED -#endif /* _TM_DEFINED */ - -#ifndef _TIMEZONE_DEFINED -struct timezone -{ - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; -#define _TIMEZONE_DEFINED -#endif /* _TIMEZONE_DEFINED */ - -/* - * Constants used internally by time functions. - */ - -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define EPOCHFILETIME (116444736000000000i64) -#else -#define EPOCHFILETIME (116444736000000000LL) -#endif - -/* Epoch base year */ -#define EPOCH_YEAR 1970 - -/* tm struct members conversion units */ -#define TM_YEAR_BASE 1900 /* tm_year base year */ -#define TM_MONTH_MIN 0 /* tm_mon = 0 - January */ -#define TM_MONTH_MAX 11 /* tm_mon = 11 - December */ - -#define MIN_SEC 60 /* seconds in a minute */ -#define HOUR_SEC 3600 /* seconds in an hour */ -#define DAY_SEC 86400 /* seconds in a day */ -#define YEAR_SEC (365 * DAY_SEC) /* seconds in a year */ -#define FOUR_YEAR_SEC (4 * YEAR_SEC + 1) /* seconds in a 4-year period */ - -/* -In every, 400 year period (greg) is an interval of the same -number of days: 365 x 400 + 97 = 146097 -Also, there are 97 leap days in every such 400 years interval -*/ -#define LEAP_DAYS_IN_GREG 97 -#define GREG_YEARS 400 -#define GREG_DAYS (365 * GREG_YEARS + LEAP_DAYS_IN_GREG) -#define GREG_SECS (GREG_DAYS * DAY_SEC) - -/* Checks if given year is a leap year. */ -#define IS_LEAP_YEAR(year) \ - (((year) % 4) == 0 && (((year) % 100) != 0 || ((year) % 400) == 0)) - -/******************************************************************************* - time.h functions -*******************************************************************************/ - -time_t wceex_time(time_t *timer); -time_t wceex_mktime(struct tm *tmbuff); -time_t wceex_gmmktime(struct tm *tmbuff); - -struct tm * wceex_localtime(const time_t *timer); -struct tm * wceex_gmtime(const time_t *timer); - -char * wceex_ctime(const time_t *timer); -char * wceex_ctime_r(const time_t *timer, char *buf); - -char * wceex_asctime(const struct tm *tmbuff); -char * wceex_asctime_r(const struct tm *tbuff, char *buff); - -/******************************************************************************* - sys/time.h functions -*******************************************************************************/ - -int wceex_gettimeofday(struct timeval *tp, struct timezone *tzp); - -/******************************************************************************* - Internal functions prototypes. -*******************************************************************************/ - -/* Internal function to get time value from tm struc. */ -extern time_t __wceex_mktime_utc(struct tm *tmbuff); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_TIME_H */ - diff --git a/Foundation/wcelibcex-1.0/src/wce_timesys.c b/Foundation/wcelibcex-1.0/src/wce_timesys.c deleted file mode 100644 index 946c4c44c..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_timesys.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * $Id: wce_timesys.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines function to convert time between formats SYSTEMTIME, - * FILETIME and time_t value. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include -#include - -/******************************************************************************* -* wceex_filetime_to_time - Convert FILETIME to time as time_t value -* -* Description: -* -* -* Return: -* -* This function shall return the specified time since the Epoch -* encoded as a value of type time_t. -* -*******************************************************************************/ -time_t wceex_filetime_to_time(const FILETIME * pft) -{ - SYSTEMTIME st; - FILETIME lft; - - /* File time as 0 value cannot be represented as Epoch time. */ - - if (!pft->dwLowDateTime && !pft->dwHighDateTime) - { - return (time_t)-1; - } - - /* Convert to a broken down local time value */ - if (!FileTimeToLocalFileTime(pft, &lft) || - !FileTimeToSystemTime(&lft, &st)) - { - return (time_t)-1; - } - - return wceex_local_to_time(&st); -} - - -/******************************************************************************* -* wceex_local_to_time - Convert broken-down local time to value of type time_t -* -* Description: -* -* -* Return: -* -* This function shall return the specified time since the Epoch -* encoded as a value of type time_t. -* -*******************************************************************************/ -time_t wceex_local_to_time(const SYSTEMTIME *st) -{ - if (st == NULL) - { - return (time_t)-1; - } - - return wceex_local_to_time_r(st->wYear - TM_YEAR_BASE, - st->wMonth - 1, - st->wDay, st->wHour, - st->wMinute, - st->wSecond); -} - -/******************************************************************************* -* wceex_local_to_time - Convert broken-down local time to value of type time_t -* -* Description: -* -* Date and time are given as a set of separate values. -* Parameters: -* - year is Epoch-based, year - 1900 -* - mon is 0 based number of current month -* - day is 1 based number of current day -* - hour, min and sec represent current local time. -* -* Return: -* -* This function shall return the specified time since the Epoch -* encoded as a value of type time_t. -* -*******************************************************************************/ -time_t wceex_local_to_time_r(int year, int mon, int day, int hour, int min, int sec) -{ - struct tm tmbuff = { 0 }; - - tmbuff.tm_year = year; - tmbuff.tm_mon = mon; - tmbuff.tm_mday = day; - tmbuff.tm_hour = hour; - tmbuff.tm_min = min; - tmbuff.tm_sec = sec; - tmbuff.tm_isdst = 0; - tmbuff.tm_wday = 0; - tmbuff.tm_yday = 0; - - /* Convert tm struct to time_tUTC */ - return wceex_mktime(&tmbuff); -} - diff --git a/Foundation/wcelibcex-1.0/src/wce_timesys.h b/Foundation/wcelibcex-1.0/src/wce_timesys.h deleted file mode 100644 index 32928b851..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_timesys.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * $Id: wce_timesys.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * wce_timesys.h - SYSTEMTIME and FILETIME conversion utilities. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - */ -#ifndef WCEEX_TIMESYS_H -#define WCEEX_TIMESYS_H 1 - -#ifndef _WIN32_WCE -# error "Only Windows CE target compilation supported" -#endif - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Function declarations. */ - -time_t wceex_filetime_to_time(const FILETIME * filetime); -time_t wceex_local_to_time(const SYSTEMTIME *systemtime); -time_t wceex_local_to_time_r(int year, int mon, int day, int hour, int min, int sec); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_TIMESYS_H */ diff --git a/Foundation/wcelibcex-1.0/src/wce_types.h b/Foundation/wcelibcex-1.0/src/wce_types.h deleted file mode 100644 index 850e17b05..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_types.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * $Id: wce_types.h,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * sys/types.h - data types - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - */ -#ifndef WCEEX_SYS_TYPES_H -#define WCEEX_SYS_TYPES_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -#ifndef _TIME_T_DEFINED -typedef long time_t; /* Used for time in seconds. */ -# define _TIME_T_DEFINED -#endif - -#ifndef _SIZE_T_DEFINED -typedef unsigned int size_t; /* Used for sizes of objects. */ -# define _SIZE_T_DEFINED -#endif - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_SYS_TYPES_H */ \ No newline at end of file diff --git a/Foundation/wcelibcex-1.0/src/wce_unistd.h b/Foundation/wcelibcex-1.0/src/wce_unistd.h deleted file mode 100644 index f8579f907..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_unistd.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * $Id$ - * - * unistd.h - defines symbolic constants, types, and declares miscellaneous functions - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Mateusz Loskot - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_UNISTD_H -#define WCEEX_UNISTD_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Winddows CE target is supported!" -#endif - -/* Defines NULL pointer value */ -#include - - -/* - * Symbolic constants for second argument to access() function. - * All constants and following expressions R_OK|W_OK, R_OK|X_OK - * and R_OK|W_OK|X_OK have distinct values. - */ - -#define R_OK 4 /* Test for read permission. */ -#define W_OK 2 /* Test for write permission. */ -#define X_OK 1 /* Test for execute (search) permission. */ -#define F_OK 0 /* Test for existence of file. */ - - -/* - * Variables used for communication with getopt() function - * to the caller. - */ - -/* Argument associated with option */ -extern char *optarg; - -/* Index into parent argv vector */ -extern int optind; - -/* If error message should be printed */ -extern int opterr; - -/* Character checked for validity */ -extern int optopt; - -#endif /* #ifndef WCEEX_UNISTD_H */ \ No newline at end of file diff --git a/Foundation/wcelibcex-1.0/src/wce_unlink.c b/Foundation/wcelibcex-1.0/src/wce_unlink.c deleted file mode 100644 index b83ecf118..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_unlink.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * $Id: wce_unlink.c,v 1.2 2006/04/09 16:48:18 mloskot Exp $ - * - * Defines unlink() function. - * - * Created by Mateusz Loskot (mateusz@loskot.net) - * - * Copyright (c) 2006 Taxus SI Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - * Contact: - * Taxus SI Ltd. - * http://www.taxussi.com.pl - * - */ - -#include -#include - -/******************************************************************************* -* wceex_unlink -remove a directory entry. -* -* Return: -* -* Upon successful completion, 0 shall be returned. Otherwise, -1. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_unlink(const char *filename) -{ - int res; - int len; - wchar_t* pWideStr; - - /* Covert filename buffer to Unicode. */ - len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0) ; - pWideStr = (wchar_t*)malloc(sizeof(wchar_t) * len); - - MultiByteToWideChar(CP_ACP, 0, filename, -1, pWideStr, len); - - /* Delete file using Win32 CE API call */ - res = DeleteFile(pWideStr); - - /* Free wide-char string */ - free(pWideStr); - - if (res) - return 0; /* success */ - else - { - errno = GetLastError(); - return -1; - } -} - -/******************************************************************************* -* wceex_wunlink -remove a directory entry. -* -* Return: -* -* Upon successful completion, 0 shall be returned. Otherwise, -1. -* -* Reference: -* -* IEEE 1003.1, 2004 Edition -* -*******************************************************************************/ -int wceex_wunlink(const wchar_t *filename) -{ - if( DeleteFile(filename) ) - return 0; - else - { - errno = GetLastError(); - return -1; - } -} \ No newline at end of file diff --git a/Foundation/wcelibcex-1.0/src/wce_winbase.c b/Foundation/wcelibcex-1.0/src/wce_winbase.c deleted file mode 100644 index b0bb3b9fe..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_winbase.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * $Id: wce_winbase.c,v 1.0 2006/11/29 17:00:28 sdunand Exp $ - * - * Defines GetStdHandle() function with dummy implementation. - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ - -#include - -HANDLE GetStdHandle( DWORD nStdHandle ) -{ - return NULL; -} diff --git a/Foundation/wcelibcex-1.0/src/wce_winbase.h b/Foundation/wcelibcex-1.0/src/wce_winbase.h deleted file mode 100644 index 3bbe5aacf..000000000 --- a/Foundation/wcelibcex-1.0/src/wce_winbase.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * $Id: wce_winbase.h,v 1.0 2006/04/12 15:11:36 sdunand Exp $ - * - * Created by Stéphane Dunand (sdunand@sirap.fr) - * - * Copyright (c) 2006 Stéphane Dunand - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH - * THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * MIT License: - * http://opensource.org/licenses/mit-license.php - * - */ -#ifndef WCEEX_WINBASE_H -#define WCEEX_WINBASE_H 1 - -#if !defined(_WIN32_WCE) -# error "Only Windows CE target is supported!" -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#define STD_INPUT_HANDLE (DWORD)-10 -#define STD_OUTPUT_HANDLE (DWORD)-11 -#define STD_ERROR_HANDLE (DWORD)-12 - -HANDLE GetStdHandle( DWORD nStdHandle ); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* #ifndef WCEEX_WINBASE_H */ - diff --git a/JSON/testsuite/CMakeLists.txt b/JSON/testsuite/CMakeLists.txt index 2a399f14f..2d2e54c2b 100644 --- a/JSON/testsuite/CMakeLists.txt +++ b/JSON/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(JSON-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/JSON/testsuite/src/WinCEDriver.cpp b/JSON/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 12f962df9..000000000 --- a/JSON/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "JSONTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("JSONTestSuite", JSONTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/JWT/testsuite/CMakeLists.txt b/JWT/testsuite/CMakeLists.txt index 32f1b3eec..b8166ed98 100644 --- a/JWT/testsuite/CMakeLists.txt +++ b/JWT/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(JWT-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/JWT/testsuite/src/WinCEDriver.cpp b/JWT/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 9961f2b8f..000000000 --- a/JWT/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2019, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "JWTTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("JWTTestSuite", JWTTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/MongoDB/testsuite/CMakeLists.txt b/MongoDB/testsuite/CMakeLists.txt index df40359d2..afa0f1659 100644 --- a/MongoDB/testsuite/CMakeLists.txt +++ b/MongoDB/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(MongoDB-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/MongoDB/testsuite/src/WinCEDriver.cpp b/MongoDB/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 2fb7f34bd..000000000 --- a/MongoDB/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "MongoDBTestSuite.h" -#include - - -int _tmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("MongoDBTestSuite", MongoDBTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Net/CMakeLists.txt b/Net/CMakeLists.txt index 04799325c..eff4df8b8 100644 --- a/Net/CMakeLists.txt +++ b/Net/CMakeLists.txt @@ -26,14 +26,10 @@ set_target_properties(Net ) target_link_libraries(Net PUBLIC Poco::Foundation) -# Windows and WindowsCE need additional libraries +# Windows need additional libraries if(WIN32) target_link_libraries(Net PUBLIC "iphlpapi.lib") - if(WINCE) - target_link_libraries(Net PUBLIC "ws2.lib") - else() - target_link_libraries(Net PUBLIC "ws2_32.lib") - endif() + target_link_libraries(Net PUBLIC "ws2_32.lib") endif(WIN32) target_include_directories(Net diff --git a/Net/include/Poco/Net/Net.h b/Net/include/Poco/Net/Net.h index 58e052af3..9b4fae0e6 100644 --- a/Net/include/Poco/Net/Net.h +++ b/Net/include/Poco/Net/Net.h @@ -106,13 +106,13 @@ std::string htmlize(const std::string& str); extern "C" const struct Net_API NetworkInitializer pocoNetworkInitializer; #if defined(Net_EXPORTS) - #if defined(_WIN64) || (defined(_WIN32_WCE) && !defined(x86)) + #if defined(_WIN64) #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) && !defined(x86)) + #if defined(_WIN64) #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)) diff --git a/Net/include/Poco/Net/SocketDefs.h b/Net/include/Poco/Net/SocketDefs.h index cbe80b9fb..3f7b182da 100644 --- a/Net/include/Poco/Net/SocketDefs.h +++ b/Net/include/Poco/Net/SocketDefs.h @@ -250,7 +250,7 @@ #endif -#if (POCO_OS == POCO_OS_HPUX) || (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_WINDOWS_CE) || (POCO_OS == POCO_OS_CYGWIN) +#if (POCO_OS == POCO_OS_HPUX) || (POCO_OS == POCO_OS_SOLARIS) || (POCO_OS == POCO_OS_CYGWIN) #define POCO_BROKEN_TIMEOUTS 1 #endif diff --git a/Net/samples/WebSocketServer/CMakeLists.txt b/Net/samples/WebSocketServer/CMakeLists.txt index 0b3abfa13..5dd584983 100644 --- a/Net/samples/WebSocketServer/CMakeLists.txt +++ b/Net/samples/WebSocketServer/CMakeLists.txt @@ -1,5 +1,3 @@ add_executable(WebSocketServer src/WebSocketServer.cpp) -if(WINCE) - set_target_properties(WebSocketServer PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(WebSocketServer PUBLIC Poco::Net Poco::Util Poco::JSON) diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index f73d8f684..0002c316d 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -1009,7 +1009,6 @@ IPAddress subnetMaskForInterface(const std::string& name, bool isLoopback) } else { -#if !defined(_WIN32_WCE) std::string subKey("SYSTEM\\CurrentControlSet\\services\\Tcpip\\Parameters\\Interfaces\\"); subKey += name; std::string netmask; @@ -1031,9 +1030,6 @@ IPAddress subnetMaskForInterface(const std::string& name, bool isLoopback) Poco::UnicodeConverter::toUTF8(unetmask, netmask); RegCloseKey(hKey); return IPAddress::parse(netmask); -#else - return IPAddress(); -#endif // !defined(_WIN32_WCE) } } @@ -1088,9 +1084,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) 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 (_WIN32_WINNT >= 0x0501) && (NTDDI_VERSION >= 0x05010100) // Win XP SP1 #if defined (IP_ADAPTER_IPV6_ENABLED) // Vista if(osvi.dwMajorVersion>=6)//vista { @@ -1190,24 +1184,8 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) // 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 >= 0x0501) && (NTDDI_VERSION >= 0x05010100) // Win XP SP1 #if (_WIN32_WINNT >= 0x0600) // Vista and newer if (osvi.dwMajorVersion >= 6) { diff --git a/Net/src/TCPServer.cpp b/Net/src/TCPServer.cpp index 46951fdb9..ea307b399 100644 --- a/Net/src/TCPServer.cpp +++ b/Net/src/TCPServer.cpp @@ -225,18 +225,10 @@ 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; + return name; } diff --git a/Net/testsuite/CMakeLists.txt b/Net/testsuite/CMakeLists.txt index f302e795a..b3f78ab81 100644 --- a/Net/testsuite/CMakeLists.txt +++ b/Net/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Net-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Net/testsuite/src/SocketAddressTest.cpp b/Net/testsuite/src/SocketAddressTest.cpp index 2249f9df1..b5b4e6cf9 100644 --- a/Net/testsuite/src/SocketAddressTest.cpp +++ b/Net/testsuite/src/SocketAddressTest.cpp @@ -57,12 +57,10 @@ void SocketAddressTest::testSocketAddress() assertTrue (sa2.host().toString() == "192.168.1.100"); assertTrue (sa2.port() == 100); -#if !defined(_WIN32_WCE) SocketAddress sa03 = SocketAddress("192.168.1.100", "ftp"); SocketAddress sa3(std::move(sa03)); assertTrue (sa3.host().toString() == "192.168.1.100"); assertTrue (sa3.port() == 21); -#endif try { diff --git a/Net/testsuite/src/WinCEDriver.cpp b/Net/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index e1b3bf516..000000000 --- a/Net/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "NetTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("NetTestSuite", NetTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/NetSSL_OpenSSL/testsuite/CMakeLists.txt b/NetSSL_OpenSSL/testsuite/CMakeLists.txt index 320d4dd14..9f8e916f5 100644 --- a/NetSSL_OpenSSL/testsuite/CMakeLists.txt +++ b/NetSSL_OpenSSL/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(NetSSL-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp b/NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 970b39b9e..000000000 --- a/NetSSL_OpenSSL/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "NetSSLTestSuite.h" -#include "Poco/Util/Application.h" -#include "Poco/Net/HTTPStreamFactory.h" -#include "Poco/Net/HTTPSStreamFactory.h" -#include - - -class NetSSLApp: public Poco::Util::Application -{ -public: - NetSSLApp() - { - Poco::Net::initializeSSL(); - Poco::Net::HTTPStreamFactory::registerFactory(); - Poco::Net::HTTPSStreamFactory::registerFactory(); - } - - ~NetSSLApp() - { - Poco::Net::uninitializeSSL(); - } - - int main(const std::vector& args) - { - CppUnit::TestRunner runner; - runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite()); - return runner.run(_targs) ? 0 : 1; - } - - void setup(const std::vector& args) - { - char* argv[] = - { - const_cast(args[0].c_str()) - }; - - init(1, argv); - for (std::size_t i = 0; i < args.size(); ++i) - _targs.push_back(args[i]); - } - -protected: - void initialize(Poco::Util::Application& self) - { - loadConfiguration(); // load default configuration files, if present - Poco::Util::Application::initialize(self); - } - -private: - std::vector _targs; -}; - - -int _tmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - - NetSSLApp app; - try - { - app.setup(args); - return app.run(); - } - catch (Poco::Exception& exc) - { - std::cout << exc.displayText() << std::endl; - return 1; - } -} diff --git a/NetSSL_Win/src/SSLManager.cpp b/NetSSL_Win/src/SSLManager.cpp index 853a1b5b0..40be6ebaa 100644 --- a/NetSSL_Win/src/SSLManager.cpp +++ b/NetSSL_Win/src/SSLManager.cpp @@ -349,9 +349,6 @@ void SSLManager::loadSecurityLibrary() if (!GetVersionEx(&VerInfo)) throw Poco::SystemException("Cannot determine OS version"); -#if defined(_WIN32_WCE) - dllPath = L"Secur32.dll"; -#else if (VerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && VerInfo.dwMajorVersion == 4) { @@ -366,7 +363,6 @@ void SSLManager::loadSecurityLibrary() { throw Poco::SystemException("Cannot determine which security DLL to use"); } -#endif // // Load Security DLL @@ -378,11 +374,7 @@ void SSLManager::loadSecurityLibrary() throw Poco::SystemException("Failed to load security DLL"); } -#if defined(_WIN32_WCE) - INIT_SECURITY_INTERFACE pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddressW( _hSecurityModule, L"InitSecurityInterfaceW"); -#else INIT_SECURITY_INTERFACE pInitSecurityInterface = (INIT_SECURITY_INTERFACE)GetProcAddress( _hSecurityModule, "InitSecurityInterfaceW"); -#endif if (!pInitSecurityInterface) { diff --git a/NetSSL_Win/src/SecureSocketImpl.cpp b/NetSSL_Win/src/SecureSocketImpl.cpp index 03aedf399..c7b9c7e6e 100644 --- a/NetSSL_Win/src/SecureSocketImpl.cpp +++ b/NetSSL_Win/src/SecureSocketImpl.cpp @@ -1308,7 +1308,6 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) } CertFreeCertificateContext(pResult); -#if !defined(_WIN32_WCE) // check if cert is revoked if (_pContext->options() & Context::OPT_PERFORM_REVOCATION_CHECK) { @@ -1338,7 +1337,6 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) } else break; } -#endif } CertFreeCertificateChain(pChainContext); } @@ -1409,7 +1407,6 @@ void SecureSocketImpl::serverVerifyCertificate() return; } -#if !defined(_WIN32_WCE) // perform revocation checking for (DWORD i = 0; i < pChainContext->cChain; i++) { @@ -1444,7 +1441,7 @@ void SecureSocketImpl::serverVerifyCertificate() } } } -#endif + if (pChainContext) { CertFreeCertificateChain(pChainContext); diff --git a/NetSSL_Win/testsuite/CMakeLists.txt b/NetSSL_Win/testsuite/CMakeLists.txt index ec45478a1..40507eda4 100644 --- a/NetSSL_Win/testsuite/CMakeLists.txt +++ b/NetSSL_Win/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(NetSSLWin-testrunner ${TEST_SRCS}) add_test( NAME NetSSLWin diff --git a/NetSSL_Win/testsuite/src/WinCEDriver.cpp b/NetSSL_Win/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 990a47c8e..000000000 --- a/NetSSL_Win/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2006-2014, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "NetSSLTestSuite.h" -#include "Poco/Util/Application.h" -#include "Poco/Net/HTTPStreamFactory.h" -#include "Poco/Net/HTTPSStreamFactory.h" -#include -#include - - -class NetSSLApp: public Poco::Util::Application -{ -public: - NetSSLApp() - { - Poco::Net::initializeSSL(); - Poco::Net::HTTPStreamFactory::registerFactory(); - Poco::Net::HTTPSStreamFactory::registerFactory(); - } - - ~NetSSLApp() - { - Poco::Net::uninitializeSSL(); - } - - int main(const std::vector& args) - { - CppUnit::TestRunner runner; - runner.addTest("NetSSLTestSuite", NetSSLTestSuite::suite()); - return runner.run(_targs) ? 0 : 1; - } - - void setup(const std::vector& args) - { - char* argv[] = - { - const_cast(args[0].c_str()) - }; - - init(1, argv); - for (std::size_t i = 0; i < args.size(); ++i) - _targs.push_back(args[i]); - } - -protected: - void initialize(Poco::Util::Application& self) - { - loadConfiguration(); // load default configuration files, if present - Poco::Util::Application::initialize(self); - } - -private: - std::vector _targs; -}; - - -int _tmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - - NetSSLApp app; - try - { - app.setup(args); - return app.run(); - } - catch (Poco::Exception& exc) - { - std::cout << exc.displayText() << std::endl; - return 1; - } -} diff --git a/Prometheus/testsuite/CMakeLists.txt b/Prometheus/testsuite/CMakeLists.txt index 2d840a988..f36482084 100644 --- a/Prometheus/testsuite/CMakeLists.txt +++ b/Prometheus/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Prometheus-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Prometheus/testsuite/src/WinCEDriver.cpp b/Prometheus/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index b17d86e24..000000000 --- a/Prometheus/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2022, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "PrometheusTestSuite.h" -#include - - -int _tmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("PrometheusTestSuite", PrometheusTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Redis/testsuite/CMakeLists.txt b/Redis/testsuite/CMakeLists.txt index 422ffc493..a74d39c7b 100644 --- a/Redis/testsuite/CMakeLists.txt +++ b/Redis/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Redis-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Redis/testsuite/src/WinCEDriver.cpp b/Redis/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 156391d69..000000000 --- a/Redis/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2015, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "RedisTestSuite.h" -#include - - -int _tmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("RedisTestSuite", RedisTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Util/include/Poco/Util/ServerApplication.h b/Util/include/Poco/Util/ServerApplication.h index ae5cea0f1..f575963da 100644 --- a/Util/include/Poco/Util/ServerApplication.h +++ b/Util/include/Poco/Util/ServerApplication.h @@ -161,9 +161,7 @@ public: protected: int run(); void waitForTerminationRequest(); -#if !defined(_WIN32_WCE) void defineOptions(OptionSet& options); -#endif private: virtual void handlePidFile(const std::string& name, const std::string& value); @@ -178,7 +176,6 @@ private: static Poco::Event _terminate; #endif #elif defined(POCO_OS_FAMILY_WINDOWS) -#if !defined(_WIN32_WCE) enum Action { SRV_RUN, @@ -208,7 +205,6 @@ private: static Poco::Event _terminated; static SERVICE_STATUS _serviceStatus; static SERVICE_STATUS_HANDLE _serviceStatusHandle; -#endif // _WIN32_WCE static Poco::NamedEvent _terminate; #endif }; diff --git a/Util/samples/SampleApp/CMakeLists.txt b/Util/samples/SampleApp/CMakeLists.txt index 30f2c787d..e86a9aa2d 100644 --- a/Util/samples/SampleApp/CMakeLists.txt +++ b/Util/samples/SampleApp/CMakeLists.txt @@ -1,5 +1,3 @@ add_executable(SampleApp src/SampleApp.cpp) -if(WINCE) - set_target_properties(SampleApp PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(SampleApp PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/samples/SampleServer/CMakeLists.txt b/Util/samples/SampleServer/CMakeLists.txt index e2bcfe0a3..7137fe489 100644 --- a/Util/samples/SampleServer/CMakeLists.txt +++ b/Util/samples/SampleServer/CMakeLists.txt @@ -1,5 +1,3 @@ add_executable(SampleServer src/SampleServer.cpp) -if(WINCE) - set_target_properties(SampleServer PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(SampleServer PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/samples/pkill/CMakeLists.txt b/Util/samples/pkill/CMakeLists.txt index 9c34d001b..b1eaf4504 100644 --- a/Util/samples/pkill/CMakeLists.txt +++ b/Util/samples/pkill/CMakeLists.txt @@ -1,5 +1,3 @@ add_executable(pkill src/pkill.cpp) -if(WINCE) - set_target_properties(pkill PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(pkill PUBLIC Poco::Util Poco::JSON Poco::XML) diff --git a/Util/src/ServerApplication.cpp b/Util/src/ServerApplication.cpp index 0d2245c1c..6ff10a959 100644 --- a/Util/src/ServerApplication.cpp +++ b/Util/src/ServerApplication.cpp @@ -34,10 +34,8 @@ #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 @@ -56,12 +54,10 @@ 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,11 +66,9 @@ 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 } @@ -109,7 +103,6 @@ void ServerApplication::terminate() #if defined(POCO_OS_FAMILY_WINDOWS) -#if !defined(_WIN32_WCE) // @@ -436,59 +429,6 @@ void ServerApplication::handleStartup(const std::string& name, const std::string } -#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(); -} - - -int ServerApplication::run(int argc, wchar_t** argv) -{ - try - { - init(argc, argv); - } - catch (Exception& exc) - { - logger().log(exc); - return EXIT_CONFIG; - } - return run(); -} - - -#endif // _WIN32_WCE #elif defined(POCO_VXWORKS) // // VxWorks specific code diff --git a/Util/src/WinRegistryConfiguration.cpp b/Util/src/WinRegistryConfiguration.cpp index b8d5c32a1..9bf9ffef3 100644 --- a/Util/src/WinRegistryConfiguration.cpp +++ b/Util/src/WinRegistryConfiguration.cpp @@ -95,19 +95,12 @@ void WinRegistryConfiguration::enumerate(const std::string& key, Keys& range) co if (fullPath.empty()) { // return all root level keys -#if defined(_WIN32_WCE) - range.push_back("HKEY_CLASSES_ROOT"); - range.push_back("HKEY_CURRENT_USER"); - range.push_back("HKEY_LOCAL_MACHINE"); - range.push_back("HKEY_USERS"); -#else range.push_back("HKEY_CLASSES_ROOT"); range.push_back("HKEY_CURRENT_CONFIG"); range.push_back("HKEY_CURRENT_USER"); range.push_back("HKEY_LOCAL_MACHINE"); range.push_back("HKEY_PERFORMANCE_DATA"); range.push_back("HKEY_USERS"); -#endif } else { diff --git a/Util/src/WinRegistryKey.cpp b/Util/src/WinRegistryKey.cpp index 7fd1a28d0..960e8f728 100644 --- a/Util/src/WinRegistryKey.cpp +++ b/Util/src/WinRegistryKey.cpp @@ -148,17 +148,14 @@ std::string WinRegistryKey::getStringExpand(const std::string& name) Poco::Buffer buffer(len + 1); RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) buffer.begin(), &size); buffer[len] = 0; -#if !defined(_WIN32_WCE) + wchar_t temp; DWORD expSize = ExpandEnvironmentStringsW(buffer.begin(), &temp, 1); Poco::Buffer expBuffer(expSize); ExpandEnvironmentStringsW(buffer.begin(), expBuffer.begin(), expSize); std::string result; UnicodeConverter::toUTF8(expBuffer.begin(), result); -#else - std::string result; - UnicodeConverter::toUTF8(buffer.begin(), result); -#endif + return result; } return std::string(); @@ -281,7 +278,6 @@ void WinRegistryKey::deleteKey() std::wstring usubKey; Poco::UnicodeConverter::toUTF16(_subKey, usubKey); -#if !defined(_WIN32_WCE) typedef LONG (WINAPI *RegDeleteKeyExWFunc)(HKEY hKey, const wchar_t* lpSubKey, REGSAM samDesired, DWORD Reserved); if (_extraSam != 0) { @@ -297,7 +293,7 @@ void WinRegistryKey::deleteKey() } } } -#endif + if (RegDeleteKeyW(_hRootKey, usubKey.c_str()) != ERROR_SUCCESS) throw NotFoundException(key()); } diff --git a/Util/src/WinService.cpp b/Util/src/WinService.cpp index 6e231bbd9..b2a9d8f6c 100644 --- a/Util/src/WinService.cpp +++ b/Util/src/WinService.cpp @@ -12,9 +12,6 @@ // -#if !defined(_WIN32_WCE) - - #include "Poco/Util/WinService.h" #include "Poco/Util/WinRegistryKey.h" #include "Poco/Thread.h" @@ -421,6 +418,3 @@ POCO_LPQUERY_SERVICE_CONFIG WinService::config() const } } // namespace Poco::Util - - -#endif // !defined(_WIN32_WCE) diff --git a/Util/testsuite/CMakeLists.txt b/Util/testsuite/CMakeLists.txt index 90332680a..4f1e0f3c4 100644 --- a/Util/testsuite/CMakeLists.txt +++ b/Util/testsuite/CMakeLists.txt @@ -17,10 +17,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Util-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Util/testsuite/src/LoggingConfiguratorTest.cpp b/Util/testsuite/src/LoggingConfiguratorTest.cpp index 9f1d97d7e..3e9250f57 100644 --- a/Util/testsuite/src/LoggingConfiguratorTest.cpp +++ b/Util/testsuite/src/LoggingConfiguratorTest.cpp @@ -89,7 +89,7 @@ void LoggingConfiguratorTest::testConfigurator() assertTrue (root.getLevel() == Message::PRIO_WARNING); FormattingChannel::Ptr pFC = root.getChannel().cast(); assertNotNull (pFC); -#if defined(_WIN32) && !defined(_WIN32_WCE) +#if defined(_WIN32) assertTrue (!pFC->getChannel().cast().isNull()); #else assertTrue (!pFC->getChannel().cast().isNull()); diff --git a/Util/testsuite/src/UtilTestSuite.cpp b/Util/testsuite/src/UtilTestSuite.cpp index 36bdbf369..d0715be78 100644 --- a/Util/testsuite/src/UtilTestSuite.cpp +++ b/Util/testsuite/src/UtilTestSuite.cpp @@ -12,7 +12,7 @@ #include "ConfigurationTestSuite.h" #include "OptionsTestSuite.h" #include "TimerTestSuite.h" -#if defined(_MSC_VER) && !defined(_WIN32_WCE) +#if defined(_MSC_VER) #include "WindowsTestSuite.h" #endif @@ -24,7 +24,7 @@ CppUnit::Test* UtilTestSuite::suite() pSuite->addTest(ConfigurationTestSuite::suite()); pSuite->addTest(OptionsTestSuite::suite()); pSuite->addTest(TimerTestSuite::suite()); -#if defined(_MSC_VER) && !defined(_WIN32_WCE) +#if defined(_MSC_VER) pSuite->addTest(WindowsTestSuite::suite()); #endif diff --git a/Util/testsuite/src/WinCEDriver.cpp b/Util/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 5ccb12824..000000000 --- a/Util/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "UtilTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("UtilTestSuite", UtilTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Util/testsuite/src/WinConfigurationTest.cpp b/Util/testsuite/src/WinConfigurationTest.cpp index 1686aeefc..078520f06 100644 --- a/Util/testsuite/src/WinConfigurationTest.cpp +++ b/Util/testsuite/src/WinConfigurationTest.cpp @@ -108,13 +108,7 @@ void WinConfigurationTest::testConfiguration() assertTrue (pRootReg->getInt("HKEY_CURRENT_USER.Software.Applied Informatics.Test.name1") == 1); pRootReg->keys(keys); -#if defined(_WIN32_WCE) - assertTrue (keys.size() == 4); - assertTrue (std::find(keys.begin(), keys.end(), "HKEY_CLASSES_ROOT") != keys.end()); - assertTrue (std::find(keys.begin(), keys.end(), "HKEY_CURRENT_USER") != keys.end()); - assertTrue (std::find(keys.begin(), keys.end(), "HKEY_LOCAL_MACHINE") != keys.end()); - assertTrue (std::find(keys.begin(), keys.end(), "HKEY_USERS") != keys.end()); -#else + assertTrue (keys.size() == 6); assertTrue (std::find(keys.begin(), keys.end(), "HKEY_CLASSES_ROOT") != keys.end()); assertTrue (std::find(keys.begin(), keys.end(), "HKEY_CURRENT_CONFIG") != keys.end()); @@ -122,7 +116,6 @@ void WinConfigurationTest::testConfiguration() assertTrue (std::find(keys.begin(), keys.end(), "HKEY_LOCAL_MACHINE") != keys.end()); assertTrue (std::find(keys.begin(), keys.end(), "HKEY_PERFORMANCE_DATA") != keys.end()); assertTrue (std::find(keys.begin(), keys.end(), "HKEY_USERS") != keys.end()); -#endif pRootReg->keys("HKEY_CURRENT_USER.Software.Applied Informatics.Test", keys); assertTrue (keys.size() == 5); diff --git a/XML/testsuite/CMakeLists.txt b/XML/testsuite/CMakeLists.txt index aae415a07..a20ce39c9 100644 --- a/XML/testsuite/CMakeLists.txt +++ b/XML/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(XML-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/XML/testsuite/src/WinCEDriver.cpp b/XML/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index c50dedda4..000000000 --- a/XML/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "XMLTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("XMLTestSuite", XMLTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/Zip/samples/unzip/CMakeLists.txt b/Zip/samples/unzip/CMakeLists.txt index e46f06ccf..ca912559e 100644 --- a/Zip/samples/unzip/CMakeLists.txt +++ b/Zip/samples/unzip/CMakeLists.txt @@ -1,5 +1,3 @@ add_executable(sample-unzip src/unzip.cpp) -if(WINCE) - set_target_properties(sample-unzip PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(sample-unzip PUBLIC Poco::Zip Poco::Util Poco::XML) diff --git a/Zip/samples/zip/CMakeLists.txt b/Zip/samples/zip/CMakeLists.txt index 74de0707d..01cd5c721 100644 --- a/Zip/samples/zip/CMakeLists.txt +++ b/Zip/samples/zip/CMakeLists.txt @@ -4,7 +4,5 @@ set(LOCAL_SRCS "") aux_source_directory(src LOCAL_SRCS) add_executable(sample-zip src/zip.cpp) -if(WINCE) - set_target_properties(sample-zip PROPERTIES LINK_FLAGS "/ENTRY:wmainCRTStartup") -endif() + target_link_libraries(sample-zip PUBLIC Poco::Zip Poco::Util Poco::XML) diff --git a/Zip/testsuite/CMakeLists.txt b/Zip/testsuite/CMakeLists.txt index aac6056cd..7fc4b93db 100644 --- a/Zip/testsuite/CMakeLists.txt +++ b/Zip/testsuite/CMakeLists.txt @@ -10,10 +10,6 @@ POCO_SOURCES_AUTO_PLAT(TEST_SRCS OFF src/WinDriver.cpp ) -POCO_SOURCES_AUTO_PLAT(TEST_SRCS WINCE - src/WinCEDriver.cpp -) - add_executable(Zip-testrunner ${TEST_SRCS}) if(ANDROID) add_test( diff --git a/Zip/testsuite/src/WinCEDriver.cpp b/Zip/testsuite/src/WinCEDriver.cpp deleted file mode 100644 index 79d306206..000000000 --- a/Zip/testsuite/src/WinCEDriver.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// -// WinCEDriver.cpp -// -// Console-based test driver for Windows CE. -// -// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH. -// and Contributors. -// -// SPDX-License-Identifier: BSL-1.0 -// - - -#include "CppUnit/TestRunner.h" -#include "ZipTestSuite.h" -#include - - -int wmain(int argc, wchar_t* argv[]) -{ - std::vector args; - for (int i = 0; i < argc; ++i) - { - char buffer[1024]; - std::wcstombs(buffer, argv[i], sizeof(buffer)); - args.push_back(std::string(buffer)); - } - CppUnit::TestRunner runner; - runner.addTest("ZipTestSuite", ZipTestSuite::suite()); - return runner.run(args) ? 0 : 1; -} diff --git a/buildwin.ps1 b/buildwin.ps1 index 0db295ab3..6025f3244 100644 --- a/buildwin.ps1 +++ b/buildwin.ps1 @@ -8,7 +8,7 @@ # [-action build | rebuild | clean] # [-linkmode shared | static_mt | static_md | all] # [-config release | debug | both] -# [-platform Win32 | x64 | ARM64 | WinCE | WEC2013] +# [-platform Win32 | x64 | ARM64 | WEC2013] # [-samples] # [-tests] # [-omit "Lib1X,LibY,LibZ,..."] @@ -42,7 +42,7 @@ Param [string] $config = 'release', [Parameter()] - [ValidateSet('Win32', 'x64', 'ARM64', 'WinCE', 'WEC2013')] + [ValidateSet('Win32', 'x64', 'ARM64', 'WEC2013')] [string] $platform = 'x64', [switch] $tests = $false, @@ -238,7 +238,7 @@ function Process-Input Write-Host ' [-action build | rebuild | clean]' Write-Host ' [-linkmode shared | static_mt | static_md | all]' Write-Host ' [-config release | debug | both]' - Write-Host ' [-platform Win32 | x64 | WinCE | WEC2013 | ARM64]' + Write-Host ' [-platform Win32 | x64 | WEC2013 | ARM64]' Write-Host ' [-samples]' Write-Host ' [-tests]' Write-Host ' [-omit "Lib1X,LibY,LibZ,..."]' diff --git a/doc/99200-WinCEPlatformNotes.page b/doc/99200-WinCEPlatformNotes.page index 34546f66b..69081ad54 100644 --- a/doc/99200-WinCEPlatformNotes.page +++ b/doc/99200-WinCEPlatformNotes.page @@ -3,130 +3,7 @@ AAAIntroduction !!!Introduction -Starting with release 1.4.0 the POCO C++ Libraries can be used on -Windows CE 6. Project files for Visual Studio 2008 are provided that -support static and shared debug and release builds. - -The port should work for Windows CE 5 as well, however, this has not been tested. - - -!!!Changing The Target In The Project Files - -The project files contain build configurations for the "Digi JumpStart (ARMV4I)" -target. To use another target, the Visual Studio project and solution files -must be changed accordingly. Note that the project files cannot be opened -by Visual Studio unless the target referenced in the project and solution files is available. -To change the project and solution files for your platform, replace -all occurrences of the string "Digi JumpStart (ARMV4I)" with the name -of your platform (e.g. "Windows Mobile 6 Professional SDK (ARMV4I)"). -This is best done with a text editor that supports global search/replace -across an entire directory tree (solution and project files are plain text/xml -files, so there's no risk breaking something). - - -!!!Restrictions - -!!Poco::Environment - -Windows CE does not support environment variables. -Therefore, Poco::Environment::get() and Poco::Environment::has() only support the -following hardcoded "pseudo" environment variables: - * TEMP - * TMP - * HOMEPATH - * COMPUTERNAME - * OS - * NUMBER_OF_PROCESSORS - * PROCESSOR_ARCHITECTURE - -Poco::Environment::set() always throws a Poco::NotImplementedException. - - -!!Date/Time Support - -Some date/time features are implemented with the help of [[http://wcelibcex.sourceforge.net/ WCELIBCEX]]. -The library is statically included in the Foundation library to simplify the build process. -However, it is also possible to use WCELIBCEX as a separate library if the Foundation project file is modified accordingly -(by removing or excluding from build the WCELIBCEX folder and modifying the header file search path accordingly). -The following functions from WCELIBCEX are used: - * wceex_time() - * wceex_localtime() - * wceex_mktime() - -It should also be possible to use wcecompat instead of WCELIBCEX, as this library provides -similar features. In this case, the calls to the wceex_* functions need to be replaced with -the wcecompat counterparts. The affected files are Random.cpp, LocalDateTime.cpp, -Timezone_WINCE.cpp and ThreadPool.cpp. - -To obtain the current date and time with millisecond resolution, -the hack described in -is used. This means there will be a one second delay when starting up -the application. - - -!!Poco::Path - -Poco::Path::listRoots() returns the root directory ("\"), as well as all mounted storage devices -(e.g., "\Hard Disk"), even if they are also present in the root directory. - -Poco::Path::current() and Poco::Path::home() always return the root directory. - - -!!Poco::RWLock - -In the reader/writer lock implementation for Windows CE, writers always take precedence over readers. - - -!!Poco::Process - -Launching a process with pipes for redirecting input/output is not supported. - - -!!Poco::Util::ServerApplication - -Poco::Util::ServerApplication::waitForTerminationRequest(): CTRL-C does not work to shut down the application as -it's not supported by the Windows CE console. The pkill utility supplied as part of the Util library -samples can be used to terminate a process from the command line. - - -!!Crypto and NetSSL - -Crypto and NetSSL_OpenSSL have not been tested yet. Project files are there, but they might need some adaptions depending on -how OpenSSL has been built for the Windows CE target. - - -!!Data - -Only the SQLite backend is currently supported. - -The SQLite engine in Data/SQLite is built without localtime support (SQLITE_OMIT_LOCALTIME) due to localtime_s() not being -available on Windows CE. - - -!!Raw Sockets in Net - -The test cases involving raw sockets will fail unless the testsuite is ran as a privileged (signed) application. -These are RawSocketTest::testEchoIPv4(), RawSocketTest::testSendToReceiveFromIPv4() and ICMPClientTest::testPing(). - - -!!!Build Notes - -Optimization settings should be set as follows for release builds -(<*Properties > Configuration Properties > C/C++ > Optimization*>): - * Optimization: Custom - * Inline Function Expansion: Default - * Enable Intrinsic Functions: Yes (/Oi) - * Floating-Point Consistency: Default Consistency - * Favor Size or Speed: Favor Fast Code (/Ot) - * Whole Program Optimization: No - -Other settings may or may not produce working programs. -Specifically, setting <*Optimization*> to <*Maximize Speed (/O2)*> will result in failures in the -test suite for Foundation Events due to a compiler optimizer bug. - -For shared/DLL builds, the /FORCE:MULTIPLE option is passed to the linker. This is -to avoid a problem with iostream classes and their methods (template instantiations), -which for some unknown reason (possibly bug) will be exported by the Foundation library -(and others) and thus cause multiply defined symbol errors. - -The reference system used for testing is a Digi ConnectCore 9P 9360 running Windows CE 6.0. +Starting with release 1.4.0 the POCO C++ Libraries cannot be used on Windows CE +platform anymore. The reason for this is that POCO has moved to support C++17. +Windows CE does not support C++17 anymore. Also as C++17 needs Visual Studio +2017 it also does not support Windows CE anymore. diff --git a/packaging/Windows/WiX/Poco.wxs b/packaging/Windows/WiX/Poco.wxs index 01f4b112e..1b7ca024a 100644 --- a/packaging/Windows/WiX/Poco.wxs +++ b/packaging/Windows/WiX/Poco.wxs @@ -1013,7 +1013,6 @@ - @@ -1036,7 +1035,6 @@ - @@ -1109,7 +1107,6 @@ - @@ -1126,7 +1123,6 @@ - @@ -1140,7 +1136,6 @@ - diff --git a/progen.ps1 b/progen.ps1 index da91900bd..94831359c 100644 --- a/progen.ps1 +++ b/progen.ps1 @@ -7,7 +7,7 @@ # [-vs 140 | 150 | 160| 170] # [-omit "Lib1X,LibY,LibZ,..."] # [-components "Lib1X,LibY,LibZ,..."] -# [-platform Win32 | x64 | ARM64 | WinCE | WEC2013] +# [-platform Win32 | x64 | ARM64 | WEC2013] # [-samples] # [-tests] # [-nobuild] @@ -26,7 +26,7 @@ Param [string] $components, [Parameter()] - [ValidateSet('Win32', 'x64', 'ARM64', 'WinCE', 'WEC2013')] + [ValidateSet('Win32', 'x64', 'ARM64', 'WEC2013')] [string] $platform = 'x64', [switch] $samples = $false,