mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-19 16:47:14 +02:00
Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
This commit is contained in:
13
vendor/POCO/Foundation/wcelibcex-1.0/AUTHORS.txt
vendored
Normal file
13
vendor/POCO/Foundation/wcelibcex-1.0/AUTHORS.txt
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
List of WCELIBCEX authors:
|
||||
|
||||
Active developers
|
||||
-----------------
|
||||
|
||||
* Mateusz Loskot (mateusz@loskot.net)
|
||||
|
||||
* St<53>phane Dunand (sdunand@sirap.fr)
|
||||
|
||||
Previously contributed
|
||||
----------------------
|
||||
|
||||
* Piotr Wisniewski (pwisniewski@taxussi.com.pl)
|
41
vendor/POCO/Foundation/wcelibcex-1.0/BUILD.txt
vendored
Normal file
41
vendor/POCO/Foundation/wcelibcex-1.0/BUILD.txt
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
$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
|
9
vendor/POCO/Foundation/wcelibcex-1.0/COPYING.txt
vendored
Normal file
9
vendor/POCO/Foundation/wcelibcex-1.0/COPYING.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
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.
|
24
vendor/POCO/Foundation/wcelibcex-1.0/LICENSE.txt
vendored
Normal file
24
vendor/POCO/Foundation/wcelibcex-1.0/LICENSE.txt
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
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.
|
22
vendor/POCO/Foundation/wcelibcex-1.0/README.txt
vendored
Normal file
22
vendor/POCO/Foundation/wcelibcex-1.0/README.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
$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 <mateusz@loskot.net>
|
||||
|
||||
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
|
15
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops
vendored
Normal file
15
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex.vsprops
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="windows-1250"?>
|
||||
<VisualStudioPropertySheet
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="wcelibcex"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
/>
|
||||
<UserMacro
|
||||
Name="WCELIBCEX_DIR"
|
||||
Value="$(ProjectDir)..\src"
|
||||
/>
|
||||
</VisualStudioPropertySheet>
|
46
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln
vendored
Normal file
46
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.sln
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
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
|
817
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj
vendored
Normal file
817
vendor/POCO/Foundation/wcelibcex-1.0/msvc80/wcelibcex_lib.vcproj
vendored
Normal file
@ -0,0 +1,817 @@
|
||||
<?xml version="1.0" encoding="windows-1250"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="wcelibcex_lib"
|
||||
ProjectGUID="{55190080-FEA8-4B07-83E1-A26E6937982A}"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Pocket PC 2003 (ARMV4)"
|
||||
/>
|
||||
<Platform
|
||||
Name="Smartphone 2003 (ARMV4)"
|
||||
/>
|
||||
<Platform
|
||||
Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
/>
|
||||
<Platform
|
||||
Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Pocket PC 2003 (ARMV4)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM"
|
||||
OutputFile="$(OutDir)/wcelibcexd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Smartphone 2003 (ARMV4)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM"
|
||||
OutputFile="$(OutDir)/wcelibcexd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/wcelibcexd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/wcelibcexd.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Pocket PC 2003 (ARMV4)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM"
|
||||
OutputFile="$(OutDir)/wcelibcex.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Smartphone 2003 (ARMV4)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,4.20 /machine:ARM"
|
||||
OutputFile="$(OutDir)/wcelibcex.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/wcelibcex.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets=".\wcelibcex.vsprops"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories="$(WCELIBCEX_DIR)"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_LIB;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/wcelibcex.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\wce_abort.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_access.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_asctime.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_bsearch.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_clock.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_ctime.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_directorymanagement.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_errno.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_findfile.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_getenv.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_getopt.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_gettimeofday.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_lfind.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_localtime.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_mkdir.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_mktime.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_path.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_rename.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_rewind.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_rmdir.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_setlocale.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_stat.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_strerror.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_time.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_timesys.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_unlink.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_winbase.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\errno.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\fcntl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_direct.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_errno.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_fcntl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_io.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_stat.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_stdio.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_stdlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_string.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_time.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_timesys.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_types.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_unistd.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\wce_winbase.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
49
vendor/POCO/Foundation/wcelibcex-1.0/src/errno.h
vendored
Normal file
49
vendor/POCO/Foundation/wcelibcex-1.0/src/errno.h
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* $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 */
|
||||
|
48
vendor/POCO/Foundation/wcelibcex-1.0/src/fcntl.h
vendored
Normal file
48
vendor/POCO/Foundation/wcelibcex-1.0/src/fcntl.h
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* $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 */
|
62
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_abort.c
vendored
Normal file
62
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_abort.c
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
}
|
||||
|
101
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_access.c
vendored
Normal file
101
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_access.c
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* $Id: wce_access.c,v 1.0 2006/11/29 16:37:06 stephaned Exp $
|
||||
*
|
||||
* Defines _access(), _waccess() functions.
|
||||
*
|
||||
* Created by St<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <wce_io.h>
|
||||
#include <wce_errno.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* wceex_waccess - Determine file-access permission
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Return:
|
||||
* 0 if the file has the given mode
|
||||
* <20>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
|
||||
* <20>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 );
|
||||
}
|
138
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_asctime.c
vendored
Normal file
138
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_asctime.c
vendored
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
90
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_bsearch.c
vendored
Normal file
90
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_bsearch.c
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* $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 <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <wce_types.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
87
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_clock.c
vendored
Normal file
87
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_clock.c
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* $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 <time.h>
|
||||
#include <winbase.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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 <time.h> 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 <time.h>.
|
||||
* 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;
|
||||
}
|
||||
|
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_ctime.c
vendored
Normal file
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_ctime.c
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
58
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_direct.h
vendored
Normal file
58
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_direct.h
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* $Id: wce_direct.h,v 1.0 2006/11/29 16:38:05 stephaned Exp $
|
||||
*
|
||||
* Created by St<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <winbase.h>
|
||||
|
||||
#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 */
|
||||
|
227
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_directorymanagement.c
vendored
Normal file
227
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_directorymanagement.c
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
/*
|
||||
* $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<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <winbase.h>
|
||||
#include <shellapi.h>
|
||||
#include <wce_direct.h>
|
||||
#include <wce_errno.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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 );
|
||||
}
|
||||
}
|
42
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_errno.c
vendored
Normal file
42
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_errno.c
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* $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;
|
||||
|
105
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_errno.h
vendored
Normal file
105
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_errno.h
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* $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 */
|
||||
|
79
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_fcntl.h
vendored
Normal file
79
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_fcntl.h
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* $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 */
|
183
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_findfile.c
vendored
Normal file
183
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_findfile.c
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
/*
|
||||
* $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 <wce_io.h>
|
||||
#include <wce_timesys.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
53
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_getenv.c
vendored
Normal file
53
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_getenv.c
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* $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 <stdlib.h>
|
||||
|
||||
char* wceex_getenv(const char* varname)
|
||||
{
|
||||
return NULL;
|
||||
}
|
154
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_getopt.c
vendored
Normal file
154
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_getopt.c
vendored
Normal file
@ -0,0 +1,154 @@
|
||||
/*
|
||||
* $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 <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* Declared in <unistd.h>
|
||||
*/
|
||||
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 */
|
||||
}
|
83
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_gettimeofday.c
vendored
Normal file
83
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_gettimeofday.c
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* $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 <winsock2.h>
|
||||
#include <time.h>
|
||||
#include <wce_time.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
110
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_io.h
vendored
Normal file
110
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_io.h
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
#include <wce_time.h>
|
||||
|
||||
#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 */
|
81
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_lfind.c
vendored
Normal file
81
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_lfind.c
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* $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 <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <wce_types.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
228
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_localtime.c
vendored
Normal file
228
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_localtime.c
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
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;
|
||||
}
|
||||
|
112
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_mkdir.c
vendored
Normal file
112
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_mkdir.c
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
#include <wce_errno.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
155
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_mktime.c
vendored
Normal file
155
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_mktime.c
vendored
Normal file
@ -0,0 +1,155 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <windows.h>
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
479
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_path.c
vendored
Normal file
479
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_path.c
vendored
Normal file
@ -0,0 +1,479 @@
|
||||
/*
|
||||
* $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<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <string.h>
|
||||
#include <wce_stdlib.h>
|
||||
#include <wce_direct.h>
|
||||
#include <wce_errno.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
91
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rename.c
vendored
Normal file
91
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rename.c
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rewind.c
vendored
Normal file
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rewind.c
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
#include <assert.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
92
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rmdir.c
vendored
Normal file
92
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_rmdir.c
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* $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 <wce_stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
|
||||
}
|
||||
|
||||
|
56
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_setlocale.c
vendored
Normal file
56
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_setlocale.c
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* $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 <locale.h> 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 "";
|
||||
}
|
233
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stat.c
vendored
Normal file
233
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stat.c
vendored
Normal file
@ -0,0 +1,233 @@
|
||||
/*
|
||||
* $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 <wce_stat.h>
|
||||
#include <wce_time.h>
|
||||
#include <wce_timesys.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
}
|
||||
|
142
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stat.h
vendored
Normal file
142
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stat.h
vendored
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* $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 <wce_types.h>
|
||||
|
||||
#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 */
|
61
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stdio.h
vendored
Normal file
61
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stdio.h
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* $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 */
|
102
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stdlib.h
vendored
Normal file
102
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_stdlib.h
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* $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 <windows.h>,
|
||||
* 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 */
|
58
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_strerror.c
vendored
Normal file
58
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_strerror.c
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* $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 */
|
||||
}
|
||||
|
59
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_string.h
vendored
Normal file
59
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_string.h
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* $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 */
|
||||
|
126
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_time.c
vendored
Normal file
126
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_time.c
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
156
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_time.h
vendored
Normal file
156
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_time.h
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/*
|
||||
* $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 */
|
||||
|
138
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_timesys.c
vendored
Normal file
138
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_timesys.c
vendored
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* $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 <wce_time.h>
|
||||
#include <wce_timesys.h>
|
||||
#include <windows.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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);
|
||||
}
|
||||
|
59
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_timesys.h
vendored
Normal file
59
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_timesys.h
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
#include <wce_time.h>
|
||||
|
||||
#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 */
|
62
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_types.h
vendored
Normal file
62
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_types.h
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* $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 */
|
72
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_unistd.h
vendored
Normal file
72
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_unistd.h
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
/*
|
||||
* $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 <stddef.h>
|
||||
|
||||
|
||||
/*
|
||||
* 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 */
|
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_unlink.c
vendored
Normal file
100
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_unlink.c
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* $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 <windows.h>
|
||||
#include <wce_errno.h>
|
||||
|
||||
/*******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
}
|
38
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_winbase.c
vendored
Normal file
38
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_winbase.c
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* $Id: wce_winbase.c,v 1.0 2006/11/29 17:00:28 sdunand Exp $
|
||||
*
|
||||
* Defines GetStdHandle() function with dummy implementation.
|
||||
*
|
||||
* Created by St<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <wce_winbase.h>
|
||||
|
||||
HANDLE GetStdHandle( DWORD nStdHandle )
|
||||
{
|
||||
return NULL;
|
||||
}
|
54
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_winbase.h
vendored
Normal file
54
vendor/POCO/Foundation/wcelibcex-1.0/src/wce_winbase.h
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* $Id: wce_winbase.h,v 1.0 2006/04/12 15:11:36 sdunand Exp $
|
||||
*
|
||||
* Created by St<53>phane Dunand (sdunand@sirap.fr)
|
||||
*
|
||||
* Copyright (c) 2006 St<53>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 <winbase.h>
|
||||
|
||||
#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 */
|
||||
|
Reference in New Issue
Block a user