Delete files and prep to use vcpk manifest
This commit is contained in:
parent
403373fcc6
commit
1fe66f8d37
10
.gitignore
vendored
10
.gitignore
vendored
@ -3,6 +3,13 @@
|
|||||||
##
|
##
|
||||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# Backup files
|
||||||
|
*.bak
|
||||||
|
|
||||||
|
# Translation files
|
||||||
|
*translated.txt
|
||||||
|
*spellcheck.txt
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
@ -24,6 +31,9 @@ bld/
|
|||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
[Ll]og/
|
[Ll]og/
|
||||||
|
|
||||||
|
# vcpkg
|
||||||
|
vcpkg_installed*/
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
# Visual Studio 2015 cache/options directory
|
||||||
.vs/
|
.vs/
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
|||||||
31
code/MeOS-orig.sln
Normal file
31
code/MeOS-orig.sln
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34330.188
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeOS", "MeOS.vcxproj", "{60BC59CB-8987-4A39-B866-403066F59B0F}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x64.Build.0 = Release|x64
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{60BC59CB-8987-4A39-B866-403066F59B0F}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {0AA159AF-578B-49E9-8D52-50F9272169DB}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
381
code/MeOS-orig.vcxproj
Normal file
381
code/MeOS-orig.vcxproj
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{60BC59CB-8987-4A39-B866-403066F59B0F}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>MeOS</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalLibraryDirectories>./lib_db</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>./lib64_db</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
||||||
|
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>./lib</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>./lib64</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
<Manifest>
|
||||||
|
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
||||||
|
</Manifest>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="animationdata.cpp" />
|
||||||
|
<ClCompile Include="autocomplete.cpp" />
|
||||||
|
<ClCompile Include="autotask.cpp" />
|
||||||
|
<ClCompile Include="binencoder.cpp" />
|
||||||
|
<ClCompile Include="classconfiginfo.cpp" />
|
||||||
|
<ClCompile Include="csvparser.cpp" />
|
||||||
|
<ClCompile Include="download.cpp" />
|
||||||
|
<ClCompile Include="gdioutput.cpp" />
|
||||||
|
<ClCompile Include="generalresult.cpp" />
|
||||||
|
<ClCompile Include="HTMLWriter.cpp" />
|
||||||
|
<ClCompile Include="image.cpp" />
|
||||||
|
<ClCompile Include="importformats.cpp" />
|
||||||
|
<ClCompile Include="infoserver.cpp" />
|
||||||
|
<ClCompile Include="iof30interface.cpp" />
|
||||||
|
<ClCompile Include="listeditor.cpp" />
|
||||||
|
<ClCompile Include="liveresult.cpp" />
|
||||||
|
<ClCompile Include="localizer.cpp" />
|
||||||
|
<ClCompile Include="machinecontainer.cpp" />
|
||||||
|
<ClCompile Include="meos.cpp" />
|
||||||
|
<ClCompile Include="MeOSFeatures.cpp" />
|
||||||
|
<ClCompile Include="MeosSQL.cpp" />
|
||||||
|
<ClCompile Include="meosversion.cpp" />
|
||||||
|
<ClCompile Include="meos_util.cpp" />
|
||||||
|
<ClCompile Include="metalist.cpp" />
|
||||||
|
<ClCompile Include="methodeditor.cpp" />
|
||||||
|
<ClCompile Include="mysqldaemon.cpp" />
|
||||||
|
<ClCompile Include="mysqlwrapper.cpp" />
|
||||||
|
<ClCompile Include="newcompetition.cpp" />
|
||||||
|
<ClCompile Include="oBase.cpp" />
|
||||||
|
<ClCompile Include="oCard.cpp" />
|
||||||
|
<ClCompile Include="oClass.cpp" />
|
||||||
|
<ClCompile Include="oClub.cpp" />
|
||||||
|
<ClCompile Include="oControl.cpp" />
|
||||||
|
<ClCompile Include="oCourse.cpp" />
|
||||||
|
<ClCompile Include="oDataContainer.cpp" />
|
||||||
|
<ClCompile Include="oEvent.cpp" />
|
||||||
|
<ClCompile Include="oEventDraw.cpp" />
|
||||||
|
<ClCompile Include="oEventResult.cpp" />
|
||||||
|
<ClCompile Include="oEventSpeaker.cpp" />
|
||||||
|
<ClCompile Include="oEventSQL.cpp" />
|
||||||
|
<ClCompile Include="oevent_transfer.cpp" />
|
||||||
|
<ClCompile Include="oFreeImport.cpp" />
|
||||||
|
<ClCompile Include="oFreePunch.cpp" />
|
||||||
|
<ClCompile Include="oImportExport.cpp" />
|
||||||
|
<ClCompile Include="oListInfo.cpp" />
|
||||||
|
<ClCompile Include="onlineinput.cpp" />
|
||||||
|
<ClCompile Include="onlineresults.cpp" />
|
||||||
|
<ClCompile Include="oPunch.cpp" />
|
||||||
|
<ClCompile Include="oReport.cpp" />
|
||||||
|
<ClCompile Include="oRunner.cpp" />
|
||||||
|
<ClCompile Include="oTeam.cpp" />
|
||||||
|
<ClCompile Include="oTeamEvent.cpp" />
|
||||||
|
<ClCompile Include="parser.cpp" />
|
||||||
|
<ClCompile Include="pdfwriter.cpp" />
|
||||||
|
<ClCompile Include="prefseditor.cpp" />
|
||||||
|
<ClCompile Include="printer.cpp" />
|
||||||
|
<ClCompile Include="progress.cpp" />
|
||||||
|
<ClCompile Include="qf_editor.cpp" />
|
||||||
|
<ClCompile Include="qualification_final.cpp" />
|
||||||
|
<ClCompile Include="random.cpp" />
|
||||||
|
<ClCompile Include="recorder.cpp" />
|
||||||
|
<ClCompile Include="restserver.cpp" />
|
||||||
|
<ClCompile Include="RestService.cpp" />
|
||||||
|
<ClCompile Include="RunnerDB.cpp" />
|
||||||
|
<ClCompile Include="socket.cpp" />
|
||||||
|
<ClCompile Include="speakermonitor.cpp" />
|
||||||
|
<ClCompile Include="SportIdent.cpp" />
|
||||||
|
<ClCompile Include="StdAfx.cpp" />
|
||||||
|
<ClCompile Include="TabAuto.cpp" />
|
||||||
|
<ClCompile Include="TabBase.cpp" />
|
||||||
|
<ClCompile Include="TabClass.cpp" />
|
||||||
|
<ClCompile Include="TabClub.cpp" />
|
||||||
|
<ClCompile Include="TabCompetition.cpp" />
|
||||||
|
<ClCompile Include="TabControl.cpp" />
|
||||||
|
<ClCompile Include="TabCourse.cpp" />
|
||||||
|
<ClCompile Include="Table.cpp" />
|
||||||
|
<ClCompile Include="TabList.cpp" />
|
||||||
|
<ClCompile Include="TabMulti.cpp" />
|
||||||
|
<ClCompile Include="TabRunner.cpp" />
|
||||||
|
<ClCompile Include="TabSI.cpp" />
|
||||||
|
<ClCompile Include="TabSpeaker.cpp" />
|
||||||
|
<ClCompile Include="TabTeam.cpp" />
|
||||||
|
<ClCompile Include="testmeos.cpp" />
|
||||||
|
<ClCompile Include="tests.cpp" />
|
||||||
|
<ClCompile Include="TimeStamp.cpp" />
|
||||||
|
<ClCompile Include="toolbar.cpp" />
|
||||||
|
<ClCompile Include="xmlparser.cpp" />
|
||||||
|
<ClCompile Include="zip.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="animationdata.h" />
|
||||||
|
<ClInclude Include="autocomplete.h" />
|
||||||
|
<ClInclude Include="autocompletehandler.h" />
|
||||||
|
<ClInclude Include="autotask.h" />
|
||||||
|
<ClInclude Include="binencoder.h" />
|
||||||
|
<ClInclude Include="classconfiginfo.h" />
|
||||||
|
<ClInclude Include="csvparser.h" />
|
||||||
|
<ClInclude Include="datadefiners.h" />
|
||||||
|
<ClInclude Include="download.h" />
|
||||||
|
<ClInclude Include="gdiconstants.h" />
|
||||||
|
<ClInclude Include="gdifonts.h" />
|
||||||
|
<ClInclude Include="gdiimpl.h" />
|
||||||
|
<ClInclude Include="gdioutput.h" />
|
||||||
|
<ClInclude Include="gdistructures.h" />
|
||||||
|
<ClInclude Include="generalresult.h" />
|
||||||
|
<ClInclude Include="guihandler.h" />
|
||||||
|
<ClInclude Include="HTMLWriter.h" />
|
||||||
|
<ClInclude Include="image.h" />
|
||||||
|
<ClInclude Include="importformats.h" />
|
||||||
|
<ClInclude Include="infoserver.h" />
|
||||||
|
<ClInclude Include="inthashmap.h" />
|
||||||
|
<ClInclude Include="intkeymap.hpp" />
|
||||||
|
<ClInclude Include="intkeymapimpl.hpp" />
|
||||||
|
<ClInclude Include="iof30interface.h" />
|
||||||
|
<ClInclude Include="listeditor.h" />
|
||||||
|
<ClInclude Include="liveresult.h" />
|
||||||
|
<ClInclude Include="localizer.h" />
|
||||||
|
<ClInclude Include="machinecontainer.h" />
|
||||||
|
<ClInclude Include="meos.h" />
|
||||||
|
<ClInclude Include="meosexception.h" />
|
||||||
|
<ClInclude Include="MeOSFeatures.h" />
|
||||||
|
<ClInclude Include="MeosSQL.h" />
|
||||||
|
<ClInclude Include="meos_util.h" />
|
||||||
|
<ClInclude Include="metalist.h" />
|
||||||
|
<ClInclude Include="methodeditor.h" />
|
||||||
|
<ClInclude Include="mysqlwrapper.h" />
|
||||||
|
<ClInclude Include="oBase.h" />
|
||||||
|
<ClInclude Include="oCard.h" />
|
||||||
|
<ClInclude Include="oClass.h" />
|
||||||
|
<ClInclude Include="oClub.h" />
|
||||||
|
<ClInclude Include="oControl.h" />
|
||||||
|
<ClInclude Include="oCourse.h" />
|
||||||
|
<ClInclude Include="oDataContainer.h" />
|
||||||
|
<ClInclude Include="oEvent.h" />
|
||||||
|
<ClInclude Include="oEventDraw.h" />
|
||||||
|
<ClInclude Include="oFreeImport.h" />
|
||||||
|
<ClInclude Include="oFreePunch.h" />
|
||||||
|
<ClInclude Include="oListInfo.h" />
|
||||||
|
<ClInclude Include="onlineinput.h" />
|
||||||
|
<ClInclude Include="onlineresults.h" />
|
||||||
|
<ClInclude Include="oPunch.h" />
|
||||||
|
<ClInclude Include="oRunner.h" />
|
||||||
|
<ClInclude Include="ospeaker.h" />
|
||||||
|
<ClInclude Include="oTeam.h" />
|
||||||
|
<ClInclude Include="parser.h" />
|
||||||
|
<ClInclude Include="pdfwriter.h" />
|
||||||
|
<ClInclude Include="prefseditor.h" />
|
||||||
|
<ClInclude Include="Printer.h" />
|
||||||
|
<ClInclude Include="progress.h" />
|
||||||
|
<ClInclude Include="qf_editor.h" />
|
||||||
|
<ClInclude Include="qualification_final.h" />
|
||||||
|
<ClInclude Include="random.h" />
|
||||||
|
<ClInclude Include="recorder.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
|
<ClInclude Include="restserver.h" />
|
||||||
|
<ClInclude Include="RestService.h" />
|
||||||
|
<ClInclude Include="RunnerDB.h" />
|
||||||
|
<ClInclude Include="socket.h" />
|
||||||
|
<ClInclude Include="speakermonitor.h" />
|
||||||
|
<ClInclude Include="SportIdent.h" />
|
||||||
|
<ClInclude Include="StdAfx.h" />
|
||||||
|
<ClInclude Include="subcommand.h" />
|
||||||
|
<ClInclude Include="TabAuto.h" />
|
||||||
|
<ClInclude Include="TabBase.h" />
|
||||||
|
<ClInclude Include="TabClass.h" />
|
||||||
|
<ClInclude Include="TabClub.h" />
|
||||||
|
<ClInclude Include="TabCompetition.h" />
|
||||||
|
<ClInclude Include="TabControl.h" />
|
||||||
|
<ClInclude Include="TabCourse.h" />
|
||||||
|
<ClInclude Include="Table.h" />
|
||||||
|
<ClInclude Include="TabList.h" />
|
||||||
|
<ClInclude Include="TabMulti.h" />
|
||||||
|
<ClInclude Include="TabRunner.h" />
|
||||||
|
<ClInclude Include="TabSI.h" />
|
||||||
|
<ClInclude Include="TabSpeaker.h" />
|
||||||
|
<ClInclude Include="TabTeam.h" />
|
||||||
|
<ClInclude Include="testmeos.h" />
|
||||||
|
<ClInclude Include="timeconstants.hpp" />
|
||||||
|
<ClInclude Include="TimeStamp.h" />
|
||||||
|
<ClInclude Include="toolbar.h" />
|
||||||
|
<ClInclude Include="xmlparser.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="meos.rc" />
|
||||||
|
<ResourceCompile Include="meoslang.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="html1.htm" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="announcer24.png" />
|
||||||
|
<Image Include="bitmap1.bmp" />
|
||||||
|
<Image Include="bmp00001.bmp" />
|
||||||
|
<Image Include="class24.png" />
|
||||||
|
<Image Include="clubs24.png" />
|
||||||
|
<Image Include="competition24.png" />
|
||||||
|
<Image Include="course24.png" />
|
||||||
|
<Image Include="ctrl24.png" />
|
||||||
|
<Image Include="edit.png" />
|
||||||
|
<Image Include="info24.png" />
|
||||||
|
<Image Include="lists24.png" />
|
||||||
|
<Image Include="meos.ICO" />
|
||||||
|
<Image Include="meos.png" />
|
||||||
|
<Image Include="readout24.png" />
|
||||||
|
<Image Include="runner24.png" />
|
||||||
|
<Image Include="services24.png" />
|
||||||
|
<Image Include="team24.png" />
|
||||||
|
<Image Include="title.png" />
|
||||||
|
<Image Include="warn24.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
@ -22,6 +22,7 @@
|
|||||||
<VCProjectVersion>17.0</VCProjectVersion>
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
<ProjectGuid>{60BC59CB-8987-4A39-B866-403066F59B0F}</ProjectGuid>
|
<ProjectGuid>{60BC59CB-8987-4A39-B866-403066F59B0F}</ProjectGuid>
|
||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>MeOS</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
@ -48,8 +49,8 @@
|
|||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
@ -69,99 +70,66 @@
|
|||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Label="Vcpkg">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<VcpkgEnableManifest>true</VcpkgEnableManifest>
|
||||||
<CopyCppRuntimeToOutputDir>false</CopyCppRuntimeToOutputDir>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<AdditionalLibraryDirectories>./lib_db</AdditionalLibraryDirectories>
|
|
||||||
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
<Manifest>
|
|
||||||
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
|
||||||
</Manifest>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
|
||||||
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
|
||||||
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<SubSystem>Windows</SubSystem>
|
|
||||||
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<AdditionalLibraryDirectories>./lib64_db</AdditionalLibraryDirectories>
|
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
|
||||||
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
|
||||||
</Manifest>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalLibraryDirectories>./lib</AdditionalLibraryDirectories>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat_vc15.lib;libmysql.lib;libhpdf.lib;RestBed.lib;libpng.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;winmm.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
|
||||||
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
|
||||||
</Manifest>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<DisableSpecificWarnings>4267;4244;4018</DisableSpecificWarnings>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>./libharu;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<SDLCheck>true</SDLCheck>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<AdditionalDependencies>Msimg32.lib;comctl32.lib;odbc32.lib;odbccp32.lib;winmm.lib;ws2_32.lib;wininet.lib;zlibstat.lib;libharu.lib;RestBed.lib;libpng.lib;libmysql.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<AdditionalLibraryDirectories>./lib64</AdditionalLibraryDirectories>
|
<AdditionalDependencies>Msimg32.lib;comctl32.lib;winmm.lib;ws2_32.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
<Manifest>
|
|
||||||
<AdditionalManifestFiles>meos_dpi_manifest.xml %(AdditionalManifestFiles)</AdditionalManifestFiles>
|
|
||||||
</Manifest>
|
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="animationdata.cpp" />
|
<ClCompile Include="animationdata.cpp" />
|
||||||
|
|||||||
26
code/_DELETE_ME_.bat
Normal file
26
code/_DELETE_ME_.bat
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
:: Remove packaged libraries (replaced by vcpkg)
|
||||||
|
RMDIR /s/q %~dp0dll
|
||||||
|
RMDIR /s/q %~dp0dll64
|
||||||
|
RMDIR /s/q %~dp0dll_debug
|
||||||
|
RMDIR /s/q %~dp0lib
|
||||||
|
RMDIR /s/q %~dp0lib64
|
||||||
|
RMDIR /s/q %~dp0libharu
|
||||||
|
RMDIR /s/q %~dp0lib_db
|
||||||
|
RMDIR /s/q %~dp0lib64_db
|
||||||
|
RMDIR /s/q %~dp0minizip
|
||||||
|
RMDIR /s/q %~dp0mysql
|
||||||
|
RMDIR /s/q %~dp0png
|
||||||
|
RMDIR /s/q %~dp0restbed
|
||||||
|
::RMDIR /s/q %~dp0sound
|
||||||
|
|
||||||
|
:: Old Solution Files
|
||||||
|
DEL %~dp0meos*vc15*
|
||||||
|
|
||||||
|
:: Remove VStudio compilation folders
|
||||||
|
RMDIR /s/q %~dp0.vs
|
||||||
|
RMDIR /s/q %~dp0bin
|
||||||
|
RMDIR /s/q %~dp0vcpkg_installed
|
||||||
|
RMDIR /s/q %~dp0obj
|
||||||
|
RMDIR /s/q %~dp0x86
|
||||||
|
RMDIR /s/q %~dp0x64
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1567
code/libharu/hpdf.h
1567
code/libharu/hpdf.h
File diff suppressed because it is too large
Load Diff
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_3DMEASURE_H
|
|
||||||
#define _HPDF_3DMEASURE_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ HPDF_3DMeasure -----------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_3DMeasure
|
|
||||||
HPDF_3DC3DMeasure_New(HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Point3D firstanchorpoint,
|
|
||||||
HPDF_Point3D textanchorpoint
|
|
||||||
);
|
|
||||||
|
|
||||||
HPDF_3DMeasure
|
|
||||||
HPDF_PD33DMeasure_New(HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Point3D annotationPlaneNormal,
|
|
||||||
HPDF_Point3D firstAnchorPoint,
|
|
||||||
HPDF_Point3D secondAnchorPoint,
|
|
||||||
HPDF_Point3D leaderLinesDirection,
|
|
||||||
HPDF_Point3D measurementValuePoint,
|
|
||||||
HPDF_Point3D textYDirection,
|
|
||||||
HPDF_REAL value,
|
|
||||||
const char* unitsString
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_3DMEASURE_H */
|
|
||||||
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_ANNOTATION_H
|
|
||||||
#define _HPDF_ANNOTATION_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ HPDF_Annotation -----------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_Annotation_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_AnnotType type,
|
|
||||||
HPDF_Rect rect);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_LinkAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
HPDF_Destination dst);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_URILinkAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
const char *uri);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_3DAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
HPDF_U3D u3d);
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_MarkupAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
const char *text,
|
|
||||||
HPDF_Encoder encoder,
|
|
||||||
HPDF_AnnotType subtype);
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_PopupAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
HPDF_Annotation parent);
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_StampAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
HPDF_StampAnnotName name,
|
|
||||||
const char* text,
|
|
||||||
HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
HPDF_Annotation
|
|
||||||
HPDF_ProjectionAnnot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_Rect rect,
|
|
||||||
const char* text,
|
|
||||||
HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Annotation_Validate (HPDF_Annotation annot);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_ANNOTATION_H */
|
|
||||||
|
|
||||||
@ -1,93 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_catalog.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_CATALOG_H
|
|
||||||
#define _HPDF_CATALOG_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef HPDF_Dict HPDF_Catalog;
|
|
||||||
|
|
||||||
HPDF_Catalog
|
|
||||||
HPDF_Catalog_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_NameDict
|
|
||||||
HPDF_Catalog_GetNames (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_SetNames (HPDF_Catalog catalog,
|
|
||||||
HPDF_NameDict dict);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Pages
|
|
||||||
HPDF_Catalog_GetRoot (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_PageLayout
|
|
||||||
HPDF_Catalog_GetPageLayout (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_SetPageLayout (HPDF_Catalog catalog,
|
|
||||||
HPDF_PageLayout layout);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_PageMode
|
|
||||||
HPDF_Catalog_GetPageMode (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_SetPageMode (HPDF_Catalog catalog,
|
|
||||||
HPDF_PageMode mode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_SetOpenAction (HPDF_Catalog catalog,
|
|
||||||
HPDF_Destination open_action);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_AddPageLabel (HPDF_Catalog catalog,
|
|
||||||
HPDF_UINT page_num,
|
|
||||||
HPDF_Dict page_label);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_Catalog_GetViewerPreference (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Catalog_SetViewerPreference (HPDF_Catalog catalog,
|
|
||||||
HPDF_UINT value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Catalog_Validate (HPDF_Catalog catalog);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_CATALOG_H */
|
|
||||||
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_conf.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_CONF_H
|
|
||||||
#define _HPDF_CONF_H
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#ifndef _USE_MATH_DEFINES
|
|
||||||
#define _USE_MATH_DEFINES 1
|
|
||||||
#endif /* _USE_MATH_DEFINES */
|
|
||||||
#endif
|
|
||||||
#ifndef __USE_XOPEN
|
|
||||||
#define __USE_XOPEN /* for M_PI */
|
|
||||||
#endif /* __USE_XOPEN */
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- standard C library functions -----------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_FOPEN fopen
|
|
||||||
#define HPDF_FCLOSE fclose
|
|
||||||
#define HPDF_FREAD fread
|
|
||||||
#define HPDF_FWRITE fwrite
|
|
||||||
#define HPDF_FFLUSH fflush
|
|
||||||
#define HPDF_FSEEK fseek
|
|
||||||
#define HPDF_FTELL ftell
|
|
||||||
#define HPDF_FEOF feof
|
|
||||||
#define HPDF_FERROR ferror
|
|
||||||
#define HPDF_MALLOC malloc
|
|
||||||
#define HPDF_FREE free
|
|
||||||
#define HPDF_FILEP FILE*
|
|
||||||
#define HPDF_TIME time
|
|
||||||
#define HPDF_PRINTF printf
|
|
||||||
#define HPDF_SIN sin
|
|
||||||
#define HPDF_COS cos
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- parameters in relation to performance --------------------------------*/
|
|
||||||
|
|
||||||
/* default buffer size of memory-stream-object */
|
|
||||||
#define HPDF_STREAM_BUF_SIZ 4096
|
|
||||||
|
|
||||||
/* default array size of list-object */
|
|
||||||
#define HPDF_DEF_ITEMS_PER_BLOCK 20
|
|
||||||
|
|
||||||
/* default array size of cross-reference-table */
|
|
||||||
#define HPDF_DEFALUT_XREF_ENTRY_NUM 1024
|
|
||||||
|
|
||||||
/* default array size of widths-table of cid-fontdef */
|
|
||||||
#define HPDF_DEF_CHAR_WIDTHS_NUM 128
|
|
||||||
|
|
||||||
/* default array size of page-list-tablef */
|
|
||||||
#define HPDF_DEF_PAGE_LIST_NUM 256
|
|
||||||
|
|
||||||
/* default array size of range-table of cid-fontdef */
|
|
||||||
#define HPDF_DEF_RANGE_TBL_NUM 128
|
|
||||||
|
|
||||||
/* default buffer size of memory-pool-object */
|
|
||||||
#define HPDF_MPOOL_BUF_SIZ 8192
|
|
||||||
#define HPDF_MIN_MPOOL_BUF_SIZ 256
|
|
||||||
#define HPDF_MAX_MPOOL_BUF_SIZ 1048576
|
|
||||||
|
|
||||||
/* alignment size of memory-pool-object
|
|
||||||
*/
|
|
||||||
#define HPDF_ALIGN_SIZ sizeof int;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _HPDF_CONF_H */
|
|
||||||
|
|
||||||
@ -1,75 +0,0 @@
|
|||||||
/* include/hpdf_config.h.in. Generated from configure.in by autoheader. */
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
|
||||||
#undef LIBHPDF_HAVE_DLFCN_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef LIBHPDF_HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `png' library (-lpng). */
|
|
||||||
#define LIBHPDF_HAVE_LIBPNG 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `z' library (-lz). */
|
|
||||||
#define LIBHPDF_HAVE_LIBZ 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <memory.h> header file. */
|
|
||||||
#undef LIBHPDF_HAVE_MEMORY_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef LIBHPDF_HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define LIBHPDF_HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#define LIBHPDF_HAVE_STRINGS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define LIBHPDF_HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#define LIBHPDF_HAVE_SYS_STAT_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef LIBHPDF_HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#define LIBHPDF_HAVE_UNISTD_H 1
|
|
||||||
|
|
||||||
/* define pi */
|
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846
|
|
||||||
#endif /* M_PI */
|
|
||||||
|
|
||||||
/* debug build */
|
|
||||||
#undef LIBHPDF_DEBUG
|
|
||||||
|
|
||||||
/* debug trace enabled */
|
|
||||||
#undef LIBHPDF_DEBUG_TRACE
|
|
||||||
|
|
||||||
/* libpng is not available */
|
|
||||||
#undef LIBHPDF_HAVE_NOPNGLIB
|
|
||||||
|
|
||||||
/* zlib is not available */
|
|
||||||
#undef LIBHPDF_HAVE_NOZLIB
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef LIBHPDF_PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef LIBHPDF_PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#define LIBHPDF_PACKAGE_STRING "libhpdf 2.2.0"
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef LIBHPDF_PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#define LIBHPDF_PACKAGE_VERSION "2.2.0"
|
|
||||||
|
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
|
||||||
#define LIBHPDF_STDC_HEADERS 1
|
|
||||||
|
|
||||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
|
||||||
#undef size_t
|
|
||||||
@ -1,549 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_consts.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _HPDF_CONSTS_H
|
|
||||||
#define _HPDF_CONSTS_H
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_TRUE 1
|
|
||||||
#define HPDF_FALSE 0
|
|
||||||
|
|
||||||
#define HPDF_OK 0
|
|
||||||
#define HPDF_NOERROR 0
|
|
||||||
|
|
||||||
/*----- default values -------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* buffer size which is required when we convert to character string. */
|
|
||||||
#define HPDF_TMP_BUF_SIZ 512
|
|
||||||
#define HPDF_SHORT_BUF_SIZ 32
|
|
||||||
#define HPDF_REAL_LEN 11
|
|
||||||
#define HPDF_INT_LEN 11
|
|
||||||
#define HPDF_TEXT_DEFAULT_LEN 256
|
|
||||||
#define HPDF_UNICODE_HEADER_LEN 2
|
|
||||||
#define HPDF_DATE_TIME_STR_LEN 23
|
|
||||||
|
|
||||||
/* length of each item defined in PDF */
|
|
||||||
#define HPDF_BYTE_OFFSET_LEN 10
|
|
||||||
#define HPDF_OBJ_ID_LEN 7
|
|
||||||
#define HPDF_GEN_NO_LEN 5
|
|
||||||
|
|
||||||
/* default value of Graphic State */
|
|
||||||
#define HPDF_DEF_FONT "Helvetica"
|
|
||||||
#define HPDF_DEF_PAGE_LAYOUT HPDF_PAGE_LAYOUT_SINGLE
|
|
||||||
#define HPDF_DEF_PAGE_MODE HPDF_PAGE_MODE_USE_NONE
|
|
||||||
#define HPDF_DEF_WORDSPACE 0
|
|
||||||
#define HPDF_DEF_CHARSPACE 0
|
|
||||||
#define HPDF_DEF_FONTSIZE 10
|
|
||||||
#define HPDF_DEF_HSCALING 100
|
|
||||||
#define HPDF_DEF_LEADING 0
|
|
||||||
#define HPDF_DEF_RENDERING_MODE HPDF_FILL
|
|
||||||
#define HPDF_DEF_RISE 0
|
|
||||||
#define HPDF_DEF_RAISE HPDF_DEF_RISE
|
|
||||||
#define HPDF_DEF_LINEWIDTH 1
|
|
||||||
#define HPDF_DEF_LINECAP HPDF_BUTT_END
|
|
||||||
#define HPDF_DEF_LINEJOIN HPDF_MITER_JOIN
|
|
||||||
#define HPDF_DEF_MITERLIMIT 10
|
|
||||||
#define HPDF_DEF_FLATNESS 1
|
|
||||||
#define HPDF_DEF_PAGE_NUM 1
|
|
||||||
|
|
||||||
#define HPDF_BS_DEF_WIDTH 1
|
|
||||||
|
|
||||||
/* defalt page-size */
|
|
||||||
#define HPDF_DEF_PAGE_WIDTH 595.276F
|
|
||||||
#define HPDF_DEF_PAGE_HEIGHT 841.89F
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- compression mode ----------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_COMP_NONE 0x00
|
|
||||||
#define HPDF_COMP_TEXT 0x01
|
|
||||||
#define HPDF_COMP_IMAGE 0x02
|
|
||||||
#define HPDF_COMP_METADATA 0x04
|
|
||||||
#define HPDF_COMP_ALL 0x0F
|
|
||||||
/* #define HPDF_COMP_BEST_COMPRESS 0x10
|
|
||||||
* #define HPDF_COMP_BEST_SPEED 0x20
|
|
||||||
*/
|
|
||||||
#define HPDF_COMP_MASK 0xFF
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- permission flags (only Revision 2 is supported)-----------------------*/
|
|
||||||
|
|
||||||
#define HPDF_ENABLE_READ 0
|
|
||||||
#define HPDF_ENABLE_PRINT 4
|
|
||||||
#define HPDF_ENABLE_EDIT_ALL 8
|
|
||||||
#define HPDF_ENABLE_COPY 16
|
|
||||||
#define HPDF_ENABLE_EDIT 32
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ viewer preferences definitions --------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_HIDE_TOOLBAR 1
|
|
||||||
#define HPDF_HIDE_MENUBAR 2
|
|
||||||
#define HPDF_HIDE_WINDOW_UI 4
|
|
||||||
#define HPDF_FIT_WINDOW 8
|
|
||||||
#define HPDF_CENTER_WINDOW 16
|
|
||||||
#define HPDF_PRINT_SCALING_NONE 32
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ limitation of object implementation (PDF1.4) -----------------------*/
|
|
||||||
|
|
||||||
#define HPDF_LIMIT_MAX_INT 2147483647
|
|
||||||
#define HPDF_LIMIT_MIN_INT -2147483647
|
|
||||||
|
|
||||||
#define HPDF_LIMIT_MAX_REAL 32767
|
|
||||||
#define HPDF_LIMIT_MIN_REAL -32767
|
|
||||||
|
|
||||||
#define HPDF_LIMIT_MAX_STRING_LEN 65535
|
|
||||||
#define HPDF_LIMIT_MAX_NAME_LEN 127
|
|
||||||
|
|
||||||
#define HPDF_LIMIT_MAX_ARRAY 32767
|
|
||||||
#define HPDF_LIMIT_MAX_DICT_ELEMENT 4095
|
|
||||||
#define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607
|
|
||||||
#define HPDF_LIMIT_MAX_GSTATE 28
|
|
||||||
#define HPDF_LIMIT_MAX_DEVICE_N 8
|
|
||||||
#define HPDF_LIMIT_MAX_DEVICE_N_V15 32
|
|
||||||
#define HPDF_LIMIT_MAX_CID 65535
|
|
||||||
#define HPDF_MAX_GENERATION_NUM 65535
|
|
||||||
|
|
||||||
#define HPDF_MIN_PAGE_HEIGHT 3
|
|
||||||
#define HPDF_MIN_PAGE_WIDTH 3
|
|
||||||
#define HPDF_MAX_PAGE_HEIGHT 14400
|
|
||||||
#define HPDF_MAX_PAGE_WIDTH 14400
|
|
||||||
#define HPDF_MIN_MAGNIFICATION_FACTOR 8
|
|
||||||
#define HPDF_MAX_MAGNIFICATION_FACTOR 3200
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ limitation of various properties -----------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_MIN_PAGE_SIZE 3
|
|
||||||
#define HPDF_MAX_PAGE_SIZE 14400
|
|
||||||
#define HPDF_MIN_HORIZONTALSCALING 10
|
|
||||||
#define HPDF_MAX_HORIZONTALSCALING 300
|
|
||||||
#define HPDF_MIN_WORDSPACE -30
|
|
||||||
#define HPDF_MAX_WORDSPACE 300
|
|
||||||
#define HPDF_MIN_CHARSPACE -30
|
|
||||||
#define HPDF_MAX_CHARSPACE 300
|
|
||||||
#define HPDF_MAX_FONTSIZE 600
|
|
||||||
#define HPDF_MAX_ZOOMSIZE 10
|
|
||||||
#define HPDF_MAX_LEADING 300
|
|
||||||
#define HPDF_MAX_LINEWIDTH 100
|
|
||||||
#define HPDF_MAX_DASH_PATTERN 100
|
|
||||||
|
|
||||||
#define HPDF_MAX_JWW_NUM 128
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- country code definition ----------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_COUNTRY_AF "AF" /* AFGHANISTAN */
|
|
||||||
#define HPDF_COUNTRY_AL "AL" /* ALBANIA */
|
|
||||||
#define HPDF_COUNTRY_DZ "DZ" /* ALGERIA */
|
|
||||||
#define HPDF_COUNTRY_AS "AS" /* AMERICAN SAMOA */
|
|
||||||
#define HPDF_COUNTRY_AD "AD" /* ANDORRA */
|
|
||||||
#define HPDF_COUNTRY_AO "AO" /* ANGOLA */
|
|
||||||
#define HPDF_COUNTRY_AI "AI" /* ANGUILLA */
|
|
||||||
#define HPDF_COUNTRY_AQ "AQ" /* ANTARCTICA */
|
|
||||||
#define HPDF_COUNTRY_AG "AG" /* ANTIGUA AND BARBUDA */
|
|
||||||
#define HPDF_COUNTRY_AR "AR" /* ARGENTINA */
|
|
||||||
#define HPDF_COUNTRY_AM "AM" /* ARMENIA */
|
|
||||||
#define HPDF_COUNTRY_AW "AW" /* ARUBA */
|
|
||||||
#define HPDF_COUNTRY_AU "AU" /* AUSTRALIA */
|
|
||||||
#define HPDF_COUNTRY_AT "AT" /* AUSTRIA */
|
|
||||||
#define HPDF_COUNTRY_AZ "AZ" /* AZERBAIJAN */
|
|
||||||
#define HPDF_COUNTRY_BS "BS" /* BAHAMAS */
|
|
||||||
#define HPDF_COUNTRY_BH "BH" /* BAHRAIN */
|
|
||||||
#define HPDF_COUNTRY_BD "BD" /* BANGLADESH */
|
|
||||||
#define HPDF_COUNTRY_BB "BB" /* BARBADOS */
|
|
||||||
#define HPDF_COUNTRY_BY "BY" /* BELARUS */
|
|
||||||
#define HPDF_COUNTRY_BE "BE" /* BELGIUM */
|
|
||||||
#define HPDF_COUNTRY_BZ "BZ" /* BELIZE */
|
|
||||||
#define HPDF_COUNTRY_BJ "BJ" /* BENIN */
|
|
||||||
#define HPDF_COUNTRY_BM "BM" /* BERMUDA */
|
|
||||||
#define HPDF_COUNTRY_BT "BT" /* BHUTAN */
|
|
||||||
#define HPDF_COUNTRY_BO "BO" /* BOLIVIA */
|
|
||||||
#define HPDF_COUNTRY_BA "BA" /* BOSNIA AND HERZEGOWINA */
|
|
||||||
#define HPDF_COUNTRY_BW "BW" /* BOTSWANA */
|
|
||||||
#define HPDF_COUNTRY_BV "BV" /* BOUVET ISLAND */
|
|
||||||
#define HPDF_COUNTRY_BR "BR" /* BRAZIL */
|
|
||||||
#define HPDF_COUNTRY_IO "IO" /* BRITISH INDIAN OCEAN TERRITORY */
|
|
||||||
#define HPDF_COUNTRY_BN "BN" /* BRUNEI DARUSSALAM */
|
|
||||||
#define HPDF_COUNTRY_BG "BG" /* BULGARIA */
|
|
||||||
#define HPDF_COUNTRY_BF "BF" /* BURKINA FASO */
|
|
||||||
#define HPDF_COUNTRY_BI "BI" /* BURUNDI */
|
|
||||||
#define HPDF_COUNTRY_KH "KH" /* CAMBODIA */
|
|
||||||
#define HPDF_COUNTRY_CM "CM" /* CAMEROON */
|
|
||||||
#define HPDF_COUNTRY_CA "CA" /* CANADA */
|
|
||||||
#define HPDF_COUNTRY_CV "CV" /* CAPE VERDE */
|
|
||||||
#define HPDF_COUNTRY_KY "KY" /* CAYMAN ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_CF "CF" /* CENTRAL AFRICAN REPUBLIC */
|
|
||||||
#define HPDF_COUNTRY_TD "TD" /* CHAD */
|
|
||||||
#define HPDF_COUNTRY_CL "CL" /* CHILE */
|
|
||||||
#define HPDF_COUNTRY_CN "CN" /* CHINA */
|
|
||||||
#define HPDF_COUNTRY_CX "CX" /* CHRISTMAS ISLAND */
|
|
||||||
#define HPDF_COUNTRY_CC "CC" /* COCOS (KEELING) ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_CO "CO" /* COLOMBIA */
|
|
||||||
#define HPDF_COUNTRY_KM "KM" /* COMOROS */
|
|
||||||
#define HPDF_COUNTRY_CG "CG" /* CONGO */
|
|
||||||
#define HPDF_COUNTRY_CK "CK" /* COOK ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_CR "CR" /* COSTA RICA */
|
|
||||||
#define HPDF_COUNTRY_CI "CI" /* COTE D'IVOIRE */
|
|
||||||
#define HPDF_COUNTRY_HR "HR" /* CROATIA (local name: Hrvatska) */
|
|
||||||
#define HPDF_COUNTRY_CU "CU" /* CUBA */
|
|
||||||
#define HPDF_COUNTRY_CY "CY" /* CYPRUS */
|
|
||||||
#define HPDF_COUNTRY_CZ "CZ" /* CZECH REPUBLIC */
|
|
||||||
#define HPDF_COUNTRY_DK "DK" /* DENMARK */
|
|
||||||
#define HPDF_COUNTRY_DJ "DJ" /* DJIBOUTI */
|
|
||||||
#define HPDF_COUNTRY_DM "DM" /* DOMINICA */
|
|
||||||
#define HPDF_COUNTRY_DO "DO" /* DOMINICAN REPUBLIC */
|
|
||||||
#define HPDF_COUNTRY_TP "TP" /* EAST TIMOR */
|
|
||||||
#define HPDF_COUNTRY_EC "EC" /* ECUADOR */
|
|
||||||
#define HPDF_COUNTRY_EG "EG" /* EGYPT */
|
|
||||||
#define HPDF_COUNTRY_SV "SV" /* EL SALVADOR */
|
|
||||||
#define HPDF_COUNTRY_GQ "GQ" /* EQUATORIAL GUINEA */
|
|
||||||
#define HPDF_COUNTRY_ER "ER" /* ERITREA */
|
|
||||||
#define HPDF_COUNTRY_EE "EE" /* ESTONIA */
|
|
||||||
#define HPDF_COUNTRY_ET "ET" /* ETHIOPIA */
|
|
||||||
#define HPDF_COUNTRY_FK "FK" /* FALKLAND ISLANDS (MALVINAS) */
|
|
||||||
#define HPDF_COUNTRY_FO "FO" /* FAROE ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_FJ "FJ" /* FIJI */
|
|
||||||
#define HPDF_COUNTRY_FI "FI" /* FINLAND */
|
|
||||||
#define HPDF_COUNTRY_FR "FR" /* FRANCE */
|
|
||||||
#define HPDF_COUNTRY_FX "FX" /* FRANCE, METROPOLITAN */
|
|
||||||
#define HPDF_COUNTRY_GF "GF" /* FRENCH GUIANA */
|
|
||||||
#define HPDF_COUNTRY_PF "PF" /* FRENCH POLYNESIA */
|
|
||||||
#define HPDF_COUNTRY_TF "TF" /* FRENCH SOUTHERN TERRITORIES */
|
|
||||||
#define HPDF_COUNTRY_GA "GA" /* GABON */
|
|
||||||
#define HPDF_COUNTRY_GM "GM" /* GAMBIA */
|
|
||||||
#define HPDF_COUNTRY_GE "GE" /* GEORGIA */
|
|
||||||
#define HPDF_COUNTRY_DE "DE" /* GERMANY */
|
|
||||||
#define HPDF_COUNTRY_GH "GH" /* GHANA */
|
|
||||||
#define HPDF_COUNTRY_GI "GI" /* GIBRALTAR */
|
|
||||||
#define HPDF_COUNTRY_GR "GR" /* GREECE */
|
|
||||||
#define HPDF_COUNTRY_GL "GL" /* GREENLAND */
|
|
||||||
#define HPDF_COUNTRY_GD "GD" /* GRENADA */
|
|
||||||
#define HPDF_COUNTRY_GP "GP" /* GUADELOUPE */
|
|
||||||
#define HPDF_COUNTRY_GU "GU" /* GUAM */
|
|
||||||
#define HPDF_COUNTRY_GT "GT" /* GUATEMALA */
|
|
||||||
#define HPDF_COUNTRY_GN "GN" /* GUINEA */
|
|
||||||
#define HPDF_COUNTRY_GW "GW" /* GUINEA-BISSAU */
|
|
||||||
#define HPDF_COUNTRY_GY "GY" /* GUYANA */
|
|
||||||
#define HPDF_COUNTRY_HT "HT" /* HAITI */
|
|
||||||
#define HPDF_COUNTRY_HM "HM" /* HEARD AND MC DONALD ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_HN "HN" /* HONDURAS */
|
|
||||||
#define HPDF_COUNTRY_HK "HK" /* HONG KONG */
|
|
||||||
#define HPDF_COUNTRY_HU "HU" /* HUNGARY */
|
|
||||||
#define HPDF_COUNTRY_IS "IS" /* ICELAND */
|
|
||||||
#define HPDF_COUNTRY_IN "IN" /* INDIA */
|
|
||||||
#define HPDF_COUNTRY_ID "ID" /* INDONESIA */
|
|
||||||
#define HPDF_COUNTRY_IR "IR" /* IRAN (ISLAMIC REPUBLIC OF) */
|
|
||||||
#define HPDF_COUNTRY_IQ "IQ" /* IRAQ */
|
|
||||||
#define HPDF_COUNTRY_IE "IE" /* IRELAND */
|
|
||||||
#define HPDF_COUNTRY_IL "IL" /* ISRAEL */
|
|
||||||
#define HPDF_COUNTRY_IT "IT" /* ITALY */
|
|
||||||
#define HPDF_COUNTRY_JM "JM" /* JAMAICA */
|
|
||||||
#define HPDF_COUNTRY_JP "JP" /* JAPAN */
|
|
||||||
#define HPDF_COUNTRY_JO "JO" /* JORDAN */
|
|
||||||
#define HPDF_COUNTRY_KZ "KZ" /* KAZAKHSTAN */
|
|
||||||
#define HPDF_COUNTRY_KE "KE" /* KENYA */
|
|
||||||
#define HPDF_COUNTRY_KI "KI" /* KIRIBATI */
|
|
||||||
#define HPDF_COUNTRY_KP "KP" /* KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF */
|
|
||||||
#define HPDF_COUNTRY_KR "KR" /* KOREA, REPUBLIC OF */
|
|
||||||
#define HPDF_COUNTRY_KW "KW" /* KUWAIT */
|
|
||||||
#define HPDF_COUNTRY_KG "KG" /* KYRGYZSTAN */
|
|
||||||
#define HPDF_COUNTRY_LA "LA" /* LAO PEOPLE'S DEMOCRATIC REPUBLIC */
|
|
||||||
#define HPDF_COUNTRY_LV "LV" /* LATVIA */
|
|
||||||
#define HPDF_COUNTRY_LB "LB" /* LEBANON */
|
|
||||||
#define HPDF_COUNTRY_LS "LS" /* LESOTHO */
|
|
||||||
#define HPDF_COUNTRY_LR "LR" /* LIBERIA */
|
|
||||||
#define HPDF_COUNTRY_LY "LY" /* LIBYAN ARAB JAMAHIRIYA */
|
|
||||||
#define HPDF_COUNTRY_LI "LI" /* LIECHTENSTEIN */
|
|
||||||
#define HPDF_COUNTRY_LT "LT" /* LITHUANIA */
|
|
||||||
#define HPDF_COUNTRY_LU "LU" /* LUXEMBOURG */
|
|
||||||
#define HPDF_COUNTRY_MO "MO" /* MACAU */
|
|
||||||
#define HPDF_COUNTRY_MK "MK" /* MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF */
|
|
||||||
#define HPDF_COUNTRY_MG "MG" /* MADAGASCAR */
|
|
||||||
#define HPDF_COUNTRY_MW "MW" /* MALAWI */
|
|
||||||
#define HPDF_COUNTRY_MY "MY" /* MALAYSIA */
|
|
||||||
#define HPDF_COUNTRY_MV "MV" /* MALDIVES */
|
|
||||||
#define HPDF_COUNTRY_ML "ML" /* MALI */
|
|
||||||
#define HPDF_COUNTRY_MT "MT" /* MALTA */
|
|
||||||
#define HPDF_COUNTRY_MH "MH" /* MARSHALL ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_MQ "MQ" /* MARTINIQUE */
|
|
||||||
#define HPDF_COUNTRY_MR "MR" /* MAURITANIA */
|
|
||||||
#define HPDF_COUNTRY_MU "MU" /* MAURITIUS */
|
|
||||||
#define HPDF_COUNTRY_YT "YT" /* MAYOTTE */
|
|
||||||
#define HPDF_COUNTRY_MX "MX" /* MEXICO */
|
|
||||||
#define HPDF_COUNTRY_FM "FM" /* MICRONESIA, FEDERATED STATES OF */
|
|
||||||
#define HPDF_COUNTRY_MD "MD" /* MOLDOVA, REPUBLIC OF */
|
|
||||||
#define HPDF_COUNTRY_MC "MC" /* MONACO */
|
|
||||||
#define HPDF_COUNTRY_MN "MN" /* MONGOLIA */
|
|
||||||
#define HPDF_COUNTRY_MS "MS" /* MONTSERRAT */
|
|
||||||
#define HPDF_COUNTRY_MA "MA" /* MOROCCO */
|
|
||||||
#define HPDF_COUNTRY_MZ "MZ" /* MOZAMBIQUE */
|
|
||||||
#define HPDF_COUNTRY_MM "MM" /* MYANMAR */
|
|
||||||
#define HPDF_COUNTRY_NA "NA" /* NAMIBIA */
|
|
||||||
#define HPDF_COUNTRY_NR "NR" /* NAURU */
|
|
||||||
#define HPDF_COUNTRY_NP "NP" /* NEPAL */
|
|
||||||
#define HPDF_COUNTRY_NL "NL" /* NETHERLANDS */
|
|
||||||
#define HPDF_COUNTRY_AN "AN" /* NETHERLANDS ANTILLES */
|
|
||||||
#define HPDF_COUNTRY_NC "NC" /* NEW CALEDONIA */
|
|
||||||
#define HPDF_COUNTRY_NZ "NZ" /* NEW ZEALAND */
|
|
||||||
#define HPDF_COUNTRY_NI "NI" /* NICARAGUA */
|
|
||||||
#define HPDF_COUNTRY_NE "NE" /* NIGER */
|
|
||||||
#define HPDF_COUNTRY_NG "NG" /* NIGERIA */
|
|
||||||
#define HPDF_COUNTRY_NU "NU" /* NIUE */
|
|
||||||
#define HPDF_COUNTRY_NF "NF" /* NORFOLK ISLAND */
|
|
||||||
#define HPDF_COUNTRY_MP "MP" /* NORTHERN MARIANA ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_NO "NO" /* NORWAY */
|
|
||||||
#define HPDF_COUNTRY_OM "OM" /* OMAN */
|
|
||||||
#define HPDF_COUNTRY_PK "PK" /* PAKISTAN */
|
|
||||||
#define HPDF_COUNTRY_PW "PW" /* PALAU */
|
|
||||||
#define HPDF_COUNTRY_PA "PA" /* PANAMA */
|
|
||||||
#define HPDF_COUNTRY_PG "PG" /* PAPUA NEW GUINEA */
|
|
||||||
#define HPDF_COUNTRY_PY "PY" /* PARAGUAY */
|
|
||||||
#define HPDF_COUNTRY_PE "PE" /* PERU */
|
|
||||||
#define HPDF_COUNTRY_PH "PH" /* PHILIPPINES */
|
|
||||||
#define HPDF_COUNTRY_PN "PN" /* PITCAIRN */
|
|
||||||
#define HPDF_COUNTRY_PL "PL" /* POLAND */
|
|
||||||
#define HPDF_COUNTRY_PT "PT" /* PORTUGAL */
|
|
||||||
#define HPDF_COUNTRY_PR "PR" /* PUERTO RICO */
|
|
||||||
#define HPDF_COUNTRY_QA "QA" /* QATAR */
|
|
||||||
#define HPDF_COUNTRY_RE "RE" /* REUNION */
|
|
||||||
#define HPDF_COUNTRY_RO "RO" /* ROMANIA */
|
|
||||||
#define HPDF_COUNTRY_RU "RU" /* RUSSIAN FEDERATION */
|
|
||||||
#define HPDF_COUNTRY_RW "RW" /* RWANDA */
|
|
||||||
#define HPDF_COUNTRY_KN "KN" /* SAINT KITTS AND NEVIS */
|
|
||||||
#define HPDF_COUNTRY_LC "LC" /* SAINT LUCIA */
|
|
||||||
#define HPDF_COUNTRY_VC "VC" /* SAINT VINCENT AND THE GRENADINES */
|
|
||||||
#define HPDF_COUNTRY_WS "WS" /* SAMOA */
|
|
||||||
#define HPDF_COUNTRY_SM "SM" /* SAN MARINO */
|
|
||||||
#define HPDF_COUNTRY_ST "ST" /* SAO TOME AND PRINCIPE */
|
|
||||||
#define HPDF_COUNTRY_SA "SA" /* SAUDI ARABIA */
|
|
||||||
#define HPDF_COUNTRY_SN "SN" /* SENEGAL */
|
|
||||||
#define HPDF_COUNTRY_SC "SC" /* SEYCHELLES */
|
|
||||||
#define HPDF_COUNTRY_SL "SL" /* SIERRA LEONE */
|
|
||||||
#define HPDF_COUNTRY_SG "SG" /* SINGAPORE */
|
|
||||||
#define HPDF_COUNTRY_SK "SK" /* SLOVAKIA (Slovak Republic) */
|
|
||||||
#define HPDF_COUNTRY_SI "SI" /* SLOVENIA */
|
|
||||||
#define HPDF_COUNTRY_SB "SB" /* SOLOMON ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_SO "SO" /* SOMALIA */
|
|
||||||
#define HPDF_COUNTRY_ZA "ZA" /* SOUTH AFRICA */
|
|
||||||
#define HPDF_COUNTRY_ES "ES" /* SPAIN */
|
|
||||||
#define HPDF_COUNTRY_LK "LK" /* SRI LANKA */
|
|
||||||
#define HPDF_COUNTRY_SH "SH" /* ST. HELENA */
|
|
||||||
#define HPDF_COUNTRY_PM "PM" /* ST. PIERRE AND MIQUELON */
|
|
||||||
#define HPDF_COUNTRY_SD "SD" /* SUDAN */
|
|
||||||
#define HPDF_COUNTRY_SR "SR" /* SURINAME */
|
|
||||||
#define HPDF_COUNTRY_SJ "SJ" /* SVALBARD AND JAN MAYEN ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_SZ "SZ" /* SWAZILAND */
|
|
||||||
#define HPDF_COUNTRY_SE "SE" /* SWEDEN */
|
|
||||||
#define HPDF_COUNTRY_CH "CH" /* SWITZERLAND */
|
|
||||||
#define HPDF_COUNTRY_SY "SY" /* SYRIAN ARAB REPUBLIC */
|
|
||||||
#define HPDF_COUNTRY_TW "TW" /* TAIWAN, PROVINCE OF CHINA */
|
|
||||||
#define HPDF_COUNTRY_TJ "TJ" /* TAJIKISTAN */
|
|
||||||
#define HPDF_COUNTRY_TZ "TZ" /* TANZANIA, UNITED REPUBLIC OF */
|
|
||||||
#define HPDF_COUNTRY_TH "TH" /* THAILAND */
|
|
||||||
#define HPDF_COUNTRY_TG "TG" /* TOGO */
|
|
||||||
#define HPDF_COUNTRY_TK "TK" /* TOKELAU */
|
|
||||||
#define HPDF_COUNTRY_TO "TO" /* TONGA */
|
|
||||||
#define HPDF_COUNTRY_TT "TT" /* TRINIDAD AND TOBAGO */
|
|
||||||
#define HPDF_COUNTRY_TN "TN" /* TUNISIA */
|
|
||||||
#define HPDF_COUNTRY_TR "TR" /* TURKEY */
|
|
||||||
#define HPDF_COUNTRY_TM "TM" /* TURKMENISTAN */
|
|
||||||
#define HPDF_COUNTRY_TC "TC" /* TURKS AND CAICOS ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_TV "TV" /* TUVALU */
|
|
||||||
#define HPDF_COUNTRY_UG "UG" /* UGANDA */
|
|
||||||
#define HPDF_COUNTRY_UA "UA" /* UKRAINE */
|
|
||||||
#define HPDF_COUNTRY_AE "AE" /* UNITED ARAB EMIRATES */
|
|
||||||
#define HPDF_COUNTRY_GB "GB" /* UNITED KINGDOM */
|
|
||||||
#define HPDF_COUNTRY_US "US" /* UNITED STATES */
|
|
||||||
#define HPDF_COUNTRY_UM "UM" /* UNITED STATES MINOR OUTLYING ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_UY "UY" /* URUGUAY */
|
|
||||||
#define HPDF_COUNTRY_UZ "UZ" /* UZBEKISTAN */
|
|
||||||
#define HPDF_COUNTRY_VU "VU" /* VANUATU */
|
|
||||||
#define HPDF_COUNTRY_VA "VA" /* VATICAN CITY STATE (HOLY SEE) */
|
|
||||||
#define HPDF_COUNTRY_VE "VE" /* VENEZUELA */
|
|
||||||
#define HPDF_COUNTRY_VN "VN" /* VIET NAM */
|
|
||||||
#define HPDF_COUNTRY_VG "VG" /* VIRGIN ISLANDS (BRITISH) */
|
|
||||||
#define HPDF_COUNTRY_VI "VI" /* VIRGIN ISLANDS (U.S.) */
|
|
||||||
#define HPDF_COUNTRY_WF "WF" /* WALLIS AND FUTUNA ISLANDS */
|
|
||||||
#define HPDF_COUNTRY_EH "EH" /* WESTERN SAHARA */
|
|
||||||
#define HPDF_COUNTRY_YE "YE" /* YEMEN */
|
|
||||||
#define HPDF_COUNTRY_YU "YU" /* YUGOSLAVIA */
|
|
||||||
#define HPDF_COUNTRY_ZR "ZR" /* ZAIRE */
|
|
||||||
#define HPDF_COUNTRY_ZM "ZM" /* ZAMBIA */
|
|
||||||
#define HPDF_COUNTRY_ZW "ZW" /* ZIMBABWE */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- lang code definition -------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_LANG_AA "aa" /* Afar */
|
|
||||||
#define HPDF_LANG_AB "ab" /* Abkhazian */
|
|
||||||
#define HPDF_LANG_AF "af" /* Afrikaans */
|
|
||||||
#define HPDF_LANG_AM "am" /* Amharic */
|
|
||||||
#define HPDF_LANG_AR "ar" /* Arabic */
|
|
||||||
#define HPDF_LANG_AS "as" /* Assamese */
|
|
||||||
#define HPDF_LANG_AY "ay" /* Aymara */
|
|
||||||
#define HPDF_LANG_AZ "az" /* Azerbaijani */
|
|
||||||
#define HPDF_LANG_BA "ba" /* Bashkir */
|
|
||||||
#define HPDF_LANG_BE "be" /* Byelorussian */
|
|
||||||
#define HPDF_LANG_BG "bg" /* Bulgarian */
|
|
||||||
#define HPDF_LANG_BH "bh" /* Bihari */
|
|
||||||
#define HPDF_LANG_BI "bi" /* Bislama */
|
|
||||||
#define HPDF_LANG_BN "bn" /* Bengali Bangla */
|
|
||||||
#define HPDF_LANG_BO "bo" /* Tibetan */
|
|
||||||
#define HPDF_LANG_BR "br" /* Breton */
|
|
||||||
#define HPDF_LANG_CA "ca" /* Catalan */
|
|
||||||
#define HPDF_LANG_CO "co" /* Corsican */
|
|
||||||
#define HPDF_LANG_CS "cs" /* Czech */
|
|
||||||
#define HPDF_LANG_CY "cy" /* Welsh */
|
|
||||||
#define HPDF_LANG_DA "da" /* Danish */
|
|
||||||
#define HPDF_LANG_DE "de" /* German */
|
|
||||||
#define HPDF_LANG_DZ "dz" /* Bhutani */
|
|
||||||
#define HPDF_LANG_EL "el" /* Greek */
|
|
||||||
#define HPDF_LANG_EN "en" /* English */
|
|
||||||
#define HPDF_LANG_EO "eo" /* Esperanto */
|
|
||||||
#define HPDF_LANG_ES "es" /* Spanish */
|
|
||||||
#define HPDF_LANG_ET "et" /* Estonian */
|
|
||||||
#define HPDF_LANG_EU "eu" /* Basque */
|
|
||||||
#define HPDF_LANG_FA "fa" /* Persian */
|
|
||||||
#define HPDF_LANG_FI "fi" /* Finnish */
|
|
||||||
#define HPDF_LANG_FJ "fj" /* Fiji */
|
|
||||||
#define HPDF_LANG_FO "fo" /* Faeroese */
|
|
||||||
#define HPDF_LANG_FR "fr" /* French */
|
|
||||||
#define HPDF_LANG_FY "fy" /* Frisian */
|
|
||||||
#define HPDF_LANG_GA "ga" /* Irish */
|
|
||||||
#define HPDF_LANG_GD "gd" /* Scots Gaelic */
|
|
||||||
#define HPDF_LANG_GL "gl" /* Galician */
|
|
||||||
#define HPDF_LANG_GN "gn" /* Guarani */
|
|
||||||
#define HPDF_LANG_GU "gu" /* Gujarati */
|
|
||||||
#define HPDF_LANG_HA "ha" /* Hausa */
|
|
||||||
#define HPDF_LANG_HI "hi" /* Hindi */
|
|
||||||
#define HPDF_LANG_HR "hr" /* Croatian */
|
|
||||||
#define HPDF_LANG_HU "hu" /* Hungarian */
|
|
||||||
#define HPDF_LANG_HY "hy" /* Armenian */
|
|
||||||
#define HPDF_LANG_IA "ia" /* Interlingua */
|
|
||||||
#define HPDF_LANG_IE "ie" /* Interlingue */
|
|
||||||
#define HPDF_LANG_IK "ik" /* Inupiak */
|
|
||||||
#define HPDF_LANG_IN "in" /* Indonesian */
|
|
||||||
#define HPDF_LANG_IS "is" /* Icelandic */
|
|
||||||
#define HPDF_LANG_IT "it" /* Italian */
|
|
||||||
#define HPDF_LANG_IW "iw" /* Hebrew */
|
|
||||||
#define HPDF_LANG_JA "ja" /* Japanese */
|
|
||||||
#define HPDF_LANG_JI "ji" /* Yiddish */
|
|
||||||
#define HPDF_LANG_JW "jw" /* Javanese */
|
|
||||||
#define HPDF_LANG_KA "ka" /* Georgian */
|
|
||||||
#define HPDF_LANG_KK "kk" /* Kazakh */
|
|
||||||
#define HPDF_LANG_KL "kl" /* Greenlandic */
|
|
||||||
#define HPDF_LANG_KM "km" /* Cambodian */
|
|
||||||
#define HPDF_LANG_KN "kn" /* Kannada */
|
|
||||||
#define HPDF_LANG_KO "ko" /* Korean */
|
|
||||||
#define HPDF_LANG_KS "ks" /* Kashmiri */
|
|
||||||
#define HPDF_LANG_KU "ku" /* Kurdish */
|
|
||||||
#define HPDF_LANG_KY "ky" /* Kirghiz */
|
|
||||||
#define HPDF_LANG_LA "la" /* Latin */
|
|
||||||
#define HPDF_LANG_LN "ln" /* Lingala */
|
|
||||||
#define HPDF_LANG_LO "lo" /* Laothian */
|
|
||||||
#define HPDF_LANG_LT "lt" /* Lithuanian */
|
|
||||||
#define HPDF_LANG_LV "lv" /* Latvian,Lettish */
|
|
||||||
#define HPDF_LANG_MG "mg" /* Malagasy */
|
|
||||||
#define HPDF_LANG_MI "mi" /* Maori */
|
|
||||||
#define HPDF_LANG_MK "mk" /* Macedonian */
|
|
||||||
#define HPDF_LANG_ML "ml" /* Malayalam */
|
|
||||||
#define HPDF_LANG_MN "mn" /* Mongolian */
|
|
||||||
#define HPDF_LANG_MO "mo" /* Moldavian */
|
|
||||||
#define HPDF_LANG_MR "mr" /* Marathi */
|
|
||||||
#define HPDF_LANG_MS "ms" /* Malay */
|
|
||||||
#define HPDF_LANG_MT "mt" /* Maltese */
|
|
||||||
#define HPDF_LANG_MY "my" /* Burmese */
|
|
||||||
#define HPDF_LANG_NA "na" /* Nauru */
|
|
||||||
#define HPDF_LANG_NE "ne" /* Nepali */
|
|
||||||
#define HPDF_LANG_NL "nl" /* Dutch */
|
|
||||||
#define HPDF_LANG_NO "no" /* Norwegian */
|
|
||||||
#define HPDF_LANG_OC "oc" /* Occitan */
|
|
||||||
#define HPDF_LANG_OM "om" /* (Afan)Oromo */
|
|
||||||
#define HPDF_LANG_OR "or" /* Oriya */
|
|
||||||
#define HPDF_LANG_PA "pa" /* Punjabi */
|
|
||||||
#define HPDF_LANG_PL "pl" /* Polish */
|
|
||||||
#define HPDF_LANG_PS "ps" /* Pashto,Pushto */
|
|
||||||
#define HPDF_LANG_PT "pt" /* Portuguese */
|
|
||||||
#define HPDF_LANG_QU "qu" /* Quechua */
|
|
||||||
#define HPDF_LANG_RM "rm" /* Rhaeto-Romance */
|
|
||||||
#define HPDF_LANG_RN "rn" /* Kirundi */
|
|
||||||
#define HPDF_LANG_RO "ro" /* Romanian */
|
|
||||||
#define HPDF_LANG_RU "ru" /* Russian */
|
|
||||||
#define HPDF_LANG_RW "rw" /* Kinyarwanda */
|
|
||||||
#define HPDF_LANG_SA "sa" /* Sanskrit */
|
|
||||||
#define HPDF_LANG_SD "sd" /* Sindhi */
|
|
||||||
#define HPDF_LANG_SG "sg" /* Sangro */
|
|
||||||
#define HPDF_LANG_SH "sh" /* Serbo-Croatian */
|
|
||||||
#define HPDF_LANG_SI "si" /* Singhalese */
|
|
||||||
#define HPDF_LANG_SK "sk" /* Slovak */
|
|
||||||
#define HPDF_LANG_SL "sl" /* Slovenian */
|
|
||||||
#define HPDF_LANG_SM "sm" /* Samoan */
|
|
||||||
#define HPDF_LANG_SN "sn" /* Shona */
|
|
||||||
#define HPDF_LANG_SO "so" /* Somali */
|
|
||||||
#define HPDF_LANG_SQ "sq" /* Albanian */
|
|
||||||
#define HPDF_LANG_SR "sr" /* Serbian */
|
|
||||||
#define HPDF_LANG_SS "ss" /* Siswati */
|
|
||||||
#define HPDF_LANG_ST "st" /* Sesotho */
|
|
||||||
#define HPDF_LANG_SU "su" /* Sundanese */
|
|
||||||
#define HPDF_LANG_SV "sv" /* Swedish */
|
|
||||||
#define HPDF_LANG_SW "sw" /* Swahili */
|
|
||||||
#define HPDF_LANG_TA "ta" /* Tamil */
|
|
||||||
#define HPDF_LANG_TE "te" /* Tegulu */
|
|
||||||
#define HPDF_LANG_TG "tg" /* Tajik */
|
|
||||||
#define HPDF_LANG_TH "th" /* Thai */
|
|
||||||
#define HPDF_LANG_TI "ti" /* Tigrinya */
|
|
||||||
#define HPDF_LANG_TK "tk" /* Turkmen */
|
|
||||||
#define HPDF_LANG_TL "tl" /* Tagalog */
|
|
||||||
#define HPDF_LANG_TN "tn" /* Setswanato Tonga */
|
|
||||||
#define HPDF_LANG_TR "tr" /* Turkish */
|
|
||||||
#define HPDF_LANG_TS "ts" /* Tsonga */
|
|
||||||
#define HPDF_LANG_TT "tt" /* Tatar */
|
|
||||||
#define HPDF_LANG_TW "tw" /* Twi */
|
|
||||||
#define HPDF_LANG_UK "uk" /* Ukrainian */
|
|
||||||
#define HPDF_LANG_UR "ur" /* Urdu */
|
|
||||||
#define HPDF_LANG_UZ "uz" /* Uzbek */
|
|
||||||
#define HPDF_LANG_VI "vi" /* Vietnamese */
|
|
||||||
#define HPDF_LANG_VO "vo" /* Volapuk */
|
|
||||||
#define HPDF_LANG_WO "wo" /* Wolof */
|
|
||||||
#define HPDF_LANG_XH "xh" /* Xhosa */
|
|
||||||
#define HPDF_LANG_YO "yo" /* Yoruba */
|
|
||||||
#define HPDF_LANG_ZH "zh" /* Chinese */
|
|
||||||
#define HPDF_LANG_ZU "zu" /* Zulu */
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- Graphis mode ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_GMODE_PAGE_DESCRIPTION 0x0001
|
|
||||||
#define HPDF_GMODE_PATH_OBJECT 0x0002
|
|
||||||
#define HPDF_GMODE_TEXT_OBJECT 0x0004
|
|
||||||
#define HPDF_GMODE_CLIPPING_PATH 0x0008
|
|
||||||
#define HPDF_GMODE_SHADING 0x0010
|
|
||||||
#define HPDF_GMODE_INLINE_IMAGE 0x0020
|
|
||||||
#define HPDF_GMODE_EXTERNAL_OBJECT 0x0040
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#endif /* _HPDF_CONSTS_H */
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_destination.c
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_DESTINATION_H
|
|
||||||
#define _HPDF_DESTINATION_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Destination -----------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_Destination
|
|
||||||
HPDF_Destination_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Page target,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Destination_Validate (HPDF_Destination dst);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_DESTINATION_H */
|
|
||||||
|
|
||||||
@ -1,162 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_doc.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _HPDF_DOC_H
|
|
||||||
#define _HPDF_DOC_H
|
|
||||||
|
|
||||||
#define HPDF_SIG_BYTES 0x41504446L
|
|
||||||
|
|
||||||
#include "hpdf_catalog.h"
|
|
||||||
#include "hpdf_image.h"
|
|
||||||
#include "hpdf_pages.h"
|
|
||||||
#include "hpdf_outline.h"
|
|
||||||
#include "hpdf_ext_gstate.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HPDF_VER_DEFAULT HPDF_VER_12
|
|
||||||
|
|
||||||
typedef struct _HPDF_Doc_Rec {
|
|
||||||
HPDF_UINT32 sig_bytes;
|
|
||||||
HPDF_PDFVer pdf_version;
|
|
||||||
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Catalog catalog;
|
|
||||||
HPDF_Outline outlines;
|
|
||||||
HPDF_Xref xref;
|
|
||||||
HPDF_Pages root_pages;
|
|
||||||
HPDF_Pages cur_pages;
|
|
||||||
HPDF_Page cur_page;
|
|
||||||
HPDF_List page_list;
|
|
||||||
HPDF_Error_Rec error;
|
|
||||||
HPDF_Dict info;
|
|
||||||
HPDF_Dict trailer;
|
|
||||||
|
|
||||||
HPDF_List font_mgr;
|
|
||||||
HPDF_BYTE ttfont_tag[6];
|
|
||||||
|
|
||||||
/* list for loaded fontdefs */
|
|
||||||
HPDF_List fontdef_list;
|
|
||||||
|
|
||||||
/* list for loaded encodings */
|
|
||||||
HPDF_List encoder_list;
|
|
||||||
|
|
||||||
HPDF_Encoder cur_encoder;
|
|
||||||
|
|
||||||
/* default compression mode */
|
|
||||||
HPDF_BOOL compression_mode;
|
|
||||||
|
|
||||||
HPDF_BOOL encrypt_on;
|
|
||||||
HPDF_EncryptDict encrypt_dict;
|
|
||||||
|
|
||||||
HPDF_Encoder def_encoder;
|
|
||||||
|
|
||||||
HPDF_UINT page_per_pages;
|
|
||||||
HPDF_UINT cur_page_num;
|
|
||||||
|
|
||||||
/* buffer for saving into memory stream */
|
|
||||||
HPDF_Stream stream;
|
|
||||||
} HPDF_Doc_Rec;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Doc_Rec *HPDF_Doc;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Encoder
|
|
||||||
HPDF_Doc_FindEncoder (HPDF_Doc pdf,
|
|
||||||
const char *encoding_name);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_Doc_FindFontDef (HPDF_Doc pdf,
|
|
||||||
const char *font_name);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Font
|
|
||||||
HPDF_Doc_FindFont (HPDF_Doc pdf,
|
|
||||||
const char *font_name,
|
|
||||||
const char *encoding_name);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Doc_Validate (HPDF_Doc pdf);
|
|
||||||
|
|
||||||
|
|
||||||
/*----- page handling -------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_Pages
|
|
||||||
HPDF_Doc_GetCurrentPages (HPDF_Doc pdf);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Pages
|
|
||||||
HPDF_Doc_AddPagesTo (HPDF_Doc pdf,
|
|
||||||
HPDF_Pages parent);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_SetCurrentPages (HPDF_Doc pdf,
|
|
||||||
HPDF_Pages pages);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_SetCurrentPage (HPDF_Doc pdf,
|
|
||||||
HPDF_Page page);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----- font handling -------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_GetFontDef (HPDF_Doc pdf,
|
|
||||||
const char *font_name);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_RegisterFontDef (HPDF_Doc pdf,
|
|
||||||
HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
|
|
||||||
/*----- encoding handling ---------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_RegisterEncoder (HPDF_Doc pdf,
|
|
||||||
HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----- encryptio------------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_SetEncryptOn (HPDF_Doc pdf);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_SetEncryptOff (HPDF_Doc pdf);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Doc_PrepareEncryption (HPDF_Doc pdf);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_DOC_H */
|
|
||||||
|
|
||||||
@ -1,318 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_encoder.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_ENCODER_H
|
|
||||||
#define _HPDF_ENCODER_H
|
|
||||||
|
|
||||||
#include "hpdf_consts.h"
|
|
||||||
#include "hpdf_streams.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*-- HPDF_Encoder ---------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_ENCODER_SIG_BYTES 0x454E4344L
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ predefined font encodings -------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_ENCODING_FONT_SPECIFIC "FontSpecific"
|
|
||||||
#define HPDF_ENCODING_STANDARD "StandardEncoding"
|
|
||||||
#define HPDF_ENCODING_MAC_ROMAN "MacRomanEncoding"
|
|
||||||
#define HPDF_ENCODING_WIN_ANSI "WinAnsiEncoding"
|
|
||||||
#define HPDF_ENCODING_ISO8859_2 "ISO8859-2"
|
|
||||||
#define HPDF_ENCODING_ISO8859_3 "ISO8859-3"
|
|
||||||
#define HPDF_ENCODING_ISO8859_4 "ISO8859-4"
|
|
||||||
#define HPDF_ENCODING_ISO8859_5 "ISO8859-5"
|
|
||||||
#define HPDF_ENCODING_ISO8859_6 "ISO8859-6"
|
|
||||||
#define HPDF_ENCODING_ISO8859_7 "ISO8859-7"
|
|
||||||
#define HPDF_ENCODING_ISO8859_8 "ISO8859-8"
|
|
||||||
#define HPDF_ENCODING_ISO8859_9 "ISO8859-9"
|
|
||||||
#define HPDF_ENCODING_ISO8859_10 "ISO8859-10"
|
|
||||||
#define HPDF_ENCODING_ISO8859_11 "ISO8859-11"
|
|
||||||
#define HPDF_ENCODING_ISO8859_13 "ISO8859-13"
|
|
||||||
#define HPDF_ENCODING_ISO8859_14 "ISO8859-14"
|
|
||||||
#define HPDF_ENCODING_ISO8859_15 "ISO8859-15"
|
|
||||||
#define HPDF_ENCODING_ISO8859_16 "ISO8859-16"
|
|
||||||
#define HPDF_ENCODING_CP1250 "CP1250"
|
|
||||||
#define HPDF_ENCODING_CP1251 "CP1251"
|
|
||||||
#define HPDF_ENCODING_CP1252 "CP1252"
|
|
||||||
#define HPDF_ENCODING_CP1253 "CP1253"
|
|
||||||
#define HPDF_ENCODING_CP1254 "CP1254"
|
|
||||||
#define HPDF_ENCODING_CP1255 "CP1255"
|
|
||||||
#define HPDF_ENCODING_CP1256 "CP1256"
|
|
||||||
#define HPDF_ENCODING_CP1257 "CP1257"
|
|
||||||
#define HPDF_ENCODING_CP1258 "CP1258"
|
|
||||||
#define HPDF_ENCODING_KOI8_R "KOI8-R"
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- definition for font encoding -----------------------------------------*/
|
|
||||||
|
|
||||||
#define char_NOTDEF ".notdef"
|
|
||||||
|
|
||||||
typedef enum _HPDF_EncodingType {
|
|
||||||
HPDF_STANDARD_ENCODING = 0,
|
|
||||||
HPDF_MAC_ROMAN_ENCODING,
|
|
||||||
HPDF_WIN_ANSI_ENCODING,
|
|
||||||
HPDF_FONT_SPECIFIC,
|
|
||||||
HPDF_ENCODING_EOF
|
|
||||||
} HPDF_EncodingType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_ParseText_Rec {
|
|
||||||
const HPDF_BYTE *text;
|
|
||||||
HPDF_UINT index;
|
|
||||||
HPDF_UINT len;
|
|
||||||
HPDF_ByteType byte_type;
|
|
||||||
} HPDF_ParseText_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Encoder_Rec *HPDF_Encoder;
|
|
||||||
|
|
||||||
typedef HPDF_ByteType
|
|
||||||
(*HPDF_Encoder_ByteType_Func) (HPDF_Encoder encoder,
|
|
||||||
HPDF_ParseText_Rec *state);
|
|
||||||
|
|
||||||
typedef HPDF_UNICODE
|
|
||||||
(*HPDF_Encoder_ToUnicode_Func) (HPDF_Encoder encoder,
|
|
||||||
HPDF_UINT16 code);
|
|
||||||
|
|
||||||
typedef char *
|
|
||||||
(*HPDF_Encoder_EncodeText_Func) (HPDF_Encoder encoder,
|
|
||||||
const char *text,
|
|
||||||
HPDF_UINT len,
|
|
||||||
HPDF_UINT *encoded_length);
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Encoder_Write_Func) (HPDF_Encoder encoder,
|
|
||||||
HPDF_Stream out);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Encoder_Init_Func) (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
typedef void
|
|
||||||
(*HPDF_Encoder_Free_Func) (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Encoder_Rec {
|
|
||||||
HPDF_UINT32 sig_bytes;
|
|
||||||
char name[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_EncoderType type;
|
|
||||||
|
|
||||||
HPDF_Encoder_ByteType_Func byte_type_fn;
|
|
||||||
HPDF_Encoder_ToUnicode_Func to_unicode_fn;
|
|
||||||
HPDF_Encoder_EncodeText_Func encode_text_fn;
|
|
||||||
HPDF_Encoder_Write_Func write_fn;
|
|
||||||
HPDF_Encoder_Free_Func free_fn;
|
|
||||||
HPDF_Encoder_Init_Func init_fn;
|
|
||||||
/*
|
|
||||||
char lang_code[3];
|
|
||||||
char country_code[3];
|
|
||||||
*/
|
|
||||||
void *attr;
|
|
||||||
} HPDF_Encoder_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_BaseEncodings {
|
|
||||||
HPDF_BASE_ENCODING_STANDARD,
|
|
||||||
HPDF_BASE_ENCODING_WIN_ANSI,
|
|
||||||
HPDF_BASE_ENCODING_MAC_ROMAN,
|
|
||||||
HPDF_BASE_ENCODING_FONT_SPECIFIC,
|
|
||||||
HPDF_BASE_ENCODING_EOF
|
|
||||||
} HPDF_BaseEncodings;
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Encoder_Validate (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encoder_SetParseText (HPDF_Encoder encoder,
|
|
||||||
HPDF_ParseText_Rec *state,
|
|
||||||
const HPDF_BYTE *text,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
HPDF_ByteType
|
|
||||||
HPDF_Encoder_ByteType (HPDF_Encoder encoder,
|
|
||||||
HPDF_ParseText_Rec *state);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UNICODE
|
|
||||||
HPDF_Encoder_ToUnicode (HPDF_Encoder encoder,
|
|
||||||
HPDF_UINT16 code);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encoder_Free (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
/*-- HPDF_BasicEncoder ----------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_BasicEncoderAttr_Rec *HPDF_BasicEncoderAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_BasicEncoderAttr_Rec {
|
|
||||||
char base_encoding[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_BYTE first_char;
|
|
||||||
HPDF_BYTE last_char;
|
|
||||||
HPDF_UNICODE unicode_map[256];
|
|
||||||
HPDF_BOOL has_differences;
|
|
||||||
HPDF_BYTE differences[256];
|
|
||||||
} HPDF_BasicEncoderAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Encoder
|
|
||||||
HPDF_BasicEncoder_New (HPDF_MMgr mmgr,
|
|
||||||
const char *encoding_name);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_BasicEncoder_Free (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_BasicEncoder_Write (HPDF_Encoder encoder,
|
|
||||||
HPDF_Stream out);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UNICODE
|
|
||||||
HPDF_BasicEncoder_ToUnicode (HPDF_Encoder encoder,
|
|
||||||
HPDF_UINT16 code);
|
|
||||||
|
|
||||||
/*-- HPDF_CMapEncoder ----------------------------------*/
|
|
||||||
|
|
||||||
typedef HPDF_BOOL
|
|
||||||
(*HPDF_CMapEncoder_ByteType_Func) (HPDF_Encoder encoder,
|
|
||||||
HPDF_BYTE b);
|
|
||||||
|
|
||||||
typedef struct _HPDF_CidRange_Rec {
|
|
||||||
HPDF_UINT16 from;
|
|
||||||
HPDF_UINT16 to;
|
|
||||||
HPDF_UINT16 cid;
|
|
||||||
} HPDF_CidRange_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_UnicodeMap_Rec {
|
|
||||||
HPDF_UINT16 code;
|
|
||||||
HPDF_UINT16 unicode;
|
|
||||||
} HPDF_UnicodeMap_Rec;
|
|
||||||
|
|
||||||
typedef struct _HPDF_CMapEncoderAttr_Rec *HPDF_CMapEncoderAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_CMapEncoderAttr_Rec {
|
|
||||||
HPDF_UNICODE unicode_map[256][256];
|
|
||||||
HPDF_UINT16 cid_map[256][256];
|
|
||||||
HPDF_UINT16 jww_line_head[HPDF_MAX_JWW_NUM];
|
|
||||||
HPDF_List cmap_range;
|
|
||||||
HPDF_List notdef_range;
|
|
||||||
HPDF_List code_space_range;
|
|
||||||
HPDF_WritingMode writing_mode;
|
|
||||||
char registry[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
char ordering[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_INT suppliment;
|
|
||||||
HPDF_CMapEncoder_ByteType_Func is_lead_byte_fn;
|
|
||||||
HPDF_CMapEncoder_ByteType_Func is_trial_byte_fn;
|
|
||||||
HPDF_INT uid_offset;
|
|
||||||
HPDF_UINT xuid[3];
|
|
||||||
} HPDF_CMapEncoderAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Encoder
|
|
||||||
HPDF_CMapEncoder_New (HPDF_MMgr mmgr,
|
|
||||||
char *name,
|
|
||||||
HPDF_Encoder_Init_Func init_fn);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_InitAttr (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_CMapEncoder_Free (HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_Write (HPDF_Encoder encoder,
|
|
||||||
HPDF_Stream out);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UNICODE
|
|
||||||
HPDF_CMapEncoder_ToUnicode (HPDF_Encoder encoder,
|
|
||||||
HPDF_UINT16 code);
|
|
||||||
|
|
||||||
HPDF_UINT16
|
|
||||||
HPDF_CMapEncoder_ToCID (HPDF_Encoder encoder,
|
|
||||||
HPDF_UINT16 code);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_SetParseText (HPDF_Encoder encoder,
|
|
||||||
HPDF_ParseText_Rec *state,
|
|
||||||
const HPDF_BYTE *text,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
HPDF_ByteType
|
|
||||||
HPDF_CMapEncoder_ByteType (HPDF_Encoder encoder,
|
|
||||||
HPDF_ParseText_Rec *state);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_AddCMap (HPDF_Encoder encoder,
|
|
||||||
const HPDF_CidRange_Rec *range);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_AddNotDefRange (HPDF_Encoder encoder,
|
|
||||||
HPDF_CidRange_Rec range);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_AddCodeSpaceRange (HPDF_Encoder encoder,
|
|
||||||
HPDF_CidRange_Rec range);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_CMapEncoder_SetUnicodeArray (HPDF_Encoder encoder,
|
|
||||||
const HPDF_UnicodeMap_Rec *array1);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CMapEncoder_AddJWWLineHead (HPDF_Encoder encoder,
|
|
||||||
const HPDF_UINT16 *code);
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Encoder_CheckJWWLineHead (HPDF_Encoder encoder,
|
|
||||||
const HPDF_UINT16 code);
|
|
||||||
|
|
||||||
/*-- utility functions ----------------------------------*/
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_UnicodeToGryphName (HPDF_UNICODE unicode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UNICODE
|
|
||||||
HPDF_GryphNameToUnicode (const char *gryph_name);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_ENCODER_H */
|
|
||||||
|
|
||||||
@ -1,159 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_encrypt.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* The code implements MD5 message-digest algorithm is based on the code
|
|
||||||
* written by Colin Plumb.
|
|
||||||
* The copyright of it is as follows.
|
|
||||||
*
|
|
||||||
* This code implements the MD5 message-digest algorithm.
|
|
||||||
* The algorithm is due to Ron Rivest. This code was
|
|
||||||
* written by Colin Plumb in 1993, no copyright is claimed.
|
|
||||||
* This code is in the public domain; do with it what you wish.
|
|
||||||
*
|
|
||||||
* Equivalent code is available from RSA Data Security, Inc.
|
|
||||||
* This code has been tested against that, and is equivalent,
|
|
||||||
* except that you don't need to include two pages of legalese
|
|
||||||
* with every copy.
|
|
||||||
*
|
|
||||||
* To compute the message digest of a chunk of bytes, declare an
|
|
||||||
* MD5Context structure, pass it to MD5Init, call MD5Update as
|
|
||||||
* needed on buffers full of bytes, and then call MD5Final, which
|
|
||||||
* will fill a supplied 16-byte array with the digest.
|
|
||||||
*
|
|
||||||
*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef HPDF_ENCRYPT_H
|
|
||||||
#define HPDF_ENCRYPT_H
|
|
||||||
|
|
||||||
#include "hpdf_mmgr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- encrypt-dict ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_ID_LEN 16
|
|
||||||
#define HPDF_PASSWD_LEN 32
|
|
||||||
#define HPDF_ENCRYPT_KEY_MAX 16
|
|
||||||
#define HPDF_MD5_KEY_LEN 16
|
|
||||||
#define HPDF_PERMISSION_PAD 0xFFFFFFC0
|
|
||||||
#define HPDF_ARC4_BUF_SIZE 256
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct HPDF_MD5Context
|
|
||||||
{
|
|
||||||
HPDF_UINT32 buf[4];
|
|
||||||
HPDF_UINT32 bits[2];
|
|
||||||
HPDF_BYTE in[64];
|
|
||||||
} HPDF_MD5_CTX;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_ARC4_Ctx_Rec {
|
|
||||||
HPDF_BYTE idx1;
|
|
||||||
HPDF_BYTE idx2;
|
|
||||||
HPDF_BYTE state[HPDF_ARC4_BUF_SIZE];
|
|
||||||
} HPDF_ARC4_Ctx_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Encrypt_Rec *HPDF_Encrypt;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Encrypt_Rec {
|
|
||||||
HPDF_EncryptMode mode;
|
|
||||||
|
|
||||||
/* key_len must be a multiple of 8, and between 40 to 128 */
|
|
||||||
HPDF_UINT key_len;
|
|
||||||
|
|
||||||
/* owner-password (not encrypted) */
|
|
||||||
HPDF_BYTE owner_passwd[HPDF_PASSWD_LEN];
|
|
||||||
|
|
||||||
/* user-password (not encrypted) */
|
|
||||||
HPDF_BYTE user_passwd[HPDF_PASSWD_LEN];
|
|
||||||
|
|
||||||
/* owner-password (encrypted) */
|
|
||||||
HPDF_BYTE owner_key[HPDF_PASSWD_LEN];
|
|
||||||
|
|
||||||
/* user-password (encrypted) */
|
|
||||||
HPDF_BYTE user_key[HPDF_PASSWD_LEN];
|
|
||||||
|
|
||||||
HPDF_INT permission;
|
|
||||||
HPDF_BYTE encrypt_id[HPDF_ID_LEN];
|
|
||||||
HPDF_BYTE encryption_key[HPDF_MD5_KEY_LEN + 5];
|
|
||||||
HPDF_BYTE md5_encryption_key[HPDF_MD5_KEY_LEN];
|
|
||||||
HPDF_ARC4_Ctx_Rec arc4ctx;
|
|
||||||
} HPDF_Encrypt_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_MD5Init (struct HPDF_MD5Context *ctx);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_MD5Update (struct HPDF_MD5Context *ctx,
|
|
||||||
const HPDF_BYTE *buf,
|
|
||||||
HPDF_UINT32 len);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_MD5Final (HPDF_BYTE digest[16],
|
|
||||||
struct HPDF_MD5Context *ctx);
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_PadOrTrancatePasswd (const char *pwd,
|
|
||||||
HPDF_BYTE *new_pwd);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_Init (HPDF_Encrypt attr);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_CreateUserKey (HPDF_Encrypt attr);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_CreateOwnerKey (HPDF_Encrypt attr);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_CreateEncryptionKey (HPDF_Encrypt attr);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_InitKey (HPDF_Encrypt attr,
|
|
||||||
HPDF_UINT32 object_id,
|
|
||||||
HPDF_UINT16 gen_no);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_Reset (HPDF_Encrypt attr);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Encrypt_CryptBuf (HPDF_Encrypt attr,
|
|
||||||
const HPDF_BYTE *src,
|
|
||||||
HPDF_BYTE *dst,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_ENCRYPT_H */
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_encryptdict.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_ENCRYPTDICT_H
|
|
||||||
#define _HPDF_ENCRYPTDICT_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ HPDF_EncryptDict ---------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_EncryptDict
|
|
||||||
HPDF_EncryptDict_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_EncryptDict_CreateID (HPDF_EncryptDict dict,
|
|
||||||
HPDF_Dict info,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_EncryptDict_OnFree (HPDF_Dict obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_EncryptDict_SetPassword (HPDF_EncryptDict dict,
|
|
||||||
const char *owner_passwd,
|
|
||||||
const char *user_passwd);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_EncryptDict_Validate (HPDF_EncryptDict dict);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_EncryptDict_Prepare (HPDF_EncryptDict dict,
|
|
||||||
HPDF_Dict info,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Encrypt
|
|
||||||
HPDF_EncryptDict_GetAttr (HPDF_EncryptDict dict);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_ENCRYPTDICT_H */
|
|
||||||
|
|
||||||
@ -1,203 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_error.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_ERROR_H
|
|
||||||
#define _HPDF_ERROR_H
|
|
||||||
|
|
||||||
#include "hpdf_types.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* error-code */
|
|
||||||
#define HPDF_ARRAY_COUNT_ERR 0x1001
|
|
||||||
#define HPDF_ARRAY_ITEM_NOT_FOUND 0x1002
|
|
||||||
#define HPDF_ARRAY_ITEM_UNEXPECTED_TYPE 0x1003
|
|
||||||
#define HPDF_BINARY_LENGTH_ERR 0x1004
|
|
||||||
#define HPDF_CANNOT_GET_PALLET 0x1005
|
|
||||||
#define HPDF_DICT_COUNT_ERR 0x1007
|
|
||||||
#define HPDF_DICT_ITEM_NOT_FOUND 0x1008
|
|
||||||
#define HPDF_DICT_ITEM_UNEXPECTED_TYPE 0x1009
|
|
||||||
#define HPDF_DICT_STREAM_LENGTH_NOT_FOUND 0x100A
|
|
||||||
#define HPDF_DOC_ENCRYPTDICT_NOT_FOUND 0x100B
|
|
||||||
#define HPDF_DOC_INVALID_OBJECT 0x100C
|
|
||||||
/* 0x100D */
|
|
||||||
#define HPDF_DUPLICATE_REGISTRATION 0x100E
|
|
||||||
#define HPDF_EXCEED_JWW_CODE_NUM_LIMIT 0x100F
|
|
||||||
/* 0x1010 */
|
|
||||||
#define HPDF_ENCRYPT_INVALID_PASSWORD 0x1011
|
|
||||||
/* 0x1012 */
|
|
||||||
#define HPDF_ERR_UNKNOWN_CLASS 0x1013
|
|
||||||
#define HPDF_EXCEED_GSTATE_LIMIT 0x1014
|
|
||||||
#define HPDF_FAILD_TO_ALLOC_MEM 0x1015
|
|
||||||
#define HPDF_FILE_IO_ERROR 0x1016
|
|
||||||
#define HPDF_FILE_OPEN_ERROR 0x1017
|
|
||||||
/* 0x1018 */
|
|
||||||
#define HPDF_FONT_EXISTS 0x1019
|
|
||||||
#define HPDF_FONT_INVALID_WIDTHS_TABLE 0x101A
|
|
||||||
#define HPDF_INVALID_AFM_HEADER 0x101B
|
|
||||||
#define HPDF_INVALID_ANNOTATION 0x101C
|
|
||||||
/* 0x101D */
|
|
||||||
#define HPDF_INVALID_BIT_PER_COMPONENT 0x101E
|
|
||||||
#define HPDF_INVALID_CHAR_MATRICS_DATA 0x101F
|
|
||||||
#define HPDF_INVALID_COLOR_SPACE 0x1020
|
|
||||||
#define HPDF_INVALID_COMPRESSION_MODE 0x1021
|
|
||||||
#define HPDF_INVALID_DATE_TIME 0x1022
|
|
||||||
#define HPDF_INVALID_DESTINATION 0x1023
|
|
||||||
/* 0x1024 */
|
|
||||||
#define HPDF_INVALID_DOCUMENT 0x1025
|
|
||||||
#define HPDF_INVALID_DOCUMENT_STATE 0x1026
|
|
||||||
#define HPDF_INVALID_ENCODER 0x1027
|
|
||||||
#define HPDF_INVALID_ENCODER_TYPE 0x1028
|
|
||||||
/* 0x1029 */
|
|
||||||
/* 0x102A */
|
|
||||||
#define HPDF_INVALID_ENCODING_NAME 0x102B
|
|
||||||
#define HPDF_INVALID_ENCRYPT_KEY_LEN 0x102C
|
|
||||||
#define HPDF_INVALID_FONTDEF_DATA 0x102D
|
|
||||||
#define HPDF_INVALID_FONTDEF_TYPE 0x102E
|
|
||||||
#define HPDF_INVALID_FONT_NAME 0x102F
|
|
||||||
#define HPDF_INVALID_IMAGE 0x1030
|
|
||||||
#define HPDF_INVALID_JPEG_DATA 0x1031
|
|
||||||
#define HPDF_INVALID_N_DATA 0x1032
|
|
||||||
#define HPDF_INVALID_OBJECT 0x1033
|
|
||||||
#define HPDF_INVALID_OBJ_ID 0x1034
|
|
||||||
#define HPDF_INVALID_OPERATION 0x1035
|
|
||||||
#define HPDF_INVALID_OUTLINE 0x1036
|
|
||||||
#define HPDF_INVALID_PAGE 0x1037
|
|
||||||
#define HPDF_INVALID_PAGES 0x1038
|
|
||||||
#define HPDF_INVALID_PARAMETER 0x1039
|
|
||||||
/* 0x103A */
|
|
||||||
#define HPDF_INVALID_PNG_IMAGE 0x103B
|
|
||||||
#define HPDF_INVALID_STREAM 0x103C
|
|
||||||
#define HPDF_MISSING_FILE_NAME_ENTRY 0x103D
|
|
||||||
/* 0x103E */
|
|
||||||
#define HPDF_INVALID_TTC_FILE 0x103F
|
|
||||||
#define HPDF_INVALID_TTC_INDEX 0x1040
|
|
||||||
#define HPDF_INVALID_WX_DATA 0x1041
|
|
||||||
#define HPDF_ITEM_NOT_FOUND 0x1042
|
|
||||||
#define HPDF_LIBPNG_ERROR 0x1043
|
|
||||||
#define HPDF_NAME_INVALID_VALUE 0x1044
|
|
||||||
#define HPDF_NAME_OUT_OF_RANGE 0x1045
|
|
||||||
/* 0x1046 */
|
|
||||||
/* 0x1047 */
|
|
||||||
#define HPDF_PAGE_INVALID_PARAM_COUNT 0x1048
|
|
||||||
#define HPDF_PAGES_MISSING_KIDS_ENTRY 0x1049
|
|
||||||
#define HPDF_PAGE_CANNOT_FIND_OBJECT 0x104A
|
|
||||||
#define HPDF_PAGE_CANNOT_GET_ROOT_PAGES 0x104B
|
|
||||||
#define HPDF_PAGE_CANNOT_RESTORE_GSTATE 0x104C
|
|
||||||
#define HPDF_PAGE_CANNOT_SET_PARENT 0x104D
|
|
||||||
#define HPDF_PAGE_FONT_NOT_FOUND 0x104E
|
|
||||||
#define HPDF_PAGE_INVALID_FONT 0x104F
|
|
||||||
#define HPDF_PAGE_INVALID_FONT_SIZE 0x1050
|
|
||||||
#define HPDF_PAGE_INVALID_GMODE 0x1051
|
|
||||||
#define HPDF_PAGE_INVALID_INDEX 0x1052
|
|
||||||
#define HPDF_PAGE_INVALID_ROTATE_VALUE 0x1053
|
|
||||||
#define HPDF_PAGE_INVALID_SIZE 0x1054
|
|
||||||
#define HPDF_PAGE_INVALID_XOBJECT 0x1055
|
|
||||||
#define HPDF_PAGE_OUT_OF_RANGE 0x1056
|
|
||||||
#define HPDF_REAL_OUT_OF_RANGE 0x1057
|
|
||||||
#define HPDF_STREAM_EOF 0x1058
|
|
||||||
#define HPDF_STREAM_READLN_CONTINUE 0x1059
|
|
||||||
/* 0x105A */
|
|
||||||
#define HPDF_STRING_OUT_OF_RANGE 0x105B
|
|
||||||
#define HPDF_THIS_FUNC_WAS_SKIPPED 0x105C
|
|
||||||
#define HPDF_TTF_CANNOT_EMBEDDING_FONT 0x105D
|
|
||||||
#define HPDF_TTF_INVALID_CMAP 0x105E
|
|
||||||
#define HPDF_TTF_INVALID_FOMAT 0x105F
|
|
||||||
#define HPDF_TTF_MISSING_TABLE 0x1060
|
|
||||||
#define HPDF_UNSUPPORTED_FONT_TYPE 0x1061
|
|
||||||
#define HPDF_UNSUPPORTED_FUNC 0x1062
|
|
||||||
#define HPDF_UNSUPPORTED_JPEG_FORMAT 0x1063
|
|
||||||
#define HPDF_UNSUPPORTED_TYPE1_FONT 0x1064
|
|
||||||
#define HPDF_XREF_COUNT_ERR 0x1065
|
|
||||||
#define HPDF_ZLIB_ERROR 0x1066
|
|
||||||
#define HPDF_INVALID_PAGE_INDEX 0x1067
|
|
||||||
#define HPDF_INVALID_URI 0x1068
|
|
||||||
#define HPDF_PAGE_LAYOUT_OUT_OF_RANGE 0x1069
|
|
||||||
#define HPDF_PAGE_MODE_OUT_OF_RANGE 0x1070
|
|
||||||
#define HPDF_PAGE_NUM_STYLE_OUT_OF_RANGE 0x1071
|
|
||||||
#define HPDF_ANNOT_INVALID_ICON 0x1072
|
|
||||||
#define HPDF_ANNOT_INVALID_BORDER_STYLE 0x1073
|
|
||||||
#define HPDF_PAGE_INVALID_DIRECTION 0x1074
|
|
||||||
#define HPDF_INVALID_FONT 0x1075
|
|
||||||
#define HPDF_PAGE_INSUFFICIENT_SPACE 0x1076
|
|
||||||
#define HPDF_PAGE_INVALID_DISPLAY_TIME 0x1077
|
|
||||||
#define HPDF_PAGE_INVALID_TRANSITION_TIME 0x1078
|
|
||||||
#define HPDF_INVALID_PAGE_SLIDESHOW_TYPE 0x1079
|
|
||||||
#define HPDF_EXT_GSTATE_OUT_OF_RANGE 0x1080
|
|
||||||
#define HPDF_INVALID_EXT_GSTATE 0x1081
|
|
||||||
#define HPDF_EXT_GSTATE_READ_ONLY 0x1082
|
|
||||||
#define HPDF_INVALID_U3D_DATA 0x1083
|
|
||||||
#define HPDF_NAME_CANNOT_GET_NAMES 0x1084
|
|
||||||
#define HPDF_INVALID_ICC_COMPONENT_NUM 0x1085
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Error ----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Error_Rec *HPDF_Error;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Error_Rec {
|
|
||||||
HPDF_STATUS error_no;
|
|
||||||
HPDF_STATUS detail_no;
|
|
||||||
HPDF_Error_Handler error_fn;
|
|
||||||
void *user_data;
|
|
||||||
} HPDF_Error_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
/* HPDF_Error_init
|
|
||||||
*
|
|
||||||
* if error_fn is NULL, the default-handlers are set as error-handler.
|
|
||||||
* user_data is used to identify the object which threw an error.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
HPDF_Error_Init (HPDF_Error error,
|
|
||||||
void *user_data);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Error_Reset (HPDF_Error error);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Error_GetCode (HPDF_Error error);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Error_GetDetailCode (HPDF_Error error);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_SetError (HPDF_Error error,
|
|
||||||
HPDF_STATUS error_no,
|
|
||||||
HPDF_STATUS detail_no);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_RaiseError (HPDF_Error error,
|
|
||||||
HPDF_STATUS error_no,
|
|
||||||
HPDF_STATUS detail_no);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_ERROR_H */
|
|
||||||
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_annotation.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_EXDATA_H
|
|
||||||
#define _HPDF_EXDATA_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ HPDF_ExData -----------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_ExData
|
|
||||||
HPDF_3DAnnotExData_New(HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_EXDATA_H */
|
|
||||||
|
|
||||||
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_ext_gstate.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_EXT_GSTATE_H
|
|
||||||
#define _HPDF_EXT_GSTATE_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_Dict
|
|
||||||
HPDF_ExtGState_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_ExtGState_Validate (HPDF_ExtGState ext_gstate);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_EXT_GSTATE_H */
|
|
||||||
|
|
||||||
@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_font.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_FONT_H
|
|
||||||
#define _HPDF_FONT_H
|
|
||||||
|
|
||||||
#include "hpdf_fontdef.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- Writing Mode ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_FontType {
|
|
||||||
HPDF_FONT_TYPE1 = 0,
|
|
||||||
HPDF_FONT_TRUETYPE,
|
|
||||||
HPDF_FONT_TYPE3,
|
|
||||||
HPDF_FONT_TYPE0_CID,
|
|
||||||
HPDF_FONT_TYPE0_TT,
|
|
||||||
HPDF_FONT_CID_TYPE0,
|
|
||||||
HPDF_FONT_CID_TYPE2,
|
|
||||||
HPDF_FONT_MMTYPE1
|
|
||||||
} HPDF_FontType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_Dict HPDF_Font;
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_TextWidth
|
|
||||||
(*HPDF_Font_TextWidths_Func) (HPDF_Font font,
|
|
||||||
const HPDF_BYTE *text,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_UINT
|
|
||||||
(*HPDF_Font_MeasureText_Func) (HPDF_Font font,
|
|
||||||
const HPDF_BYTE *text,
|
|
||||||
HPDF_UINT len,
|
|
||||||
HPDF_REAL width,
|
|
||||||
HPDF_REAL fontsize,
|
|
||||||
HPDF_REAL charspace,
|
|
||||||
HPDF_REAL wordspace,
|
|
||||||
HPDF_BOOL wordwrap,
|
|
||||||
HPDF_REAL *real_width);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_FontAttr_Rec *HPDF_FontAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_FontAttr_Rec {
|
|
||||||
HPDF_FontType type;
|
|
||||||
HPDF_WritingMode writing_mode;
|
|
||||||
HPDF_Font_TextWidths_Func text_width_fn;
|
|
||||||
HPDF_Font_MeasureText_Func measure_text_fn;
|
|
||||||
HPDF_FontDef fontdef;
|
|
||||||
HPDF_Encoder encoder;
|
|
||||||
|
|
||||||
/* if the encoding-type is HPDF_ENCODER_TYPE_SINGLE_BYTE, the width of
|
|
||||||
* each charactors are cashed in 'widths'.
|
|
||||||
* when HPDF_ENCODER_TYPE_DOUBLE_BYTE the width is calculate each time.
|
|
||||||
*/
|
|
||||||
HPDF_INT16* widths;
|
|
||||||
HPDF_BYTE* used;
|
|
||||||
|
|
||||||
HPDF_Xref xref;
|
|
||||||
HPDF_Font descendant_font;
|
|
||||||
HPDF_Dict map_stream;
|
|
||||||
HPDF_Dict cmap_stream;
|
|
||||||
} HPDF_FontAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Font
|
|
||||||
HPDF_Type1Font_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_FontDef fontdef,
|
|
||||||
HPDF_Encoder encoder,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_Font
|
|
||||||
HPDF_TTFont_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_FontDef fontdef,
|
|
||||||
HPDF_Encoder encoder,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_Font
|
|
||||||
HPDF_Type0Font_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_FontDef fontdef,
|
|
||||||
HPDF_Encoder encoder,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Font_Validate (HPDF_Font font);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_FONT_H */
|
|
||||||
|
|
||||||
@ -1,406 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_fontdef.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_FONTDEF_H
|
|
||||||
#define _HPDF_FONTDEF_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define HPDF_FONTDEF_SIG_BYTES 0x464F4E54L
|
|
||||||
|
|
||||||
/*------ collection of flags for defining characteristics. ---*/
|
|
||||||
|
|
||||||
#define HPDF_FONT_FIXED_WIDTH 1
|
|
||||||
#define HPDF_FONT_SERIF 2
|
|
||||||
#define HPDF_FONT_SYMBOLIC 4
|
|
||||||
#define HPDF_FONT_SCRIPT 8
|
|
||||||
/* Reserved 16 */
|
|
||||||
#define HPDF_FONT_STD_CHARSET 32
|
|
||||||
#define HPDF_FONT_ITALIC 64
|
|
||||||
/* Reserved 128
|
|
||||||
Reserved 256
|
|
||||||
Reserved 512
|
|
||||||
Reserved 1024
|
|
||||||
Reserved 2048
|
|
||||||
Reserved 4096
|
|
||||||
Reserved 8192
|
|
||||||
Reserved 16384
|
|
||||||
Reserved 32768 */
|
|
||||||
#define HPDF_FONT_ALL_CAP 65536
|
|
||||||
#define HPDF_FONT_SMALL_CAP 131072
|
|
||||||
#define HPDF_FONT_FOURCE_BOLD 262144
|
|
||||||
|
|
||||||
#define HPDF_CID_W_TYPE_FROM_TO 0
|
|
||||||
#define HPDF_CID_W_TYPE_FROM_ARRAY 1
|
|
||||||
|
|
||||||
/*-- HPDF_FontDef ---------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_CharData {
|
|
||||||
HPDF_INT16 char_cd;
|
|
||||||
HPDF_UNICODE unicode;
|
|
||||||
HPDF_INT16 width;
|
|
||||||
} HPDF_CharData;
|
|
||||||
|
|
||||||
typedef enum _HPDF_FontDefType {
|
|
||||||
HPDF_FONTDEF_TYPE_TYPE1,
|
|
||||||
HPDF_FONTDEF_TYPE_TRUETYPE,
|
|
||||||
HPDF_FONTDEF_TYPE_CID,
|
|
||||||
HPDF_FONTDEF_TYPE_UNINITIALIZED,
|
|
||||||
HPDF_FONTDEF_TYPE_EOF
|
|
||||||
} HPDF_FontDefType;
|
|
||||||
|
|
||||||
typedef struct _HPDF_CID_Width {
|
|
||||||
HPDF_UINT16 cid;
|
|
||||||
HPDF_INT16 width;
|
|
||||||
} HPDF_CID_Width;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_FontDef ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_FontDef_Rec *HPDF_FontDef;
|
|
||||||
|
|
||||||
typedef void (*HPDF_FontDef_FreeFunc) (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
typedef void (*HPDF_FontDef_CleanFunc) (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
typedef HPDF_STATUS (*HPDF_FontDef_InitFunc) (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
typedef struct _HPDF_FontDef_Rec {
|
|
||||||
HPDF_UINT32 sig_bytes;
|
|
||||||
char base_font[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_FontDefType type;
|
|
||||||
HPDF_FontDef_CleanFunc clean_fn;
|
|
||||||
HPDF_FontDef_FreeFunc free_fn;
|
|
||||||
HPDF_FontDef_InitFunc init_fn;
|
|
||||||
|
|
||||||
HPDF_INT16 ascent;
|
|
||||||
HPDF_INT16 descent;
|
|
||||||
HPDF_UINT flags;
|
|
||||||
HPDF_Box font_bbox;
|
|
||||||
HPDF_INT16 italic_angle;
|
|
||||||
HPDF_UINT16 stemv;
|
|
||||||
HPDF_INT16 avg_width;
|
|
||||||
HPDF_INT16 max_width;
|
|
||||||
HPDF_INT16 missing_width;
|
|
||||||
HPDF_UINT16 stemh;
|
|
||||||
HPDF_UINT16 x_height;
|
|
||||||
HPDF_UINT16 cap_height;
|
|
||||||
|
|
||||||
/* the initial value of descriptor entry is NULL.
|
|
||||||
* when first font-object besed on the fontdef object is created,
|
|
||||||
* the font-descriptor object is created and descriptor entry is set.
|
|
||||||
*/
|
|
||||||
HPDF_Dict descriptor;
|
|
||||||
HPDF_Stream data;
|
|
||||||
|
|
||||||
HPDF_BOOL valid;
|
|
||||||
void *attr;
|
|
||||||
} HPDF_FontDef_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_FontDef_Free (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_FontDef_Cleanup (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_FontDef_Validate (HPDF_FontDef fontdef);
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Type1FontDef ---------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Type1FontDefAttrRec *HPDF_Type1FontDefAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Type1FontDefAttrRec {
|
|
||||||
HPDF_BYTE first_char; /* Required */
|
|
||||||
HPDF_BYTE last_char; /* Required */
|
|
||||||
HPDF_CharData *widths; /* Required */
|
|
||||||
HPDF_UINT widths_count;
|
|
||||||
|
|
||||||
HPDF_INT16 leading;
|
|
||||||
char *char_set;
|
|
||||||
char encoding_scheme[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_UINT length1;
|
|
||||||
HPDF_UINT length2;
|
|
||||||
HPDF_UINT length3;
|
|
||||||
HPDF_BOOL is_base14font;
|
|
||||||
HPDF_BOOL is_fixed_pitch;
|
|
||||||
|
|
||||||
HPDF_Stream font_data;
|
|
||||||
} HPDF_Type1FontDefAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_Type1FontDef_New (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_Type1FontDef_Load (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream afm,
|
|
||||||
HPDF_Stream font_data);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_Type1FontDef_Duplicate (HPDF_MMgr mmgr,
|
|
||||||
HPDF_FontDef src);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Type1FontDef_SetWidths (HPDF_FontDef fontdef,
|
|
||||||
const HPDF_CharData *widths);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT16
|
|
||||||
HPDF_Type1FontDef_GetWidthByName (HPDF_FontDef fontdef,
|
|
||||||
const char *gryph_name);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT16
|
|
||||||
HPDF_Type1FontDef_GetWidth (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UNICODE unicode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_Base14FontDef_New (HPDF_MMgr mmgr,
|
|
||||||
const char *font_name);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_TTFontDef ------------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_TTF_FONT_TAG_LEN 6
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_Table {
|
|
||||||
char tag[4];
|
|
||||||
HPDF_UINT32 check_sum;
|
|
||||||
HPDF_UINT32 offset;
|
|
||||||
HPDF_UINT32 length;
|
|
||||||
} HPDF_TTFTable;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_OffsetTbl {
|
|
||||||
HPDF_UINT32 sfnt_version;
|
|
||||||
HPDF_UINT16 num_tables;
|
|
||||||
HPDF_UINT16 search_range;
|
|
||||||
HPDF_UINT16 entry_selector;
|
|
||||||
HPDF_UINT16 range_shift;
|
|
||||||
HPDF_TTFTable *table;
|
|
||||||
} HPDF_TTF_OffsetTbl;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_CmapRange {
|
|
||||||
HPDF_UINT16 format;
|
|
||||||
HPDF_UINT16 length;
|
|
||||||
HPDF_UINT16 language;
|
|
||||||
HPDF_UINT16 seg_count_x2;
|
|
||||||
HPDF_UINT16 search_range;
|
|
||||||
HPDF_UINT16 entry_selector;
|
|
||||||
HPDF_UINT16 range_shift;
|
|
||||||
HPDF_UINT16 *end_count;
|
|
||||||
HPDF_UINT16 reserved_pad;
|
|
||||||
HPDF_UINT16 *start_count;
|
|
||||||
HPDF_INT16 *id_delta;
|
|
||||||
HPDF_UINT16 *id_range_offset;
|
|
||||||
HPDF_UINT16 *glyph_id_array;
|
|
||||||
HPDF_UINT glyph_id_array_count;
|
|
||||||
} HPDF_TTF_CmapRange;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_GryphOffsets {
|
|
||||||
HPDF_UINT32 base_offset;
|
|
||||||
HPDF_UINT32 *offsets;
|
|
||||||
HPDF_BYTE *flgs; /* 0: unused, 1: used */
|
|
||||||
} HPDF_TTF_GryphOffsets;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_LongHorMetric {
|
|
||||||
HPDF_UINT16 advance_width;
|
|
||||||
HPDF_INT16 lsb;
|
|
||||||
} HPDF_TTF_LongHorMetric;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_FontHeader {
|
|
||||||
HPDF_BYTE version_number[4];
|
|
||||||
HPDF_UINT32 font_revision;
|
|
||||||
HPDF_UINT32 check_sum_adjustment;
|
|
||||||
HPDF_UINT32 magic_number;
|
|
||||||
HPDF_UINT16 flags;
|
|
||||||
HPDF_UINT16 units_per_em;
|
|
||||||
HPDF_BYTE created[8];
|
|
||||||
HPDF_BYTE modified[8];
|
|
||||||
HPDF_INT16 x_min;
|
|
||||||
HPDF_INT16 y_min;
|
|
||||||
HPDF_INT16 x_max;
|
|
||||||
HPDF_INT16 y_max;
|
|
||||||
HPDF_UINT16 mac_style;
|
|
||||||
HPDF_UINT16 lowest_rec_ppem;
|
|
||||||
HPDF_INT16 font_direction_hint;
|
|
||||||
HPDF_INT16 index_to_loc_format;
|
|
||||||
HPDF_INT16 glyph_data_format;
|
|
||||||
} HPDF_TTF_FontHeader;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_NameRecord {
|
|
||||||
HPDF_UINT16 platform_id;
|
|
||||||
HPDF_UINT16 encoding_id;
|
|
||||||
HPDF_UINT16 language_id;
|
|
||||||
HPDF_UINT16 name_id;
|
|
||||||
HPDF_UINT16 length;
|
|
||||||
HPDF_UINT16 offset;
|
|
||||||
} HPDF_TTF_NameRecord;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTF_NamingTable {
|
|
||||||
HPDF_UINT16 format;
|
|
||||||
HPDF_UINT16 count;
|
|
||||||
HPDF_UINT16 string_offset;
|
|
||||||
HPDF_TTF_NameRecord *name_records;
|
|
||||||
} HPDF_TTF_NamingTable;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTFontDefAttr_Rec *HPDF_TTFontDefAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_TTFontDefAttr_Rec {
|
|
||||||
char base_font[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
HPDF_BYTE first_char;
|
|
||||||
HPDF_BYTE last_char;
|
|
||||||
char *char_set;
|
|
||||||
char tag_name[HPDF_TTF_FONT_TAG_LEN + 1];
|
|
||||||
char tag_name2[(HPDF_TTF_FONT_TAG_LEN + 1) * 2];
|
|
||||||
HPDF_TTF_FontHeader header;
|
|
||||||
HPDF_TTF_GryphOffsets glyph_tbl;
|
|
||||||
HPDF_UINT16 num_glyphs;
|
|
||||||
HPDF_TTF_NamingTable name_tbl;
|
|
||||||
HPDF_TTF_LongHorMetric *h_metric;
|
|
||||||
HPDF_UINT16 num_h_metric;
|
|
||||||
HPDF_TTF_OffsetTbl offset_tbl;
|
|
||||||
HPDF_TTF_CmapRange cmap;
|
|
||||||
HPDF_UINT16 fs_type;
|
|
||||||
HPDF_BYTE sfamilyclass[2];
|
|
||||||
HPDF_BYTE panose[10];
|
|
||||||
HPDF_UINT32 code_page_range1;
|
|
||||||
HPDF_UINT32 code_page_range2;
|
|
||||||
|
|
||||||
HPDF_UINT length1;
|
|
||||||
|
|
||||||
HPDF_BOOL embedding;
|
|
||||||
HPDF_BOOL is_cidfont;
|
|
||||||
|
|
||||||
HPDF_Stream stream;
|
|
||||||
} HPDF_TTFontDefAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_TTFontDef_New (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_TTFontDef_Load (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_BOOL embedding);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_TTFontDef_Load2 (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_UINT index,
|
|
||||||
HPDF_BOOL embedding);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT16
|
|
||||||
HPDF_TTFontDef_GetGlyphid (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UINT16 unicode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT16
|
|
||||||
HPDF_TTFontDef_GetCharWidth (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UINT16 unicode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT16
|
|
||||||
HPDF_TTFontDef_GetGidWidth (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UINT16 gid);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_TTFontDef_SaveFontData (HPDF_FontDef fontdef,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Box
|
|
||||||
HPDF_TTFontDef_GetCharBBox (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UINT16 unicode);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_TTFontDef_SetTagName (HPDF_FontDef fontdef,
|
|
||||||
char *tag);
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_CIDFontDef -----------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_CIDFontDefAttrRec *HPDF_CIDFontDefAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_CIDFontDefAttrRec {
|
|
||||||
HPDF_List widths;
|
|
||||||
HPDF_INT16 DW;
|
|
||||||
HPDF_INT16 DW2[2];
|
|
||||||
} HPDF_CIDFontDefAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_FontDef
|
|
||||||
HPDF_CIDFontDef_New (HPDF_MMgr mmgr,
|
|
||||||
char *name,
|
|
||||||
HPDF_FontDef_InitFunc init_fn);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CIDFontDef_AddWidth (HPDF_FontDef fontdef,
|
|
||||||
const HPDF_CID_Width *widths);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT16
|
|
||||||
HPDF_CIDFontDef_GetCIDWidth (HPDF_FontDef fontdef,
|
|
||||||
HPDF_UINT16 cid);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_CIDFontDef_ChangeStyle (HPDF_FontDef fontdef,
|
|
||||||
HPDF_BOOL bold,
|
|
||||||
HPDF_BOOL italic);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_FONTDEF_H */
|
|
||||||
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_gstate.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_GSTATE_H
|
|
||||||
#define _HPDF_GSTATE_H
|
|
||||||
|
|
||||||
#include "hpdf_font.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ graphic state stack -------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_GState_Rec *HPDF_GState;
|
|
||||||
|
|
||||||
typedef struct _HPDF_GState_Rec {
|
|
||||||
HPDF_TransMatrix trans_matrix;
|
|
||||||
HPDF_REAL line_width;
|
|
||||||
HPDF_LineCap line_cap;
|
|
||||||
HPDF_LineJoin line_join;
|
|
||||||
HPDF_REAL miter_limit;
|
|
||||||
HPDF_DashMode dash_mode;
|
|
||||||
HPDF_REAL flatness;
|
|
||||||
|
|
||||||
HPDF_REAL char_space;
|
|
||||||
HPDF_REAL word_space;
|
|
||||||
HPDF_REAL h_scalling;
|
|
||||||
HPDF_REAL text_leading;
|
|
||||||
HPDF_TextRenderingMode rendering_mode;
|
|
||||||
HPDF_REAL text_rise;
|
|
||||||
|
|
||||||
HPDF_ColorSpace cs_fill;
|
|
||||||
HPDF_ColorSpace cs_stroke;
|
|
||||||
HPDF_RGBColor rgb_fill;
|
|
||||||
HPDF_RGBColor rgb_stroke;
|
|
||||||
HPDF_CMYKColor cmyk_fill;
|
|
||||||
HPDF_CMYKColor cmyk_stroke;
|
|
||||||
HPDF_REAL gray_fill;
|
|
||||||
HPDF_REAL gray_stroke;
|
|
||||||
|
|
||||||
HPDF_Font font;
|
|
||||||
HPDF_REAL font_size;
|
|
||||||
HPDF_WritingMode writing_mode;
|
|
||||||
|
|
||||||
HPDF_GState prev;
|
|
||||||
HPDF_UINT depth;
|
|
||||||
} HPDF_GState_Rec;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_GState
|
|
||||||
HPDF_GState_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_GState current);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_GState
|
|
||||||
HPDF_GState_Free (HPDF_MMgr mmgr,
|
|
||||||
HPDF_GState gstate);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_GSTATE_H */
|
|
||||||
|
|
||||||
@ -1,99 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_image.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_IMAGE_H
|
|
||||||
#define _HPDF_IMAGE_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_Load1BitImageFromMem (HPDF_MMgr mmgr,
|
|
||||||
const HPDF_BYTE *buf,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_UINT width,
|
|
||||||
HPDF_UINT height,
|
|
||||||
HPDF_UINT line_width,
|
|
||||||
HPDF_BOOL top_is_first
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef LIBHPDF_HAVE_NOPNGLIB
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_LoadPngImage (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream png_data,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_BOOL delayed_loading);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_LoadJpegImage (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream jpeg_data,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_LoadJpegImageFromMem (HPDF_MMgr mmgr,
|
|
||||||
const HPDF_BYTE *buf,
|
|
||||||
HPDF_UINT size,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_LoadRawImage (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_UINT width,
|
|
||||||
HPDF_UINT height,
|
|
||||||
HPDF_ColorSpace color_space);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Image
|
|
||||||
HPDF_Image_LoadRawImageFromMem (HPDF_MMgr mmgr,
|
|
||||||
const HPDF_BYTE *buf,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_UINT width,
|
|
||||||
HPDF_UINT height,
|
|
||||||
HPDF_ColorSpace color_space,
|
|
||||||
HPDF_UINT bits_per_component);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Image_Validate (HPDF_Image image);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Image_SetMask (HPDF_Image image,
|
|
||||||
HPDF_BOOL mask);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Image_SetColorSpace (HPDF_Image image,
|
|
||||||
HPDF_Array colorspace);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Image_SetRenderingIntent (HPDF_Image image,
|
|
||||||
const char* intent);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_XOBJECTS_H */
|
|
||||||
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_info.c
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef _HPDF_INFO_H
|
|
||||||
#define _HPDF_INFO_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Info_SetInfoAttr (HPDF_Dict info,
|
|
||||||
HPDF_InfoType type,
|
|
||||||
const char *value,
|
|
||||||
HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Info_GetInfoAttr (HPDF_Dict info,
|
|
||||||
HPDF_InfoType type);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Info_SetInfoDateAttr (HPDF_Dict info,
|
|
||||||
HPDF_InfoType type,
|
|
||||||
HPDF_Date value);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_INFO_H */
|
|
||||||
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_list.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_LIST_H
|
|
||||||
#define _HPDF_LIST_H
|
|
||||||
|
|
||||||
#include "hpdf_error.h"
|
|
||||||
#include "hpdf_mmgr.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _HPDF_List_Rec *HPDF_List;
|
|
||||||
|
|
||||||
typedef struct _HPDF_List_Rec {
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_UINT block_siz;
|
|
||||||
HPDF_UINT items_per_block;
|
|
||||||
HPDF_UINT count;
|
|
||||||
void **obj;
|
|
||||||
} HPDF_List_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_List
|
|
||||||
HPDF_List_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_UINT items_per_block);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_List_Free (HPDF_List list);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_List_Add (HPDF_List list,
|
|
||||||
void *item);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_List_Insert (HPDF_List list,
|
|
||||||
void *target,
|
|
||||||
void *item);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_List_Remove (HPDF_List list,
|
|
||||||
void *item);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_List_RemoveByIndex (HPDF_List list,
|
|
||||||
HPDF_UINT index);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_List_ItemAt (HPDF_List list,
|
|
||||||
HPDF_UINT index);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT32
|
|
||||||
HPDF_List_Find (HPDF_List list,
|
|
||||||
void *item);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_List_Clear (HPDF_List list);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_LIST_H */
|
|
||||||
|
|
||||||
@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_mmgr.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_MMGR_H
|
|
||||||
#define _HPDF_MMGR_H
|
|
||||||
|
|
||||||
#include "hpdf_types.h"
|
|
||||||
#include "hpdf_error.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _HPDF_MPool_Node_Rec *HPDF_MPool_Node;
|
|
||||||
|
|
||||||
typedef struct _HPDF_MPool_Node_Rec {
|
|
||||||
HPDF_BYTE* buf;
|
|
||||||
HPDF_UINT size;
|
|
||||||
HPDF_UINT used_size;
|
|
||||||
HPDF_MPool_Node next_node;
|
|
||||||
} HPDF_MPool_Node_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_MMgr_Rec *HPDF_MMgr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_MMgr_Rec {
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_Alloc_Func alloc_fn;
|
|
||||||
HPDF_Free_Func free_fn;
|
|
||||||
HPDF_MPool_Node mpool;
|
|
||||||
HPDF_UINT buf_size;
|
|
||||||
|
|
||||||
#ifdef HPDF_MEM_DEBUG
|
|
||||||
HPDF_UINT alloc_cnt;
|
|
||||||
HPDF_UINT free_cnt;
|
|
||||||
#endif
|
|
||||||
} HPDF_MMgr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
/* HPDF_mpool_new
|
|
||||||
*
|
|
||||||
* create new HPDF_mpool object. when memory allocation goes wrong,
|
|
||||||
* it returns NULL and error handling function will be called.
|
|
||||||
* if buf_size is non-zero, mmgr is configured to be using memory-pool
|
|
||||||
*/
|
|
||||||
HPDF_MMgr
|
|
||||||
HPDF_MMgr_New (HPDF_Error error,
|
|
||||||
HPDF_UINT buf_size,
|
|
||||||
HPDF_Alloc_Func alloc_fn,
|
|
||||||
HPDF_Free_Func free_fn);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_MMgr_Free (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_GetMem (HPDF_MMgr mmgr,
|
|
||||||
HPDF_UINT size);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_FreeMem (HPDF_MMgr mmgr,
|
|
||||||
void *aptr);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_MMGR_H */
|
|
||||||
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_namedict.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_NAMEDICT_H
|
|
||||||
#define _HPDF_NAMEDICT_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_NameDict
|
|
||||||
HPDF_NameDict_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_NameTree
|
|
||||||
HPDF_NameDict_GetNameTree (HPDF_NameDict namedict,
|
|
||||||
HPDF_NameDictKey key);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_NameDict_SetNameTree (HPDF_NameDict namedict,
|
|
||||||
HPDF_NameDictKey key,
|
|
||||||
HPDF_NameTree tree);
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_NameDict_Validate (HPDF_NameDict namedict);
|
|
||||||
|
|
||||||
|
|
||||||
/*------- NameTree -------*/
|
|
||||||
|
|
||||||
HPDF_NameTree
|
|
||||||
HPDF_NameTree_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_NameTree_Add (HPDF_NameTree tree,
|
|
||||||
HPDF_String name,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_NameTree_Validate (HPDF_NameTree tree);
|
|
||||||
|
|
||||||
|
|
||||||
/*------- EmbeddedFile -------*/
|
|
||||||
|
|
||||||
HPDF_EmbeddedFile
|
|
||||||
HPDF_EmbeddedFile_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
const char *file);
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_EmbeddedFile_Validate (HPDF_EmbeddedFile emfile);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_NAMEDICT_H */
|
|
||||||
|
|
||||||
@ -1,604 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_objects.c
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_OBJECTS_H
|
|
||||||
#define _HPDF_OBJECTS_H
|
|
||||||
|
|
||||||
#include "hpdf_encoder.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* if HPDF_OTYPE_DIRECT bit is set, the object owned by other container
|
|
||||||
* object. if HPDF_OTYPE_INDIRECT bit is set, the object managed by xref.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define HPDF_OTYPE_NONE 0x00000000
|
|
||||||
#define HPDF_OTYPE_DIRECT 0x80000000
|
|
||||||
#define HPDF_OTYPE_INDIRECT 0x40000000
|
|
||||||
#define HPDF_OTYPE_ANY (HPDF_OTYPE_DIRECT | HPDF_OTYPE_INDIRECT)
|
|
||||||
#define HPDF_OTYPE_HIDDEN 0x10000000
|
|
||||||
|
|
||||||
#define HPDF_OCLASS_UNKNOWN 0x0001
|
|
||||||
#define HPDF_OCLASS_NULL 0x0002
|
|
||||||
#define HPDF_OCLASS_BOOLEAN 0x0003
|
|
||||||
#define HPDF_OCLASS_NUMBER 0x0004
|
|
||||||
#define HPDF_OCLASS_REAL 0x0005
|
|
||||||
#define HPDF_OCLASS_NAME 0x0006
|
|
||||||
#define HPDF_OCLASS_STRING 0x0007
|
|
||||||
#define HPDF_OCLASS_BINARY 0x0008
|
|
||||||
#define HPDF_OCLASS_ARRAY 0x0010
|
|
||||||
#define HPDF_OCLASS_DICT 0x0011
|
|
||||||
#define HPDF_OCLASS_PROXY 0x0012
|
|
||||||
#define HPDF_OCLASS_ANY 0x00FF
|
|
||||||
|
|
||||||
#define HPDF_OSUBCLASS_FONT 0x0100
|
|
||||||
#define HPDF_OSUBCLASS_CATALOG 0x0200
|
|
||||||
#define HPDF_OSUBCLASS_PAGES 0x0300
|
|
||||||
#define HPDF_OSUBCLASS_PAGE 0x0400
|
|
||||||
#define HPDF_OSUBCLASS_XOBJECT 0x0500
|
|
||||||
#define HPDF_OSUBCLASS_OUTLINE 0x0600
|
|
||||||
#define HPDF_OSUBCLASS_DESTINATION 0x0700
|
|
||||||
#define HPDF_OSUBCLASS_ANNOTATION 0x0800
|
|
||||||
#define HPDF_OSUBCLASS_ENCRYPT 0x0900
|
|
||||||
#define HPDF_OSUBCLASS_EXT_GSTATE 0x0A00
|
|
||||||
#define HPDF_OSUBCLASS_EXT_GSTATE_R 0x0B00 /* read only object */
|
|
||||||
#define HPDF_OSUBCLASS_NAMEDICT 0x0C00
|
|
||||||
#define HPDF_OSUBCLASS_NAMETREE 0x0D00
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ Values related xref -------------------------------------------------*/
|
|
||||||
|
|
||||||
#define HPDF_FREE_ENTRY 'f'
|
|
||||||
#define HPDF_IN_USE_ENTRY 'n'
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* structure of Object-ID
|
|
||||||
*
|
|
||||||
* 1 direct-object
|
|
||||||
* 2 indirect-object
|
|
||||||
* 3 reserved
|
|
||||||
* 4 shadow-object
|
|
||||||
* 5-8 reserved
|
|
||||||
* 9-32 object-id<EFBFBD>i0-8388607<EFBFBD>j
|
|
||||||
*
|
|
||||||
* the real Object-ID is described "obj_id & 0x00FFFFFF"
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Obj_Header {
|
|
||||||
HPDF_UINT32 obj_id;
|
|
||||||
HPDF_UINT16 gen_no;
|
|
||||||
HPDF_UINT16 obj_class;
|
|
||||||
} HPDF_Obj_Header;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Obj_WriteValue (void *obj,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Obj_Write (void *obj,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Obj_Free (HPDF_MMgr mmgr,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Obj_ForceFree (HPDF_MMgr mmgr,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Null -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Null_Rec *HPDF_Null;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Null_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
} HPDF_Null_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Null
|
|
||||||
HPDF_Null_New (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Boolean --------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Boolean_Rec *HPDF_Boolean;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Boolean_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_BOOL value;
|
|
||||||
} HPDF_Boolean_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Boolean
|
|
||||||
HPDF_Boolean_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_BOOL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Boolean_Write (HPDF_Boolean obj,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Number ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Number_Rec *HPDF_Number;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Number_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_INT32 value;
|
|
||||||
} HPDF_Number_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Number
|
|
||||||
HPDF_Number_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_INT32 value);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Number_SetValue (HPDF_Number obj,
|
|
||||||
HPDF_INT32 value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Number_Write (HPDF_Number obj,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Real -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Real_Rec *HPDF_Real;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Real_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_REAL value;
|
|
||||||
} HPDF_Real_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Real
|
|
||||||
HPDF_Real_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Real_Write (HPDF_Real obj,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Real_SetValue (HPDF_Real obj,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Name -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Name_Rec *HPDF_Name;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Name_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_Error error;
|
|
||||||
char value[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
} HPDF_Name_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Name
|
|
||||||
HPDF_Name_New (HPDF_MMgr mmgr,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Name_SetValue (HPDF_Name obj,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Name_Write (HPDF_Name obj,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Name_GetValue (HPDF_Name obj);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_String ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_String_Rec *HPDF_String;
|
|
||||||
|
|
||||||
typedef struct _HPDF_String_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_Encoder encoder;
|
|
||||||
HPDF_BYTE *value;
|
|
||||||
HPDF_UINT len;
|
|
||||||
} HPDF_String_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_String
|
|
||||||
HPDF_String_New (HPDF_MMgr mmgr,
|
|
||||||
const char *value,
|
|
||||||
HPDF_Encoder encoder);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_String_SetValue (HPDF_String obj,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_String_Free (HPDF_String obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_String_Write (HPDF_String obj,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
HPDF_INT32
|
|
||||||
HPDF_String_Cmp (HPDF_String s1,
|
|
||||||
HPDF_String s2);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Binary ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Binary_Rec *HPDF_Binary;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Binary_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_BYTE *value;
|
|
||||||
HPDF_UINT len;
|
|
||||||
} HPDF_Binary_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Binary
|
|
||||||
HPDF_Binary_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_BYTE *value,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Binary_SetValue (HPDF_Binary obj,
|
|
||||||
HPDF_BYTE *value,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BYTE*
|
|
||||||
HPDF_Binary_GetValue (HPDF_Binary obj);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Binary_Free (HPDF_Binary obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Binary_Write (HPDF_Binary obj,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_Binary_GetLen (HPDF_Binary obj);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Array ----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Array_Rec *HPDF_Array;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Array_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_List list;
|
|
||||||
} HPDF_Array_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Array
|
|
||||||
HPDF_Array_New (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Array
|
|
||||||
HPDF_Box_Array_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Box box);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Array_Free (HPDF_Array array);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_Write (HPDF_Array array,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_Add (HPDF_Array array,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_Insert (HPDF_Array array,
|
|
||||||
void *target,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_Array_GetItem (HPDF_Array array,
|
|
||||||
HPDF_UINT index,
|
|
||||||
HPDF_UINT16 obj_class);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_AddNumber (HPDF_Array array,
|
|
||||||
HPDF_INT32 value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_AddReal (HPDF_Array array,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Array_AddName (HPDF_Array array,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Array_Clear (HPDF_Array array);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_Array_Items (HPDF_Array array);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Dict -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_Xref_Rec *HPDF_Xref;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Dict_Rec *HPDF_Dict;
|
|
||||||
|
|
||||||
typedef void
|
|
||||||
(*HPDF_Dict_FreeFunc) (HPDF_Dict obj);
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Dict_BeforeWriteFunc) (HPDF_Dict obj);
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Dict_AfterWriteFunc) (HPDF_Dict obj);
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Dict_OnWriteFunc) (HPDF_Dict obj,
|
|
||||||
HPDF_Stream stream);
|
|
||||||
|
|
||||||
typedef struct _HPDF_Dict_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_List list;
|
|
||||||
HPDF_Dict_BeforeWriteFunc before_write_fn;
|
|
||||||
HPDF_Dict_OnWriteFunc write_fn;
|
|
||||||
HPDF_Dict_AfterWriteFunc after_write_fn;
|
|
||||||
HPDF_Dict_FreeFunc free_fn;
|
|
||||||
HPDF_Stream stream;
|
|
||||||
HPDF_UINT filter;
|
|
||||||
HPDF_Dict filterParams;
|
|
||||||
void *attr;
|
|
||||||
} HPDF_Dict_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_DictElement_Rec *HPDF_DictElement;
|
|
||||||
|
|
||||||
typedef struct _HPDF_DictElement_Rec {
|
|
||||||
char key[HPDF_LIMIT_MAX_NAME_LEN + 1];
|
|
||||||
void *value;
|
|
||||||
} HPDF_DictElement_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Dict
|
|
||||||
HPDF_Dict_New (HPDF_MMgr mmgr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Dict
|
|
||||||
HPDF_DictStream_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Dict_Free (HPDF_Dict dict);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_Write (HPDF_Dict dict,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Dict_GetKeyByObj (HPDF_Dict dict,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_Add (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_Dict_GetItem (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
HPDF_UINT16 obj_class);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_AddName (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_AddNumber (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
HPDF_INT32 value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_AddReal (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_AddBoolean (HPDF_Dict dict,
|
|
||||||
const char *key,
|
|
||||||
HPDF_BOOL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Dict_RemoveElement (HPDF_Dict dict,
|
|
||||||
const char *key);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_ProxyObject ----------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Proxy_Rec *HPDF_Proxy;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Proxy_Rec {
|
|
||||||
HPDF_Obj_Header header;
|
|
||||||
void *obj;
|
|
||||||
} HPDF_Proxy_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Proxy
|
|
||||||
HPDF_Proxy_New (HPDF_MMgr mmgr,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Xref -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_XrefEntry_Rec *HPDF_XrefEntry;
|
|
||||||
|
|
||||||
typedef struct _HPDF_XrefEntry_Rec {
|
|
||||||
char entry_typ;
|
|
||||||
HPDF_UINT byte_offset;
|
|
||||||
HPDF_UINT16 gen_no;
|
|
||||||
void* obj;
|
|
||||||
} HPDF_XrefEntry_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Xref_Rec {
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_UINT32 start_offset;
|
|
||||||
HPDF_List entries;
|
|
||||||
HPDF_UINT addr;
|
|
||||||
HPDF_Xref prev;
|
|
||||||
HPDF_Dict trailer;
|
|
||||||
} HPDF_Xref_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Xref
|
|
||||||
HPDF_Xref_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_UINT32 offset);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Xref_Free (HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Xref_Add (HPDF_Xref xref,
|
|
||||||
void *obj);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_XrefEntry
|
|
||||||
HPDF_Xref_GetEntry (HPDF_Xref xref,
|
|
||||||
HPDF_UINT index);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Xref_WriteToStream (HPDF_Xref xref,
|
|
||||||
HPDF_Stream stream,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_XrefEntry
|
|
||||||
HPDF_Xref_GetEntryByObjectId (HPDF_Xref xref,
|
|
||||||
HPDF_UINT obj_id);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_Dict HPDF_EmbeddedFile;
|
|
||||||
typedef HPDF_Dict HPDF_NameDict;
|
|
||||||
typedef HPDF_Dict HPDF_NameTree;
|
|
||||||
typedef HPDF_Dict HPDF_Pages;
|
|
||||||
typedef HPDF_Dict HPDF_Page;
|
|
||||||
typedef HPDF_Dict HPDF_Annotation;
|
|
||||||
typedef HPDF_Dict HPDF_3DMeasure;
|
|
||||||
typedef HPDF_Dict HPDF_ExData;
|
|
||||||
typedef HPDF_Dict HPDF_XObject;
|
|
||||||
typedef HPDF_Dict HPDF_Image;
|
|
||||||
typedef HPDF_Dict HPDF_Outline;
|
|
||||||
typedef HPDF_Dict HPDF_EncryptDict;
|
|
||||||
typedef HPDF_Dict HPDF_Action;
|
|
||||||
typedef HPDF_Dict HPDF_ExtGState;
|
|
||||||
typedef HPDF_Array HPDF_Destination;
|
|
||||||
typedef HPDF_Dict HPDF_U3D;
|
|
||||||
typedef HPDF_Dict HPDF_OutputIntent;
|
|
||||||
typedef HPDF_Dict HPDF_JavaScript;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_OBJECTS_H */
|
|
||||||
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_outline.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_OUTLINE_H
|
|
||||||
#define _HPDF_OUTLINE_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Outline ---------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_OutlineRoot_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Outline parent,
|
|
||||||
const char *title,
|
|
||||||
HPDF_Encoder encoder,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_GetFirst (HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_GetLast (HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_GetPrev(HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_GetNext (HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Outline
|
|
||||||
HPDF_Outline_GetParent (HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Outline_GetOpened (HPDF_Outline outline);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Outline_Validate (HPDF_Outline obj);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_OUTLINE_H */
|
|
||||||
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_page_label.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_PAGE_LABEL_H
|
|
||||||
#define _HPDF_PAGE_LABEL_H
|
|
||||||
|
|
||||||
#include "hpdf.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_Dict
|
|
||||||
HPDF_PageLabel_New (HPDF_Doc pdf,
|
|
||||||
HPDF_PageNumStyle style,
|
|
||||||
HPDF_INT first_page,
|
|
||||||
const char *prefix);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_pages.c
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_PAGES_H
|
|
||||||
#define _HPDF_PAGES_H
|
|
||||||
|
|
||||||
#include "hpdf_gstate.h"
|
|
||||||
#include "hpdf_ext_gstate.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Pages -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_Pages
|
|
||||||
HPDF_Pages_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Pages parent,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Pages_Validate (HPDF_Pages pages);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Pages_AddKids (HPDF_Pages parent,
|
|
||||||
HPDF_Dict kid);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Page_InsertBefore (HPDF_Page page,
|
|
||||||
HPDF_Page target);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_PageAttr_Rec *HPDF_PageAttr;
|
|
||||||
|
|
||||||
typedef struct _HPDF_PageAttr_Rec {
|
|
||||||
HPDF_Pages parent;
|
|
||||||
HPDF_Dict fonts;
|
|
||||||
HPDF_Dict xobjects;
|
|
||||||
HPDF_Dict ext_gstates;
|
|
||||||
HPDF_GState gstate;
|
|
||||||
HPDF_Point str_pos;
|
|
||||||
HPDF_Point cur_pos;
|
|
||||||
HPDF_Point text_pos;
|
|
||||||
HPDF_TransMatrix text_matrix;
|
|
||||||
HPDF_UINT16 gmode;
|
|
||||||
HPDF_Dict contents;
|
|
||||||
HPDF_Stream stream;
|
|
||||||
HPDF_Xref xref;
|
|
||||||
HPDF_UINT compression_mode;
|
|
||||||
HPDF_PDFVer *ver;
|
|
||||||
} HPDF_PageAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_Page ------------------------------------------------------------*/
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Page_Validate (HPDF_Page page);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Page
|
|
||||||
HPDF_Page_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_Page_GetInheritableItem (HPDF_Page page,
|
|
||||||
const char *key,
|
|
||||||
HPDF_UINT16 obj_class);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Page_GetXObjectName (HPDF_Page page,
|
|
||||||
HPDF_XObject xobj);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Page_GetLocalFontName (HPDF_Page page,
|
|
||||||
HPDF_Font font);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_Page_GetExtGStateName (HPDF_Page page,
|
|
||||||
HPDF_ExtGState gstate);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Box
|
|
||||||
HPDF_Page_GetMediaBox (HPDF_Page page);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Page_SetBoxValue (HPDF_Page page,
|
|
||||||
const char *name,
|
|
||||||
HPDF_UINT index,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Page_SetFilter (HPDF_Page page,
|
|
||||||
HPDF_UINT filter);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Page_CheckState (HPDF_Page page,
|
|
||||||
HPDF_UINT mode);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_PAGES_H */
|
|
||||||
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_pdfa.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_PDFA_H
|
|
||||||
#define _HPDF_PDFA_H
|
|
||||||
|
|
||||||
#include "hpdf_doc.h"
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_PDFA_AppendOutputIntents(HPDF_Doc pdf, const char *iccname, HPDF_Dict iccdict);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,
|
|
||||||
HPDF_PDFAType pdfatype);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_PDFA_GenerateID(HPDF_Doc);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,280 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_streams.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
* 2005.12.20 Created.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_STREAMS_H
|
|
||||||
#define _HPDF_STREAMS_H
|
|
||||||
|
|
||||||
#include "hpdf_list.h"
|
|
||||||
#include "hpdf_encrypt.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define HPDF_STREAM_SIG_BYTES 0x5354524DL
|
|
||||||
|
|
||||||
typedef enum _HPDF_StreamType {
|
|
||||||
HPDF_STREAM_UNKNOWN = 0,
|
|
||||||
HPDF_STREAM_CALLBACK,
|
|
||||||
HPDF_STREAM_FILE,
|
|
||||||
HPDF_STREAM_MEMORY
|
|
||||||
} HPDF_StreamType;
|
|
||||||
|
|
||||||
#define HPDF_STREAM_FILTER_NONE 0x0000
|
|
||||||
#define HPDF_STREAM_FILTER_ASCIIHEX 0x0100
|
|
||||||
#define HPDF_STREAM_FILTER_ASCII85 0x0200
|
|
||||||
#define HPDF_STREAM_FILTER_FLATE_DECODE 0x0400
|
|
||||||
#define HPDF_STREAM_FILTER_DCT_DECODE 0x0800
|
|
||||||
#define HPDF_STREAM_FILTER_CCITT_DECODE 0x1000
|
|
||||||
|
|
||||||
typedef enum _HPDF_WhenceMode {
|
|
||||||
HPDF_SEEK_SET = 0,
|
|
||||||
HPDF_SEEK_CUR,
|
|
||||||
HPDF_SEEK_END
|
|
||||||
} HPDF_WhenceMode;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Stream_Rec *HPDF_Stream;
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Stream_Write_Func) (HPDF_Stream stream,
|
|
||||||
const HPDF_BYTE *ptr,
|
|
||||||
HPDF_UINT siz);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Stream_Read_Func) (HPDF_Stream stream,
|
|
||||||
HPDF_BYTE *ptr,
|
|
||||||
HPDF_UINT *siz);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_STATUS
|
|
||||||
(*HPDF_Stream_Seek_Func) (HPDF_Stream stream,
|
|
||||||
HPDF_INT pos,
|
|
||||||
HPDF_WhenceMode mode);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_INT32
|
|
||||||
(*HPDF_Stream_Tell_Func) (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
typedef void
|
|
||||||
(*HPDF_Stream_Free_Func) (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
typedef HPDF_UINT32
|
|
||||||
(*HPDF_Stream_Size_Func) (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_MemStreamAttr_Rec *HPDF_MemStreamAttr;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_MemStreamAttr_Rec {
|
|
||||||
HPDF_List buf;
|
|
||||||
HPDF_UINT buf_siz;
|
|
||||||
HPDF_UINT w_pos;
|
|
||||||
HPDF_BYTE *w_ptr;
|
|
||||||
HPDF_UINT r_ptr_idx;
|
|
||||||
HPDF_UINT r_pos;
|
|
||||||
HPDF_BYTE *r_ptr;
|
|
||||||
} HPDF_MemStreamAttr_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _HPDF_Stream_Rec {
|
|
||||||
HPDF_UINT32 sig_bytes;
|
|
||||||
HPDF_StreamType type;
|
|
||||||
HPDF_MMgr mmgr;
|
|
||||||
HPDF_Error error;
|
|
||||||
HPDF_UINT size;
|
|
||||||
HPDF_Stream_Write_Func write_fn;
|
|
||||||
HPDF_Stream_Read_Func read_fn;
|
|
||||||
HPDF_Stream_Seek_Func seek_fn;
|
|
||||||
HPDF_Stream_Free_Func free_fn;
|
|
||||||
HPDF_Stream_Tell_Func tell_fn;
|
|
||||||
HPDF_Stream_Size_Func size_fn;
|
|
||||||
void* attr;
|
|
||||||
} HPDF_Stream_Rec;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Stream
|
|
||||||
HPDF_MemStream_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_UINT buf_siz);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BYTE*
|
|
||||||
HPDF_MemStream_GetBufPtr (HPDF_Stream stream,
|
|
||||||
HPDF_UINT index,
|
|
||||||
HPDF_UINT *length);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_MemStream_GetBufSize (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_MemStream_GetBufCount (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_MemStream_Rewrite (HPDF_Stream stream,
|
|
||||||
HPDF_BYTE *buf,
|
|
||||||
HPDF_UINT size);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_MemStream_FreeData (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteToStream (HPDF_Stream src,
|
|
||||||
HPDF_Stream dst,
|
|
||||||
HPDF_UINT filter,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Stream
|
|
||||||
HPDF_FileReader_New (HPDF_MMgr mmgr,
|
|
||||||
const char *fname);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Stream
|
|
||||||
HPDF_FileWriter_New (HPDF_MMgr mmgr,
|
|
||||||
const char *fname);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Stream
|
|
||||||
HPDF_CallbackReader_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream_Read_Func read_fn,
|
|
||||||
HPDF_Stream_Seek_Func seek_fn,
|
|
||||||
HPDF_Stream_Tell_Func tell_fn,
|
|
||||||
HPDF_Stream_Size_Func size_fn,
|
|
||||||
void* data);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Stream
|
|
||||||
HPDF_CallbackWriter_New (HPDF_MMgr mmgr,
|
|
||||||
HPDF_Stream_Write_Func write_fn,
|
|
||||||
void* data);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_Stream_Free (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteChar (HPDF_Stream stream,
|
|
||||||
char value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteStr (HPDF_Stream stream,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteUChar (HPDF_Stream stream,
|
|
||||||
HPDF_BYTE value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteInt (HPDF_Stream stream,
|
|
||||||
HPDF_INT value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteUInt (HPDF_Stream stream,
|
|
||||||
HPDF_UINT value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteReal (HPDF_Stream stream,
|
|
||||||
HPDF_REAL value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_Write (HPDF_Stream stream,
|
|
||||||
const HPDF_BYTE *ptr,
|
|
||||||
HPDF_UINT size);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_Read (HPDF_Stream stream,
|
|
||||||
HPDF_BYTE *ptr,
|
|
||||||
HPDF_UINT *size);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_ReadLn (HPDF_Stream stream,
|
|
||||||
char *s,
|
|
||||||
HPDF_UINT *size);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT32
|
|
||||||
HPDF_Stream_Tell (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_Seek (HPDF_Stream stream,
|
|
||||||
HPDF_INT pos,
|
|
||||||
HPDF_WhenceMode mode);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BOOL
|
|
||||||
HPDF_Stream_EOF (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT32
|
|
||||||
HPDF_Stream_Size (HPDF_Stream stream);
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_Flush (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteEscapeName (HPDF_Stream stream,
|
|
||||||
const char *value);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteEscapeText2 (HPDF_Stream stream,
|
|
||||||
const char *text,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteEscapeText (HPDF_Stream stream,
|
|
||||||
const char *text);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_WriteBinary (HPDF_Stream stream,
|
|
||||||
const HPDF_BYTE *data,
|
|
||||||
HPDF_UINT len,
|
|
||||||
HPDF_Encrypt e);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_STATUS
|
|
||||||
HPDF_Stream_Validate (HPDF_Stream stream);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_STREAMS_H */
|
|
||||||
@ -1,565 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_types.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_TYPES_H
|
|
||||||
#define _HPDF_TYPES_H
|
|
||||||
|
|
||||||
#ifndef HPDF_STDCALL
|
|
||||||
#ifdef HPDF_DLL_MAKE
|
|
||||||
#define HPDF_STDCALL __stdcall
|
|
||||||
#else
|
|
||||||
#ifdef HPDF_DLL
|
|
||||||
#define HPDF_STDCALL __stdcall
|
|
||||||
#else
|
|
||||||
#define HPDF_STDCALL
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- type definition ------------------------------------------------------*/
|
|
||||||
|
|
||||||
|
|
||||||
/* native OS integer types */
|
|
||||||
typedef signed int HPDF_INT;
|
|
||||||
typedef unsigned int HPDF_UINT;
|
|
||||||
|
|
||||||
|
|
||||||
/* 32bit integer types
|
|
||||||
*/
|
|
||||||
typedef signed int HPDF_INT32;
|
|
||||||
typedef unsigned int HPDF_UINT32;
|
|
||||||
|
|
||||||
|
|
||||||
/* 16bit integer types
|
|
||||||
*/
|
|
||||||
typedef signed short HPDF_INT16;
|
|
||||||
typedef unsigned short HPDF_UINT16;
|
|
||||||
|
|
||||||
|
|
||||||
/* 8bit integer types
|
|
||||||
*/
|
|
||||||
typedef signed char HPDF_INT8;
|
|
||||||
typedef unsigned char HPDF_UINT8;
|
|
||||||
|
|
||||||
|
|
||||||
/* 8bit binary types
|
|
||||||
*/
|
|
||||||
typedef unsigned char HPDF_BYTE;
|
|
||||||
|
|
||||||
|
|
||||||
/* float type (32bit IEEE754)
|
|
||||||
*/
|
|
||||||
typedef float HPDF_REAL;
|
|
||||||
|
|
||||||
|
|
||||||
/* double type (64bit IEEE754)
|
|
||||||
*/
|
|
||||||
typedef double HPDF_DOUBLE;
|
|
||||||
|
|
||||||
|
|
||||||
/* boolean type (0: False, !0: True)
|
|
||||||
*/
|
|
||||||
typedef signed int HPDF_BOOL;
|
|
||||||
|
|
||||||
|
|
||||||
/* error-no type (32bit unsigned integer)
|
|
||||||
*/
|
|
||||||
typedef unsigned long HPDF_STATUS;
|
|
||||||
|
|
||||||
|
|
||||||
/* charactor-code type (16bit)
|
|
||||||
*/
|
|
||||||
typedef HPDF_UINT16 HPDF_CID;
|
|
||||||
typedef HPDF_UINT16 HPDF_UNICODE;
|
|
||||||
|
|
||||||
|
|
||||||
/* HPDF_Point struct
|
|
||||||
*/
|
|
||||||
typedef struct _HPDF_Point {
|
|
||||||
HPDF_REAL x;
|
|
||||||
HPDF_REAL y;
|
|
||||||
} HPDF_Point;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Rect {
|
|
||||||
HPDF_REAL left;
|
|
||||||
HPDF_REAL bottom;
|
|
||||||
HPDF_REAL right;
|
|
||||||
HPDF_REAL top;
|
|
||||||
} HPDF_Rect;
|
|
||||||
|
|
||||||
/* HPDF_Point3D struct
|
|
||||||
*/
|
|
||||||
typedef struct _HPDF_Point3D {
|
|
||||||
HPDF_REAL x;
|
|
||||||
HPDF_REAL y;
|
|
||||||
HPDF_REAL z;
|
|
||||||
} HPDF_Point3D;
|
|
||||||
|
|
||||||
typedef struct _HPDF_Rect HPDF_Box;
|
|
||||||
|
|
||||||
/* HPDF_Date struct
|
|
||||||
*/
|
|
||||||
typedef struct _HPDF_Date {
|
|
||||||
HPDF_INT year;
|
|
||||||
HPDF_INT month;
|
|
||||||
HPDF_INT day;
|
|
||||||
HPDF_INT hour;
|
|
||||||
HPDF_INT minutes;
|
|
||||||
HPDF_INT seconds;
|
|
||||||
char ind;
|
|
||||||
HPDF_INT off_hour;
|
|
||||||
HPDF_INT off_minutes;
|
|
||||||
} HPDF_Date;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_InfoType {
|
|
||||||
/* date-time type parameters */
|
|
||||||
HPDF_INFO_CREATION_DATE = 0,
|
|
||||||
HPDF_INFO_MOD_DATE,
|
|
||||||
|
|
||||||
/* string type parameters */
|
|
||||||
HPDF_INFO_AUTHOR,
|
|
||||||
HPDF_INFO_CREATOR,
|
|
||||||
HPDF_INFO_PRODUCER,
|
|
||||||
HPDF_INFO_TITLE,
|
|
||||||
HPDF_INFO_SUBJECT,
|
|
||||||
HPDF_INFO_KEYWORDS,
|
|
||||||
HPDF_INFO_TRAPPED,
|
|
||||||
HPDF_INFO_GTS_PDFX,
|
|
||||||
HPDF_INFO_EOF
|
|
||||||
} HPDF_InfoType;
|
|
||||||
|
|
||||||
/* PDF-A Types */
|
|
||||||
|
|
||||||
typedef enum _HPDF_PDFA_TYPE
|
|
||||||
{
|
|
||||||
HPDF_PDFA_1A = 0,
|
|
||||||
HPDF_PDFA_1B = 1
|
|
||||||
} HPDF_PDFAType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_PdfVer {
|
|
||||||
HPDF_VER_12 = 0,
|
|
||||||
HPDF_VER_13,
|
|
||||||
HPDF_VER_14,
|
|
||||||
HPDF_VER_15,
|
|
||||||
HPDF_VER_16,
|
|
||||||
HPDF_VER_17,
|
|
||||||
HPDF_VER_EOF
|
|
||||||
} HPDF_PDFVer;
|
|
||||||
|
|
||||||
typedef enum _HPDF_EncryptMode {
|
|
||||||
HPDF_ENCRYPT_R2 = 2,
|
|
||||||
HPDF_ENCRYPT_R3 = 3
|
|
||||||
} HPDF_EncryptMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef void
|
|
||||||
(HPDF_STDCALL *HPDF_Error_Handler) (HPDF_STATUS error_no,
|
|
||||||
HPDF_STATUS detail_no,
|
|
||||||
void *user_data);
|
|
||||||
|
|
||||||
typedef void*
|
|
||||||
(HPDF_STDCALL *HPDF_Alloc_Func) (HPDF_UINT size);
|
|
||||||
|
|
||||||
|
|
||||||
typedef void
|
|
||||||
(HPDF_STDCALL *HPDF_Free_Func) (void *aptr);
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ text width struct --------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_TextWidth {
|
|
||||||
HPDF_UINT numchars;
|
|
||||||
|
|
||||||
/* don't use this value (it may be change in the feature).
|
|
||||||
use numspace as alternated. */
|
|
||||||
HPDF_UINT numwords;
|
|
||||||
|
|
||||||
HPDF_UINT width;
|
|
||||||
HPDF_UINT numspace;
|
|
||||||
} HPDF_TextWidth;
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ dash mode ----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_DashMode {
|
|
||||||
HPDF_UINT16 ptn[8];
|
|
||||||
HPDF_UINT num_ptn;
|
|
||||||
HPDF_UINT phase;
|
|
||||||
} HPDF_DashMode;
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_TransMatrix struct ---------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_TransMatrix {
|
|
||||||
HPDF_REAL a;
|
|
||||||
HPDF_REAL b;
|
|
||||||
HPDF_REAL c;
|
|
||||||
HPDF_REAL d;
|
|
||||||
HPDF_REAL x;
|
|
||||||
HPDF_REAL y;
|
|
||||||
} HPDF_TransMatrix;
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_ColorSpace {
|
|
||||||
HPDF_CS_DEVICE_GRAY = 0,
|
|
||||||
HPDF_CS_DEVICE_RGB,
|
|
||||||
HPDF_CS_DEVICE_CMYK,
|
|
||||||
HPDF_CS_CAL_GRAY,
|
|
||||||
HPDF_CS_CAL_RGB,
|
|
||||||
HPDF_CS_LAB,
|
|
||||||
HPDF_CS_ICC_BASED,
|
|
||||||
HPDF_CS_SEPARATION,
|
|
||||||
HPDF_CS_DEVICE_N,
|
|
||||||
HPDF_CS_INDEXED,
|
|
||||||
HPDF_CS_PATTERN,
|
|
||||||
HPDF_CS_EOF
|
|
||||||
} HPDF_ColorSpace;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_RGBColor struct ------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_RGBColor {
|
|
||||||
HPDF_REAL r;
|
|
||||||
HPDF_REAL g;
|
|
||||||
HPDF_REAL b;
|
|
||||||
} HPDF_RGBColor;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*----- HPDF_CMYKColor struct -----------------------------------------------*/
|
|
||||||
|
|
||||||
typedef struct _HPDF_CMYKColor {
|
|
||||||
HPDF_REAL c;
|
|
||||||
HPDF_REAL m;
|
|
||||||
HPDF_REAL y;
|
|
||||||
HPDF_REAL k;
|
|
||||||
} HPDF_CMYKColor;
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/*------ The line cap style -------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_LineCap {
|
|
||||||
HPDF_BUTT_END = 0,
|
|
||||||
HPDF_ROUND_END,
|
|
||||||
HPDF_PROJECTING_SCUARE_END,
|
|
||||||
HPDF_LINECAP_EOF
|
|
||||||
} HPDF_LineCap;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ The line join style -------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_LineJoin {
|
|
||||||
HPDF_MITER_JOIN = 0,
|
|
||||||
HPDF_ROUND_JOIN,
|
|
||||||
HPDF_BEVEL_JOIN,
|
|
||||||
HPDF_LINEJOIN_EOF
|
|
||||||
} HPDF_LineJoin;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ The text rendering mode ---------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_TextRenderingMode {
|
|
||||||
HPDF_FILL = 0,
|
|
||||||
HPDF_STROKE,
|
|
||||||
HPDF_FILL_THEN_STROKE,
|
|
||||||
HPDF_INVISIBLE,
|
|
||||||
HPDF_FILL_CLIPPING,
|
|
||||||
HPDF_STROKE_CLIPPING,
|
|
||||||
HPDF_FILL_STROKE_CLIPPING,
|
|
||||||
HPDF_CLIPPING,
|
|
||||||
HPDF_RENDERING_MODE_EOF
|
|
||||||
} HPDF_TextRenderingMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_WritingMode {
|
|
||||||
HPDF_WMODE_HORIZONTAL = 0,
|
|
||||||
HPDF_WMODE_VERTICAL,
|
|
||||||
HPDF_WMODE_EOF
|
|
||||||
} HPDF_WritingMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_PageLayout {
|
|
||||||
HPDF_PAGE_LAYOUT_SINGLE = 0,
|
|
||||||
HPDF_PAGE_LAYOUT_ONE_COLUMN,
|
|
||||||
HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT,
|
|
||||||
HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT,
|
|
||||||
HPDF_PAGE_LAYOUT_TWO_PAGE_LEFT,
|
|
||||||
HPDF_PAGE_LAYOUT_TWO_PAGE_RIGHT,
|
|
||||||
HPDF_PAGE_LAYOUT_EOF
|
|
||||||
} HPDF_PageLayout;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_PageMode {
|
|
||||||
HPDF_PAGE_MODE_USE_NONE = 0,
|
|
||||||
HPDF_PAGE_MODE_USE_OUTLINE,
|
|
||||||
HPDF_PAGE_MODE_USE_THUMBS,
|
|
||||||
HPDF_PAGE_MODE_FULL_SCREEN,
|
|
||||||
/* HPDF_PAGE_MODE_USE_OC,
|
|
||||||
HPDF_PAGE_MODE_USE_ATTACHMENTS,
|
|
||||||
*/
|
|
||||||
HPDF_PAGE_MODE_EOF
|
|
||||||
} HPDF_PageMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_PageNumStyle {
|
|
||||||
HPDF_PAGE_NUM_STYLE_DECIMAL = 0,
|
|
||||||
HPDF_PAGE_NUM_STYLE_UPPER_ROMAN,
|
|
||||||
HPDF_PAGE_NUM_STYLE_LOWER_ROMAN,
|
|
||||||
HPDF_PAGE_NUM_STYLE_UPPER_LETTERS,
|
|
||||||
HPDF_PAGE_NUM_STYLE_LOWER_LETTERS,
|
|
||||||
HPDF_PAGE_NUM_STYLE_EOF
|
|
||||||
} HPDF_PageNumStyle;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_DestinationType {
|
|
||||||
HPDF_XYZ = 0,
|
|
||||||
HPDF_FIT,
|
|
||||||
HPDF_FIT_H,
|
|
||||||
HPDF_FIT_V,
|
|
||||||
HPDF_FIT_R,
|
|
||||||
HPDF_FIT_B,
|
|
||||||
HPDF_FIT_BH,
|
|
||||||
HPDF_FIT_BV,
|
|
||||||
HPDF_DST_EOF
|
|
||||||
} HPDF_DestinationType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_AnnotType {
|
|
||||||
HPDF_ANNOT_TEXT_NOTES,
|
|
||||||
HPDF_ANNOT_LINK,
|
|
||||||
HPDF_ANNOT_SOUND,
|
|
||||||
HPDF_ANNOT_FREE_TEXT,
|
|
||||||
HPDF_ANNOT_STAMP,
|
|
||||||
HPDF_ANNOT_SQUARE,
|
|
||||||
HPDF_ANNOT_CIRCLE,
|
|
||||||
HPDF_ANNOT_STRIKE_OUT,
|
|
||||||
HPDF_ANNOT_HIGHTLIGHT,
|
|
||||||
HPDF_ANNOT_UNDERLINE,
|
|
||||||
HPDF_ANNOT_INK,
|
|
||||||
HPDF_ANNOT_FILE_ATTACHMENT,
|
|
||||||
HPDF_ANNOT_POPUP,
|
|
||||||
HPDF_ANNOT_3D,
|
|
||||||
HPDF_ANNOT_SQUIGGLY,
|
|
||||||
HPDF_ANNOT_LINE,
|
|
||||||
HPDF_ANNOT_PROJECTION
|
|
||||||
} HPDF_AnnotType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_AnnotFlgs {
|
|
||||||
HPDF_ANNOT_INVISIBLE,
|
|
||||||
HPDF_ANNOT_HIDDEN,
|
|
||||||
HPDF_ANNOT_PRINT,
|
|
||||||
HPDF_ANNOT_NOZOOM,
|
|
||||||
HPDF_ANNOT_NOROTATE,
|
|
||||||
HPDF_ANNOT_NOVIEW,
|
|
||||||
HPDF_ANNOT_READONLY
|
|
||||||
} HPDF_AnnotFlgs;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_AnnotHighlightMode {
|
|
||||||
HPDF_ANNOT_NO_HIGHTLIGHT = 0,
|
|
||||||
HPDF_ANNOT_INVERT_BOX,
|
|
||||||
HPDF_ANNOT_INVERT_BORDER,
|
|
||||||
HPDF_ANNOT_DOWN_APPEARANCE,
|
|
||||||
HPDF_ANNOT_HIGHTLIGHT_MODE_EOF
|
|
||||||
} HPDF_AnnotHighlightMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_AnnotIcon {
|
|
||||||
HPDF_ANNOT_ICON_COMMENT = 0,
|
|
||||||
HPDF_ANNOT_ICON_KEY,
|
|
||||||
HPDF_ANNOT_ICON_NOTE,
|
|
||||||
HPDF_ANNOT_ICON_HELP,
|
|
||||||
HPDF_ANNOT_ICON_NEW_PARAGRAPH,
|
|
||||||
HPDF_ANNOT_ICON_PARAGRAPH,
|
|
||||||
HPDF_ANNOT_ICON_INSERT,
|
|
||||||
HPDF_ANNOT_ICON_EOF
|
|
||||||
} HPDF_AnnotIcon;
|
|
||||||
|
|
||||||
typedef enum _HPDF_AnnotIntent {
|
|
||||||
HPDF_ANNOT_INTENT_FREETEXTCALLOUT = 0,
|
|
||||||
HPDF_ANNOT_INTENT_FREETEXTTYPEWRITER,
|
|
||||||
HPDF_ANNOT_INTENT_LINEARROW,
|
|
||||||
HPDF_ANNOT_INTENT_LINEDIMENSION,
|
|
||||||
HPDF_ANNOT_INTENT_POLYGONCLOUD,
|
|
||||||
HPDF_ANNOT_INTENT_POLYLINEDIMENSION,
|
|
||||||
HPDF_ANNOT_INTENT_POLYGONDIMENSION
|
|
||||||
} HPDF_AnnotIntent;
|
|
||||||
|
|
||||||
typedef enum _HPDF_LineAnnotEndingStyle {
|
|
||||||
HPDF_LINE_ANNOT_NONE = 0,
|
|
||||||
HPDF_LINE_ANNOT_SQUARE,
|
|
||||||
HPDF_LINE_ANNOT_CIRCLE,
|
|
||||||
HPDF_LINE_ANNOT_DIAMOND,
|
|
||||||
HPDF_LINE_ANNOT_OPENARROW,
|
|
||||||
HPDF_LINE_ANNOT_CLOSEDARROW,
|
|
||||||
HPDF_LINE_ANNOT_BUTT,
|
|
||||||
HPDF_LINE_ANNOT_ROPENARROW,
|
|
||||||
HPDF_LINE_ANNOT_RCLOSEDARROW,
|
|
||||||
HPDF_LINE_ANNOT_SLASH
|
|
||||||
} HPDF_LineAnnotEndingStyle;
|
|
||||||
|
|
||||||
typedef enum _HPDF_LineAnnotCapPosition{
|
|
||||||
HPDF_LINE_ANNOT_CAP_INLINE = 0,
|
|
||||||
HPDF_LINE_ANNOT_CAP_TOP
|
|
||||||
} HPDF_LineAnnotCapPosition;
|
|
||||||
|
|
||||||
typedef enum _HPDF_StampAnnotName{
|
|
||||||
HPDF_STAMP_ANNOT_APPROVED = 0,
|
|
||||||
HPDF_STAMP_ANNOT_EXPERIMENTAL,
|
|
||||||
HPDF_STAMP_ANNOT_NOTAPPROVED,
|
|
||||||
HPDF_STAMP_ANNOT_ASIS,
|
|
||||||
HPDF_STAMP_ANNOT_EXPIRED,
|
|
||||||
HPDF_STAMP_ANNOT_NOTFORPUBLICRELEASE,
|
|
||||||
HPDF_STAMP_ANNOT_CONFIDENTIAL,
|
|
||||||
HPDF_STAMP_ANNOT_FINAL,
|
|
||||||
HPDF_STAMP_ANNOT_SOLD,
|
|
||||||
HPDF_STAMP_ANNOT_DEPARTMENTAL,
|
|
||||||
HPDF_STAMP_ANNOT_FORCOMMENT,
|
|
||||||
HPDF_STAMP_ANNOT_TOPSECRET,
|
|
||||||
HPDF_STAMP_ANNOT_DRAFT,
|
|
||||||
HPDF_STAMP_ANNOT_FORPUBLICRELEASE
|
|
||||||
} HPDF_StampAnnotName;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*------ border stype --------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_BSSubtype {
|
|
||||||
HPDF_BS_SOLID,
|
|
||||||
HPDF_BS_DASHED,
|
|
||||||
HPDF_BS_BEVELED,
|
|
||||||
HPDF_BS_INSET,
|
|
||||||
HPDF_BS_UNDERLINED
|
|
||||||
} HPDF_BSSubtype;
|
|
||||||
|
|
||||||
|
|
||||||
/*----- blend modes ----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_BlendMode {
|
|
||||||
HPDF_BM_NORMAL,
|
|
||||||
HPDF_BM_MULTIPLY,
|
|
||||||
HPDF_BM_SCREEN,
|
|
||||||
HPDF_BM_OVERLAY,
|
|
||||||
HPDF_BM_DARKEN,
|
|
||||||
HPDF_BM_LIGHTEN,
|
|
||||||
HPDF_BM_COLOR_DODGE,
|
|
||||||
HPDF_BM_COLOR_BUM,
|
|
||||||
HPDF_BM_HARD_LIGHT,
|
|
||||||
HPDF_BM_SOFT_LIGHT,
|
|
||||||
HPDF_BM_DIFFERENCE,
|
|
||||||
HPDF_BM_EXCLUSHON,
|
|
||||||
HPDF_BM_EOF
|
|
||||||
} HPDF_BlendMode;
|
|
||||||
|
|
||||||
/*----- slide show -----------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_TransitionStyle {
|
|
||||||
HPDF_TS_WIPE_RIGHT = 0,
|
|
||||||
HPDF_TS_WIPE_UP,
|
|
||||||
HPDF_TS_WIPE_LEFT,
|
|
||||||
HPDF_TS_WIPE_DOWN,
|
|
||||||
HPDF_TS_BARN_DOORS_HORIZONTAL_OUT,
|
|
||||||
HPDF_TS_BARN_DOORS_HORIZONTAL_IN,
|
|
||||||
HPDF_TS_BARN_DOORS_VERTICAL_OUT,
|
|
||||||
HPDF_TS_BARN_DOORS_VERTICAL_IN,
|
|
||||||
HPDF_TS_BOX_OUT,
|
|
||||||
HPDF_TS_BOX_IN,
|
|
||||||
HPDF_TS_BLINDS_HORIZONTAL,
|
|
||||||
HPDF_TS_BLINDS_VERTICAL,
|
|
||||||
HPDF_TS_DISSOLVE,
|
|
||||||
HPDF_TS_GLITTER_RIGHT,
|
|
||||||
HPDF_TS_GLITTER_DOWN,
|
|
||||||
HPDF_TS_GLITTER_TOP_LEFT_TO_BOTTOM_RIGHT,
|
|
||||||
HPDF_TS_REPLACE,
|
|
||||||
HPDF_TS_EOF
|
|
||||||
} HPDF_TransitionStyle;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
typedef enum _HPDF_PageSizes {
|
|
||||||
HPDF_PAGE_SIZE_LETTER = 0,
|
|
||||||
HPDF_PAGE_SIZE_LEGAL,
|
|
||||||
HPDF_PAGE_SIZE_A3,
|
|
||||||
HPDF_PAGE_SIZE_A4,
|
|
||||||
HPDF_PAGE_SIZE_A5,
|
|
||||||
HPDF_PAGE_SIZE_B4,
|
|
||||||
HPDF_PAGE_SIZE_B5,
|
|
||||||
HPDF_PAGE_SIZE_EXECUTIVE,
|
|
||||||
HPDF_PAGE_SIZE_US4x6,
|
|
||||||
HPDF_PAGE_SIZE_US4x8,
|
|
||||||
HPDF_PAGE_SIZE_US5x7,
|
|
||||||
HPDF_PAGE_SIZE_COMM10,
|
|
||||||
HPDF_PAGE_SIZE_EOF
|
|
||||||
} HPDF_PageSizes;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_PageDirection {
|
|
||||||
HPDF_PAGE_PORTRAIT = 0,
|
|
||||||
HPDF_PAGE_LANDSCAPE
|
|
||||||
} HPDF_PageDirection;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_EncoderType {
|
|
||||||
HPDF_ENCODER_TYPE_SINGLE_BYTE,
|
|
||||||
HPDF_ENCODER_TYPE_DOUBLE_BYTE,
|
|
||||||
HPDF_ENCODER_TYPE_UNINITIALIZED,
|
|
||||||
HPDF_ENCODER_UNKNOWN
|
|
||||||
} HPDF_EncoderType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_ByteType {
|
|
||||||
HPDF_BYTE_TYPE_SINGLE = 0,
|
|
||||||
HPDF_BYTE_TYPE_LEAD,
|
|
||||||
HPDF_BYTE_TYPE_TRIAL,
|
|
||||||
HPDF_BYTE_TYPE_UNKNOWN
|
|
||||||
} HPDF_ByteType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _HPDF_TextAlignment {
|
|
||||||
HPDF_TALIGN_LEFT = 0,
|
|
||||||
HPDF_TALIGN_RIGHT,
|
|
||||||
HPDF_TALIGN_CENTER,
|
|
||||||
HPDF_TALIGN_JUSTIFY
|
|
||||||
} HPDF_TextAlignment;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Name Dictionary values -- see PDF reference section 7.7.4 */
|
|
||||||
typedef enum _HPDF_NameDictKey {
|
|
||||||
HPDF_NAME_EMBEDDED_FILES = 0, /* TODO the rest */
|
|
||||||
HPDF_NAME_EOF
|
|
||||||
} HPDF_NameDictKey;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_TYPES_H */
|
|
||||||
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- hpdf_u3d.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_U3D_H
|
|
||||||
#define _HPDF_U3D_H
|
|
||||||
|
|
||||||
#include "hpdf_objects.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *code);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename);
|
|
||||||
HPDF_EXPORT(HPDF_Image) HPDF_LoadU3DFromMem (HPDF_Doc pdf, const HPDF_BYTE *buffer, HPDF_UINT size);
|
|
||||||
HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_AddOnInstanciate(HPDF_U3D u3d, HPDF_JavaScript javaScript);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_AddNode(HPDF_Dict view, const char *name, HPDF_REAL opacity, HPDF_BOOL visible);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetLighting(HPDF_Dict view, const char *scheme);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetBackgroundColor(HPDF_Dict view, HPDF_REAL r, HPDF_REAL g, HPDF_REAL b);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetPerspectiveProjection(HPDF_Dict view, HPDF_REAL fov);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetOrthogonalProjection(HPDF_Dict view, HPDF_REAL mag);
|
|
||||||
HPDF_EXPORT(HPDF_STATUS) HPDF_3DView_SetCamera(HPDF_Dict view, HPDF_REAL coox, HPDF_REAL cooy, HPDF_REAL cooz, HPDF_REAL c2cx, HPDF_REAL c2cy, HPDF_REAL c2cz, HPDF_REAL roo, HPDF_REAL roll);
|
|
||||||
|
|
||||||
HPDF_Dict
|
|
||||||
HPDF_3DView_New ( HPDF_MMgr mmgr,
|
|
||||||
HPDF_Xref xref,
|
|
||||||
HPDF_U3D u3d,
|
|
||||||
const char *name);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* _HPDF_U3D_H */
|
|
||||||
|
|
||||||
@ -1,165 +0,0 @@
|
|||||||
/*
|
|
||||||
* << Haru Free PDF Library >> -- fpdf_utils.h
|
|
||||||
*
|
|
||||||
* URL: http://libharu.org
|
|
||||||
*
|
|
||||||
* Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp>
|
|
||||||
* Copyright (c) 2007-2009 Antony Dovgal <tony@daylessday.org>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, distribute and sell this software
|
|
||||||
* and its documentation for any purpose is hereby granted without fee,
|
|
||||||
* provided that the above copyright notice appear in all copies and
|
|
||||||
* that both that copyright notice and this permission notice appear
|
|
||||||
* in supporting documentation.
|
|
||||||
* It is provided "as is" without express or implied warranty.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HPDF_UTILS_H
|
|
||||||
#define _HPDF_UTILS_H
|
|
||||||
|
|
||||||
#include "hpdf_config.h"
|
|
||||||
#include "hpdf_types.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
HPDF_INT
|
|
||||||
HPDF_AToI (const char* s);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_DOUBLE
|
|
||||||
HPDF_AToF (const char* s);
|
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
HPDF_IToA (char* s,
|
|
||||||
HPDF_INT32 val,
|
|
||||||
char* eptr);
|
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
HPDF_IToA2 (char *s,
|
|
||||||
HPDF_UINT32 val,
|
|
||||||
HPDF_UINT len);
|
|
||||||
|
|
||||||
|
|
||||||
char*
|
|
||||||
HPDF_FToA (char *s,
|
|
||||||
HPDF_REAL val,
|
|
||||||
char *eptr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BYTE*
|
|
||||||
HPDF_MemCpy (HPDF_BYTE* out,
|
|
||||||
const HPDF_BYTE* in,
|
|
||||||
HPDF_UINT n);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_BYTE*
|
|
||||||
HPDF_StrCpy (char* out,
|
|
||||||
const char* in,
|
|
||||||
char* eptr);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT
|
|
||||||
HPDF_MemCmp (const HPDF_BYTE* s1,
|
|
||||||
const HPDF_BYTE* s2,
|
|
||||||
HPDF_UINT n);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_INT
|
|
||||||
HPDF_StrCmp (const char* s1,
|
|
||||||
const char* s2);
|
|
||||||
|
|
||||||
|
|
||||||
const char*
|
|
||||||
HPDF_StrStr (const char *s1,
|
|
||||||
const char *s2,
|
|
||||||
HPDF_UINT maxlen);
|
|
||||||
|
|
||||||
|
|
||||||
void*
|
|
||||||
HPDF_MemSet (void* s,
|
|
||||||
HPDF_BYTE c,
|
|
||||||
HPDF_UINT n);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_UINT
|
|
||||||
HPDF_StrLen (const char* s,
|
|
||||||
HPDF_INT maxlen);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Box
|
|
||||||
HPDF_ToBox (HPDF_INT16 left,
|
|
||||||
HPDF_INT16 bottom,
|
|
||||||
HPDF_INT16 right,
|
|
||||||
HPDF_INT16 top);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Point
|
|
||||||
HPDF_ToPoint (HPDF_INT16 x,
|
|
||||||
HPDF_INT16 y);
|
|
||||||
|
|
||||||
|
|
||||||
HPDF_Rect
|
|
||||||
HPDF_ToRect (HPDF_REAL left,
|
|
||||||
HPDF_REAL bottom,
|
|
||||||
HPDF_REAL right,
|
|
||||||
HPDF_REAL top);
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
HPDF_UInt16Swap (HPDF_UINT16 *value);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#define HPDF_NEEDS_ESCAPE(c) (c < 0x20 || \
|
|
||||||
c > 0x7e || \
|
|
||||||
c == '\\' || \
|
|
||||||
c == '%' || \
|
|
||||||
c == '#' || \
|
|
||||||
c == '/' || \
|
|
||||||
c == '(' || \
|
|
||||||
c == ')' || \
|
|
||||||
c == '<' || \
|
|
||||||
c == '>' || \
|
|
||||||
c == '[' || \
|
|
||||||
c == ']' || \
|
|
||||||
c == '{' || \
|
|
||||||
c == '}' ) \
|
|
||||||
|
|
||||||
#define HPDF_IS_WHITE_SPACE(c) (c == 0x00 || \
|
|
||||||
c == 0x09 || \
|
|
||||||
c == 0x0A || \
|
|
||||||
c == 0x0C || \
|
|
||||||
c == 0x0D || \
|
|
||||||
c == 0x20 ) \
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*----- macros for debug -----------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifdef LIBHPDF_DEBUG_TRACE
|
|
||||||
#ifndef HPDF_PTRACE_ON
|
|
||||||
#define HPDF_PTRACE_ON
|
|
||||||
#endif /* HPDF_PTRACE_ON */
|
|
||||||
#endif /* LIBHPDF_DEBUG_TRACE */
|
|
||||||
|
|
||||||
#ifdef HPDF_PTRACE_ON
|
|
||||||
#define HPDF_PTRACE(ARGS) HPDF_PRINTF ARGS
|
|
||||||
#else
|
|
||||||
#define HPDF_PTRACE(ARGS) /* do nothing */
|
|
||||||
#endif /* HPDF_PTRACE */
|
|
||||||
|
|
||||||
#ifdef LIBHPDF_DEBUG
|
|
||||||
#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) HPDF_PrintBinary(BUF, LEN, CAPTION)
|
|
||||||
#else
|
|
||||||
#define HPDF_PRINT_BINARY(BUF, LEN, CAPTION) /* do nothing */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _HPDF_UTILS_H */
|
|
||||||
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
/* automatically generated by configure */
|
|
||||||
/* edit configure.in to change version number */
|
|
||||||
#define HPDF_MAJOR_VERSION 2
|
|
||||||
#define HPDF_MINOR_VERSION 3
|
|
||||||
#define HPDF_BUGFIX_VERSION 0
|
|
||||||
#define HPDF_EXTRA_VERSION "RC2"
|
|
||||||
#define HPDF_VERSION_TEXT "2.3.0RC2"
|
|
||||||
#define HPDF_VERSION_ID 20300
|
|
||||||
@ -1,441 +0,0 @@
|
|||||||
/* crc32.h -- tables for rapid CRC calculation
|
|
||||||
* Generated automatically by crc32.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
local const unsigned long FAR crc_table[TBLS][256] =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
|
|
||||||
0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
|
|
||||||
0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
|
|
||||||
0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
|
|
||||||
0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
|
|
||||||
0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
|
|
||||||
0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
|
|
||||||
0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
|
|
||||||
0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
|
|
||||||
0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
|
|
||||||
0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
|
|
||||||
0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
|
|
||||||
0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
|
|
||||||
0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
|
|
||||||
0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
|
|
||||||
0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
|
|
||||||
0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
|
|
||||||
0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
|
|
||||||
0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
|
|
||||||
0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
|
|
||||||
0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
|
|
||||||
0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
|
|
||||||
0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
|
|
||||||
0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
|
|
||||||
0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
|
|
||||||
0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
|
|
||||||
0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
|
|
||||||
0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
|
|
||||||
0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
|
|
||||||
0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
|
|
||||||
0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
|
|
||||||
0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
|
|
||||||
0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
|
|
||||||
0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
|
|
||||||
0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
|
|
||||||
0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
|
|
||||||
0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
|
|
||||||
0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
|
|
||||||
0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
|
|
||||||
0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
|
|
||||||
0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
|
|
||||||
0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
|
|
||||||
0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
|
|
||||||
0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
|
|
||||||
0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
|
|
||||||
0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
|
|
||||||
0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
|
|
||||||
0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
|
|
||||||
0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
|
|
||||||
0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
|
|
||||||
0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
|
|
||||||
0x2d02ef8dUL
|
|
||||||
#ifdef BYFOUR
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
|
|
||||||
0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
|
|
||||||
0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
|
|
||||||
0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
|
|
||||||
0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
|
|
||||||
0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
|
|
||||||
0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
|
|
||||||
0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
|
|
||||||
0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
|
|
||||||
0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
|
|
||||||
0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
|
|
||||||
0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
|
|
||||||
0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
|
|
||||||
0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
|
|
||||||
0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
|
|
||||||
0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
|
|
||||||
0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
|
|
||||||
0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
|
|
||||||
0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
|
|
||||||
0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
|
|
||||||
0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
|
|
||||||
0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
|
|
||||||
0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
|
|
||||||
0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
|
|
||||||
0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
|
|
||||||
0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
|
|
||||||
0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
|
|
||||||
0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
|
|
||||||
0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
|
|
||||||
0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
|
|
||||||
0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
|
|
||||||
0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
|
|
||||||
0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
|
|
||||||
0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
|
|
||||||
0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
|
|
||||||
0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
|
|
||||||
0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
|
|
||||||
0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
|
|
||||||
0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
|
|
||||||
0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
|
|
||||||
0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
|
|
||||||
0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
|
|
||||||
0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
|
|
||||||
0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
|
|
||||||
0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
|
|
||||||
0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
|
|
||||||
0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
|
|
||||||
0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
|
|
||||||
0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
|
|
||||||
0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
|
|
||||||
0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
|
|
||||||
0x9324fd72UL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
|
|
||||||
0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
|
|
||||||
0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
|
|
||||||
0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
|
|
||||||
0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
|
|
||||||
0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
|
|
||||||
0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
|
|
||||||
0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
|
|
||||||
0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
|
|
||||||
0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
|
|
||||||
0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
|
|
||||||
0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
|
|
||||||
0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
|
|
||||||
0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
|
|
||||||
0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
|
|
||||||
0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
|
|
||||||
0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
|
|
||||||
0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
|
|
||||||
0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
|
|
||||||
0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
|
|
||||||
0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
|
|
||||||
0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
|
|
||||||
0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
|
|
||||||
0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
|
|
||||||
0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
|
|
||||||
0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
|
|
||||||
0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
|
|
||||||
0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
|
|
||||||
0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
|
|
||||||
0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
|
|
||||||
0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
|
|
||||||
0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
|
|
||||||
0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
|
|
||||||
0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
|
|
||||||
0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
|
|
||||||
0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
|
|
||||||
0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
|
|
||||||
0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
|
|
||||||
0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
|
|
||||||
0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
|
|
||||||
0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
|
|
||||||
0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
|
|
||||||
0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
|
|
||||||
0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
|
|
||||||
0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
|
|
||||||
0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
|
|
||||||
0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
|
|
||||||
0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
|
|
||||||
0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
|
|
||||||
0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
|
|
||||||
0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
|
|
||||||
0xbe9834edUL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
|
|
||||||
0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
|
|
||||||
0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
|
|
||||||
0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
|
|
||||||
0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
|
|
||||||
0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
|
|
||||||
0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
|
|
||||||
0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
|
|
||||||
0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
|
|
||||||
0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
|
|
||||||
0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
|
|
||||||
0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
|
|
||||||
0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
|
|
||||||
0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
|
|
||||||
0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
|
|
||||||
0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
|
|
||||||
0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
|
|
||||||
0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
|
|
||||||
0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
|
|
||||||
0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
|
|
||||||
0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
|
|
||||||
0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
|
|
||||||
0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
|
|
||||||
0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
|
|
||||||
0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
|
|
||||||
0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
|
|
||||||
0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
|
|
||||||
0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
|
|
||||||
0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
|
|
||||||
0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
|
|
||||||
0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
|
|
||||||
0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
|
|
||||||
0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
|
|
||||||
0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
|
|
||||||
0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
|
|
||||||
0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
|
|
||||||
0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
|
|
||||||
0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
|
|
||||||
0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
|
|
||||||
0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
|
|
||||||
0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
|
|
||||||
0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
|
|
||||||
0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
|
|
||||||
0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
|
|
||||||
0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
|
|
||||||
0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
|
|
||||||
0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
|
|
||||||
0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
|
|
||||||
0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
|
|
||||||
0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
|
|
||||||
0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
|
|
||||||
0xde0506f1UL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
|
|
||||||
0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
|
|
||||||
0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
|
|
||||||
0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
|
|
||||||
0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
|
|
||||||
0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
|
|
||||||
0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
|
|
||||||
0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
|
|
||||||
0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
|
|
||||||
0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
|
|
||||||
0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
|
|
||||||
0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
|
|
||||||
0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
|
|
||||||
0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
|
|
||||||
0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
|
|
||||||
0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
|
|
||||||
0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
|
|
||||||
0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
|
|
||||||
0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
|
|
||||||
0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
|
|
||||||
0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
|
|
||||||
0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
|
|
||||||
0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
|
|
||||||
0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
|
|
||||||
0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
|
|
||||||
0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
|
|
||||||
0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
|
|
||||||
0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
|
|
||||||
0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
|
|
||||||
0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
|
|
||||||
0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
|
|
||||||
0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
|
|
||||||
0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
|
|
||||||
0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
|
|
||||||
0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
|
|
||||||
0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
|
|
||||||
0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
|
|
||||||
0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
|
|
||||||
0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
|
|
||||||
0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
|
|
||||||
0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
|
|
||||||
0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
|
|
||||||
0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
|
|
||||||
0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
|
|
||||||
0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
|
|
||||||
0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
|
|
||||||
0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
|
|
||||||
0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
|
|
||||||
0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
|
|
||||||
0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
|
|
||||||
0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
|
|
||||||
0x8def022dUL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
|
|
||||||
0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
|
|
||||||
0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
|
|
||||||
0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
|
|
||||||
0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
|
|
||||||
0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
|
|
||||||
0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
|
|
||||||
0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
|
|
||||||
0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
|
|
||||||
0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
|
|
||||||
0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
|
|
||||||
0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
|
|
||||||
0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
|
|
||||||
0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
|
|
||||||
0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
|
|
||||||
0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
|
|
||||||
0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
|
|
||||||
0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
|
|
||||||
0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
|
|
||||||
0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
|
|
||||||
0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
|
|
||||||
0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
|
|
||||||
0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
|
|
||||||
0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
|
|
||||||
0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
|
|
||||||
0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
|
|
||||||
0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
|
|
||||||
0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
|
|
||||||
0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
|
|
||||||
0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
|
|
||||||
0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
|
|
||||||
0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
|
|
||||||
0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
|
|
||||||
0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
|
|
||||||
0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
|
|
||||||
0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
|
|
||||||
0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
|
|
||||||
0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
|
|
||||||
0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
|
|
||||||
0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
|
|
||||||
0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
|
|
||||||
0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
|
|
||||||
0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
|
|
||||||
0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
|
|
||||||
0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
|
|
||||||
0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
|
|
||||||
0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
|
|
||||||
0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
|
|
||||||
0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
|
|
||||||
0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
|
|
||||||
0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
|
|
||||||
0x72fd2493UL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
|
|
||||||
0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
|
|
||||||
0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
|
|
||||||
0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
|
|
||||||
0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
|
|
||||||
0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
|
|
||||||
0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
|
|
||||||
0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
|
|
||||||
0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
|
|
||||||
0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
|
|
||||||
0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
|
|
||||||
0x15f32421UL, 0x28b4782aUL, 0x1fdeba2bUL, 0x4660fc29UL, 0x710a3e28UL,
|
|
||||||
0xf41c712dUL, 0xc376b32cUL, 0x9ac8f52eUL, 0xada2372fUL, 0xc08d9a70UL,
|
|
||||||
0xf7e75871UL, 0xae591e73UL, 0x9933dc72UL, 0x1c259377UL, 0x2b4f5176UL,
|
|
||||||
0x72f11774UL, 0x459bd575UL, 0x78dc897eUL, 0x4fb64b7fUL, 0x16080d7dUL,
|
|
||||||
0x2162cf7cUL, 0xa4748079UL, 0x931e4278UL, 0xcaa0047aUL, 0xfdcac67bUL,
|
|
||||||
0xb02ebc6cUL, 0x87447e6dUL, 0xdefa386fUL, 0xe990fa6eUL, 0x6c86b56bUL,
|
|
||||||
0x5bec776aUL, 0x02523168UL, 0x3538f369UL, 0x087faf62UL, 0x3f156d63UL,
|
|
||||||
0x66ab2b61UL, 0x51c1e960UL, 0xd4d7a665UL, 0xe3bd6464UL, 0xba032266UL,
|
|
||||||
0x8d69e067UL, 0x20cbd748UL, 0x17a11549UL, 0x4e1f534bUL, 0x7975914aUL,
|
|
||||||
0xfc63de4fUL, 0xcb091c4eUL, 0x92b75a4cUL, 0xa5dd984dUL, 0x989ac446UL,
|
|
||||||
0xaff00647UL, 0xf64e4045UL, 0xc1248244UL, 0x4432cd41UL, 0x73580f40UL,
|
|
||||||
0x2ae64942UL, 0x1d8c8b43UL, 0x5068f154UL, 0x67023355UL, 0x3ebc7557UL,
|
|
||||||
0x09d6b756UL, 0x8cc0f853UL, 0xbbaa3a52UL, 0xe2147c50UL, 0xd57ebe51UL,
|
|
||||||
0xe839e25aUL, 0xdf53205bUL, 0x86ed6659UL, 0xb187a458UL, 0x3491eb5dUL,
|
|
||||||
0x03fb295cUL, 0x5a456f5eUL, 0x6d2fad5fUL, 0x801b35e1UL, 0xb771f7e0UL,
|
|
||||||
0xeecfb1e2UL, 0xd9a573e3UL, 0x5cb33ce6UL, 0x6bd9fee7UL, 0x3267b8e5UL,
|
|
||||||
0x050d7ae4UL, 0x384a26efUL, 0x0f20e4eeUL, 0x569ea2ecUL, 0x61f460edUL,
|
|
||||||
0xe4e22fe8UL, 0xd388ede9UL, 0x8a36abebUL, 0xbd5c69eaUL, 0xf0b813fdUL,
|
|
||||||
0xc7d2d1fcUL, 0x9e6c97feUL, 0xa90655ffUL, 0x2c101afaUL, 0x1b7ad8fbUL,
|
|
||||||
0x42c49ef9UL, 0x75ae5cf8UL, 0x48e900f3UL, 0x7f83c2f2UL, 0x263d84f0UL,
|
|
||||||
0x115746f1UL, 0x944109f4UL, 0xa32bcbf5UL, 0xfa958df7UL, 0xcdff4ff6UL,
|
|
||||||
0x605d78d9UL, 0x5737bad8UL, 0x0e89fcdaUL, 0x39e33edbUL, 0xbcf571deUL,
|
|
||||||
0x8b9fb3dfUL, 0xd221f5ddUL, 0xe54b37dcUL, 0xd80c6bd7UL, 0xef66a9d6UL,
|
|
||||||
0xb6d8efd4UL, 0x81b22dd5UL, 0x04a462d0UL, 0x33cea0d1UL, 0x6a70e6d3UL,
|
|
||||||
0x5d1a24d2UL, 0x10fe5ec5UL, 0x27949cc4UL, 0x7e2adac6UL, 0x494018c7UL,
|
|
||||||
0xcc5657c2UL, 0xfb3c95c3UL, 0xa282d3c1UL, 0x95e811c0UL, 0xa8af4dcbUL,
|
|
||||||
0x9fc58fcaUL, 0xc67bc9c8UL, 0xf1110bc9UL, 0x740744ccUL, 0x436d86cdUL,
|
|
||||||
0x1ad3c0cfUL, 0x2db902ceUL, 0x4096af91UL, 0x77fc6d90UL, 0x2e422b92UL,
|
|
||||||
0x1928e993UL, 0x9c3ea696UL, 0xab546497UL, 0xf2ea2295UL, 0xc580e094UL,
|
|
||||||
0xf8c7bc9fUL, 0xcfad7e9eUL, 0x9613389cUL, 0xa179fa9dUL, 0x246fb598UL,
|
|
||||||
0x13057799UL, 0x4abb319bUL, 0x7dd1f39aUL, 0x3035898dUL, 0x075f4b8cUL,
|
|
||||||
0x5ee10d8eUL, 0x698bcf8fUL, 0xec9d808aUL, 0xdbf7428bUL, 0x82490489UL,
|
|
||||||
0xb523c688UL, 0x88649a83UL, 0xbf0e5882UL, 0xe6b01e80UL, 0xd1dadc81UL,
|
|
||||||
0x54cc9384UL, 0x63a65185UL, 0x3a181787UL, 0x0d72d586UL, 0xa0d0e2a9UL,
|
|
||||||
0x97ba20a8UL, 0xce0466aaUL, 0xf96ea4abUL, 0x7c78ebaeUL, 0x4b1229afUL,
|
|
||||||
0x12ac6fadUL, 0x25c6adacUL, 0x1881f1a7UL, 0x2feb33a6UL, 0x765575a4UL,
|
|
||||||
0x413fb7a5UL, 0xc429f8a0UL, 0xf3433aa1UL, 0xaafd7ca3UL, 0x9d97bea2UL,
|
|
||||||
0xd073c4b5UL, 0xe71906b4UL, 0xbea740b6UL, 0x89cd82b7UL, 0x0cdbcdb2UL,
|
|
||||||
0x3bb10fb3UL, 0x620f49b1UL, 0x55658bb0UL, 0x6822d7bbUL, 0x5f4815baUL,
|
|
||||||
0x06f653b8UL, 0x319c91b9UL, 0xb48adebcUL, 0x83e01cbdUL, 0xda5e5abfUL,
|
|
||||||
0xed3498beUL
|
|
||||||
},
|
|
||||||
{
|
|
||||||
0x00000000UL, 0x6567bcb8UL, 0x8bc809aaUL, 0xeeafb512UL, 0x5797628fUL,
|
|
||||||
0x32f0de37UL, 0xdc5f6b25UL, 0xb938d79dUL, 0xef28b4c5UL, 0x8a4f087dUL,
|
|
||||||
0x64e0bd6fUL, 0x018701d7UL, 0xb8bfd64aUL, 0xddd86af2UL, 0x3377dfe0UL,
|
|
||||||
0x56106358UL, 0x9f571950UL, 0xfa30a5e8UL, 0x149f10faUL, 0x71f8ac42UL,
|
|
||||||
0xc8c07bdfUL, 0xada7c767UL, 0x43087275UL, 0x266fcecdUL, 0x707fad95UL,
|
|
||||||
0x1518112dUL, 0xfbb7a43fUL, 0x9ed01887UL, 0x27e8cf1aUL, 0x428f73a2UL,
|
|
||||||
0xac20c6b0UL, 0xc9477a08UL, 0x3eaf32a0UL, 0x5bc88e18UL, 0xb5673b0aUL,
|
|
||||||
0xd00087b2UL, 0x6938502fUL, 0x0c5fec97UL, 0xe2f05985UL, 0x8797e53dUL,
|
|
||||||
0xd1878665UL, 0xb4e03addUL, 0x5a4f8fcfUL, 0x3f283377UL, 0x8610e4eaUL,
|
|
||||||
0xe3775852UL, 0x0dd8ed40UL, 0x68bf51f8UL, 0xa1f82bf0UL, 0xc49f9748UL,
|
|
||||||
0x2a30225aUL, 0x4f579ee2UL, 0xf66f497fUL, 0x9308f5c7UL, 0x7da740d5UL,
|
|
||||||
0x18c0fc6dUL, 0x4ed09f35UL, 0x2bb7238dUL, 0xc518969fUL, 0xa07f2a27UL,
|
|
||||||
0x1947fdbaUL, 0x7c204102UL, 0x928ff410UL, 0xf7e848a8UL, 0x3d58149bUL,
|
|
||||||
0x583fa823UL, 0xb6901d31UL, 0xd3f7a189UL, 0x6acf7614UL, 0x0fa8caacUL,
|
|
||||||
0xe1077fbeUL, 0x8460c306UL, 0xd270a05eUL, 0xb7171ce6UL, 0x59b8a9f4UL,
|
|
||||||
0x3cdf154cUL, 0x85e7c2d1UL, 0xe0807e69UL, 0x0e2fcb7bUL, 0x6b4877c3UL,
|
|
||||||
0xa20f0dcbUL, 0xc768b173UL, 0x29c70461UL, 0x4ca0b8d9UL, 0xf5986f44UL,
|
|
||||||
0x90ffd3fcUL, 0x7e5066eeUL, 0x1b37da56UL, 0x4d27b90eUL, 0x284005b6UL,
|
|
||||||
0xc6efb0a4UL, 0xa3880c1cUL, 0x1ab0db81UL, 0x7fd76739UL, 0x9178d22bUL,
|
|
||||||
0xf41f6e93UL, 0x03f7263bUL, 0x66909a83UL, 0x883f2f91UL, 0xed589329UL,
|
|
||||||
0x546044b4UL, 0x3107f80cUL, 0xdfa84d1eUL, 0xbacff1a6UL, 0xecdf92feUL,
|
|
||||||
0x89b82e46UL, 0x67179b54UL, 0x027027ecUL, 0xbb48f071UL, 0xde2f4cc9UL,
|
|
||||||
0x3080f9dbUL, 0x55e74563UL, 0x9ca03f6bUL, 0xf9c783d3UL, 0x176836c1UL,
|
|
||||||
0x720f8a79UL, 0xcb375de4UL, 0xae50e15cUL, 0x40ff544eUL, 0x2598e8f6UL,
|
|
||||||
0x73888baeUL, 0x16ef3716UL, 0xf8408204UL, 0x9d273ebcUL, 0x241fe921UL,
|
|
||||||
0x41785599UL, 0xafd7e08bUL, 0xcab05c33UL, 0x3bb659edUL, 0x5ed1e555UL,
|
|
||||||
0xb07e5047UL, 0xd519ecffUL, 0x6c213b62UL, 0x094687daUL, 0xe7e932c8UL,
|
|
||||||
0x828e8e70UL, 0xd49eed28UL, 0xb1f95190UL, 0x5f56e482UL, 0x3a31583aUL,
|
|
||||||
0x83098fa7UL, 0xe66e331fUL, 0x08c1860dUL, 0x6da63ab5UL, 0xa4e140bdUL,
|
|
||||||
0xc186fc05UL, 0x2f294917UL, 0x4a4ef5afUL, 0xf3762232UL, 0x96119e8aUL,
|
|
||||||
0x78be2b98UL, 0x1dd99720UL, 0x4bc9f478UL, 0x2eae48c0UL, 0xc001fdd2UL,
|
|
||||||
0xa566416aUL, 0x1c5e96f7UL, 0x79392a4fUL, 0x97969f5dUL, 0xf2f123e5UL,
|
|
||||||
0x05196b4dUL, 0x607ed7f5UL, 0x8ed162e7UL, 0xebb6de5fUL, 0x528e09c2UL,
|
|
||||||
0x37e9b57aUL, 0xd9460068UL, 0xbc21bcd0UL, 0xea31df88UL, 0x8f566330UL,
|
|
||||||
0x61f9d622UL, 0x049e6a9aUL, 0xbda6bd07UL, 0xd8c101bfUL, 0x366eb4adUL,
|
|
||||||
0x53090815UL, 0x9a4e721dUL, 0xff29cea5UL, 0x11867bb7UL, 0x74e1c70fUL,
|
|
||||||
0xcdd91092UL, 0xa8beac2aUL, 0x46111938UL, 0x2376a580UL, 0x7566c6d8UL,
|
|
||||||
0x10017a60UL, 0xfeaecf72UL, 0x9bc973caUL, 0x22f1a457UL, 0x479618efUL,
|
|
||||||
0xa939adfdUL, 0xcc5e1145UL, 0x06ee4d76UL, 0x6389f1ceUL, 0x8d2644dcUL,
|
|
||||||
0xe841f864UL, 0x51792ff9UL, 0x341e9341UL, 0xdab12653UL, 0xbfd69aebUL,
|
|
||||||
0xe9c6f9b3UL, 0x8ca1450bUL, 0x620ef019UL, 0x07694ca1UL, 0xbe519b3cUL,
|
|
||||||
0xdb362784UL, 0x35999296UL, 0x50fe2e2eUL, 0x99b95426UL, 0xfcdee89eUL,
|
|
||||||
0x12715d8cUL, 0x7716e134UL, 0xce2e36a9UL, 0xab498a11UL, 0x45e63f03UL,
|
|
||||||
0x208183bbUL, 0x7691e0e3UL, 0x13f65c5bUL, 0xfd59e949UL, 0x983e55f1UL,
|
|
||||||
0x2106826cUL, 0x44613ed4UL, 0xaace8bc6UL, 0xcfa9377eUL, 0x38417fd6UL,
|
|
||||||
0x5d26c36eUL, 0xb389767cUL, 0xd6eecac4UL, 0x6fd61d59UL, 0x0ab1a1e1UL,
|
|
||||||
0xe41e14f3UL, 0x8179a84bUL, 0xd769cb13UL, 0xb20e77abUL, 0x5ca1c2b9UL,
|
|
||||||
0x39c67e01UL, 0x80fea99cUL, 0xe5991524UL, 0x0b36a036UL, 0x6e511c8eUL,
|
|
||||||
0xa7166686UL, 0xc271da3eUL, 0x2cde6f2cUL, 0x49b9d394UL, 0xf0810409UL,
|
|
||||||
0x95e6b8b1UL, 0x7b490da3UL, 0x1e2eb11bUL, 0x483ed243UL, 0x2d596efbUL,
|
|
||||||
0xc3f6dbe9UL, 0xa6916751UL, 0x1fa9b0ccUL, 0x7ace0c74UL, 0x9461b966UL,
|
|
||||||
0xf10605deUL
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1,131 +0,0 @@
|
|||||||
/* crypt.h -- base code for crypt/uncrypt ZIPfile
|
|
||||||
|
|
||||||
|
|
||||||
Version 1.01e, February 12th, 2005
|
|
||||||
|
|
||||||
Copyright (C) 1998-2005 Gilles Vollant
|
|
||||||
|
|
||||||
This code is a modified version of crypting code in Infozip distribution
|
|
||||||
|
|
||||||
The encryption/decryption parts of this source code (as opposed to the
|
|
||||||
non-echoing password parts) were originally written in Europe. The
|
|
||||||
whole source package can be freely distributed, including from the USA.
|
|
||||||
(Prior to January 2000, re-export from the US was a violation of US law.)
|
|
||||||
|
|
||||||
This encryption code is a direct transcription of the algorithm from
|
|
||||||
Roger Schlafly, described by Phil Katz in the file appnote.txt. This
|
|
||||||
file (appnote.txt) is distributed with the PKZIP program (even in the
|
|
||||||
version without encryption capabilities).
|
|
||||||
|
|
||||||
If you don't need crypting in your application, just define symbols
|
|
||||||
NOCRYPT and NOUNCRYPT.
|
|
||||||
|
|
||||||
This code support the "Traditional PKWARE Encryption".
|
|
||||||
|
|
||||||
The new AES encryption added on Zip format by Winzip (see the page
|
|
||||||
http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong
|
|
||||||
Encryption is not supported.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8))
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* Return the next byte in the pseudo-random sequence
|
|
||||||
*/
|
|
||||||
static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
|
|
||||||
{
|
|
||||||
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
|
|
||||||
* unpredictable manner on 16-bit systems; not a problem
|
|
||||||
* with any known compiler so far, though */
|
|
||||||
|
|
||||||
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
|
|
||||||
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* Update the encryption keys with the next byte of plain text
|
|
||||||
*/
|
|
||||||
static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
|
|
||||||
{
|
|
||||||
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
|
|
||||||
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
|
|
||||||
(*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1;
|
|
||||||
{
|
|
||||||
register int keyshift = (int)((*(pkeys+1)) >> 24);
|
|
||||||
(*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift);
|
|
||||||
}
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* Initialize the encryption keys and the random header according to
|
|
||||||
* the given password.
|
|
||||||
*/
|
|
||||||
static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
|
|
||||||
{
|
|
||||||
*(pkeys+0) = 305419896L;
|
|
||||||
*(pkeys+1) = 591751049L;
|
|
||||||
*(pkeys+2) = 878082192L;
|
|
||||||
while (*passwd != '\0') {
|
|
||||||
update_keys(pkeys,pcrc_32_tab,(int)*passwd);
|
|
||||||
passwd++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#define zdecode(pkeys,pcrc_32_tab,c) \
|
|
||||||
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
|
|
||||||
|
|
||||||
#define zencode(pkeys,pcrc_32_tab,c,t) \
|
|
||||||
(t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
|
|
||||||
|
|
||||||
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
|
|
||||||
|
|
||||||
#define RAND_HEAD_LEN 12
|
|
||||||
/* "last resort" source for second part of crypt seed pattern */
|
|
||||||
# ifndef ZCR_SEED2
|
|
||||||
# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
|
|
||||||
# endif
|
|
||||||
|
|
||||||
static int crypthead(const char* passwd, /* password string */
|
|
||||||
unsigned char* buf, /* where to write header */
|
|
||||||
int bufSize,
|
|
||||||
unsigned long* pkeys,
|
|
||||||
const unsigned long* pcrc_32_tab,
|
|
||||||
unsigned long crcForCrypting)
|
|
||||||
{
|
|
||||||
int n; /* index in random header */
|
|
||||||
int t; /* temporary */
|
|
||||||
int c; /* random byte */
|
|
||||||
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
|
|
||||||
static unsigned calls = 0; /* ensure different random header each time */
|
|
||||||
|
|
||||||
if (bufSize<RAND_HEAD_LEN)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* First generate RAND_HEAD_LEN-2 random bytes. We encrypt the
|
|
||||||
* output of rand() to get less predictability, since rand() is
|
|
||||||
* often poorly implemented.
|
|
||||||
*/
|
|
||||||
if (++calls == 1)
|
|
||||||
{
|
|
||||||
srand((unsigned)(time(NULL) ^ ZCR_SEED2));
|
|
||||||
}
|
|
||||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
|
||||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
|
||||||
{
|
|
||||||
c = (rand() >> 7) & 0xff;
|
|
||||||
header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t);
|
|
||||||
}
|
|
||||||
/* Encrypt random header (last two bytes is high word of crc) */
|
|
||||||
init_keys(passwd, pkeys, pcrc_32_tab);
|
|
||||||
for (n = 0; n < RAND_HEAD_LEN-2; n++)
|
|
||||||
{
|
|
||||||
buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t);
|
|
||||||
}
|
|
||||||
buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t);
|
|
||||||
buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t);
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,342 +0,0 @@
|
|||||||
/* deflate.h -- internal compression state
|
|
||||||
* Copyright (C) 1995-2010 Jean-loup Gailly
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
|
||||||
part of the implementation of the compression library and is
|
|
||||||
subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* @(#) $Id$ */
|
|
||||||
|
|
||||||
#ifndef DEFLATE_H
|
|
||||||
#define DEFLATE_H
|
|
||||||
|
|
||||||
#include "zutil.h"
|
|
||||||
|
|
||||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
|
||||||
trailer creation by deflate(). NO_GZIP would be used to avoid linking in
|
|
||||||
the crc code when it is not needed. For shared libraries, gzip encoding
|
|
||||||
should be left enabled. */
|
|
||||||
#ifndef NO_GZIP
|
|
||||||
# define GZIP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* ===========================================================================
|
|
||||||
* Internal compression state.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LENGTH_CODES 29
|
|
||||||
/* number of length codes, not counting the special END_BLOCK code */
|
|
||||||
|
|
||||||
#define LITERALS 256
|
|
||||||
/* number of literal bytes 0..255 */
|
|
||||||
|
|
||||||
#define L_CODES (LITERALS+1+LENGTH_CODES)
|
|
||||||
/* number of Literal or Length codes, including the END_BLOCK code */
|
|
||||||
|
|
||||||
#define D_CODES 30
|
|
||||||
/* number of distance codes */
|
|
||||||
|
|
||||||
#define BL_CODES 19
|
|
||||||
/* number of codes used to transfer the bit lengths */
|
|
||||||
|
|
||||||
#define HEAP_SIZE (2*L_CODES+1)
|
|
||||||
/* maximum heap size */
|
|
||||||
|
|
||||||
#define MAX_BITS 15
|
|
||||||
/* All codes must not exceed MAX_BITS bits */
|
|
||||||
|
|
||||||
#define INIT_STATE 42
|
|
||||||
#define EXTRA_STATE 69
|
|
||||||
#define NAME_STATE 73
|
|
||||||
#define COMMENT_STATE 91
|
|
||||||
#define HCRC_STATE 103
|
|
||||||
#define BUSY_STATE 113
|
|
||||||
#define FINISH_STATE 666
|
|
||||||
/* Stream status */
|
|
||||||
|
|
||||||
|
|
||||||
/* Data structure describing a single value and its code string. */
|
|
||||||
typedef struct ct_data_s {
|
|
||||||
union {
|
|
||||||
ush freq; /* frequency count */
|
|
||||||
ush code; /* bit string */
|
|
||||||
} fc;
|
|
||||||
union {
|
|
||||||
ush dad; /* father node in Huffman tree */
|
|
||||||
ush len; /* length of bit string */
|
|
||||||
} dl;
|
|
||||||
} FAR ct_data;
|
|
||||||
|
|
||||||
#define Freq fc.freq
|
|
||||||
#define Code fc.code
|
|
||||||
#define Dad dl.dad
|
|
||||||
#define Len dl.len
|
|
||||||
|
|
||||||
typedef struct static_tree_desc_s static_tree_desc;
|
|
||||||
|
|
||||||
typedef struct tree_desc_s {
|
|
||||||
ct_data *dyn_tree; /* the dynamic tree */
|
|
||||||
int max_code; /* largest code with non zero frequency */
|
|
||||||
static_tree_desc *stat_desc; /* the corresponding static tree */
|
|
||||||
} FAR tree_desc;
|
|
||||||
|
|
||||||
typedef ush Pos;
|
|
||||||
typedef Pos FAR Posf;
|
|
||||||
typedef unsigned IPos;
|
|
||||||
|
|
||||||
/* A Pos is an index in the character window. We use short instead of int to
|
|
||||||
* save space in the various tables. IPos is used only for parameter passing.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct internal_state {
|
|
||||||
z_streamp strm; /* pointer back to this zlib stream */
|
|
||||||
int status; /* as the name implies */
|
|
||||||
Bytef *pending_buf; /* output still pending */
|
|
||||||
ulg pending_buf_size; /* size of pending_buf */
|
|
||||||
Bytef *pending_out; /* next pending byte to output to the stream */
|
|
||||||
uInt pending; /* nb of bytes in the pending buffer */
|
|
||||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
|
||||||
gz_headerp gzhead; /* gzip header information to write */
|
|
||||||
uInt gzindex; /* where in extra, name, or comment */
|
|
||||||
Byte method; /* STORED (for zip only) or DEFLATED */
|
|
||||||
int last_flush; /* value of flush param for previous deflate call */
|
|
||||||
|
|
||||||
/* used by deflate.c: */
|
|
||||||
|
|
||||||
uInt w_size; /* LZ77 window size (32K by default) */
|
|
||||||
uInt w_bits; /* log2(w_size) (8..16) */
|
|
||||||
uInt w_mask; /* w_size - 1 */
|
|
||||||
|
|
||||||
Bytef *window;
|
|
||||||
/* Sliding window. Input bytes are read into the second half of the window,
|
|
||||||
* and move to the first half later to keep a dictionary of at least wSize
|
|
||||||
* bytes. With this organization, matches are limited to a distance of
|
|
||||||
* wSize-MAX_MATCH bytes, but this ensures that IO is always
|
|
||||||
* performed with a length multiple of the block size. Also, it limits
|
|
||||||
* the window size to 64K, which is quite useful on MSDOS.
|
|
||||||
* To do: use the user input buffer as sliding window.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ulg window_size;
|
|
||||||
/* Actual size of window: 2*wSize, except when the user input buffer
|
|
||||||
* is directly used as sliding window.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Posf *prev;
|
|
||||||
/* Link to older string with same hash index. To limit the size of this
|
|
||||||
* array to 64K, this link is maintained only for the last 32K strings.
|
|
||||||
* An index in this array is thus a window index modulo 32K.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Posf *head; /* Heads of the hash chains or NIL. */
|
|
||||||
|
|
||||||
uInt ins_h; /* hash index of string to be inserted */
|
|
||||||
uInt hash_size; /* number of elements in hash table */
|
|
||||||
uInt hash_bits; /* log2(hash_size) */
|
|
||||||
uInt hash_mask; /* hash_size-1 */
|
|
||||||
|
|
||||||
uInt hash_shift;
|
|
||||||
/* Number of bits by which ins_h must be shifted at each input
|
|
||||||
* step. It must be such that after MIN_MATCH steps, the oldest
|
|
||||||
* byte no longer takes part in the hash key, that is:
|
|
||||||
* hash_shift * MIN_MATCH >= hash_bits
|
|
||||||
*/
|
|
||||||
|
|
||||||
long block_start;
|
|
||||||
/* Window position at the beginning of the current output block. Gets
|
|
||||||
* negative when the window is moved backwards.
|
|
||||||
*/
|
|
||||||
|
|
||||||
uInt match_length; /* length of best match */
|
|
||||||
IPos prev_match; /* previous match */
|
|
||||||
int match_available; /* set if previous match exists */
|
|
||||||
uInt strstart; /* start of string to insert */
|
|
||||||
uInt match_start; /* start of matching string */
|
|
||||||
uInt lookahead; /* number of valid bytes ahead in window */
|
|
||||||
|
|
||||||
uInt prev_length;
|
|
||||||
/* Length of the best match at previous step. Matches not greater than this
|
|
||||||
* are discarded. This is used in the lazy match evaluation.
|
|
||||||
*/
|
|
||||||
|
|
||||||
uInt max_chain_length;
|
|
||||||
/* To speed up deflation, hash chains are never searched beyond this
|
|
||||||
* length. A higher limit improves compression ratio but degrades the
|
|
||||||
* speed.
|
|
||||||
*/
|
|
||||||
|
|
||||||
uInt max_lazy_match;
|
|
||||||
/* Attempt to find a better match only when the current match is strictly
|
|
||||||
* smaller than this value. This mechanism is used only for compression
|
|
||||||
* levels >= 4.
|
|
||||||
*/
|
|
||||||
# define max_insert_length max_lazy_match
|
|
||||||
/* Insert new strings in the hash table only if the match length is not
|
|
||||||
* greater than this length. This saves time but degrades compression.
|
|
||||||
* max_insert_length is used only for compression levels <= 3.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int level; /* compression level (1..9) */
|
|
||||||
int strategy; /* favor or force Huffman coding*/
|
|
||||||
|
|
||||||
uInt good_match;
|
|
||||||
/* Use a faster search when the previous match is longer than this */
|
|
||||||
|
|
||||||
int nice_match; /* Stop searching when current match exceeds this */
|
|
||||||
|
|
||||||
/* used by trees.c: */
|
|
||||||
/* Didn't use ct_data typedef below to supress compiler warning */
|
|
||||||
struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
|
|
||||||
struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
|
|
||||||
struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
|
|
||||||
|
|
||||||
struct tree_desc_s l_desc; /* desc. for literal tree */
|
|
||||||
struct tree_desc_s d_desc; /* desc. for distance tree */
|
|
||||||
struct tree_desc_s bl_desc; /* desc. for bit length tree */
|
|
||||||
|
|
||||||
ush bl_count[MAX_BITS+1];
|
|
||||||
/* number of codes at each bit length for an optimal tree */
|
|
||||||
|
|
||||||
int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
|
|
||||||
int heap_len; /* number of elements in the heap */
|
|
||||||
int heap_max; /* element of largest frequency */
|
|
||||||
/* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
|
|
||||||
* The same heap array is used to build all trees.
|
|
||||||
*/
|
|
||||||
|
|
||||||
uch depth[2*L_CODES+1];
|
|
||||||
/* Depth of each subtree used as tie breaker for trees of equal frequency
|
|
||||||
*/
|
|
||||||
|
|
||||||
uchf *l_buf; /* buffer for literals or lengths */
|
|
||||||
|
|
||||||
uInt lit_bufsize;
|
|
||||||
/* Size of match buffer for literals/lengths. There are 4 reasons for
|
|
||||||
* limiting lit_bufsize to 64K:
|
|
||||||
* - frequencies can be kept in 16 bit counters
|
|
||||||
* - if compression is not successful for the first block, all input
|
|
||||||
* data is still in the window so we can still emit a stored block even
|
|
||||||
* when input comes from standard input. (This can also be done for
|
|
||||||
* all blocks if lit_bufsize is not greater than 32K.)
|
|
||||||
* - if compression is not successful for a file smaller than 64K, we can
|
|
||||||
* even emit a stored file instead of a stored block (saving 5 bytes).
|
|
||||||
* This is applicable only for zip (not gzip or zlib).
|
|
||||||
* - creating new Huffman trees less frequently may not provide fast
|
|
||||||
* adaptation to changes in the input data statistics. (Take for
|
|
||||||
* example a binary file with poorly compressible code followed by
|
|
||||||
* a highly compressible string table.) Smaller buffer sizes give
|
|
||||||
* fast adaptation but have of course the overhead of transmitting
|
|
||||||
* trees more frequently.
|
|
||||||
* - I can't count above 4
|
|
||||||
*/
|
|
||||||
|
|
||||||
uInt last_lit; /* running index in l_buf */
|
|
||||||
|
|
||||||
ushf *d_buf;
|
|
||||||
/* Buffer for distances. To simplify the code, d_buf and l_buf have
|
|
||||||
* the same number of elements. To use different lengths, an extra flag
|
|
||||||
* array would be necessary.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ulg opt_len; /* bit length of current block with optimal trees */
|
|
||||||
ulg static_len; /* bit length of current block with static trees */
|
|
||||||
uInt matches; /* number of string matches in current block */
|
|
||||||
int last_eob_len; /* bit length of EOB code for last block */
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
ulg compressed_len; /* total bit length of compressed file mod 2^32 */
|
|
||||||
ulg bits_sent; /* bit length of compressed data sent mod 2^32 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ush bi_buf;
|
|
||||||
/* Output buffer. bits are inserted starting at the bottom (least
|
|
||||||
* significant bits).
|
|
||||||
*/
|
|
||||||
int bi_valid;
|
|
||||||
/* Number of valid bits in bi_buf. All bits above the last valid bit
|
|
||||||
* are always zero.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ulg high_water;
|
|
||||||
/* High water mark offset in window for initialized bytes -- bytes above
|
|
||||||
* this are set to zero in order to avoid memory check warnings when
|
|
||||||
* longest match routines access bytes past the input. This is then
|
|
||||||
* updated to the new high water mark.
|
|
||||||
*/
|
|
||||||
|
|
||||||
} FAR deflate_state;
|
|
||||||
|
|
||||||
/* Output a byte on the stream.
|
|
||||||
* IN assertion: there is enough room in pending_buf.
|
|
||||||
*/
|
|
||||||
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);}
|
|
||||||
|
|
||||||
|
|
||||||
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1)
|
|
||||||
/* Minimum amount of lookahead, except at the end of the input file.
|
|
||||||
* See deflate.c for comments about the MIN_MATCH+1.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD)
|
|
||||||
/* In order to simplify the code, particularly on 16 bit machines, match
|
|
||||||
* distances are limited to MAX_DIST instead of WSIZE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define WIN_INIT MAX_MATCH
|
|
||||||
/* Number of bytes after end of data in window to initialize in order to avoid
|
|
||||||
memory checker errors from longest match routines */
|
|
||||||
|
|
||||||
/* in trees.c */
|
|
||||||
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
|
|
||||||
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
|
|
||||||
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
|
|
||||||
ulg stored_len, int last));
|
|
||||||
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
|
|
||||||
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
|
|
||||||
ulg stored_len, int last));
|
|
||||||
|
|
||||||
#define d_code(dist) \
|
|
||||||
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
|
|
||||||
/* Mapping from a distance to a distance code. dist is the distance - 1 and
|
|
||||||
* must not have side effects. _dist_code[256] and _dist_code[257] are never
|
|
||||||
* used.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef DEBUG
|
|
||||||
/* Inline versions of _tr_tally for speed: */
|
|
||||||
|
|
||||||
#if defined(GEN_TREES_H) || !defined(STDC)
|
|
||||||
extern uch ZLIB_INTERNAL _length_code[];
|
|
||||||
extern uch ZLIB_INTERNAL _dist_code[];
|
|
||||||
#else
|
|
||||||
extern const uch ZLIB_INTERNAL _length_code[];
|
|
||||||
extern const uch ZLIB_INTERNAL _dist_code[];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
# define _tr_tally_lit(s, c, flush) \
|
|
||||||
{ uch cc = (c); \
|
|
||||||
s->d_buf[s->last_lit] = 0; \
|
|
||||||
s->l_buf[s->last_lit++] = cc; \
|
|
||||||
s->dyn_ltree[cc].Freq++; \
|
|
||||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
|
||||||
}
|
|
||||||
# define _tr_tally_dist(s, distance, length, flush) \
|
|
||||||
{ uch len = (length); \
|
|
||||||
ush dist = (distance); \
|
|
||||||
s->d_buf[s->last_lit] = dist; \
|
|
||||||
s->l_buf[s->last_lit++] = len; \
|
|
||||||
dist--; \
|
|
||||||
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
|
||||||
s->dyn_dtree[d_code(dist)].Freq++; \
|
|
||||||
flush = (s->last_lit == s->lit_bufsize-1); \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
|
|
||||||
# define _tr_tally_dist(s, distance, length, flush) \
|
|
||||||
flush = _tr_tally(s, distance, length)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* DEFLATE_H */
|
|
||||||
@ -1,132 +0,0 @@
|
|||||||
/* gzguts.h -- zlib internal header definitions for gz* operations
|
|
||||||
* Copyright (C) 2004, 2005, 2010 Mark Adler
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef _LARGEFILE64_SOURCE
|
|
||||||
# ifndef _LARGEFILE_SOURCE
|
|
||||||
# define _LARGEFILE_SOURCE 1
|
|
||||||
# endif
|
|
||||||
# ifdef _FILE_OFFSET_BITS
|
|
||||||
# undef _FILE_OFFSET_BITS
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
|
|
||||||
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
|
|
||||||
#else
|
|
||||||
# define ZLIB_INTERNAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "zlib.h"
|
|
||||||
#ifdef STDC
|
|
||||||
# include <string.h>
|
|
||||||
# include <stdlib.h>
|
|
||||||
# include <limits.h>
|
|
||||||
#endif
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#ifdef NO_DEFLATE /* for compatibility with old definition */
|
|
||||||
# define NO_GZCOMPRESS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# include <io.h>
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef local
|
|
||||||
# define local static
|
|
||||||
#endif
|
|
||||||
/* compile with -Dlocal if your debugger can't find static symbols */
|
|
||||||
|
|
||||||
/* gz* functions always use library allocation functions */
|
|
||||||
#ifndef STDC
|
|
||||||
extern voidp malloc OF((uInt size));
|
|
||||||
extern void free OF((voidpf ptr));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* get errno and strerror definition */
|
|
||||||
#if defined UNDER_CE
|
|
||||||
# include <windows.h>
|
|
||||||
# define zstrerror() gz_strwinerror((DWORD)GetLastError())
|
|
||||||
#else
|
|
||||||
# ifdef STDC
|
|
||||||
# include <errno.h>
|
|
||||||
# define zstrerror() strerror(errno)
|
|
||||||
# else
|
|
||||||
# define zstrerror() "stdio error (consult errno)"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* provide prototypes for these when building zlib without LFS */
|
|
||||||
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
|
|
||||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
|
|
||||||
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
|
|
||||||
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
|
|
||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* default i/o buffer size -- double this for output when reading */
|
|
||||||
#define GZBUFSIZE 8192
|
|
||||||
|
|
||||||
/* gzip modes, also provide a little integrity check on the passed structure */
|
|
||||||
#define GZ_NONE 0
|
|
||||||
#define GZ_READ 7247
|
|
||||||
#define GZ_WRITE 31153
|
|
||||||
#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
|
|
||||||
|
|
||||||
/* values for gz_state how */
|
|
||||||
#define LOOK 0 /* look for a gzip header */
|
|
||||||
#define COPY 1 /* copy input directly */
|
|
||||||
#define GZIP 2 /* decompress a gzip stream */
|
|
||||||
|
|
||||||
/* internal gzip file state data structure */
|
|
||||||
typedef struct {
|
|
||||||
/* used for both reading and writing */
|
|
||||||
int mode; /* see gzip modes above */
|
|
||||||
int fd; /* file descriptor */
|
|
||||||
char *path; /* path or fd for error messages */
|
|
||||||
z_off64_t pos; /* current position in uncompressed data */
|
|
||||||
unsigned size; /* buffer size, zero if not allocated yet */
|
|
||||||
unsigned want; /* requested buffer size, default is GZBUFSIZE */
|
|
||||||
unsigned char *in; /* input buffer */
|
|
||||||
unsigned char *out; /* output buffer (double-sized when reading) */
|
|
||||||
unsigned char *next; /* next output data to deliver or write */
|
|
||||||
/* just for reading */
|
|
||||||
unsigned have; /* amount of output data unused at next */
|
|
||||||
int eof; /* true if end of input file reached */
|
|
||||||
z_off64_t start; /* where the gzip data started, for rewinding */
|
|
||||||
z_off64_t raw; /* where the raw data started, for seeking */
|
|
||||||
int how; /* 0: get header, 1: copy, 2: decompress */
|
|
||||||
int direct; /* true if last read direct, false if gzip */
|
|
||||||
/* just for writing */
|
|
||||||
int level; /* compression level */
|
|
||||||
int strategy; /* compression strategy */
|
|
||||||
/* seek request */
|
|
||||||
z_off64_t skip; /* amount to skip (already rewound if backwards) */
|
|
||||||
int seek; /* true if seek request pending */
|
|
||||||
/* error information */
|
|
||||||
int err; /* error code */
|
|
||||||
char *msg; /* error message */
|
|
||||||
/* zlib inflate or deflate stream */
|
|
||||||
z_stream strm; /* stream structure in-place (not a pointer) */
|
|
||||||
} gz_state;
|
|
||||||
typedef gz_state FAR *gz_statep;
|
|
||||||
|
|
||||||
/* shared functions */
|
|
||||||
void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
|
|
||||||
#if defined UNDER_CE
|
|
||||||
char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
|
|
||||||
value -- needed when comparing unsigned to z_off64_t, which is signed
|
|
||||||
(possible z_off64_t types off_t, off64_t, and long are all signed) */
|
|
||||||
#ifdef INT_MAX
|
|
||||||
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
|
|
||||||
#else
|
|
||||||
unsigned ZLIB_INTERNAL gz_intmax OF((void));
|
|
||||||
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
|
|
||||||
#endif
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
/* inffast.h -- header to use inffast.c
|
|
||||||
* Copyright (C) 1995-2003, 2010 Mark Adler
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
|
||||||
part of the implementation of the compression library and is
|
|
||||||
subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
|
|
||||||
@ -1,94 +0,0 @@
|
|||||||
/* inffixed.h -- table for decoding fixed codes
|
|
||||||
* Generated automatically by makefixed().
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It
|
|
||||||
is part of the implementation of the compression library and
|
|
||||||
is subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static const code lenfix[512] = {
|
|
||||||
{96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
|
|
||||||
{0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
|
|
||||||
{0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
|
|
||||||
{0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
|
|
||||||
{0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
|
|
||||||
{21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
|
|
||||||
{0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
|
|
||||||
{0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
|
|
||||||
{18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
|
|
||||||
{0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
|
|
||||||
{0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
|
|
||||||
{0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
|
|
||||||
{20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
|
|
||||||
{0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
|
|
||||||
{0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
|
|
||||||
{0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
|
|
||||||
{16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
|
|
||||||
{0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
|
|
||||||
{0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
|
|
||||||
{0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
|
|
||||||
{0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
|
|
||||||
{0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
|
|
||||||
{0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
|
|
||||||
{0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
|
|
||||||
{17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
|
|
||||||
{0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
|
|
||||||
{0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
|
|
||||||
{0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
|
|
||||||
{19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
|
|
||||||
{0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
|
|
||||||
{0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
|
|
||||||
{0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
|
|
||||||
{16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
|
|
||||||
{0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
|
|
||||||
{0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
|
|
||||||
{0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
|
|
||||||
{0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
|
|
||||||
{20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
|
|
||||||
{0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
|
|
||||||
{0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
|
|
||||||
{17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
|
|
||||||
{0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
|
|
||||||
{0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
|
|
||||||
{0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
|
|
||||||
{20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
|
|
||||||
{0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
|
|
||||||
{0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
|
|
||||||
{0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
|
|
||||||
{16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
|
|
||||||
{0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
|
|
||||||
{0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
|
|
||||||
{0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
|
|
||||||
{0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
|
|
||||||
{0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
|
|
||||||
{0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
|
|
||||||
{0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
|
|
||||||
{16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
|
|
||||||
{0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
|
|
||||||
{0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
|
|
||||||
{0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
|
|
||||||
{19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
|
|
||||||
{0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
|
|
||||||
{0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
|
|
||||||
{0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
|
|
||||||
{16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
|
|
||||||
{0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
|
|
||||||
{0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
|
|
||||||
{0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
|
|
||||||
{0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
|
|
||||||
{64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
|
|
||||||
{0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
|
|
||||||
{0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
|
|
||||||
{18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
|
|
||||||
{0,9,255}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const code distfix[32] = {
|
|
||||||
{16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
|
|
||||||
{21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
|
|
||||||
{18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
|
|
||||||
{19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
|
|
||||||
{16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
|
|
||||||
{22,5,193},{64,5,0}
|
|
||||||
};
|
|
||||||
@ -1,122 +0,0 @@
|
|||||||
/* inflate.h -- internal inflate state definition
|
|
||||||
* Copyright (C) 1995-2009 Mark Adler
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
|
||||||
part of the implementation of the compression library and is
|
|
||||||
subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* define NO_GZIP when compiling if you want to disable gzip header and
|
|
||||||
trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
|
|
||||||
the crc code when it is not needed. For shared libraries, gzip decoding
|
|
||||||
should be left enabled. */
|
|
||||||
#ifndef NO_GZIP
|
|
||||||
# define GUNZIP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Possible inflate modes between inflate() calls */
|
|
||||||
typedef enum {
|
|
||||||
HEAD, /* i: waiting for magic header */
|
|
||||||
FLAGS, /* i: waiting for method and flags (gzip) */
|
|
||||||
TIME, /* i: waiting for modification time (gzip) */
|
|
||||||
OS, /* i: waiting for extra flags and operating system (gzip) */
|
|
||||||
EXLEN, /* i: waiting for extra length (gzip) */
|
|
||||||
EXTRA, /* i: waiting for extra bytes (gzip) */
|
|
||||||
NAME, /* i: waiting for end of file name (gzip) */
|
|
||||||
COMMENT, /* i: waiting for end of comment (gzip) */
|
|
||||||
HCRC, /* i: waiting for header crc (gzip) */
|
|
||||||
DICTID, /* i: waiting for dictionary check value */
|
|
||||||
DICT, /* waiting for inflateSetDictionary() call */
|
|
||||||
TYPE, /* i: waiting for type bits, including last-flag bit */
|
|
||||||
TYPEDO, /* i: same, but skip check to exit inflate on new block */
|
|
||||||
STORED, /* i: waiting for stored size (length and complement) */
|
|
||||||
COPY_, /* i/o: same as COPY below, but only first time in */
|
|
||||||
COPY, /* i/o: waiting for input or output to copy stored block */
|
|
||||||
TABLE, /* i: waiting for dynamic block table lengths */
|
|
||||||
LENLENS, /* i: waiting for code length code lengths */
|
|
||||||
CODELENS, /* i: waiting for length/lit and distance code lengths */
|
|
||||||
LEN_, /* i: same as LEN below, but only first time in */
|
|
||||||
LEN, /* i: waiting for length/lit/eob code */
|
|
||||||
LENEXT, /* i: waiting for length extra bits */
|
|
||||||
DIST, /* i: waiting for distance code */
|
|
||||||
DISTEXT, /* i: waiting for distance extra bits */
|
|
||||||
MATCH, /* o: waiting for output space to copy string */
|
|
||||||
LIT, /* o: waiting for output space to write literal */
|
|
||||||
CHECK, /* i: waiting for 32-bit check value */
|
|
||||||
LENGTH, /* i: waiting for 32-bit length (gzip) */
|
|
||||||
DONE, /* finished check, done -- remain here until reset */
|
|
||||||
BAD, /* got a data error -- remain here until reset */
|
|
||||||
MEM, /* got an inflate() memory error -- remain here until reset */
|
|
||||||
SYNC /* looking for synchronization bytes to restart inflate() */
|
|
||||||
} inflate_mode;
|
|
||||||
|
|
||||||
/*
|
|
||||||
State transitions between above modes -
|
|
||||||
|
|
||||||
(most modes can go to BAD or MEM on error -- not shown for clarity)
|
|
||||||
|
|
||||||
Process header:
|
|
||||||
HEAD -> (gzip) or (zlib) or (raw)
|
|
||||||
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
|
|
||||||
HCRC -> TYPE
|
|
||||||
(zlib) -> DICTID or TYPE
|
|
||||||
DICTID -> DICT -> TYPE
|
|
||||||
(raw) -> TYPEDO
|
|
||||||
Read deflate blocks:
|
|
||||||
TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
|
|
||||||
STORED -> COPY_ -> COPY -> TYPE
|
|
||||||
TABLE -> LENLENS -> CODELENS -> LEN_
|
|
||||||
LEN_ -> LEN
|
|
||||||
Read deflate codes in fixed or dynamic block:
|
|
||||||
LEN -> LENEXT or LIT or TYPE
|
|
||||||
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
|
|
||||||
LIT -> LEN
|
|
||||||
Process trailer:
|
|
||||||
CHECK -> LENGTH -> DONE
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* state maintained between inflate() calls. Approximately 10K bytes. */
|
|
||||||
struct inflate_state {
|
|
||||||
inflate_mode mode; /* current inflate mode */
|
|
||||||
int last; /* true if processing last block */
|
|
||||||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */
|
|
||||||
int havedict; /* true if dictionary provided */
|
|
||||||
int flags; /* gzip header method and flags (0 if zlib) */
|
|
||||||
unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
|
|
||||||
unsigned long check; /* protected copy of check value */
|
|
||||||
unsigned long total; /* protected copy of output count */
|
|
||||||
gz_headerp head; /* where to save gzip header information */
|
|
||||||
/* sliding window */
|
|
||||||
unsigned wbits; /* log base 2 of requested window size */
|
|
||||||
unsigned wsize; /* window size or zero if not using window */
|
|
||||||
unsigned whave; /* valid bytes in the window */
|
|
||||||
unsigned wnext; /* window write index */
|
|
||||||
unsigned char FAR *window; /* allocated sliding window, if needed */
|
|
||||||
/* bit accumulator */
|
|
||||||
unsigned long hold; /* input bit accumulator */
|
|
||||||
unsigned bits; /* number of bits in "in" */
|
|
||||||
/* for string and stored block copying */
|
|
||||||
unsigned length; /* literal or length of data to copy */
|
|
||||||
unsigned offset; /* distance back to copy string from */
|
|
||||||
/* for table and code decoding */
|
|
||||||
unsigned extra; /* extra bits needed */
|
|
||||||
/* fixed and dynamic code tables */
|
|
||||||
code const FAR *lencode; /* starting table for length/literal codes */
|
|
||||||
code const FAR *distcode; /* starting table for distance codes */
|
|
||||||
unsigned lenbits; /* index bits for lencode */
|
|
||||||
unsigned distbits; /* index bits for distcode */
|
|
||||||
/* dynamic table building */
|
|
||||||
unsigned ncode; /* number of code length code lengths */
|
|
||||||
unsigned nlen; /* number of length code lengths */
|
|
||||||
unsigned ndist; /* number of distance code lengths */
|
|
||||||
unsigned have; /* number of code lengths in lens[] */
|
|
||||||
code FAR *next; /* next available space in codes[] */
|
|
||||||
unsigned short lens[320]; /* temporary storage for code lengths */
|
|
||||||
unsigned short work[288]; /* work area for code table building */
|
|
||||||
code codes[ENOUGH]; /* space for code tables */
|
|
||||||
int sane; /* if false, allow invalid distance too far */
|
|
||||||
int back; /* bits back of last unprocessed length/lit */
|
|
||||||
unsigned was; /* initial length of match */
|
|
||||||
};
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
/* inftrees.h -- header to use inftrees.c
|
|
||||||
* Copyright (C) 1995-2005, 2010 Mark Adler
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
|
||||||
part of the implementation of the compression library and is
|
|
||||||
subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Structure for decoding tables. Each entry provides either the
|
|
||||||
information needed to do the operation requested by the code that
|
|
||||||
indexed that table entry, or it provides a pointer to another
|
|
||||||
table that indexes more bits of the code. op indicates whether
|
|
||||||
the entry is a pointer to another table, a literal, a length or
|
|
||||||
distance, an end-of-block, or an invalid code. For a table
|
|
||||||
pointer, the low four bits of op is the number of index bits of
|
|
||||||
that table. For a length or distance, the low four bits of op
|
|
||||||
is the number of extra bits to get after the code. bits is
|
|
||||||
the number of bits in this code or part of the code to drop off
|
|
||||||
of the bit buffer. val is the actual byte to output in the case
|
|
||||||
of a literal, the base length or distance, or the offset from
|
|
||||||
the current table to the next table. Each entry is four bytes. */
|
|
||||||
typedef struct {
|
|
||||||
unsigned char op; /* operation, extra bits, table bits */
|
|
||||||
unsigned char bits; /* bits in this part of the code */
|
|
||||||
unsigned short val; /* offset in table or code value */
|
|
||||||
} code;
|
|
||||||
|
|
||||||
/* op values as set by inflate_table():
|
|
||||||
00000000 - literal
|
|
||||||
0000tttt - table link, tttt != 0 is the number of table index bits
|
|
||||||
0001eeee - length or distance, eeee is the number of extra bits
|
|
||||||
01100000 - end of block
|
|
||||||
01000000 - invalid code
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Maximum size of the dynamic table. The maximum number of code structures is
|
|
||||||
1444, which is the sum of 852 for literal/length codes and 592 for distance
|
|
||||||
codes. These values were found by exhaustive searches using the program
|
|
||||||
examples/enough.c found in the zlib distribtution. The arguments to that
|
|
||||||
program are the number of symbols, the initial root table size, and the
|
|
||||||
maximum bit length of a code. "enough 286 9 15" for literal/length codes
|
|
||||||
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
|
|
||||||
The initial root table size (9 or 6) is found in the fifth argument of the
|
|
||||||
inflate_table() calls in inflate.c and infback.c. If the root table size is
|
|
||||||
changed, then these maximum sizes would be need to be recalculated and
|
|
||||||
updated. */
|
|
||||||
#define ENOUGH_LENS 852
|
|
||||||
#define ENOUGH_DISTS 592
|
|
||||||
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
|
|
||||||
|
|
||||||
/* Type of code to build for inflate_table() */
|
|
||||||
typedef enum {
|
|
||||||
CODES,
|
|
||||||
LENS,
|
|
||||||
DISTS
|
|
||||||
} codetype;
|
|
||||||
|
|
||||||
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
|
|
||||||
unsigned codes, code FAR * FAR *table,
|
|
||||||
unsigned FAR *bits, unsigned short FAR *work));
|
|
||||||
@ -1,200 +0,0 @@
|
|||||||
/* ioapi.h -- IO base function header for compress/uncompress .zip
|
|
||||||
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Modifications for Zip64 support
|
|
||||||
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
|
||||||
|
|
||||||
For more info read MiniZip_info.txt
|
|
||||||
|
|
||||||
Changes
|
|
||||||
|
|
||||||
Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
|
|
||||||
Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
|
|
||||||
More if/def section may be needed to support other platforms
|
|
||||||
Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
|
|
||||||
(but you should use iowin32.c for windows instead)
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ZLIBIOAPI64_H
|
|
||||||
#define _ZLIBIOAPI64_H
|
|
||||||
|
|
||||||
#if (!defined(_WIN32)) && (!defined(WIN32))
|
|
||||||
|
|
||||||
// Linux needs this to support file operation on files larger then 4+GB
|
|
||||||
// But might need better if/def to select just the platforms that needs them.
|
|
||||||
|
|
||||||
#ifndef __USE_FILE_OFFSET64
|
|
||||||
#define __USE_FILE_OFFSET64
|
|
||||||
#endif
|
|
||||||
#ifndef __USE_LARGEFILE64
|
|
||||||
#define __USE_LARGEFILE64
|
|
||||||
#endif
|
|
||||||
#ifndef _LARGEFILE64_SOURCE
|
|
||||||
#define _LARGEFILE64_SOURCE
|
|
||||||
#endif
|
|
||||||
#ifndef _FILE_OFFSET_BIT
|
|
||||||
#define _FILE_OFFSET_BIT 64
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "zlib.h"
|
|
||||||
|
|
||||||
#if defined(USE_FILE32API)
|
|
||||||
#define fopen64 fopen
|
|
||||||
#define ftello64 ftell
|
|
||||||
#define fseeko64 fseek
|
|
||||||
#else
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#define fopen64 _wfopen
|
|
||||||
#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
|
|
||||||
#define ftello64 _ftelli64
|
|
||||||
#define fseeko64 _fseeki64
|
|
||||||
#else // old MSC
|
|
||||||
#define ftello64 ftell
|
|
||||||
#define fseeko64 fseek
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
#ifndef ZPOS64_T
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define ZPOS64_T fpos_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h>
|
|
||||||
#define ZPOS64_T uint64_t
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef HAVE_MINIZIP64_CONF_H
|
|
||||||
#include "mz64conf.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* a type choosen by DEFINE */
|
|
||||||
#ifdef HAVE_64BIT_INT_CUSTOM
|
|
||||||
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
|
|
||||||
#else
|
|
||||||
#ifdef HAS_STDINT_H
|
|
||||||
#include "stdint.h"
|
|
||||||
typedef uint64_t ZPOS64_T;
|
|
||||||
#else
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
|
||||||
typedef unsigned __int64 ZPOS64_T;
|
|
||||||
#else
|
|
||||||
typedef unsigned long long int ZPOS64_T;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define ZLIB_FILEFUNC_SEEK_CUR (1)
|
|
||||||
#define ZLIB_FILEFUNC_SEEK_END (2)
|
|
||||||
#define ZLIB_FILEFUNC_SEEK_SET (0)
|
|
||||||
|
|
||||||
#define ZLIB_FILEFUNC_MODE_READ (1)
|
|
||||||
#define ZLIB_FILEFUNC_MODE_WRITE (2)
|
|
||||||
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
|
|
||||||
|
|
||||||
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
|
|
||||||
#define ZLIB_FILEFUNC_MODE_CREATE (8)
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef ZCALLBACK
|
|
||||||
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
|
|
||||||
#define ZCALLBACK CALLBACK
|
|
||||||
#else
|
|
||||||
#define ZCALLBACK
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
|
|
||||||
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
|
|
||||||
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
|
|
||||||
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
|
|
||||||
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
|
|
||||||
|
|
||||||
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
|
|
||||||
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
|
|
||||||
|
|
||||||
|
|
||||||
/* here is the "old" 32 bits structure structure */
|
|
||||||
typedef struct zlib_filefunc_def_s
|
|
||||||
{
|
|
||||||
open_file_func zopen_file;
|
|
||||||
read_file_func zread_file;
|
|
||||||
write_file_func zwrite_file;
|
|
||||||
tell_file_func ztell_file;
|
|
||||||
seek_file_func zseek_file;
|
|
||||||
close_file_func zclose_file;
|
|
||||||
testerror_file_func zerror_file;
|
|
||||||
voidpf opaque;
|
|
||||||
} zlib_filefunc_def;
|
|
||||||
|
|
||||||
typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
|
|
||||||
typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
|
|
||||||
typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
|
|
||||||
|
|
||||||
typedef struct zlib_filefunc64_def_s
|
|
||||||
{
|
|
||||||
open64_file_func zopen64_file;
|
|
||||||
read_file_func zread_file;
|
|
||||||
write_file_func zwrite_file;
|
|
||||||
tell64_file_func ztell64_file;
|
|
||||||
seek64_file_func zseek64_file;
|
|
||||||
close_file_func zclose_file;
|
|
||||||
testerror_file_func zerror_file;
|
|
||||||
voidpf opaque;
|
|
||||||
} zlib_filefunc64_def;
|
|
||||||
|
|
||||||
void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
|
|
||||||
|
|
||||||
/* now internal definition, only for zip.c and unzip.h */
|
|
||||||
typedef struct zlib_filefunc64_32_def_s
|
|
||||||
{
|
|
||||||
zlib_filefunc64_def zfile_func64;
|
|
||||||
open_file_func zopen32_file;
|
|
||||||
tell_file_func ztell32_file;
|
|
||||||
seek_file_func zseek32_file;
|
|
||||||
} zlib_filefunc64_32_def;
|
|
||||||
|
|
||||||
|
|
||||||
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
|
|
||||||
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
|
|
||||||
//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
|
|
||||||
//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
|
|
||||||
#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
|
|
||||||
#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
|
|
||||||
|
|
||||||
voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
|
|
||||||
long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
|
|
||||||
ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
|
|
||||||
|
|
||||||
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
|
|
||||||
|
|
||||||
#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
|
|
||||||
#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
|
|
||||||
#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
/* iowin32.h -- IO base function header for compress/uncompress .zip
|
|
||||||
Version 1.1, February 14h, 2010
|
|
||||||
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Modifications for Zip64 support
|
|
||||||
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
|
||||||
|
|
||||||
For more info read MiniZip_info.txt
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void fill_win32_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
|
|
||||||
void fill_win32_filefunc64 OF((zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
void fill_win32_filefunc64A OF((zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
void fill_win32_filefunc64W OF((zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
Additional tools for Minizip
|
|
||||||
Code: Xavier Roche '2004
|
|
||||||
License: Same as ZLIB (www.gzip.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _zip_tools_H
|
|
||||||
#define _zip_tools_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ZLIB_H
|
|
||||||
#include "zlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "unzip.h"
|
|
||||||
|
|
||||||
/* Repair a ZIP file (missing central directory)
|
|
||||||
file: file to recover
|
|
||||||
fileOut: output file after recovery
|
|
||||||
fileOutTmp: temporary file name used for recovery
|
|
||||||
*/
|
|
||||||
extern int ZEXPORT unzRepair(const char* file,
|
|
||||||
const char* fileOut,
|
|
||||||
const char* fileOutTmp,
|
|
||||||
uLong* nRecovered,
|
|
||||||
uLong* bytesRecovered);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
/* header created automatically with -DGEN_TREES_H */
|
|
||||||
|
|
||||||
local const ct_data static_ltree[L_CODES+2] = {
|
|
||||||
{{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}},
|
|
||||||
{{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}},
|
|
||||||
{{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}},
|
|
||||||
{{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}},
|
|
||||||
{{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}},
|
|
||||||
{{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}},
|
|
||||||
{{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}},
|
|
||||||
{{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}},
|
|
||||||
{{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}},
|
|
||||||
{{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}},
|
|
||||||
{{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}},
|
|
||||||
{{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}},
|
|
||||||
{{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}},
|
|
||||||
{{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}},
|
|
||||||
{{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}},
|
|
||||||
{{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}},
|
|
||||||
{{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}},
|
|
||||||
{{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}},
|
|
||||||
{{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}},
|
|
||||||
{{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}},
|
|
||||||
{{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}},
|
|
||||||
{{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}},
|
|
||||||
{{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}},
|
|
||||||
{{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}},
|
|
||||||
{{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}},
|
|
||||||
{{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}},
|
|
||||||
{{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}},
|
|
||||||
{{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}},
|
|
||||||
{{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}},
|
|
||||||
{{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}},
|
|
||||||
{{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}},
|
|
||||||
{{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}},
|
|
||||||
{{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}},
|
|
||||||
{{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}},
|
|
||||||
{{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}},
|
|
||||||
{{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}},
|
|
||||||
{{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}},
|
|
||||||
{{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}},
|
|
||||||
{{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}},
|
|
||||||
{{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}},
|
|
||||||
{{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}},
|
|
||||||
{{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}},
|
|
||||||
{{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}},
|
|
||||||
{{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}},
|
|
||||||
{{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}},
|
|
||||||
{{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}},
|
|
||||||
{{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}},
|
|
||||||
{{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}},
|
|
||||||
{{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}},
|
|
||||||
{{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}},
|
|
||||||
{{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}},
|
|
||||||
{{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}},
|
|
||||||
{{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}},
|
|
||||||
{{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}},
|
|
||||||
{{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}},
|
|
||||||
{{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}},
|
|
||||||
{{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}},
|
|
||||||
{{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}}
|
|
||||||
};
|
|
||||||
|
|
||||||
local const ct_data static_dtree[D_CODES] = {
|
|
||||||
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}},
|
|
||||||
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}},
|
|
||||||
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}},
|
|
||||||
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}},
|
|
||||||
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}},
|
|
||||||
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}}
|
|
||||||
};
|
|
||||||
|
|
||||||
const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = {
|
|
||||||
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8,
|
|
||||||
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10,
|
|
||||||
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
|
|
||||||
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
|
||||||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13,
|
|
||||||
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
|
||||||
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
|
||||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
|
||||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
|
||||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
|
|
||||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
|
||||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
|
||||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17,
|
|
||||||
18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22,
|
|
||||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
|
||||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
|
||||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27,
|
|
||||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
|
||||||
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
|
||||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
|
||||||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
|
||||||
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
|
||||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
|
||||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
|
|
||||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
|
|
||||||
};
|
|
||||||
|
|
||||||
const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= {
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12,
|
|
||||||
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
||||||
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19,
|
|
||||||
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
|
|
||||||
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22,
|
|
||||||
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23,
|
|
||||||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
|
||||||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26,
|
|
||||||
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
|
|
||||||
26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
|
|
||||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28
|
|
||||||
};
|
|
||||||
|
|
||||||
local const int base_length[LENGTH_CODES] = {
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
|
|
||||||
64, 80, 96, 112, 128, 160, 192, 224, 0
|
|
||||||
};
|
|
||||||
|
|
||||||
local const int base_dist[D_CODES] = {
|
|
||||||
0, 1, 2, 3, 4, 6, 8, 12, 16, 24,
|
|
||||||
32, 48, 64, 96, 128, 192, 256, 384, 512, 768,
|
|
||||||
1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576
|
|
||||||
};
|
|
||||||
|
|
||||||
@ -1,437 +0,0 @@
|
|||||||
/* unzip.h -- IO for uncompress .zip files using zlib
|
|
||||||
Version 1.1, February 14h, 2010
|
|
||||||
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Modifications of Unzip for Zip64
|
|
||||||
Copyright (C) 2007-2008 Even Rouault
|
|
||||||
|
|
||||||
Modifications for Zip64 support on both zip and unzip
|
|
||||||
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
|
||||||
|
|
||||||
For more info read MiniZip_info.txt
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Condition of use and distribution are the same than zlib :
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Changes
|
|
||||||
|
|
||||||
See header of unzip64.c
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _unz64_H
|
|
||||||
#define _unz64_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ZLIB_H
|
|
||||||
#include "zlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ZLIBIOAPI_H
|
|
||||||
#include "ioapi.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BZIP2
|
|
||||||
#include "bzlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z_BZIP2ED 12
|
|
||||||
|
|
||||||
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
|
|
||||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
|
||||||
from (void*) without cast */
|
|
||||||
typedef struct TagunzFile__ { int unused; } unzFile__;
|
|
||||||
typedef unzFile__ *unzFile;
|
|
||||||
#else
|
|
||||||
typedef voidp unzFile;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#define UNZ_OK (0)
|
|
||||||
#define UNZ_END_OF_LIST_OF_FILE (-100)
|
|
||||||
#define UNZ_ERRNO (Z_ERRNO)
|
|
||||||
#define UNZ_EOF (0)
|
|
||||||
#define UNZ_PARAMERROR (-102)
|
|
||||||
#define UNZ_BADZIPFILE (-103)
|
|
||||||
#define UNZ_INTERNALERROR (-104)
|
|
||||||
#define UNZ_CRCERROR (-105)
|
|
||||||
|
|
||||||
/* tm_unz contain date/time info */
|
|
||||||
typedef struct tm_unz_s
|
|
||||||
{
|
|
||||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
|
||||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
|
||||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
|
||||||
uInt tm_mday; /* day of the month - [1,31] */
|
|
||||||
uInt tm_mon; /* months since January - [0,11] */
|
|
||||||
uInt tm_year; /* years - [1980..2044] */
|
|
||||||
} tm_unz;
|
|
||||||
|
|
||||||
/* unz_global_info structure contain global data about the ZIPfile
|
|
||||||
These data comes from the end of central dir */
|
|
||||||
typedef struct unz_global_info64_s
|
|
||||||
{
|
|
||||||
ZPOS64_T number_entry; /* total number of entries in
|
|
||||||
the central dir on this disk */
|
|
||||||
uLong size_comment; /* size of the global comment of the zipfile */
|
|
||||||
} unz_global_info64;
|
|
||||||
|
|
||||||
typedef struct unz_global_info_s
|
|
||||||
{
|
|
||||||
uLong number_entry; /* total number of entries in
|
|
||||||
the central dir on this disk */
|
|
||||||
uLong size_comment; /* size of the global comment of the zipfile */
|
|
||||||
} unz_global_info;
|
|
||||||
|
|
||||||
/* unz_file_info contain information about a file in the zipfile */
|
|
||||||
typedef struct unz_file_info64_s
|
|
||||||
{
|
|
||||||
uLong version; /* version made by 2 bytes */
|
|
||||||
uLong version_needed; /* version needed to extract 2 bytes */
|
|
||||||
uLong flag; /* general purpose bit flag 2 bytes */
|
|
||||||
uLong compression_method; /* compression method 2 bytes */
|
|
||||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
|
||||||
uLong crc; /* crc-32 4 bytes */
|
|
||||||
ZPOS64_T compressed_size; /* compressed size 8 bytes */
|
|
||||||
ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
|
|
||||||
uLong size_filename; /* filename length 2 bytes */
|
|
||||||
uLong size_file_extra; /* extra field length 2 bytes */
|
|
||||||
uLong size_file_comment; /* file comment length 2 bytes */
|
|
||||||
|
|
||||||
uLong disk_num_start; /* disk number start 2 bytes */
|
|
||||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
|
||||||
uLong external_fa; /* external file attributes 4 bytes */
|
|
||||||
|
|
||||||
tm_unz tmu_date;
|
|
||||||
} unz_file_info64;
|
|
||||||
|
|
||||||
typedef struct unz_file_info_s
|
|
||||||
{
|
|
||||||
uLong version; /* version made by 2 bytes */
|
|
||||||
uLong version_needed; /* version needed to extract 2 bytes */
|
|
||||||
uLong flag; /* general purpose bit flag 2 bytes */
|
|
||||||
uLong compression_method; /* compression method 2 bytes */
|
|
||||||
uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
|
|
||||||
uLong crc; /* crc-32 4 bytes */
|
|
||||||
uLong compressed_size; /* compressed size 4 bytes */
|
|
||||||
uLong uncompressed_size; /* uncompressed size 4 bytes */
|
|
||||||
uLong size_filename; /* filename length 2 bytes */
|
|
||||||
uLong size_file_extra; /* extra field length 2 bytes */
|
|
||||||
uLong size_file_comment; /* file comment length 2 bytes */
|
|
||||||
|
|
||||||
uLong disk_num_start; /* disk number start 2 bytes */
|
|
||||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
|
||||||
uLong external_fa; /* external file attributes 4 bytes */
|
|
||||||
|
|
||||||
tm_unz tmu_date;
|
|
||||||
} unz_file_info;
|
|
||||||
|
|
||||||
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
|
|
||||||
const char* fileName2,
|
|
||||||
int iCaseSensitivity));
|
|
||||||
/*
|
|
||||||
Compare two filename (fileName1,fileName2).
|
|
||||||
If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
|
|
||||||
If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
|
|
||||||
or strcasecmp)
|
|
||||||
If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
|
|
||||||
(like 1 on Unix, 2 on Windows)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern unzFile ZEXPORT unzOpen OF((const char *path));
|
|
||||||
extern unzFile ZEXPORT unzOpen64 OF((const void *path));
|
|
||||||
/*
|
|
||||||
Open a Zip file. path contain the full pathname (by example,
|
|
||||||
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
|
|
||||||
"zlib/zlib113.zip".
|
|
||||||
If the zipfile cannot be opened (file don't exist or in not valid), the
|
|
||||||
return value is NULL.
|
|
||||||
Else, the return value is a unzFile Handle, usable with other function
|
|
||||||
of this unzip package.
|
|
||||||
the "64" function take a const void* pointer, because the path is just the
|
|
||||||
value passed to the open64_file_func callback.
|
|
||||||
Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
|
|
||||||
is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
|
|
||||||
does not describe the reality
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern unzFile ZEXPORT unzOpen2 OF((const char *path,
|
|
||||||
zlib_filefunc_def* pzlib_filefunc_def));
|
|
||||||
/*
|
|
||||||
Open a Zip file, like unzOpen, but provide a set of file low level API
|
|
||||||
for read/write the zip file (see ioapi.h)
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern unzFile ZEXPORT unzOpen2_64 OF((const void *path,
|
|
||||||
zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
/*
|
|
||||||
Open a Zip file, like unz64Open, but provide a set of file low level API
|
|
||||||
for read/write the zip file (see ioapi.h)
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzClose OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Close a ZipFile opened with unzipOpen.
|
|
||||||
If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
|
|
||||||
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
|
|
||||||
return UNZ_OK if there is no problem. */
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
|
|
||||||
unz_global_info *pglobal_info));
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
|
|
||||||
unz_global_info64 *pglobal_info));
|
|
||||||
/*
|
|
||||||
Write info about the ZipFile in the *pglobal_info structure.
|
|
||||||
No preparation of the structure is needed
|
|
||||||
return UNZ_OK if there is no problem. */
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
|
|
||||||
char *szComment,
|
|
||||||
uLong uSizeBuf));
|
|
||||||
/*
|
|
||||||
Get the global comment string of the ZipFile, in the szComment buffer.
|
|
||||||
uSizeBuf is the size of the szComment buffer.
|
|
||||||
return the number of byte copied or an error code <0
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
/* Unzip package allow you browse the directory of the zipfile */
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Set the current file of the zipfile to the first file.
|
|
||||||
return UNZ_OK if there is no problem
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGoToNextFile OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Set the current file of the zipfile to the next file.
|
|
||||||
return UNZ_OK if there is no problem
|
|
||||||
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzLocateFile OF((unzFile file,
|
|
||||||
const char *szFileName,
|
|
||||||
int iCaseSensitivity));
|
|
||||||
/*
|
|
||||||
Try locate the file szFileName in the zipfile.
|
|
||||||
For the iCaseSensitivity signification, see unzStringFileNameCompare
|
|
||||||
|
|
||||||
return value :
|
|
||||||
UNZ_OK if the file is found. It becomes the current file.
|
|
||||||
UNZ_END_OF_LIST_OF_FILE if the file is not found
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* ****************************************** */
|
|
||||||
/* Ryan supplied functions */
|
|
||||||
/* unz_file_info contain information about a file in the zipfile */
|
|
||||||
typedef struct unz_file_pos_s
|
|
||||||
{
|
|
||||||
uLong pos_in_zip_directory; /* offset in zip file directory */
|
|
||||||
uLong num_of_file; /* # of file */
|
|
||||||
} unz_file_pos;
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetFilePos(
|
|
||||||
unzFile file,
|
|
||||||
unz_file_pos* file_pos);
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGoToFilePos(
|
|
||||||
unzFile file,
|
|
||||||
unz_file_pos* file_pos);
|
|
||||||
|
|
||||||
typedef struct unz64_file_pos_s
|
|
||||||
{
|
|
||||||
ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
|
|
||||||
ZPOS64_T num_of_file; /* # of file */
|
|
||||||
} unz64_file_pos;
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetFilePos64(
|
|
||||||
unzFile file,
|
|
||||||
unz64_file_pos* file_pos);
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGoToFilePos64(
|
|
||||||
unzFile file,
|
|
||||||
const unz64_file_pos* file_pos);
|
|
||||||
|
|
||||||
/* ****************************************** */
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
|
|
||||||
unz_file_info64 *pfile_info,
|
|
||||||
char *szFileName,
|
|
||||||
uLong fileNameBufferSize,
|
|
||||||
void *extraField,
|
|
||||||
uLong extraFieldBufferSize,
|
|
||||||
char *szComment,
|
|
||||||
uLong commentBufferSize));
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
|
|
||||||
unz_file_info *pfile_info,
|
|
||||||
char *szFileName,
|
|
||||||
uLong fileNameBufferSize,
|
|
||||||
void *extraField,
|
|
||||||
uLong extraFieldBufferSize,
|
|
||||||
char *szComment,
|
|
||||||
uLong commentBufferSize));
|
|
||||||
/*
|
|
||||||
Get Info about the current file
|
|
||||||
if pfile_info!=NULL, the *pfile_info structure will contain somes info about
|
|
||||||
the current file
|
|
||||||
if szFileName!=NULL, the filemane string will be copied in szFileName
|
|
||||||
(fileNameBufferSize is the size of the buffer)
|
|
||||||
if extraField!=NULL, the extra field information will be copied in extraField
|
|
||||||
(extraFieldBufferSize is the size of the buffer).
|
|
||||||
This is the Central-header version of the extra field
|
|
||||||
if szComment!=NULL, the comment string of the file will be copied in szComment
|
|
||||||
(commentBufferSize is the size of the buffer)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/** Addition for GDAL : START */
|
|
||||||
|
|
||||||
extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
|
|
||||||
|
|
||||||
/** Addition for GDAL : END */
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
/* for reading the content of the current zipfile, you can open it, read data
|
|
||||||
from it, and close it (you can close it before reading all the file)
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Open for reading data the current file in the zipfile.
|
|
||||||
If there is no error, the return value is UNZ_OK.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
|
|
||||||
const char* password));
|
|
||||||
/*
|
|
||||||
Open for reading data the current file in the zipfile.
|
|
||||||
password is a crypting password
|
|
||||||
If there is no error, the return value is UNZ_OK.
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
|
|
||||||
int* method,
|
|
||||||
int* level,
|
|
||||||
int raw));
|
|
||||||
/*
|
|
||||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
|
||||||
if raw==1
|
|
||||||
*method will receive method of compression, *level will receive level of
|
|
||||||
compression
|
|
||||||
note : you can set level parameter as NULL (if you did not want known level,
|
|
||||||
but you CANNOT set method parameter as NULL
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
|
|
||||||
int* method,
|
|
||||||
int* level,
|
|
||||||
int raw,
|
|
||||||
const char* password));
|
|
||||||
/*
|
|
||||||
Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
|
|
||||||
if raw==1
|
|
||||||
*method will receive method of compression, *level will receive level of
|
|
||||||
compression
|
|
||||||
note : you can set level parameter as NULL (if you did not want known level,
|
|
||||||
but you CANNOT set method parameter as NULL
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Close the file in zip opened with unzOpenCurrentFile
|
|
||||||
Return UNZ_CRCERROR if all the file was read but the CRC is not good
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
|
|
||||||
voidp buf,
|
|
||||||
unsigned len));
|
|
||||||
/*
|
|
||||||
Read bytes from the current file (opened by unzOpenCurrentFile)
|
|
||||||
buf contain buffer where data must be copied
|
|
||||||
len the size of buf.
|
|
||||||
|
|
||||||
return the number of byte copied if somes bytes are copied
|
|
||||||
return 0 if the end of file was reached
|
|
||||||
return <0 with error code if there is an error
|
|
||||||
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern z_off_t ZEXPORT unztell OF((unzFile file));
|
|
||||||
|
|
||||||
extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
|
|
||||||
/*
|
|
||||||
Give the current position in uncompressed data
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzeof OF((unzFile file));
|
|
||||||
/*
|
|
||||||
return 1 if the end of file was reached, 0 elsewhere
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
|
|
||||||
voidp buf,
|
|
||||||
unsigned len));
|
|
||||||
/*
|
|
||||||
Read extra field from the current file (opened by unzOpenCurrentFile)
|
|
||||||
This is the local-header version of the extra field (sometimes, there is
|
|
||||||
more info in the local-header version than in the central-header)
|
|
||||||
|
|
||||||
if buf==NULL, it return the size of the local extra field
|
|
||||||
|
|
||||||
if buf!=NULL, len is the size of the buffer, the extra header is copied in
|
|
||||||
buf.
|
|
||||||
the return value is the number of bytes copied in buf, or (if <0)
|
|
||||||
the error code
|
|
||||||
*/
|
|
||||||
|
|
||||||
/***************************************************************************/
|
|
||||||
|
|
||||||
/* Get the current file offset */
|
|
||||||
extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
|
|
||||||
extern uLong ZEXPORT unzGetOffset (unzFile file);
|
|
||||||
|
|
||||||
/* Set the current file offset */
|
|
||||||
extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
|
|
||||||
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _unz64_H */
|
|
||||||
@ -1,428 +0,0 @@
|
|||||||
/* zconf.h -- configuration of the zlib compression library
|
|
||||||
* Copyright (C) 1995-2010 Jean-loup Gailly.
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* @(#) $Id$ */
|
|
||||||
|
|
||||||
#ifndef ZCONF_H
|
|
||||||
#define ZCONF_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If you *really* need a unique prefix for all types and library functions,
|
|
||||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
|
||||||
* Even better than compiling with -DZ_PREFIX would be to use configure to set
|
|
||||||
* this permanently in zconf.h using "./configure --zprefix".
|
|
||||||
*/
|
|
||||||
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
|
|
||||||
|
|
||||||
/* all linked symbols */
|
|
||||||
# define _dist_code z__dist_code
|
|
||||||
# define _length_code z__length_code
|
|
||||||
# define _tr_align z__tr_align
|
|
||||||
# define _tr_flush_block z__tr_flush_block
|
|
||||||
# define _tr_init z__tr_init
|
|
||||||
# define _tr_stored_block z__tr_stored_block
|
|
||||||
# define _tr_tally z__tr_tally
|
|
||||||
# define adler32 z_adler32
|
|
||||||
# define adler32_combine z_adler32_combine
|
|
||||||
# define adler32_combine64 z_adler32_combine64
|
|
||||||
# define compress z_compress
|
|
||||||
# define compress2 z_compress2
|
|
||||||
# define compressBound z_compressBound
|
|
||||||
# define crc32 z_crc32
|
|
||||||
# define crc32_combine z_crc32_combine
|
|
||||||
# define crc32_combine64 z_crc32_combine64
|
|
||||||
# define deflate z_deflate
|
|
||||||
# define deflateBound z_deflateBound
|
|
||||||
# define deflateCopy z_deflateCopy
|
|
||||||
# define deflateEnd z_deflateEnd
|
|
||||||
# define deflateInit2_ z_deflateInit2_
|
|
||||||
# define deflateInit_ z_deflateInit_
|
|
||||||
# define deflateParams z_deflateParams
|
|
||||||
# define deflatePrime z_deflatePrime
|
|
||||||
# define deflateReset z_deflateReset
|
|
||||||
# define deflateSetDictionary z_deflateSetDictionary
|
|
||||||
# define deflateSetHeader z_deflateSetHeader
|
|
||||||
# define deflateTune z_deflateTune
|
|
||||||
# define deflate_copyright z_deflate_copyright
|
|
||||||
# define get_crc_table z_get_crc_table
|
|
||||||
# define gz_error z_gz_error
|
|
||||||
# define gz_intmax z_gz_intmax
|
|
||||||
# define gz_strwinerror z_gz_strwinerror
|
|
||||||
# define gzbuffer z_gzbuffer
|
|
||||||
# define gzclearerr z_gzclearerr
|
|
||||||
# define gzclose z_gzclose
|
|
||||||
# define gzclose_r z_gzclose_r
|
|
||||||
# define gzclose_w z_gzclose_w
|
|
||||||
# define gzdirect z_gzdirect
|
|
||||||
# define gzdopen z_gzdopen
|
|
||||||
# define gzeof z_gzeof
|
|
||||||
# define gzerror z_gzerror
|
|
||||||
# define gzflush z_gzflush
|
|
||||||
# define gzgetc z_gzgetc
|
|
||||||
# define gzgets z_gzgets
|
|
||||||
# define gzoffset z_gzoffset
|
|
||||||
# define gzoffset64 z_gzoffset64
|
|
||||||
# define gzopen z_gzopen
|
|
||||||
# define gzopen64 z_gzopen64
|
|
||||||
# define gzprintf z_gzprintf
|
|
||||||
# define gzputc z_gzputc
|
|
||||||
# define gzputs z_gzputs
|
|
||||||
# define gzread z_gzread
|
|
||||||
# define gzrewind z_gzrewind
|
|
||||||
# define gzseek z_gzseek
|
|
||||||
# define gzseek64 z_gzseek64
|
|
||||||
# define gzsetparams z_gzsetparams
|
|
||||||
# define gztell z_gztell
|
|
||||||
# define gztell64 z_gztell64
|
|
||||||
# define gzungetc z_gzungetc
|
|
||||||
# define gzwrite z_gzwrite
|
|
||||||
# define inflate z_inflate
|
|
||||||
# define inflateBack z_inflateBack
|
|
||||||
# define inflateBackEnd z_inflateBackEnd
|
|
||||||
# define inflateBackInit_ z_inflateBackInit_
|
|
||||||
# define inflateCopy z_inflateCopy
|
|
||||||
# define inflateEnd z_inflateEnd
|
|
||||||
# define inflateGetHeader z_inflateGetHeader
|
|
||||||
# define inflateInit2_ z_inflateInit2_
|
|
||||||
# define inflateInit_ z_inflateInit_
|
|
||||||
# define inflateMark z_inflateMark
|
|
||||||
# define inflatePrime z_inflatePrime
|
|
||||||
# define inflateReset z_inflateReset
|
|
||||||
# define inflateReset2 z_inflateReset2
|
|
||||||
# define inflateSetDictionary z_inflateSetDictionary
|
|
||||||
# define inflateSync z_inflateSync
|
|
||||||
# define inflateSyncPoint z_inflateSyncPoint
|
|
||||||
# define inflateUndermine z_inflateUndermine
|
|
||||||
# define inflate_copyright z_inflate_copyright
|
|
||||||
# define inflate_fast z_inflate_fast
|
|
||||||
# define inflate_table z_inflate_table
|
|
||||||
# define uncompress z_uncompress
|
|
||||||
# define zError z_zError
|
|
||||||
# define zcalloc z_zcalloc
|
|
||||||
# define zcfree z_zcfree
|
|
||||||
# define zlibCompileFlags z_zlibCompileFlags
|
|
||||||
# define zlibVersion z_zlibVersion
|
|
||||||
|
|
||||||
/* all zlib typedefs in zlib.h and zconf.h */
|
|
||||||
# define Byte z_Byte
|
|
||||||
# define Bytef z_Bytef
|
|
||||||
# define alloc_func z_alloc_func
|
|
||||||
# define charf z_charf
|
|
||||||
# define free_func z_free_func
|
|
||||||
# define gzFile z_gzFile
|
|
||||||
# define gz_header z_gz_header
|
|
||||||
# define gz_headerp z_gz_headerp
|
|
||||||
# define in_func z_in_func
|
|
||||||
# define intf z_intf
|
|
||||||
# define out_func z_out_func
|
|
||||||
# define uInt z_uInt
|
|
||||||
# define uIntf z_uIntf
|
|
||||||
# define uLong z_uLong
|
|
||||||
# define uLongf z_uLongf
|
|
||||||
# define voidp z_voidp
|
|
||||||
# define voidpc z_voidpc
|
|
||||||
# define voidpf z_voidpf
|
|
||||||
|
|
||||||
/* all zlib structs in zlib.h and zconf.h */
|
|
||||||
# define gz_header_s z_gz_header_s
|
|
||||||
# define internal_state z_internal_state
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
|
||||||
# define MSDOS
|
|
||||||
#endif
|
|
||||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
|
||||||
# define OS2
|
|
||||||
#endif
|
|
||||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
|
||||||
# define WINDOWS
|
|
||||||
#endif
|
|
||||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
|
||||||
# ifndef WIN32
|
|
||||||
# define WIN32
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
|
||||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
|
||||||
# ifndef SYS16BIT
|
|
||||||
# define SYS16BIT
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
|
||||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
|
||||||
*/
|
|
||||||
#ifdef SYS16BIT
|
|
||||||
# define MAXSEG_64K
|
|
||||||
#endif
|
|
||||||
#ifdef MSDOS
|
|
||||||
# define UNALIGNED_OK
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __STDC_VERSION__
|
|
||||||
# ifndef STDC
|
|
||||||
# define STDC
|
|
||||||
# endif
|
|
||||||
# if __STDC_VERSION__ >= 199901L
|
|
||||||
# ifndef STDC99
|
|
||||||
# define STDC99
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
|
||||||
# define STDC
|
|
||||||
#endif
|
|
||||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
|
||||||
# define STDC
|
|
||||||
#endif
|
|
||||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
|
||||||
# define STDC
|
|
||||||
#endif
|
|
||||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
|
||||||
# define STDC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
|
||||||
# define STDC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef STDC
|
|
||||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
|
||||||
# define const /* note: need a more gentle solution here */
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some Mac compilers merge all .h files incorrectly: */
|
|
||||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
|
||||||
# define NO_DUMMY_DECL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Maximum value for memLevel in deflateInit2 */
|
|
||||||
#ifndef MAX_MEM_LEVEL
|
|
||||||
# ifdef MAXSEG_64K
|
|
||||||
# define MAX_MEM_LEVEL 8
|
|
||||||
# else
|
|
||||||
# define MAX_MEM_LEVEL 9
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
|
||||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
|
||||||
* created by gzip. (Files created by minigzip can still be extracted by
|
|
||||||
* gzip.)
|
|
||||||
*/
|
|
||||||
#ifndef MAX_WBITS
|
|
||||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The memory requirements for deflate are (in bytes):
|
|
||||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
|
||||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
|
||||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
|
||||||
the default memory requirements from 256K to 128K, compile with
|
|
||||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
|
||||||
Of course this will generally degrade compression (there's no free lunch).
|
|
||||||
|
|
||||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
|
||||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
|
||||||
for small objects.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Type declarations */
|
|
||||||
|
|
||||||
#ifndef OF /* function prototypes */
|
|
||||||
# ifdef STDC
|
|
||||||
# define OF(args) args
|
|
||||||
# else
|
|
||||||
# define OF(args) ()
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
|
||||||
* model programming (small or medium model with some far allocations).
|
|
||||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
|
||||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
|
||||||
* just define FAR to be empty.
|
|
||||||
*/
|
|
||||||
#ifdef SYS16BIT
|
|
||||||
# if defined(M_I86SM) || defined(M_I86MM)
|
|
||||||
/* MSC small or medium model */
|
|
||||||
# define SMALL_MEDIUM
|
|
||||||
# ifdef _MSC_VER
|
|
||||||
# define FAR _far
|
|
||||||
# else
|
|
||||||
# define FAR far
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
|
||||||
/* Turbo C small or medium model */
|
|
||||||
# define SMALL_MEDIUM
|
|
||||||
# ifdef __BORLANDC__
|
|
||||||
# define FAR _far
|
|
||||||
# else
|
|
||||||
# define FAR far
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(WINDOWS) || defined(WIN32)
|
|
||||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
|
||||||
* This is not mandatory, but it offers a little performance increase.
|
|
||||||
*/
|
|
||||||
# ifdef ZLIB_DLL
|
|
||||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
|
||||||
# ifdef ZLIB_INTERNAL
|
|
||||||
# define ZEXTERN extern __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define ZEXTERN extern __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif /* ZLIB_DLL */
|
|
||||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
|
||||||
* define ZLIB_WINAPI.
|
|
||||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
|
||||||
*/
|
|
||||||
# ifdef ZLIB_WINAPI
|
|
||||||
# ifdef FAR
|
|
||||||
# undef FAR
|
|
||||||
# endif
|
|
||||||
# include <windows.h>
|
|
||||||
/* No need for _export, use ZLIB.DEF instead. */
|
|
||||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
|
||||||
# define ZEXPORT WINAPI
|
|
||||||
# ifdef WIN32
|
|
||||||
# define ZEXPORTVA WINAPIV
|
|
||||||
# else
|
|
||||||
# define ZEXPORTVA FAR CDECL
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (__BEOS__)
|
|
||||||
# ifdef ZLIB_DLL
|
|
||||||
# ifdef ZLIB_INTERNAL
|
|
||||||
# define ZEXPORT __declspec(dllexport)
|
|
||||||
# define ZEXPORTVA __declspec(dllexport)
|
|
||||||
# else
|
|
||||||
# define ZEXPORT __declspec(dllimport)
|
|
||||||
# define ZEXPORTVA __declspec(dllimport)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ZEXTERN
|
|
||||||
# define ZEXTERN extern
|
|
||||||
#endif
|
|
||||||
#ifndef ZEXPORT
|
|
||||||
# define ZEXPORT
|
|
||||||
#endif
|
|
||||||
#ifndef ZEXPORTVA
|
|
||||||
# define ZEXPORTVA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef FAR
|
|
||||||
# define FAR
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__MACTYPES__)
|
|
||||||
typedef unsigned char Byte; /* 8 bits */
|
|
||||||
#endif
|
|
||||||
typedef unsigned int uInt; /* 16 bits or more */
|
|
||||||
typedef unsigned long uLong; /* 32 bits or more */
|
|
||||||
|
|
||||||
#ifdef SMALL_MEDIUM
|
|
||||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
|
||||||
# define Bytef Byte FAR
|
|
||||||
#else
|
|
||||||
typedef Byte FAR Bytef;
|
|
||||||
#endif
|
|
||||||
typedef char FAR charf;
|
|
||||||
typedef int FAR intf;
|
|
||||||
typedef uInt FAR uIntf;
|
|
||||||
typedef uLong FAR uLongf;
|
|
||||||
|
|
||||||
#ifdef STDC
|
|
||||||
typedef void const *voidpc;
|
|
||||||
typedef void FAR *voidpf;
|
|
||||||
typedef void *voidp;
|
|
||||||
#else
|
|
||||||
typedef Byte const *voidpc;
|
|
||||||
typedef Byte FAR *voidpf;
|
|
||||||
typedef Byte *voidp;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
|
||||||
# define Z_HAVE_UNISTD_H
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STDC
|
|
||||||
# include <sys/types.h> /* for off_t */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
|
|
||||||
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
|
|
||||||
* though the former does not conform to the LFS document), but considering
|
|
||||||
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
|
|
||||||
* equivalently requesting no 64-bit operations
|
|
||||||
*/
|
|
||||||
#if -_LARGEFILE64_SOURCE - -1 == 1
|
|
||||||
# undef _LARGEFILE64_SOURCE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
|
||||||
# include <unistd.h> /* for SEEK_* and off_t */
|
|
||||||
# ifdef VMS
|
|
||||||
# include <unixio.h> /* for off_t */
|
|
||||||
# endif
|
|
||||||
# ifndef z_off_t
|
|
||||||
# define z_off_t off_t
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SEEK_SET
|
|
||||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
|
||||||
# define SEEK_CUR 1 /* Seek from current position. */
|
|
||||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef z_off_t
|
|
||||||
# define z_off_t long
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
|
|
||||||
# define z_off64_t off64_t
|
|
||||||
#else
|
|
||||||
# define z_off64_t z_off_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__OS400__)
|
|
||||||
# define NO_vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__MVS__)
|
|
||||||
# define NO_vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* MVS linker does not support external names larger than 8 bytes */
|
|
||||||
#if defined(__MVS__)
|
|
||||||
#pragma map(deflateInit_,"DEIN")
|
|
||||||
#pragma map(deflateInit2_,"DEIN2")
|
|
||||||
#pragma map(deflateEnd,"DEEND")
|
|
||||||
#pragma map(deflateBound,"DEBND")
|
|
||||||
#pragma map(inflateInit_,"ININ")
|
|
||||||
#pragma map(inflateInit2_,"ININ2")
|
|
||||||
#pragma map(inflateEnd,"INEND")
|
|
||||||
#pragma map(inflateSync,"INSY")
|
|
||||||
#pragma map(inflateSetDictionary,"INSEDI")
|
|
||||||
#pragma map(compressBound,"CMBND")
|
|
||||||
#pragma map(inflate_table,"INTABL")
|
|
||||||
#pragma map(inflate_fast,"INFA")
|
|
||||||
#pragma map(inflate_copyright,"INCOPY")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* ZCONF_H */
|
|
||||||
@ -1,362 +0,0 @@
|
|||||||
/* zip.h -- IO on .zip files using zlib
|
|
||||||
Version 1.1, February 14h, 2010
|
|
||||||
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
|
|
||||||
|
|
||||||
Modifications for Zip64 support
|
|
||||||
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
|
|
||||||
|
|
||||||
For more info read MiniZip_info.txt
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Condition of use and distribution are the same than zlib :
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Changes
|
|
||||||
|
|
||||||
See header of zip.h
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _zip12_H
|
|
||||||
#define _zip12_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#define HAVE_BZIP2
|
|
||||||
|
|
||||||
#ifndef _ZLIB_H
|
|
||||||
#include "zlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _ZLIBIOAPI_H
|
|
||||||
#include "ioapi.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BZIP2
|
|
||||||
#include "bzlib.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define Z_BZIP2ED 12
|
|
||||||
|
|
||||||
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
|
|
||||||
/* like the STRICT of WIN32, we define a pointer that cannot be converted
|
|
||||||
from (void*) without cast */
|
|
||||||
typedef struct TagzipFile__ { int unused; } zipFile__;
|
|
||||||
typedef zipFile__ *zipFile;
|
|
||||||
#else
|
|
||||||
typedef voidp zipFile;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ZIP_OK (0)
|
|
||||||
#define ZIP_EOF (0)
|
|
||||||
#define ZIP_ERRNO (Z_ERRNO)
|
|
||||||
#define ZIP_PARAMERROR (-102)
|
|
||||||
#define ZIP_BADZIPFILE (-103)
|
|
||||||
#define ZIP_INTERNALERROR (-104)
|
|
||||||
|
|
||||||
#ifndef DEF_MEM_LEVEL
|
|
||||||
# if MAX_MEM_LEVEL >= 8
|
|
||||||
# define DEF_MEM_LEVEL 8
|
|
||||||
# else
|
|
||||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
/* default memLevel */
|
|
||||||
|
|
||||||
/* tm_zip contain date/time info */
|
|
||||||
typedef struct tm_zip_s
|
|
||||||
{
|
|
||||||
uInt tm_sec; /* seconds after the minute - [0,59] */
|
|
||||||
uInt tm_min; /* minutes after the hour - [0,59] */
|
|
||||||
uInt tm_hour; /* hours since midnight - [0,23] */
|
|
||||||
uInt tm_mday; /* day of the month - [1,31] */
|
|
||||||
uInt tm_mon; /* months since January - [0,11] */
|
|
||||||
uInt tm_year; /* years - [1980..2044] */
|
|
||||||
} tm_zip;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
tm_zip tmz_date; /* date in understandable format */
|
|
||||||
uLong dosDate; /* if dos_date == 0, tmu_date is used */
|
|
||||||
/* uLong flag; */ /* general purpose bit flag 2 bytes */
|
|
||||||
|
|
||||||
uLong internal_fa; /* internal file attributes 2 bytes */
|
|
||||||
uLong external_fa; /* external file attributes 4 bytes */
|
|
||||||
} zip_fileinfo;
|
|
||||||
|
|
||||||
typedef const char* zipcharpc;
|
|
||||||
|
|
||||||
|
|
||||||
#define APPEND_STATUS_CREATE (0)
|
|
||||||
#define APPEND_STATUS_CREATEAFTER (1)
|
|
||||||
#define APPEND_STATUS_ADDINZIP (2)
|
|
||||||
|
|
||||||
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
|
|
||||||
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
|
|
||||||
/*
|
|
||||||
Create a zipfile.
|
|
||||||
pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
|
|
||||||
an Unix computer "zlib/zlib113.zip".
|
|
||||||
if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
|
|
||||||
will be created at the end of the file.
|
|
||||||
(useful if the file contain a self extractor code)
|
|
||||||
if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
|
|
||||||
add files in existing zip (be sure you don't add file that doesn't exist)
|
|
||||||
If the zipfile cannot be opened, the return value is NULL.
|
|
||||||
Else, the return value is a zipFile Handle, usable with other function
|
|
||||||
of this zip package.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Note : there is no delete function into a zipfile.
|
|
||||||
If you want delete file into a zipfile, you must open a zipfile, and create another
|
|
||||||
Of couse, you can use RAW reading and writing to copy the file you did not want delte
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
|
|
||||||
int append,
|
|
||||||
zipcharpc* globalcomment,
|
|
||||||
zlib_filefunc_def* pzlib_filefunc_def));
|
|
||||||
|
|
||||||
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
|
|
||||||
int append,
|
|
||||||
zipcharpc* globalcomment,
|
|
||||||
zlib_filefunc64_def* pzlib_filefunc_def));
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level));
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int zip64));
|
|
||||||
|
|
||||||
/*
|
|
||||||
Open a file in the ZIP for writing.
|
|
||||||
filename : the filename in zip (if NULL, '-' without quote will be used
|
|
||||||
*zipfi contain supplemental information
|
|
||||||
if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
|
|
||||||
contains the extrafield data the the local header
|
|
||||||
if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
|
|
||||||
contains the extrafield data the the local header
|
|
||||||
if comment != NULL, comment contain the comment string
|
|
||||||
method contain the compression method (0 for store, Z_DEFLATED for deflate)
|
|
||||||
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
|
|
||||||
zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
|
|
||||||
this MUST be '1' if the uncompressed size is >= 0xffffffff.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw));
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw,
|
|
||||||
int zip64));
|
|
||||||
/*
|
|
||||||
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw,
|
|
||||||
int windowBits,
|
|
||||||
int memLevel,
|
|
||||||
int strategy,
|
|
||||||
const char* password,
|
|
||||||
uLong crcForCrypting));
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw,
|
|
||||||
int windowBits,
|
|
||||||
int memLevel,
|
|
||||||
int strategy,
|
|
||||||
const char* password,
|
|
||||||
uLong crcForCrypting,
|
|
||||||
int zip64
|
|
||||||
));
|
|
||||||
|
|
||||||
/*
|
|
||||||
Same than zipOpenNewFileInZip2, except
|
|
||||||
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
|
|
||||||
password : crypting password (NULL for no crypting)
|
|
||||||
crcForCrypting : crc of file to compress (needed for crypting)
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw,
|
|
||||||
int windowBits,
|
|
||||||
int memLevel,
|
|
||||||
int strategy,
|
|
||||||
const char* password,
|
|
||||||
uLong crcForCrypting,
|
|
||||||
uLong versionMadeBy,
|
|
||||||
uLong flagBase
|
|
||||||
));
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
|
|
||||||
const char* filename,
|
|
||||||
const zip_fileinfo* zipfi,
|
|
||||||
const void* extrafield_local,
|
|
||||||
uInt size_extrafield_local,
|
|
||||||
const void* extrafield_global,
|
|
||||||
uInt size_extrafield_global,
|
|
||||||
const char* comment,
|
|
||||||
int method,
|
|
||||||
int level,
|
|
||||||
int raw,
|
|
||||||
int windowBits,
|
|
||||||
int memLevel,
|
|
||||||
int strategy,
|
|
||||||
const char* password,
|
|
||||||
uLong crcForCrypting,
|
|
||||||
uLong versionMadeBy,
|
|
||||||
uLong flagBase,
|
|
||||||
int zip64
|
|
||||||
));
|
|
||||||
/*
|
|
||||||
Same than zipOpenNewFileInZip4, except
|
|
||||||
versionMadeBy : value for Version made by field
|
|
||||||
flag : value for flag field (compression level info will be added)
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
|
|
||||||
const void* buf,
|
|
||||||
unsigned len));
|
|
||||||
/*
|
|
||||||
Write data in the zipfile
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
|
|
||||||
/*
|
|
||||||
Close the current file in the zipfile
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
|
|
||||||
uLong uncompressed_size,
|
|
||||||
uLong crc32));
|
|
||||||
|
|
||||||
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
|
|
||||||
ZPOS64_T uncompressed_size,
|
|
||||||
uLong crc32));
|
|
||||||
|
|
||||||
/*
|
|
||||||
Close the current file in the zipfile, for file opened with
|
|
||||||
parameter raw=1 in zipOpenNewFileInZip2
|
|
||||||
uncompressed_size and crc32 are value for the uncompressed size
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern int ZEXPORT zipClose OF((zipFile file,
|
|
||||||
const char* global_comment));
|
|
||||||
/*
|
|
||||||
Close the zipfile
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
|
|
||||||
/*
|
|
||||||
zipRemoveExtraInfoBlock - Added by Mathias Svensson
|
|
||||||
|
|
||||||
Remove extra information block from a extra information data for the local file header or central directory header
|
|
||||||
|
|
||||||
It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
|
|
||||||
|
|
||||||
0x0001 is the signature header for the ZIP64 extra information blocks
|
|
||||||
|
|
||||||
usage.
|
|
||||||
Remove ZIP64 Extra information from a central director extra field data
|
|
||||||
zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
|
|
||||||
|
|
||||||
Remove ZIP64 Extra information from a Local File Header extra field data
|
|
||||||
zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _zip64_H */
|
|
||||||
1613
code/minizip/zlib.h
1613
code/minizip/zlib.h
File diff suppressed because it is too large
Load Diff
@ -1,274 +0,0 @@
|
|||||||
/* zutil.h -- internal interface and configuration of the compression library
|
|
||||||
* Copyright (C) 1995-2010 Jean-loup Gailly.
|
|
||||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WARNING: this file should *not* be used by applications. It is
|
|
||||||
part of the implementation of the compression library and is
|
|
||||||
subject to change. Applications should only use zlib.h.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* @(#) $Id$ */
|
|
||||||
|
|
||||||
#ifndef ZUTIL_H
|
|
||||||
#define ZUTIL_H
|
|
||||||
|
|
||||||
#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ)
|
|
||||||
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
|
|
||||||
#else
|
|
||||||
# define ZLIB_INTERNAL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "zlib.h"
|
|
||||||
|
|
||||||
#ifdef STDC
|
|
||||||
# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
|
|
||||||
# include <stddef.h>
|
|
||||||
# endif
|
|
||||||
# include <string.h>
|
|
||||||
# include <stdlib.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef local
|
|
||||||
# define local static
|
|
||||||
#endif
|
|
||||||
/* compile with -Dlocal if your debugger can't find static symbols */
|
|
||||||
|
|
||||||
typedef unsigned char uch;
|
|
||||||
typedef uch FAR uchf;
|
|
||||||
typedef unsigned short ush;
|
|
||||||
typedef ush FAR ushf;
|
|
||||||
typedef unsigned long ulg;
|
|
||||||
|
|
||||||
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|
||||||
/* (size given to avoid silly warnings with Visual C++) */
|
|
||||||
|
|
||||||
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
|
||||||
|
|
||||||
#define ERR_RETURN(strm,err) \
|
|
||||||
return (strm->msg = (char*)ERR_MSG(err), (err))
|
|
||||||
/* To be used only when the state is known to be valid */
|
|
||||||
|
|
||||||
/* common constants */
|
|
||||||
|
|
||||||
#ifndef DEF_WBITS
|
|
||||||
# define DEF_WBITS MAX_WBITS
|
|
||||||
#endif
|
|
||||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
|
||||||
|
|
||||||
#if MAX_MEM_LEVEL >= 8
|
|
||||||
# define DEF_MEM_LEVEL 8
|
|
||||||
#else
|
|
||||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
|
||||||
#endif
|
|
||||||
/* default memLevel */
|
|
||||||
|
|
||||||
#define STORED_BLOCK 0
|
|
||||||
#define STATIC_TREES 1
|
|
||||||
#define DYN_TREES 2
|
|
||||||
/* The three kinds of block type */
|
|
||||||
|
|
||||||
#define MIN_MATCH 3
|
|
||||||
#define MAX_MATCH 258
|
|
||||||
/* The minimum and maximum match lengths */
|
|
||||||
|
|
||||||
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
|
|
||||||
|
|
||||||
/* target dependencies */
|
|
||||||
|
|
||||||
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
|
|
||||||
# define OS_CODE 0x00
|
|
||||||
# if defined(__TURBOC__) || defined(__BORLANDC__)
|
|
||||||
# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
|
|
||||||
/* Allow compilation with ANSI keywords only enabled */
|
|
||||||
void _Cdecl farfree( void *block );
|
|
||||||
void *_Cdecl farmalloc( unsigned long nbytes );
|
|
||||||
# else
|
|
||||||
# include <alloc.h>
|
|
||||||
# endif
|
|
||||||
# else /* MSC or DJGPP */
|
|
||||||
# include <malloc.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef AMIGA
|
|
||||||
# define OS_CODE 0x01
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(VAXC) || defined(VMS)
|
|
||||||
# define OS_CODE 0x02
|
|
||||||
# define F_OPEN(name, mode) \
|
|
||||||
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ATARI) || defined(atarist)
|
|
||||||
# define OS_CODE 0x05
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef OS2
|
|
||||||
# define OS_CODE 0x06
|
|
||||||
# ifdef M_I86
|
|
||||||
# include <malloc.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MACOS) || defined(TARGET_OS_MAC)
|
|
||||||
# define OS_CODE 0x07
|
|
||||||
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
|
|
||||||
# include <unix.h> /* for fdopen */
|
|
||||||
# else
|
|
||||||
# ifndef fdopen
|
|
||||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef TOPS20
|
|
||||||
# define OS_CODE 0x0a
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
|
|
||||||
# define OS_CODE 0x0b
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __50SERIES /* Prime/PRIMOS */
|
|
||||||
# define OS_CODE 0x0f
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_BEOS_) || defined(RISCOS)
|
|
||||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
|
|
||||||
# if defined(_WIN32_WCE)
|
|
||||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
|
||||||
# ifndef _PTRDIFF_T_DEFINED
|
|
||||||
typedef int ptrdiff_t;
|
|
||||||
# define _PTRDIFF_T_DEFINED
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# define fdopen(fd,type) _fdopen(fd,type)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__BORLANDC__)
|
|
||||||
#pragma warn -8004
|
|
||||||
#pragma warn -8008
|
|
||||||
#pragma warn -8066
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* provide prototypes for these when building zlib without LFS */
|
|
||||||
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
|
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* common defaults */
|
|
||||||
|
|
||||||
#ifndef OS_CODE
|
|
||||||
# define OS_CODE 0x03 /* assume Unix */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef F_OPEN
|
|
||||||
# define F_OPEN(name, mode) fopen((name), (mode))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* functions */
|
|
||||||
|
|
||||||
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
|
|
||||||
# ifndef HAVE_VSNPRINTF
|
|
||||||
# define HAVE_VSNPRINTF
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if defined(__CYGWIN__)
|
|
||||||
# ifndef HAVE_VSNPRINTF
|
|
||||||
# define HAVE_VSNPRINTF
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_VSNPRINTF
|
|
||||||
# ifdef MSDOS
|
|
||||||
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
|
|
||||||
but for now we just assume it doesn't. */
|
|
||||||
# define NO_vsnprintf
|
|
||||||
# endif
|
|
||||||
# ifdef __TURBOC__
|
|
||||||
# define NO_vsnprintf
|
|
||||||
# endif
|
|
||||||
# ifdef WIN32
|
|
||||||
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
|
|
||||||
# if !defined(vsnprintf) && !defined(NO_vsnprintf)
|
|
||||||
# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
|
|
||||||
# define vsnprintf _vsnprintf
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# ifdef __SASC
|
|
||||||
# define NO_vsnprintf
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifdef VMS
|
|
||||||
# define NO_vsnprintf
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(pyr)
|
|
||||||
# define NO_MEMCPY
|
|
||||||
#endif
|
|
||||||
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
|
|
||||||
/* Use our own functions for small and medium model with MSC <= 5.0.
|
|
||||||
* You may have to use the same strategy for Borland C (untested).
|
|
||||||
* The __SC__ check is for Symantec.
|
|
||||||
*/
|
|
||||||
# define NO_MEMCPY
|
|
||||||
#endif
|
|
||||||
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
|
|
||||||
# define HAVE_MEMCPY
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_MEMCPY
|
|
||||||
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
|
|
||||||
# define zmemcpy _fmemcpy
|
|
||||||
# define zmemcmp _fmemcmp
|
|
||||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
|
||||||
# else
|
|
||||||
# define zmemcpy memcpy
|
|
||||||
# define zmemcmp memcmp
|
|
||||||
# define zmemzero(dest, len) memset(dest, 0, len)
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
|
|
||||||
int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
|
|
||||||
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Diagnostic functions */
|
|
||||||
#ifdef DEBUG
|
|
||||||
# include <stdio.h>
|
|
||||||
extern int ZLIB_INTERNAL z_verbose;
|
|
||||||
extern void ZLIB_INTERNAL z_error OF((char *m));
|
|
||||||
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
|
|
||||||
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
|
|
||||||
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
|
|
||||||
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
|
|
||||||
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
|
|
||||||
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
|
|
||||||
#else
|
|
||||||
# define Assert(cond,msg)
|
|
||||||
# define Trace(x)
|
|
||||||
# define Tracev(x)
|
|
||||||
# define Tracevv(x)
|
|
||||||
# define Tracec(c,x)
|
|
||||||
# define Tracecv(c,x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
|
|
||||||
unsigned size));
|
|
||||||
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
|
|
||||||
|
|
||||||
#define ZALLOC(strm, items, size) \
|
|
||||||
(*((strm)->zalloc))((strm)->opaque, (items), (size))
|
|
||||||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
|
|
||||||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
|
|
||||||
|
|
||||||
#endif /* ZUTIL_H */
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
Data in big-endian format.
|
|
||||||
*/
|
|
||||||
static inline void float4store(uchar *T, float A)
|
|
||||||
{ *(T)= ((uchar *) &A)[3];
|
|
||||||
*((T)+1)=(char) ((uchar *) &A)[2];
|
|
||||||
*((T)+2)=(char) ((uchar *) &A)[1];
|
|
||||||
*((T)+3)=(char) ((uchar *) &A)[0]; }
|
|
||||||
|
|
||||||
static inline void float4get (float *V, const uchar *M)
|
|
||||||
{ float def_temp;
|
|
||||||
((uchar*) &def_temp)[0]=(M)[3];
|
|
||||||
((uchar*) &def_temp)[1]=(M)[2];
|
|
||||||
((uchar*) &def_temp)[2]=(M)[1];
|
|
||||||
((uchar*) &def_temp)[3]=(M)[0];
|
|
||||||
(*V)=def_temp; }
|
|
||||||
|
|
||||||
static inline void float8store(uchar *T, double V)
|
|
||||||
{ *(T)= ((uchar *) &V)[7];
|
|
||||||
*((T)+1)=(char) ((uchar *) &V)[6];
|
|
||||||
*((T)+2)=(char) ((uchar *) &V)[5];
|
|
||||||
*((T)+3)=(char) ((uchar *) &V)[4];
|
|
||||||
*((T)+4)=(char) ((uchar *) &V)[3];
|
|
||||||
*((T)+5)=(char) ((uchar *) &V)[2];
|
|
||||||
*((T)+6)=(char) ((uchar *) &V)[1];
|
|
||||||
*((T)+7)=(char) ((uchar *) &V)[0]; }
|
|
||||||
|
|
||||||
static inline void float8get (double *V, const uchar *M)
|
|
||||||
{ double def_temp;
|
|
||||||
((uchar*) &def_temp)[0]=(M)[7];
|
|
||||||
((uchar*) &def_temp)[1]=(M)[6];
|
|
||||||
((uchar*) &def_temp)[2]=(M)[5];
|
|
||||||
((uchar*) &def_temp)[3]=(M)[4];
|
|
||||||
((uchar*) &def_temp)[4]=(M)[3];
|
|
||||||
((uchar*) &def_temp)[5]=(M)[2];
|
|
||||||
((uchar*) &def_temp)[6]=(M)[1];
|
|
||||||
((uchar*) &def_temp)[7]=(M)[0];
|
|
||||||
(*V) = def_temp; }
|
|
||||||
|
|
||||||
static inline void ushortget(uint16 *V, const uchar *pM)
|
|
||||||
{ *V = (uint16) (((uint16) ((uchar) (pM)[1]))+
|
|
||||||
((uint16) ((uint16) (pM)[0]) << 8)); }
|
|
||||||
static inline void shortget (int16 *V, const uchar *pM)
|
|
||||||
{ *V = (short) (((short) ((uchar) (pM)[1]))+
|
|
||||||
((short) ((short) (pM)[0]) << 8)); }
|
|
||||||
static inline void longget (int32 *V, const uchar *pM)
|
|
||||||
{ int32 def_temp;
|
|
||||||
((uchar*) &def_temp)[0]=(pM)[0];
|
|
||||||
((uchar*) &def_temp)[1]=(pM)[1];
|
|
||||||
((uchar*) &def_temp)[2]=(pM)[2];
|
|
||||||
((uchar*) &def_temp)[3]=(pM)[3];
|
|
||||||
(*V)=def_temp; }
|
|
||||||
static inline void ulongget (uint32 *V, const uchar *pM)
|
|
||||||
{ uint32 def_temp;
|
|
||||||
((uchar*) &def_temp)[0]=(pM)[0];
|
|
||||||
((uchar*) &def_temp)[1]=(pM)[1];
|
|
||||||
((uchar*) &def_temp)[2]=(pM)[2];
|
|
||||||
((uchar*) &def_temp)[3]=(pM)[3];
|
|
||||||
(*V)=def_temp; }
|
|
||||||
static inline void shortstore(uchar *T, int16 A)
|
|
||||||
{ uint def_temp=(uint) (A) ;
|
|
||||||
*(((char*)T)+1)=(char)(def_temp);
|
|
||||||
*(((char*)T)+0)=(char)(def_temp >> 8); }
|
|
||||||
static inline void longstore (uchar *T, int32 A)
|
|
||||||
{ *(((char*)T)+3)=((A));
|
|
||||||
*(((char*)T)+2)=(((A) >> 8));
|
|
||||||
*(((char*)T)+1)=(((A) >> 16));
|
|
||||||
*(((char*)T)+0)=(((A) >> 24)); }
|
|
||||||
|
|
||||||
static inline void floatget(float *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, (M), sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void floatstore(uchar *T, float V)
|
|
||||||
{
|
|
||||||
memcpy((T), (&V), sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void doubleget(double *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, (M), sizeof(double));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void doublestore(uchar *T, double V)
|
|
||||||
{
|
|
||||||
memcpy((T), &V, sizeof(double));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void longlongget(longlong *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, (M), sizeof(ulonglong));
|
|
||||||
}
|
|
||||||
static inline void longlongstore(uchar *T, longlong V)
|
|
||||||
{
|
|
||||||
memcpy((T), &V, sizeof(ulonglong));
|
|
||||||
}
|
|
||||||
@ -1,82 +0,0 @@
|
|||||||
/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/**
|
|
||||||
@file binary_log_types.h
|
|
||||||
|
|
||||||
@brief This file contains the field type.
|
|
||||||
|
|
||||||
|
|
||||||
@note This file can be imported both from C and C++ code, so the
|
|
||||||
definitions have to be constructed to support this.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BINARY_LOG_TYPES_INCLUDED
|
|
||||||
#define BINARY_LOG_TYPES_INCLUDED
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Constants exported from this package.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum enum_field_types {
|
|
||||||
MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
|
|
||||||
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
|
|
||||||
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
|
|
||||||
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
|
|
||||||
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
|
|
||||||
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
|
|
||||||
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
|
|
||||||
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
|
|
||||||
MYSQL_TYPE_BIT,
|
|
||||||
MYSQL_TYPE_TIMESTAMP2,
|
|
||||||
MYSQL_TYPE_DATETIME2,
|
|
||||||
MYSQL_TYPE_TIME2,
|
|
||||||
MYSQL_TYPE_JSON=245,
|
|
||||||
MYSQL_TYPE_NEWDECIMAL=246,
|
|
||||||
MYSQL_TYPE_ENUM=247,
|
|
||||||
MYSQL_TYPE_SET=248,
|
|
||||||
MYSQL_TYPE_TINY_BLOB=249,
|
|
||||||
MYSQL_TYPE_MEDIUM_BLOB=250,
|
|
||||||
MYSQL_TYPE_LONG_BLOB=251,
|
|
||||||
MYSQL_TYPE_BLOB=252,
|
|
||||||
MYSQL_TYPE_VAR_STRING=253,
|
|
||||||
MYSQL_TYPE_STRING=254,
|
|
||||||
MYSQL_TYPE_GEOMETRY=255
|
|
||||||
} enum_field_types;
|
|
||||||
|
|
||||||
#define DATETIME_MAX_DECIMALS 6
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif // __cplusplus
|
|
||||||
|
|
||||||
#endif /* BINARY_LOG_TYPES_INCLUDED */
|
|
||||||
@ -1,104 +0,0 @@
|
|||||||
/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Endianness-independent definitions for architectures other
|
|
||||||
than the x86 architecture.
|
|
||||||
*/
|
|
||||||
static inline int16 sint2korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(int16) (((int16) (A[0])) +
|
|
||||||
((int16) (A[1]) << 8))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int32 sint4korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(int32) (((int32) (A[0])) +
|
|
||||||
(((int32) (A[1]) << 8)) +
|
|
||||||
(((int32) (A[2]) << 16)) +
|
|
||||||
(((int32) (A[3]) << 24)))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint16 uint2korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(uint16) (((uint16) (A[0])) +
|
|
||||||
((uint16) (A[1]) << 8))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32 uint4korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(uint32) (((uint32) (A[0])) +
|
|
||||||
(((uint32) (A[1])) << 8) +
|
|
||||||
(((uint32) (A[2])) << 16) +
|
|
||||||
(((uint32) (A[3])) << 24))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong uint8korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
((ulonglong)(((uint32) (A[0])) +
|
|
||||||
(((uint32) (A[1])) << 8) +
|
|
||||||
(((uint32) (A[2])) << 16) +
|
|
||||||
(((uint32) (A[3])) << 24)) +
|
|
||||||
(((ulonglong) (((uint32) (A[4])) +
|
|
||||||
(((uint32) (A[5])) << 8) +
|
|
||||||
(((uint32) (A[6])) << 16) +
|
|
||||||
(((uint32) (A[7])) << 24))) <<
|
|
||||||
32))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline longlong sint8korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return (longlong) uint8korr(A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int2store(uchar *T, uint16 A)
|
|
||||||
{
|
|
||||||
uint def_temp= A ;
|
|
||||||
*(T)= (uchar)(def_temp);
|
|
||||||
*(T+1)= (uchar)(def_temp >> 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int4store(uchar *T, uint32 A)
|
|
||||||
{
|
|
||||||
*(T)= (uchar) (A);
|
|
||||||
*(T+1)=(uchar) (A >> 8);
|
|
||||||
*(T+2)=(uchar) (A >> 16);
|
|
||||||
*(T+3)=(uchar) (A >> 24);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int8store(uchar *T, ulonglong A)
|
|
||||||
{
|
|
||||||
uint def_temp= (uint) A,
|
|
||||||
def_temp2= (uint) (A >> 32);
|
|
||||||
int4store(T, def_temp);
|
|
||||||
int4store(T+4,def_temp2);
|
|
||||||
}
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Optimized functions for the x86 architecture (_WIN32 included).
|
|
||||||
|
|
||||||
x86 handles misaligned reads and writes just fine, so suppress
|
|
||||||
UBSAN warnings for these functions.
|
|
||||||
*/
|
|
||||||
static inline int16 sint2korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline int16 sint2korr(const uchar *A) { return *((int16*) A); }
|
|
||||||
|
|
||||||
static inline int32 sint4korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline int32 sint4korr(const uchar *A) { return *((int32*) A); }
|
|
||||||
|
|
||||||
static inline uint16 uint2korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline uint16 uint2korr(const uchar *A) { return *((uint16*) A); }
|
|
||||||
|
|
||||||
static inline uint32 uint4korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline uint32 uint4korr(const uchar *A) { return *((uint32*) A); }
|
|
||||||
|
|
||||||
static inline ulonglong uint8korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline ulonglong uint8korr(const uchar *A) { return *((ulonglong*) A);}
|
|
||||||
|
|
||||||
static inline longlong sint8korr(const uchar *A) SUPPRESS_UBSAN;
|
|
||||||
static inline longlong sint8korr(const uchar *A) { return *((longlong*) A); }
|
|
||||||
|
|
||||||
static inline void int2store(uchar *T, uint16 A) SUPPRESS_UBSAN;
|
|
||||||
static inline void int2store(uchar *T, uint16 A)
|
|
||||||
{
|
|
||||||
*((uint16*) T)= A;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int4store(uchar *T, uint32 A) SUPPRESS_UBSAN;
|
|
||||||
static inline void int4store(uchar *T, uint32 A)
|
|
||||||
{
|
|
||||||
*((uint32*) T)= A;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int8store(uchar *T, ulonglong A) SUPPRESS_UBSAN;
|
|
||||||
static inline void int8store(uchar *T, ulonglong A)
|
|
||||||
{
|
|
||||||
*((ulonglong*) T)= A;
|
|
||||||
}
|
|
||||||
@ -1,144 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef DECIMAL_INCLUDED
|
|
||||||
#define DECIMAL_INCLUDED
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{TRUNCATE=0, HALF_EVEN, HALF_UP, CEILING, FLOOR}
|
|
||||||
decimal_round_mode;
|
|
||||||
typedef int32 decimal_digit_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
intg is the number of *decimal* digits (NOT number of decimal_digit_t's !)
|
|
||||||
before the point
|
|
||||||
frac is the number of decimal digits after the point
|
|
||||||
len is the length of buf (length of allocated space) in decimal_digit_t's,
|
|
||||||
not in bytes
|
|
||||||
sign false means positive, true means negative
|
|
||||||
buf is an array of decimal_digit_t's
|
|
||||||
*/
|
|
||||||
typedef struct st_decimal_t {
|
|
||||||
int intg, frac, len;
|
|
||||||
my_bool sign;
|
|
||||||
decimal_digit_t *buf;
|
|
||||||
} decimal_t;
|
|
||||||
|
|
||||||
#ifndef MYSQL_ABI_CHECK
|
|
||||||
int internal_str2dec(const char *from, decimal_t *to, char **end,
|
|
||||||
my_bool fixed);
|
|
||||||
int decimal2string(const decimal_t *from, char *to, int *to_len,
|
|
||||||
int fixed_precision, int fixed_decimals,
|
|
||||||
char filler);
|
|
||||||
int decimal2ulonglong(decimal_t *from, ulonglong *to);
|
|
||||||
int ulonglong2decimal(ulonglong from, decimal_t *to);
|
|
||||||
int decimal2longlong(decimal_t *from, longlong *to);
|
|
||||||
int longlong2decimal(longlong from, decimal_t *to);
|
|
||||||
int decimal2double(const decimal_t *from, double *to);
|
|
||||||
int double2decimal(double from, decimal_t *to);
|
|
||||||
int decimal_actual_fraction(decimal_t *from);
|
|
||||||
int decimal2bin(decimal_t *from, uchar *to, int precision, int scale);
|
|
||||||
int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Convert decimal to lldiv_t.
|
|
||||||
The integer part is stored in to->quot.
|
|
||||||
The fractional part is multiplied to 10^9 and stored to to->rem.
|
|
||||||
@param from Decimal value
|
|
||||||
@param to lldiv_t value
|
|
||||||
@retval 0 on success
|
|
||||||
@retval !0 in error
|
|
||||||
*/
|
|
||||||
int decimal2lldiv_t(const decimal_t *from, lldiv_t *to);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Convert doube to lldiv_t.
|
|
||||||
The integer part is stored in to->quot.
|
|
||||||
The fractional part is multiplied to 10^9 and stored to to->rem.
|
|
||||||
@param from Decimal value
|
|
||||||
@param to lldiv_t value
|
|
||||||
@retval 0 on success
|
|
||||||
@retval !0 in error
|
|
||||||
*/
|
|
||||||
|
|
||||||
int double2lldiv_t(double from, lldiv_t *to);
|
|
||||||
int decimal_size(int precision, int scale);
|
|
||||||
int decimal_bin_size(int precision, int scale);
|
|
||||||
int decimal_result_size(decimal_t *from1, decimal_t *from2, char op,
|
|
||||||
int param);
|
|
||||||
|
|
||||||
int decimal_intg(const decimal_t *from);
|
|
||||||
int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
|
|
||||||
int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
|
|
||||||
int decimal_cmp(const decimal_t *from1, const decimal_t *from2);
|
|
||||||
int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
|
|
||||||
int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to,
|
|
||||||
int scale_incr);
|
|
||||||
int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to);
|
|
||||||
int decimal_round(const decimal_t *from, decimal_t *to, int new_scale,
|
|
||||||
decimal_round_mode mode);
|
|
||||||
int decimal_is_zero(const decimal_t *from);
|
|
||||||
void max_decimal(int precision, int frac, decimal_t *to);
|
|
||||||
|
|
||||||
#define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0)
|
|
||||||
#define string2decimal_fixed(A,B,C) internal_str2dec((A), (B), (C), 1)
|
|
||||||
|
|
||||||
/* set a decimal_t to zero */
|
|
||||||
|
|
||||||
#define decimal_make_zero(dec) do { \
|
|
||||||
(dec)->buf[0]=0; \
|
|
||||||
(dec)->intg=1; \
|
|
||||||
(dec)->frac=0; \
|
|
||||||
(dec)->sign=0; \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
/*
|
|
||||||
returns the length of the buffer to hold string representation
|
|
||||||
of the decimal (including decimal dot, possible sign and \0)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define decimal_string_size(dec) (((dec)->intg ? (dec)->intg : 1) + \
|
|
||||||
(dec)->frac + ((dec)->frac > 0) + 2)
|
|
||||||
|
|
||||||
/*
|
|
||||||
conventions:
|
|
||||||
|
|
||||||
decimal_smth() == 0 -- everything's ok
|
|
||||||
decimal_smth() <= 1 -- result is usable, but precision loss is possible
|
|
||||||
decimal_smth() <= 2 -- result can be unusable, most significant digits
|
|
||||||
could've been lost
|
|
||||||
decimal_smth() > 2 -- no result was generated
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define E_DEC_OK 0
|
|
||||||
#define E_DEC_TRUNCATED 1
|
|
||||||
#define E_DEC_OVERFLOW 2
|
|
||||||
#define E_DEC_DIV_ZERO 4
|
|
||||||
#define E_DEC_BAD_NUM 8
|
|
||||||
#define E_DEC_OOM 16
|
|
||||||
|
|
||||||
#define E_DEC_ERROR 31
|
|
||||||
#define E_DEC_FATAL_ERROR 30
|
|
||||||
|
|
||||||
#endif // !MYSQL_ABI_CHECK
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,120 +0,0 @@
|
|||||||
#ifndef ERRMSG_INCLUDED
|
|
||||||
#define ERRMSG_INCLUDED
|
|
||||||
|
|
||||||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/* Error messages for MySQL clients */
|
|
||||||
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
void init_client_errs(void);
|
|
||||||
void finish_client_errs(void);
|
|
||||||
extern const char *client_errors[]; /* Error messages */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CR_MIN_ERROR 2000 /* For easier client code */
|
|
||||||
#define CR_MAX_ERROR 2999
|
|
||||||
#if !defined(ER)
|
|
||||||
#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \
|
|
||||||
client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR])
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
|
|
||||||
|
|
||||||
/* Do not add error numbers before CR_ERROR_FIRST. */
|
|
||||||
/* If necessary to add lower numbers, change CR_ERROR_FIRST accordingly. */
|
|
||||||
#define CR_ERROR_FIRST 2000 /*Copy first error nr.*/
|
|
||||||
#define CR_UNKNOWN_ERROR 2000
|
|
||||||
#define CR_SOCKET_CREATE_ERROR 2001
|
|
||||||
#define CR_CONNECTION_ERROR 2002
|
|
||||||
#define CR_CONN_HOST_ERROR 2003
|
|
||||||
#define CR_IPSOCK_ERROR 2004
|
|
||||||
#define CR_UNKNOWN_HOST 2005
|
|
||||||
#define CR_SERVER_GONE_ERROR 2006
|
|
||||||
#define CR_VERSION_ERROR 2007
|
|
||||||
#define CR_OUT_OF_MEMORY 2008
|
|
||||||
#define CR_WRONG_HOST_INFO 2009
|
|
||||||
#define CR_LOCALHOST_CONNECTION 2010
|
|
||||||
#define CR_TCP_CONNECTION 2011
|
|
||||||
#define CR_SERVER_HANDSHAKE_ERR 2012
|
|
||||||
#define CR_SERVER_LOST 2013
|
|
||||||
#define CR_COMMANDS_OUT_OF_SYNC 2014
|
|
||||||
#define CR_NAMEDPIPE_CONNECTION 2015
|
|
||||||
#define CR_NAMEDPIPEWAIT_ERROR 2016
|
|
||||||
#define CR_NAMEDPIPEOPEN_ERROR 2017
|
|
||||||
#define CR_NAMEDPIPESETSTATE_ERROR 2018
|
|
||||||
#define CR_CANT_READ_CHARSET 2019
|
|
||||||
#define CR_NET_PACKET_TOO_LARGE 2020
|
|
||||||
#define CR_EMBEDDED_CONNECTION 2021
|
|
||||||
#define CR_PROBE_SLAVE_STATUS 2022
|
|
||||||
#define CR_PROBE_SLAVE_HOSTS 2023
|
|
||||||
#define CR_PROBE_SLAVE_CONNECT 2024
|
|
||||||
#define CR_PROBE_MASTER_CONNECT 2025
|
|
||||||
#define CR_SSL_CONNECTION_ERROR 2026
|
|
||||||
#define CR_MALFORMED_PACKET 2027
|
|
||||||
#define CR_WRONG_LICENSE 2028
|
|
||||||
|
|
||||||
/* new 4.1 error codes */
|
|
||||||
#define CR_NULL_POINTER 2029
|
|
||||||
#define CR_NO_PREPARE_STMT 2030
|
|
||||||
#define CR_PARAMS_NOT_BOUND 2031
|
|
||||||
#define CR_DATA_TRUNCATED 2032
|
|
||||||
#define CR_NO_PARAMETERS_EXISTS 2033
|
|
||||||
#define CR_INVALID_PARAMETER_NO 2034
|
|
||||||
#define CR_INVALID_BUFFER_USE 2035
|
|
||||||
#define CR_UNSUPPORTED_PARAM_TYPE 2036
|
|
||||||
|
|
||||||
#define CR_SHARED_MEMORY_CONNECTION 2037
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
|
|
||||||
#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
|
|
||||||
#define CR_SHARED_MEMORY_MAP_ERROR 2043
|
|
||||||
#define CR_SHARED_MEMORY_EVENT_ERROR 2044
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045
|
|
||||||
#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
|
|
||||||
#define CR_CONN_UNKNOW_PROTOCOL 2047
|
|
||||||
#define CR_INVALID_CONN_HANDLE 2048
|
|
||||||
#define CR_UNUSED_1 2049
|
|
||||||
#define CR_FETCH_CANCELED 2050
|
|
||||||
#define CR_NO_DATA 2051
|
|
||||||
#define CR_NO_STMT_METADATA 2052
|
|
||||||
#define CR_NO_RESULT_SET 2053
|
|
||||||
#define CR_NOT_IMPLEMENTED 2054
|
|
||||||
#define CR_SERVER_LOST_EXTENDED 2055
|
|
||||||
#define CR_STMT_CLOSED 2056
|
|
||||||
#define CR_NEW_STMT_METADATA 2057
|
|
||||||
#define CR_ALREADY_CONNECTED 2058
|
|
||||||
#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059
|
|
||||||
#define CR_DUPLICATE_CONNECTION_ATTR 2060
|
|
||||||
#define CR_AUTH_PLUGIN_ERR 2061
|
|
||||||
#define CR_INSECURE_API_ERR 2062
|
|
||||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2062
|
|
||||||
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
|
|
||||||
|
|
||||||
#endif /* ERRMSG_INCLUDED */
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/* Key cache variable structures */
|
|
||||||
|
|
||||||
#ifndef _keycache_h
|
|
||||||
#define _keycache_h
|
|
||||||
|
|
||||||
#include "my_sys.h" /* flush_type */
|
|
||||||
|
|
||||||
C_MODE_START
|
|
||||||
|
|
||||||
/* declare structures that is used by st_key_cache */
|
|
||||||
|
|
||||||
struct st_block_link;
|
|
||||||
typedef struct st_block_link BLOCK_LINK;
|
|
||||||
struct st_hash_link;
|
|
||||||
typedef struct st_hash_link HASH_LINK;
|
|
||||||
|
|
||||||
/* Thread specific variables */
|
|
||||||
typedef struct st_keycache_thread_var
|
|
||||||
{
|
|
||||||
mysql_cond_t suspend;
|
|
||||||
struct st_keycache_thread_var *next,**prev;
|
|
||||||
void *opt_info;
|
|
||||||
} st_keycache_thread_var;
|
|
||||||
|
|
||||||
/* info about requests in a waiting queue */
|
|
||||||
typedef struct st_keycache_wqueue
|
|
||||||
{
|
|
||||||
st_keycache_thread_var *last_thread; /* circular list of waiting threads */
|
|
||||||
} KEYCACHE_WQUEUE;
|
|
||||||
|
|
||||||
#define CHANGED_BLOCKS_HASH 128 /* must be power of 2 */
|
|
||||||
|
|
||||||
/*
|
|
||||||
The key cache structure
|
|
||||||
It also contains read-only statistics parameters.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct st_key_cache
|
|
||||||
{
|
|
||||||
my_bool key_cache_inited;
|
|
||||||
my_bool in_resize; /* true during resize operation */
|
|
||||||
my_bool resize_in_flush; /* true during flush of resize operation */
|
|
||||||
my_bool can_be_used; /* usage of cache for read/write is allowed */
|
|
||||||
size_t key_cache_mem_size; /* specified size of the cache memory */
|
|
||||||
uint key_cache_block_size; /* size of the page buffer of a cache block */
|
|
||||||
ulonglong min_warm_blocks; /* min number of warm blocks; */
|
|
||||||
ulonglong age_threshold; /* age threshold for hot blocks */
|
|
||||||
ulonglong keycache_time; /* total number of block link operations */
|
|
||||||
uint hash_entries; /* max number of entries in the hash table */
|
|
||||||
int hash_links; /* max number of hash links */
|
|
||||||
int hash_links_used; /* number of hash links currently used */
|
|
||||||
int disk_blocks; /* max number of blocks in the cache */
|
|
||||||
ulong blocks_used; /* maximum number of concurrently used blocks */
|
|
||||||
ulong blocks_unused; /* number of currently unused blocks */
|
|
||||||
ulong blocks_changed; /* number of currently dirty blocks */
|
|
||||||
ulong warm_blocks; /* number of blocks in warm sub-chain */
|
|
||||||
ulong cnt_for_resize_op; /* counter to block resize operation */
|
|
||||||
long blocks_available; /* number of blocks available in the LRU chain */
|
|
||||||
HASH_LINK **hash_root; /* arr. of entries into hash table buckets */
|
|
||||||
HASH_LINK *hash_link_root; /* memory for hash table links */
|
|
||||||
HASH_LINK *free_hash_list; /* list of free hash links */
|
|
||||||
BLOCK_LINK *free_block_list; /* list of free blocks */
|
|
||||||
BLOCK_LINK *block_root; /* memory for block links */
|
|
||||||
uchar *block_mem; /* memory for block buffers */
|
|
||||||
BLOCK_LINK *used_last; /* ptr to the last block of the LRU chain */
|
|
||||||
BLOCK_LINK *used_ins; /* ptr to the insertion block in LRU chain */
|
|
||||||
mysql_mutex_t cache_lock; /* to lock access to the cache structure */
|
|
||||||
KEYCACHE_WQUEUE resize_queue; /* threads waiting during resize operation */
|
|
||||||
/*
|
|
||||||
Waiting for a zero resize count. Using a queue for symmetry though
|
|
||||||
only one thread can wait here.
|
|
||||||
*/
|
|
||||||
KEYCACHE_WQUEUE waiting_for_resize_cnt;
|
|
||||||
KEYCACHE_WQUEUE waiting_for_hash_link; /* waiting for a free hash link */
|
|
||||||
KEYCACHE_WQUEUE waiting_for_block; /* requests waiting for a free block */
|
|
||||||
BLOCK_LINK *changed_blocks[CHANGED_BLOCKS_HASH]; /* hash for dirty file bl.*/
|
|
||||||
BLOCK_LINK *file_blocks[CHANGED_BLOCKS_HASH]; /* hash for other file bl.*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
The following variables are and variables used to hold parameters for
|
|
||||||
initializing the key cache.
|
|
||||||
*/
|
|
||||||
|
|
||||||
ulonglong param_buff_size; /* size the memory allocated for the cache */
|
|
||||||
ulonglong param_block_size; /* size of the blocks in the key cache */
|
|
||||||
ulonglong param_division_limit; /* min. percentage of warm blocks */
|
|
||||||
ulonglong param_age_threshold; /* determines when hot block is downgraded */
|
|
||||||
|
|
||||||
/* Statistics variables. These are reset in reset_key_cache_counters(). */
|
|
||||||
ulong global_blocks_changed; /* number of currently dirty blocks */
|
|
||||||
ulonglong global_cache_w_requests;/* number of write requests (write hits) */
|
|
||||||
ulonglong global_cache_write; /* number of writes from cache to files */
|
|
||||||
ulonglong global_cache_r_requests;/* number of read requests (read hits) */
|
|
||||||
ulonglong global_cache_read; /* number of reads from files to cache */
|
|
||||||
|
|
||||||
int blocks; /* max number of blocks in the cache */
|
|
||||||
my_bool in_init; /* Set to 1 in MySQL during init/resize */
|
|
||||||
} KEY_CACHE;
|
|
||||||
|
|
||||||
/* The default key cache */
|
|
||||||
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
|
|
||||||
|
|
||||||
extern int init_key_cache(KEY_CACHE *keycache, ulonglong key_cache_block_size,
|
|
||||||
size_t use_mem, ulonglong division_limit,
|
|
||||||
ulonglong age_threshold);
|
|
||||||
extern int resize_key_cache(KEY_CACHE *keycache,
|
|
||||||
st_keycache_thread_var *thread_var,
|
|
||||||
ulonglong key_cache_block_size,
|
|
||||||
size_t use_mem, ulonglong division_limit,
|
|
||||||
ulonglong age_threshold);
|
|
||||||
extern uchar *key_cache_read(KEY_CACHE *keycache,
|
|
||||||
st_keycache_thread_var *thread_var,
|
|
||||||
File file, my_off_t filepos, int level,
|
|
||||||
uchar *buff, uint length,
|
|
||||||
uint block_length,int return_buffer);
|
|
||||||
extern int key_cache_insert(KEY_CACHE *keycache,
|
|
||||||
st_keycache_thread_var *thread_var,
|
|
||||||
File file, my_off_t filepos, int level,
|
|
||||||
uchar *buff, uint length);
|
|
||||||
extern int key_cache_write(KEY_CACHE *keycache,
|
|
||||||
st_keycache_thread_var *thread_var,
|
|
||||||
File file, my_off_t filepos, int level,
|
|
||||||
uchar *buff, uint length,
|
|
||||||
uint block_length,int force_write);
|
|
||||||
extern int flush_key_blocks(KEY_CACHE *keycache,
|
|
||||||
st_keycache_thread_var *thread_var,
|
|
||||||
int file, enum flush_type type);
|
|
||||||
extern void end_key_cache(KEY_CACHE *keycache, my_bool cleanup);
|
|
||||||
|
|
||||||
/* Functions to handle multiple key caches */
|
|
||||||
extern my_bool multi_keycache_init(void);
|
|
||||||
extern void multi_keycache_free(void);
|
|
||||||
extern KEY_CACHE *multi_key_cache_search(uchar *key, uint length);
|
|
||||||
extern my_bool multi_key_cache_set(const uchar *key, uint length,
|
|
||||||
KEY_CACHE *key_cache);
|
|
||||||
extern void multi_key_cache_change(KEY_CACHE *old_data,
|
|
||||||
KEY_CACHE *new_data);
|
|
||||||
extern int reset_key_cache_counters(const char *name,
|
|
||||||
KEY_CACHE *key_cache);
|
|
||||||
C_MODE_END
|
|
||||||
#endif /* _keycache_h */
|
|
||||||
@ -1,105 +0,0 @@
|
|||||||
#ifndef LITTLE_ENDIAN_INCLUDED
|
|
||||||
#define LITTLE_ENDIAN_INCLUDED
|
|
||||||
/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Data in little-endian format.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static inline void float4get (float *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, (M), sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void float4store(uchar *V, float M)
|
|
||||||
{
|
|
||||||
memcpy(V, (&M), sizeof(float));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void float8get (double *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, M, sizeof(double));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void float8store(uchar *V, double M)
|
|
||||||
{
|
|
||||||
memcpy(V, &M, sizeof(double));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void floatget (float *V, const uchar *M) { float4get(V, M); }
|
|
||||||
static inline void floatstore (uchar *V, float M) { float4store(V, M); }
|
|
||||||
|
|
||||||
/* Bi-endian hardware.... */
|
|
||||||
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
|
|
||||||
static inline void doublestore(uchar *T, double V)
|
|
||||||
{ *(((char*)T)+0)=(char) ((uchar *) &V)[4];
|
|
||||||
*(((char*)T)+1)=(char) ((uchar *) &V)[5];
|
|
||||||
*(((char*)T)+2)=(char) ((uchar *) &V)[6];
|
|
||||||
*(((char*)T)+3)=(char) ((uchar *) &V)[7];
|
|
||||||
*(((char*)T)+4)=(char) ((uchar *) &V)[0];
|
|
||||||
*(((char*)T)+5)=(char) ((uchar *) &V)[1];
|
|
||||||
*(((char*)T)+6)=(char) ((uchar *) &V)[2];
|
|
||||||
*(((char*)T)+7)=(char) ((uchar *) &V)[3]; }
|
|
||||||
static inline void doubleget(double *V, const uchar *M)
|
|
||||||
{ double def_temp;
|
|
||||||
((uchar*) &def_temp)[0]=(M)[4];
|
|
||||||
((uchar*) &def_temp)[1]=(M)[5];
|
|
||||||
((uchar*) &def_temp)[2]=(M)[6];
|
|
||||||
((uchar*) &def_temp)[3]=(M)[7];
|
|
||||||
((uchar*) &def_temp)[4]=(M)[0];
|
|
||||||
((uchar*) &def_temp)[5]=(M)[1];
|
|
||||||
((uchar*) &def_temp)[6]=(M)[2];
|
|
||||||
((uchar*) &def_temp)[7]=(M)[3];
|
|
||||||
(*V) = def_temp; }
|
|
||||||
|
|
||||||
#else /* Bi-endian hardware.... */
|
|
||||||
|
|
||||||
static inline void doublestore(uchar *T, double V) { memcpy(T, &V, sizeof(double)); }
|
|
||||||
static inline void doubleget (double *V, const uchar *M) { memcpy(V, M, sizeof(double)); }
|
|
||||||
|
|
||||||
#endif /* Bi-endian hardware.... */
|
|
||||||
|
|
||||||
static inline void ushortget(uint16 *V, const uchar *pM) { *V= uint2korr(pM); }
|
|
||||||
static inline void shortget (int16 *V, const uchar *pM) { *V= sint2korr(pM); }
|
|
||||||
static inline void longget (int32 *V, const uchar *pM) { *V= sint4korr(pM); }
|
|
||||||
static inline void ulongget (uint32 *V, const uchar *pM) { *V= uint4korr(pM); }
|
|
||||||
static inline void shortstore(uchar *T, int16 V) { int2store(T, V); }
|
|
||||||
static inline void longstore (uchar *T, int32 V) { int4store(T, V); }
|
|
||||||
|
|
||||||
static inline void longlongget(longlong *V, const uchar *M)
|
|
||||||
{
|
|
||||||
memcpy(V, (M), sizeof(ulonglong));
|
|
||||||
}
|
|
||||||
static inline void longlongstore(uchar *T, longlong V)
|
|
||||||
{
|
|
||||||
memcpy((T), &V, sizeof(ulonglong));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* LITTLE_ENDIAN_INCLUDED */
|
|
||||||
@ -1,813 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/*
|
|
||||||
A better inplementation of the UNIX ctype(3) library.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _m_ctype_h
|
|
||||||
#define _m_ctype_h
|
|
||||||
|
|
||||||
#include "my_global.h" /* uint16, uchar */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_CS_NAME_SIZE 32
|
|
||||||
#define MY_CS_CTYPE_TABLE_SIZE 257
|
|
||||||
#define MY_CS_TO_LOWER_TABLE_SIZE 256
|
|
||||||
#define MY_CS_TO_UPPER_TABLE_SIZE 256
|
|
||||||
#define MY_CS_SORT_ORDER_TABLE_SIZE 256
|
|
||||||
#define MY_CS_TO_UNI_TABLE_SIZE 256
|
|
||||||
|
|
||||||
#define CHARSET_DIR "charsets/"
|
|
||||||
|
|
||||||
#define my_wc_t ulong
|
|
||||||
|
|
||||||
#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD
|
|
||||||
|
|
||||||
/*
|
|
||||||
On i386 we store Unicode->CS conversion tables for
|
|
||||||
some character sets using Big-endian order,
|
|
||||||
to copy two bytes at onces.
|
|
||||||
This gives some performance improvement.
|
|
||||||
*/
|
|
||||||
#ifdef __i386__
|
|
||||||
#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8))
|
|
||||||
#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); }
|
|
||||||
#else
|
|
||||||
#define MB2(x) (x)
|
|
||||||
#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct unicase_info_char_st
|
|
||||||
{
|
|
||||||
uint32 toupper;
|
|
||||||
uint32 tolower;
|
|
||||||
uint32 sort;
|
|
||||||
} MY_UNICASE_CHARACTER;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct unicase_info_st
|
|
||||||
{
|
|
||||||
my_wc_t maxchar;
|
|
||||||
const MY_UNICASE_CHARACTER **page;
|
|
||||||
} MY_UNICASE_INFO;
|
|
||||||
|
|
||||||
|
|
||||||
extern MY_UNICASE_INFO my_unicase_default;
|
|
||||||
extern MY_UNICASE_INFO my_unicase_turkish;
|
|
||||||
extern MY_UNICASE_INFO my_unicase_mysql500;
|
|
||||||
extern MY_UNICASE_INFO my_unicase_unicode520;
|
|
||||||
|
|
||||||
#define MY_UCA_MAX_CONTRACTION 6
|
|
||||||
#define MY_UCA_MAX_WEIGHT_SIZE 8
|
|
||||||
#define MY_UCA_WEIGHT_LEVELS 1
|
|
||||||
|
|
||||||
typedef struct my_contraction_t
|
|
||||||
{
|
|
||||||
my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */
|
|
||||||
uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */
|
|
||||||
my_bool with_context;
|
|
||||||
} MY_CONTRACTION;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct my_contraction_list_t
|
|
||||||
{
|
|
||||||
size_t nitems; /* Number of items in the list */
|
|
||||||
MY_CONTRACTION *item; /* List of contractions */
|
|
||||||
char *flags; /* Character flags, e.g. "is contraction head") */
|
|
||||||
} MY_CONTRACTIONS;
|
|
||||||
|
|
||||||
|
|
||||||
my_bool my_uca_can_be_contraction_head(const MY_CONTRACTIONS *c, my_wc_t wc);
|
|
||||||
my_bool my_uca_can_be_contraction_tail(const MY_CONTRACTIONS *c, my_wc_t wc);
|
|
||||||
uint16 *my_uca_contraction2_weight(const MY_CONTRACTIONS *c,
|
|
||||||
my_wc_t wc1, my_wc_t wc2);
|
|
||||||
|
|
||||||
|
|
||||||
/* Collation weights on a single level (e.g. primary, secondary, tertiarty) */
|
|
||||||
typedef struct my_uca_level_info_st
|
|
||||||
{
|
|
||||||
my_wc_t maxchar;
|
|
||||||
uchar *lengths;
|
|
||||||
uint16 **weights;
|
|
||||||
MY_CONTRACTIONS contractions;
|
|
||||||
} MY_UCA_WEIGHT_LEVEL;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct uca_info_st
|
|
||||||
{
|
|
||||||
MY_UCA_WEIGHT_LEVEL level[MY_UCA_WEIGHT_LEVELS];
|
|
||||||
|
|
||||||
/* Logical positions */
|
|
||||||
my_wc_t first_non_ignorable;
|
|
||||||
my_wc_t last_non_ignorable;
|
|
||||||
my_wc_t first_primary_ignorable;
|
|
||||||
my_wc_t last_primary_ignorable;
|
|
||||||
my_wc_t first_secondary_ignorable;
|
|
||||||
my_wc_t last_secondary_ignorable;
|
|
||||||
my_wc_t first_tertiary_ignorable;
|
|
||||||
my_wc_t last_tertiary_ignorable;
|
|
||||||
my_wc_t first_trailing;
|
|
||||||
my_wc_t last_trailing;
|
|
||||||
my_wc_t first_variable;
|
|
||||||
my_wc_t last_variable;
|
|
||||||
|
|
||||||
} MY_UCA_INFO;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern MY_UCA_INFO my_uca_v400;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct uni_ctype_st
|
|
||||||
{
|
|
||||||
uchar pctype;
|
|
||||||
uchar *ctype;
|
|
||||||
} MY_UNI_CTYPE;
|
|
||||||
|
|
||||||
extern MY_UNI_CTYPE my_uni_ctype[256];
|
|
||||||
|
|
||||||
/* wm_wc and wc_mb return codes */
|
|
||||||
#define MY_CS_ILSEQ 0 /* Wrong by sequence: wb_wc */
|
|
||||||
#define MY_CS_ILUNI 0 /* Cannot encode Unicode to charset: wc_mb */
|
|
||||||
#define MY_CS_TOOSMALL -101 /* Need at least one byte: wc_mb and mb_wc */
|
|
||||||
#define MY_CS_TOOSMALL2 -102 /* Need at least two bytes: wc_mb and mb_wc */
|
|
||||||
#define MY_CS_TOOSMALL3 -103 /* Need at least three bytes: wc_mb and mb_wc */
|
|
||||||
/* These following three are currently not really used */
|
|
||||||
#define MY_CS_TOOSMALL4 -104 /* Need at least 4 bytes: wc_mb and mb_wc */
|
|
||||||
#define MY_CS_TOOSMALL5 -105 /* Need at least 5 bytes: wc_mb and mb_wc */
|
|
||||||
#define MY_CS_TOOSMALL6 -106 /* Need at least 6 bytes: wc_mb and mb_wc */
|
|
||||||
/* A helper macros for "need at least n bytes" */
|
|
||||||
#define MY_CS_TOOSMALLN(n) (-100-(n))
|
|
||||||
|
|
||||||
#define MY_SEQ_INTTAIL 1
|
|
||||||
#define MY_SEQ_SPACES 2
|
|
||||||
|
|
||||||
/* My charsets_list flags */
|
|
||||||
#define MY_CS_COMPILED 1 /* compiled-in sets */
|
|
||||||
#define MY_CS_CONFIG 2 /* sets that have a *.conf file */
|
|
||||||
#define MY_CS_INDEX 4 /* sets listed in the Index file */
|
|
||||||
#define MY_CS_LOADED 8 /* sets that are currently loaded */
|
|
||||||
#define MY_CS_BINSORT 16 /* if binary sort order */
|
|
||||||
#define MY_CS_PRIMARY 32 /* if primary collation */
|
|
||||||
#define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */
|
|
||||||
#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */
|
|
||||||
#define MY_CS_READY 256 /* if a charset is initialized */
|
|
||||||
#define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/
|
|
||||||
#define MY_CS_CSSORT 1024 /* if case sensitive sort order */
|
|
||||||
#define MY_CS_HIDDEN 2048 /* don't display in SHOW */
|
|
||||||
#define MY_CS_PUREASCII 4096 /* if a charset is pure ascii */
|
|
||||||
#define MY_CS_NONASCII 8192 /* if not ASCII-compatible */
|
|
||||||
#define MY_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */
|
|
||||||
#define MY_CS_LOWER_SORT 32768 /* If use lower case as weight */
|
|
||||||
#define MY_CHARSET_UNDEFINED 0
|
|
||||||
|
|
||||||
/* Character repertoire flags */
|
|
||||||
#define MY_REPERTOIRE_ASCII 1 /* Pure ASCII U+0000..U+007F */
|
|
||||||
#define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */
|
|
||||||
#define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */
|
|
||||||
|
|
||||||
/* Flags for strxfrm */
|
|
||||||
#define MY_STRXFRM_LEVEL1 0x00000001 /* for primary weights */
|
|
||||||
#define MY_STRXFRM_LEVEL2 0x00000002 /* for secondary weights */
|
|
||||||
#define MY_STRXFRM_LEVEL3 0x00000004 /* for tertiary weights */
|
|
||||||
#define MY_STRXFRM_LEVEL4 0x00000008 /* fourth level weights */
|
|
||||||
#define MY_STRXFRM_LEVEL5 0x00000010 /* fifth level weights */
|
|
||||||
#define MY_STRXFRM_LEVEL6 0x00000020 /* sixth level weights */
|
|
||||||
#define MY_STRXFRM_LEVEL_ALL 0x0000003F /* Bit OR for the above six */
|
|
||||||
#define MY_STRXFRM_NLEVELS 6 /* Number of possible levels*/
|
|
||||||
|
|
||||||
#define MY_STRXFRM_PAD_WITH_SPACE 0x00000040 /* if pad result with spaces */
|
|
||||||
#define MY_STRXFRM_PAD_TO_MAXLEN 0x00000080 /* if pad tail(for filesort) */
|
|
||||||
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL1 0x00000100 /* if desc order for level1 */
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL2 0x00000200 /* if desc order for level2 */
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL3 0x00000300 /* if desc order for level3 */
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL4 0x00000800 /* if desc order for level4 */
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL5 0x00001000 /* if desc order for level5 */
|
|
||||||
#define MY_STRXFRM_DESC_LEVEL6 0x00002000 /* if desc order for level6 */
|
|
||||||
#define MY_STRXFRM_DESC_SHIFT 8
|
|
||||||
|
|
||||||
#define MY_STRXFRM_UNUSED_00004000 0x00004000 /* for future extensions */
|
|
||||||
#define MY_STRXFRM_UNUSED_00008000 0x00008000 /* for future extensions */
|
|
||||||
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL1 0x00010000 /* if reverse order for level1 */
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL2 0x00020000 /* if reverse order for level2 */
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL3 0x00040000 /* if reverse order for level3 */
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL4 0x00080000 /* if reverse order for level4 */
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL5 0x00100000 /* if reverse order for level5 */
|
|
||||||
#define MY_STRXFRM_REVERSE_LEVEL6 0x00200000 /* if reverse order for level6 */
|
|
||||||
#define MY_STRXFRM_REVERSE_SHIFT 16
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct my_uni_idx_st
|
|
||||||
{
|
|
||||||
uint16 from;
|
|
||||||
uint16 to;
|
|
||||||
const uchar *tab;
|
|
||||||
} MY_UNI_IDX;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
uint beg;
|
|
||||||
uint end;
|
|
||||||
uint mb_len;
|
|
||||||
} my_match_t;
|
|
||||||
|
|
||||||
struct charset_info_st;
|
|
||||||
|
|
||||||
typedef struct my_charset_loader_st
|
|
||||||
{
|
|
||||||
char error[128];
|
|
||||||
void *(*once_alloc)(size_t);
|
|
||||||
void *(*mem_malloc)(size_t);
|
|
||||||
void *(*mem_realloc)(void *, size_t);
|
|
||||||
void (*mem_free)(void *);
|
|
||||||
void (*reporter)(enum loglevel, const char *format, ...);
|
|
||||||
int (*add_collation)(struct charset_info_st *cs);
|
|
||||||
} MY_CHARSET_LOADER;
|
|
||||||
|
|
||||||
|
|
||||||
extern int (*my_string_stack_guard)(int);
|
|
||||||
|
|
||||||
/* See strings/CHARSET_INFO.txt for information about this structure */
|
|
||||||
typedef struct my_collation_handler_st
|
|
||||||
{
|
|
||||||
my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *);
|
|
||||||
/* Collation routines */
|
|
||||||
int (*strnncoll)(const struct charset_info_st *,
|
|
||||||
const uchar *, size_t, const uchar *, size_t, my_bool);
|
|
||||||
int (*strnncollsp)(const struct charset_info_st *,
|
|
||||||
const uchar *, size_t, const uchar *, size_t,
|
|
||||||
my_bool diff_if_only_endspace_difference);
|
|
||||||
size_t (*strnxfrm)(const struct charset_info_st *,
|
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
|
||||||
const uchar *src, size_t srclen, uint flags);
|
|
||||||
size_t (*strnxfrmlen)(const struct charset_info_st *, size_t);
|
|
||||||
my_bool (*like_range)(const struct charset_info_st *,
|
|
||||||
const char *s, size_t s_length,
|
|
||||||
pchar w_prefix, pchar w_one, pchar w_many,
|
|
||||||
size_t res_length,
|
|
||||||
char *min_str, char *max_str,
|
|
||||||
size_t *min_len, size_t *max_len);
|
|
||||||
int (*wildcmp)(const struct charset_info_st *,
|
|
||||||
const char *str,const char *str_end,
|
|
||||||
const char *wildstr,const char *wildend,
|
|
||||||
int escape,int w_one, int w_many);
|
|
||||||
|
|
||||||
int (*strcasecmp)(const struct charset_info_st *, const char *,
|
|
||||||
const char *);
|
|
||||||
|
|
||||||
uint (*instr)(const struct charset_info_st *,
|
|
||||||
const char *b, size_t b_length,
|
|
||||||
const char *s, size_t s_length,
|
|
||||||
my_match_t *match, uint nmatch);
|
|
||||||
|
|
||||||
/* Hash calculation */
|
|
||||||
void (*hash_sort)(const struct charset_info_st *cs, const uchar *key,
|
|
||||||
size_t len, ulong *nr1, ulong *nr2);
|
|
||||||
my_bool (*propagate)(const struct charset_info_st *cs, const uchar *str,
|
|
||||||
size_t len);
|
|
||||||
} MY_COLLATION_HANDLER;
|
|
||||||
|
|
||||||
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
|
|
||||||
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
|
|
||||||
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
|
|
||||||
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
|
|
||||||
|
|
||||||
/* Some typedef to make it easy for C++ to make function pointers */
|
|
||||||
typedef int (*my_charset_conv_mb_wc)(const struct charset_info_st *,
|
|
||||||
my_wc_t *, const uchar *, const uchar *);
|
|
||||||
typedef int (*my_charset_conv_wc_mb)(const struct charset_info_st *, my_wc_t,
|
|
||||||
uchar *, uchar *);
|
|
||||||
typedef size_t (*my_charset_conv_case)(const struct charset_info_st *,
|
|
||||||
char *, size_t, char *, size_t);
|
|
||||||
|
|
||||||
|
|
||||||
/* See strings/CHARSET_INFO.txt about information on this structure */
|
|
||||||
typedef struct my_charset_handler_st
|
|
||||||
{
|
|
||||||
my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader);
|
|
||||||
/* Multibyte routines */
|
|
||||||
uint (*ismbchar)(const struct charset_info_st *, const char *,
|
|
||||||
const char *);
|
|
||||||
uint (*mbcharlen)(const struct charset_info_st *, uint c);
|
|
||||||
size_t (*numchars)(const struct charset_info_st *, const char *b,
|
|
||||||
const char *e);
|
|
||||||
size_t (*charpos)(const struct charset_info_st *, const char *b,
|
|
||||||
const char *e, size_t pos);
|
|
||||||
size_t (*well_formed_len)(const struct charset_info_st *,
|
|
||||||
const char *b,const char *e,
|
|
||||||
size_t nchars, int *error);
|
|
||||||
size_t (*lengthsp)(const struct charset_info_st *, const char *ptr,
|
|
||||||
size_t length);
|
|
||||||
size_t (*numcells)(const struct charset_info_st *, const char *b,
|
|
||||||
const char *e);
|
|
||||||
|
|
||||||
/* Unicode conversion */
|
|
||||||
my_charset_conv_mb_wc mb_wc;
|
|
||||||
my_charset_conv_wc_mb wc_mb;
|
|
||||||
|
|
||||||
/* CTYPE scanner */
|
|
||||||
int (*ctype)(const struct charset_info_st *cs, int *ctype,
|
|
||||||
const uchar *s, const uchar *e);
|
|
||||||
|
|
||||||
/* Functions for case and sort conversion */
|
|
||||||
size_t (*caseup_str)(const struct charset_info_st *, char *);
|
|
||||||
size_t (*casedn_str)(const struct charset_info_st *, char *);
|
|
||||||
|
|
||||||
my_charset_conv_case caseup;
|
|
||||||
my_charset_conv_case casedn;
|
|
||||||
|
|
||||||
/* Charset dependant snprintf() */
|
|
||||||
size_t (*snprintf)(const struct charset_info_st *, char *to, size_t n,
|
|
||||||
const char *fmt,
|
|
||||||
...) MY_ATTRIBUTE((format(printf, 4, 5)));
|
|
||||||
size_t (*long10_to_str)(const struct charset_info_st *, char *to, size_t n,
|
|
||||||
int radix, long int val);
|
|
||||||
size_t (*longlong10_to_str)(const struct charset_info_st *, char *to,
|
|
||||||
size_t n, int radix, longlong val);
|
|
||||||
|
|
||||||
void (*fill)(const struct charset_info_st *, char *to, size_t len,
|
|
||||||
int fill);
|
|
||||||
|
|
||||||
/* String-to-number conversion routines */
|
|
||||||
long (*strntol)(const struct charset_info_st *, const char *s,
|
|
||||||
size_t l, int base, char **e, int *err);
|
|
||||||
ulong (*strntoul)(const struct charset_info_st *, const char *s,
|
|
||||||
size_t l, int base, char **e, int *err);
|
|
||||||
longlong (*strntoll)(const struct charset_info_st *, const char *s,
|
|
||||||
size_t l, int base, char **e, int *err);
|
|
||||||
ulonglong (*strntoull)(const struct charset_info_st *, const char *s,
|
|
||||||
size_t l, int base, char **e, int *err);
|
|
||||||
double (*strntod)(const struct charset_info_st *, char *s,
|
|
||||||
size_t l, char **e, int *err);
|
|
||||||
longlong (*strtoll10)(const struct charset_info_st *cs,
|
|
||||||
const char *nptr, char **endptr, int *error);
|
|
||||||
ulonglong (*strntoull10rnd)(const struct charset_info_st *cs,
|
|
||||||
const char *str, size_t length,
|
|
||||||
int unsigned_fl,
|
|
||||||
char **endptr, int *error);
|
|
||||||
size_t (*scan)(const struct charset_info_st *, const char *b,
|
|
||||||
const char *e, int sq);
|
|
||||||
} MY_CHARSET_HANDLER;
|
|
||||||
|
|
||||||
extern MY_CHARSET_HANDLER my_charset_8bit_handler;
|
|
||||||
extern MY_CHARSET_HANDLER my_charset_ascii_handler;
|
|
||||||
extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
We define this CHARSET_INFO_DEFINED here to prevent a repeat of the
|
|
||||||
typedef in hash.c, which will cause a compiler error.
|
|
||||||
*/
|
|
||||||
#define CHARSET_INFO_DEFINED
|
|
||||||
|
|
||||||
/* See strings/CHARSET_INFO.txt about information on this structure */
|
|
||||||
typedef struct charset_info_st
|
|
||||||
{
|
|
||||||
uint number;
|
|
||||||
uint primary_number;
|
|
||||||
uint binary_number;
|
|
||||||
uint state;
|
|
||||||
const char *csname;
|
|
||||||
const char *name;
|
|
||||||
const char *comment;
|
|
||||||
const char *tailoring;
|
|
||||||
const uchar *ctype;
|
|
||||||
const uchar *to_lower;
|
|
||||||
const uchar *to_upper;
|
|
||||||
const uchar *sort_order;
|
|
||||||
MY_UCA_INFO *uca; /* This can be changed in apply_one_rule() */
|
|
||||||
const uint16 *tab_to_uni;
|
|
||||||
const MY_UNI_IDX *tab_from_uni;
|
|
||||||
const MY_UNICASE_INFO *caseinfo;
|
|
||||||
const struct lex_state_maps_st *state_maps; /* parser internal data */
|
|
||||||
const uchar *ident_map; /* parser internal data */
|
|
||||||
uint strxfrm_multiply;
|
|
||||||
uchar caseup_multiply;
|
|
||||||
uchar casedn_multiply;
|
|
||||||
uint mbminlen;
|
|
||||||
uint mbmaxlen;
|
|
||||||
uint mbmaxlenlen;
|
|
||||||
my_wc_t min_sort_char;
|
|
||||||
my_wc_t max_sort_char; /* For LIKE optimization */
|
|
||||||
uchar pad_char;
|
|
||||||
my_bool escape_with_backslash_is_dangerous;
|
|
||||||
uchar levels_for_compare;
|
|
||||||
uchar levels_for_order;
|
|
||||||
|
|
||||||
MY_CHARSET_HANDLER *cset;
|
|
||||||
MY_COLLATION_HANDLER *coll;
|
|
||||||
|
|
||||||
} CHARSET_INFO;
|
|
||||||
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
|
|
||||||
|
|
||||||
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
|
|
||||||
|
|
||||||
extern CHARSET_INFO my_charset_big5_chinese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_big5_bin;
|
|
||||||
extern CHARSET_INFO my_charset_cp932_japanese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_cp932_bin;
|
|
||||||
extern CHARSET_INFO my_charset_cp1250_czech_ci;
|
|
||||||
extern CHARSET_INFO my_charset_eucjpms_japanese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_eucjpms_bin;
|
|
||||||
extern CHARSET_INFO my_charset_euckr_korean_ci;
|
|
||||||
extern CHARSET_INFO my_charset_euckr_bin;
|
|
||||||
extern CHARSET_INFO my_charset_gb2312_chinese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_gb2312_bin;
|
|
||||||
extern CHARSET_INFO my_charset_gbk_chinese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_gbk_bin;
|
|
||||||
extern CHARSET_INFO my_charset_gb18030_chinese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_gb18030_bin;
|
|
||||||
extern CHARSET_INFO my_charset_latin1_german2_ci;
|
|
||||||
extern CHARSET_INFO my_charset_latin1_bin;
|
|
||||||
extern CHARSET_INFO my_charset_latin2_czech_ci;
|
|
||||||
extern CHARSET_INFO my_charset_sjis_japanese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_sjis_bin;
|
|
||||||
extern CHARSET_INFO my_charset_tis620_thai_ci;
|
|
||||||
extern CHARSET_INFO my_charset_tis620_bin;
|
|
||||||
extern CHARSET_INFO my_charset_ucs2_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_ucs2_bin;
|
|
||||||
extern CHARSET_INFO my_charset_ucs2_unicode_ci;
|
|
||||||
extern CHARSET_INFO my_charset_ucs2_general_mysql500_ci;
|
|
||||||
extern CHARSET_INFO my_charset_ujis_japanese_ci;
|
|
||||||
extern CHARSET_INFO my_charset_ujis_bin;
|
|
||||||
extern CHARSET_INFO my_charset_utf16_bin;
|
|
||||||
extern CHARSET_INFO my_charset_utf16_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf16_unicode_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf16le_bin;
|
|
||||||
extern CHARSET_INFO my_charset_utf16le_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf32_bin;
|
|
||||||
extern CHARSET_INFO my_charset_utf32_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf32_unicode_ci;
|
|
||||||
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf8_tolower_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf8_unicode_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf8_bin;
|
|
||||||
extern CHARSET_INFO my_charset_utf8_general_mysql500_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf8mb4_bin;
|
|
||||||
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8mb4_general_ci;
|
|
||||||
extern CHARSET_INFO my_charset_utf8mb4_unicode_ci;
|
|
||||||
#define MY_UTF8MB3 "utf8"
|
|
||||||
#define MY_UTF8MB4 "utf8mb4"
|
|
||||||
|
|
||||||
|
|
||||||
/* declarations for simple charsets */
|
|
||||||
extern size_t my_strnxfrm_simple(const CHARSET_INFO *,
|
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
|
||||||
const uchar *src, size_t srclen, uint flags);
|
|
||||||
size_t my_strnxfrmlen_simple(const CHARSET_INFO *, size_t);
|
|
||||||
extern int my_strnncoll_simple(const CHARSET_INFO *, const uchar *, size_t,
|
|
||||||
const uchar *, size_t, my_bool);
|
|
||||||
|
|
||||||
extern int my_strnncollsp_simple(const CHARSET_INFO *, const uchar *, size_t,
|
|
||||||
const uchar *, size_t,
|
|
||||||
my_bool diff_if_only_endspace_difference);
|
|
||||||
|
|
||||||
extern void my_hash_sort_simple(const CHARSET_INFO *cs,
|
|
||||||
const uchar *key, size_t len,
|
|
||||||
ulong *nr1, ulong *nr2);
|
|
||||||
|
|
||||||
extern size_t my_lengthsp_8bit(const CHARSET_INFO *cs, const char *ptr,
|
|
||||||
size_t length);
|
|
||||||
|
|
||||||
extern uint my_instr_simple(const struct charset_info_st *,
|
|
||||||
const char *b, size_t b_length,
|
|
||||||
const char *s, size_t s_length,
|
|
||||||
my_match_t *match, uint nmatch);
|
|
||||||
|
|
||||||
|
|
||||||
/* Functions for 8bit */
|
|
||||||
extern size_t my_caseup_str_8bit(const CHARSET_INFO *, char *);
|
|
||||||
extern size_t my_casedn_str_8bit(const CHARSET_INFO *, char *);
|
|
||||||
extern size_t my_caseup_8bit(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
extern size_t my_casedn_8bit(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
|
|
||||||
extern int my_strcasecmp_8bit(const CHARSET_INFO * cs, const char *,
|
|
||||||
const char *);
|
|
||||||
|
|
||||||
int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,
|
|
||||||
const uchar *e);
|
|
||||||
int my_wc_mb_8bit(const CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
|
|
||||||
|
|
||||||
int my_mb_ctype_8bit(const CHARSET_INFO *,int *, const uchar *,const uchar *);
|
|
||||||
int my_mb_ctype_mb(const CHARSET_INFO *,int *, const uchar *,const uchar *);
|
|
||||||
|
|
||||||
size_t my_scan_8bit(const CHARSET_INFO *cs, const char *b, const char *e,
|
|
||||||
int sq);
|
|
||||||
|
|
||||||
size_t my_snprintf_8bit(const struct charset_info_st *, char *to, size_t n,
|
|
||||||
const char *fmt, ...)
|
|
||||||
MY_ATTRIBUTE((format(printf, 4, 5)));
|
|
||||||
|
|
||||||
long my_strntol_8bit(const CHARSET_INFO *, const char *s, size_t l,
|
|
||||||
int base, char **e, int *err);
|
|
||||||
ulong my_strntoul_8bit(const CHARSET_INFO *, const char *s, size_t l,
|
|
||||||
int base, char **e, int *err);
|
|
||||||
longlong my_strntoll_8bit(const CHARSET_INFO *, const char *s, size_t l,
|
|
||||||
int base, char **e, int *err);
|
|
||||||
ulonglong my_strntoull_8bit(const CHARSET_INFO *, const char *s, size_t l,
|
|
||||||
int base, char **e, int *err);
|
|
||||||
double my_strntod_8bit(const CHARSET_INFO *, char *s, size_t l, char **e,
|
|
||||||
int *err);
|
|
||||||
size_t my_long10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
|
|
||||||
int radix, long int val);
|
|
||||||
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *, char *to, size_t l,
|
|
||||||
int radix, longlong val);
|
|
||||||
|
|
||||||
longlong my_strtoll10_8bit(const CHARSET_INFO *cs,
|
|
||||||
const char *nptr, char **endptr, int *error);
|
|
||||||
longlong my_strtoll10_ucs2(const CHARSET_INFO *cs,
|
|
||||||
const char *nptr, char **endptr, int *error);
|
|
||||||
|
|
||||||
ulonglong my_strntoull10rnd_8bit(const CHARSET_INFO *cs,
|
|
||||||
const char *str, size_t length, int
|
|
||||||
unsigned_fl, char **endptr, int *error);
|
|
||||||
ulonglong my_strntoull10rnd_ucs2(const CHARSET_INFO *cs,
|
|
||||||
const char *str, size_t length,
|
|
||||||
int unsigned_fl, char **endptr, int *error);
|
|
||||||
|
|
||||||
void my_fill_8bit(const CHARSET_INFO *cs, char* to, size_t l, int fill);
|
|
||||||
|
|
||||||
/* For 8-bit character set */
|
|
||||||
my_bool my_like_range_simple(const CHARSET_INFO *cs,
|
|
||||||
const char *ptr, size_t ptr_length,
|
|
||||||
pbool escape, pbool w_one, pbool w_many,
|
|
||||||
size_t res_length,
|
|
||||||
char *min_str, char *max_str,
|
|
||||||
size_t *min_length, size_t *max_length);
|
|
||||||
|
|
||||||
/* For ASCII-based multi-byte character sets with mbminlen=1 */
|
|
||||||
my_bool my_like_range_mb(const CHARSET_INFO *cs,
|
|
||||||
const char *ptr, size_t ptr_length,
|
|
||||||
pbool escape, pbool w_one, pbool w_many,
|
|
||||||
size_t res_length,
|
|
||||||
char *min_str, char *max_str,
|
|
||||||
size_t *min_length, size_t *max_length);
|
|
||||||
|
|
||||||
/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */
|
|
||||||
my_bool my_like_range_generic(const CHARSET_INFO *cs,
|
|
||||||
const char *ptr, size_t ptr_length,
|
|
||||||
pbool escape, pbool w_one, pbool w_many,
|
|
||||||
size_t res_length,
|
|
||||||
char *min_str, char *max_str,
|
|
||||||
size_t *min_length, size_t *max_length);
|
|
||||||
|
|
||||||
int my_wildcmp_8bit(const CHARSET_INFO *,
|
|
||||||
const char *str,const char *str_end,
|
|
||||||
const char *wildstr,const char *wildend,
|
|
||||||
int escape, int w_one, int w_many);
|
|
||||||
|
|
||||||
int my_wildcmp_bin(const CHARSET_INFO *,
|
|
||||||
const char *str,const char *str_end,
|
|
||||||
const char *wildstr,const char *wildend,
|
|
||||||
int escape, int w_one, int w_many);
|
|
||||||
|
|
||||||
size_t my_numchars_8bit(const CHARSET_INFO *, const char *b, const char *e);
|
|
||||||
size_t my_numcells_8bit(const CHARSET_INFO *, const char *b, const char *e);
|
|
||||||
size_t my_charpos_8bit(const CHARSET_INFO *, const char *b, const char *e,
|
|
||||||
size_t pos);
|
|
||||||
size_t my_well_formed_len_8bit(const CHARSET_INFO *, const char *b,
|
|
||||||
const char *e, size_t pos, int *error);
|
|
||||||
uint my_mbcharlen_8bit(const CHARSET_INFO *, uint c);
|
|
||||||
|
|
||||||
|
|
||||||
/* Functions for multibyte charsets */
|
|
||||||
extern size_t my_caseup_str_mb(const CHARSET_INFO *, char *);
|
|
||||||
extern size_t my_casedn_str_mb(const CHARSET_INFO *, char *);
|
|
||||||
extern size_t my_caseup_mb(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
extern size_t my_casedn_mb(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
extern size_t my_caseup_mb_varlen(const CHARSET_INFO *, char *src,
|
|
||||||
size_t srclen, char *dst, size_t dstlen);
|
|
||||||
extern size_t my_casedn_mb_varlen(const CHARSET_INFO *, char *src,
|
|
||||||
size_t srclen, char *dst, size_t dstlen);
|
|
||||||
extern size_t my_caseup_ujis(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
extern size_t my_casedn_ujis(const CHARSET_INFO *, char *src, size_t srclen,
|
|
||||||
char *dst, size_t dstlen);
|
|
||||||
extern int my_strcasecmp_mb(const CHARSET_INFO * cs,const char *,
|
|
||||||
const char *);
|
|
||||||
|
|
||||||
int my_wildcmp_mb(const CHARSET_INFO *,
|
|
||||||
const char *str,const char *str_end,
|
|
||||||
const char *wildstr,const char *wildend,
|
|
||||||
int escape, int w_one, int w_many);
|
|
||||||
size_t my_numchars_mb(const CHARSET_INFO *, const char *b, const char *e);
|
|
||||||
size_t my_numcells_mb(const CHARSET_INFO *, const char *b, const char *e);
|
|
||||||
size_t my_charpos_mb(const CHARSET_INFO *, const char *b, const char *e,
|
|
||||||
size_t pos);
|
|
||||||
size_t my_well_formed_len_mb(const CHARSET_INFO *, const char *b,
|
|
||||||
const char *e, size_t pos, int *error);
|
|
||||||
uint my_instr_mb(const struct charset_info_st *,
|
|
||||||
const char *b, size_t b_length,
|
|
||||||
const char *s, size_t s_length,
|
|
||||||
my_match_t *match, uint nmatch);
|
|
||||||
|
|
||||||
int my_strnncoll_mb_bin(const CHARSET_INFO * cs,
|
|
||||||
const uchar *s, size_t slen,
|
|
||||||
const uchar *t, size_t tlen,
|
|
||||||
my_bool t_is_prefix);
|
|
||||||
|
|
||||||
int my_strnncollsp_mb_bin(const CHARSET_INFO *cs,
|
|
||||||
const uchar *a, size_t a_length,
|
|
||||||
const uchar *b, size_t b_length,
|
|
||||||
my_bool diff_if_only_endspace_difference);
|
|
||||||
|
|
||||||
int my_wildcmp_mb_bin(const CHARSET_INFO *cs,
|
|
||||||
const char *str,const char *str_end,
|
|
||||||
const char *wildstr,const char *wildend,
|
|
||||||
int escape, int w_one, int w_many);
|
|
||||||
|
|
||||||
int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
|
|
||||||
const char *s, const char *t);
|
|
||||||
|
|
||||||
void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
|
|
||||||
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
|
|
||||||
|
|
||||||
size_t my_strnxfrm_mb(const CHARSET_INFO *,
|
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
|
||||||
const uchar *src, size_t srclen, uint flags);
|
|
||||||
|
|
||||||
size_t my_strnxfrm_unicode(const CHARSET_INFO *,
|
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
|
||||||
const uchar *src, size_t srclen, uint flags);
|
|
||||||
|
|
||||||
size_t my_strnxfrm_unicode_full_bin(const CHARSET_INFO *,
|
|
||||||
uchar *dst, size_t dstlen, uint nweights,
|
|
||||||
const uchar *src, size_t srclen, uint flags);
|
|
||||||
size_t my_strnxfrmlen_unicode_full_bin(const CHARSET_INFO *, size_t);
|
|
||||||
|
|
||||||
int my_wildcmp_unicode(const CHARSET_INFO *cs,
|
|
||||||
const char *str, const char *str_end,
|
|
||||||
const char *wildstr, const char *wildend,
|
|
||||||
int escape, int w_one, int w_many,
|
|
||||||
const MY_UNICASE_INFO *weights);
|
|
||||||
|
|
||||||
extern my_bool my_parse_charset_xml(MY_CHARSET_LOADER *loader,
|
|
||||||
const char *buf, size_t buflen);
|
|
||||||
extern char *my_strchr(const CHARSET_INFO *cs, const char *str,
|
|
||||||
const char *end, pchar c);
|
|
||||||
extern size_t my_strcspn(const CHARSET_INFO *cs, const char *str,
|
|
||||||
const char *end, const char *reject,
|
|
||||||
size_t reject_length);
|
|
||||||
|
|
||||||
my_bool my_propagate_simple(const CHARSET_INFO *cs, const uchar *str,
|
|
||||||
size_t len);
|
|
||||||
my_bool my_propagate_complex(const CHARSET_INFO *cs, const uchar *str,
|
|
||||||
size_t len);
|
|
||||||
|
|
||||||
|
|
||||||
uint my_string_repertoire(const CHARSET_INFO *cs, const char *str, size_t len);
|
|
||||||
my_bool my_charset_is_ascii_based(const CHARSET_INFO *cs);
|
|
||||||
my_bool my_charset_is_8bit_pure_ascii(const CHARSET_INFO *cs);
|
|
||||||
uint my_charset_repertoire(const CHARSET_INFO *cs);
|
|
||||||
|
|
||||||
|
|
||||||
uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
|
|
||||||
void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
|
|
||||||
uint flags, uint level);
|
|
||||||
size_t my_strxfrm_pad_desc_and_reverse(const CHARSET_INFO *cs,
|
|
||||||
uchar *str, uchar *frmend, uchar *strend,
|
|
||||||
uint nweights, uint flags, uint level);
|
|
||||||
|
|
||||||
my_bool my_charset_is_ascii_compatible(const CHARSET_INFO *cs);
|
|
||||||
|
|
||||||
const MY_CONTRACTIONS *my_charset_get_contractions(const CHARSET_INFO *cs,
|
|
||||||
int level);
|
|
||||||
|
|
||||||
extern size_t my_vsnprintf_ex(const CHARSET_INFO *cs, char *to, size_t n,
|
|
||||||
const char* fmt, va_list ap);
|
|
||||||
|
|
||||||
size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs,
|
|
||||||
const char *from, size_t from_length,
|
|
||||||
const CHARSET_INFO *from_cs, uint *errors);
|
|
||||||
|
|
||||||
uint my_mbcharlen_ptr(const CHARSET_INFO *cs, const char *s, const char *e);
|
|
||||||
|
|
||||||
#define _MY_U 01 /* Upper case */
|
|
||||||
#define _MY_L 02 /* Lower case */
|
|
||||||
#define _MY_NMR 04 /* Numeral (digit) */
|
|
||||||
#define _MY_SPC 010 /* Spacing character */
|
|
||||||
#define _MY_PNT 020 /* Punctuation */
|
|
||||||
#define _MY_CTR 040 /* Control character */
|
|
||||||
#define _MY_B 0100 /* Blank */
|
|
||||||
#define _MY_X 0200 /* heXadecimal digit */
|
|
||||||
|
|
||||||
|
|
||||||
#define my_isascii(c) (!((c) & ~0177))
|
|
||||||
#define my_toascii(c) ((c) & 0177)
|
|
||||||
#define my_tocntrl(c) ((c) & 31)
|
|
||||||
#define my_toprint(c) ((c) | 64)
|
|
||||||
#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
|
|
||||||
#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
|
|
||||||
#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
|
|
||||||
#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
|
|
||||||
#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
|
|
||||||
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
|
|
||||||
#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
|
|
||||||
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
|
|
||||||
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
|
|
||||||
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
|
|
||||||
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
|
|
||||||
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
|
|
||||||
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
|
|
||||||
|
|
||||||
/* Some macros that should be cleaned up a little */
|
|
||||||
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
|
|
||||||
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
|
|
||||||
|
|
||||||
#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
|
|
||||||
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
|
|
||||||
#define my_strnxfrm(cs, d, dl, s, sl) \
|
|
||||||
((cs)->coll->strnxfrm((cs), (d), (dl), (dl), (s), (sl), MY_STRXFRM_PAD_WITH_SPACE))
|
|
||||||
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0))
|
|
||||||
#define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \
|
|
||||||
((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j)))
|
|
||||||
#define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m)))
|
|
||||||
#define my_strcasecmp(s, a, b) ((s)->coll->strcasecmp((s), (a), (b)))
|
|
||||||
#define my_charpos(cs, b, e, num) (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num))
|
|
||||||
|
|
||||||
|
|
||||||
#define use_mb(s) ((s)->cset->ismbchar != NULL)
|
|
||||||
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
|
|
||||||
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
|
|
||||||
/**
|
|
||||||
Get the length of gb18030 code by the given two leading bytes
|
|
||||||
|
|
||||||
@param[in] s charset_info
|
|
||||||
@param[in] a first byte of gb18030 code
|
|
||||||
@param[in] b second byte of gb18030 code
|
|
||||||
@return the length of gb18030 code starting with given two bytes,
|
|
||||||
the length would be 2 or 4 for valid gb18030 code,
|
|
||||||
or 0 for invalid gb18030 code
|
|
||||||
*/
|
|
||||||
#define my_mbcharlen_2(s, a, b) ((s)->cset->mbcharlen((s),((((a) & 0xFF) << 8) + ((b) & 0xFF))))
|
|
||||||
/**
|
|
||||||
Get the maximum length of leading bytes needed to determine the length of a
|
|
||||||
multi-byte gb18030 code
|
|
||||||
|
|
||||||
@param[in] s charset_info
|
|
||||||
@return number of leading bytes we need, would be 2 for gb18030
|
|
||||||
and 1 for all other charsets
|
|
||||||
*/
|
|
||||||
#define my_mbmaxlenlen(s) ((s)->mbmaxlenlen)
|
|
||||||
/**
|
|
||||||
Judge if the given byte is a possible leading byte for a charset.
|
|
||||||
For gb18030 whose mbmaxlenlen is 2, we can't determine the length of
|
|
||||||
a multi-byte character by looking at the first byte only
|
|
||||||
|
|
||||||
@param[in] s charset_info
|
|
||||||
@param[in] i possible leading byte
|
|
||||||
@return true if it is, otherwise false
|
|
||||||
*/
|
|
||||||
#define my_ismb1st(s, i) \
|
|
||||||
(my_mbcharlen((s), (i)) > 1 || \
|
|
||||||
(my_mbmaxlenlen((s)) == 2 && my_mbcharlen((s), (i)) == 0))
|
|
||||||
|
|
||||||
#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
|
|
||||||
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
|
|
||||||
#define my_strntol(s, a, b, c, d, e) ((s)->cset->strntol((s),(a),(b),(c),(d),(e)))
|
|
||||||
#define my_strntoul(s, a, b, c, d, e) ((s)->cset->strntoul((s),(a),(b),(c),(d),(e)))
|
|
||||||
#define my_strntoll(s, a, b, c, d, e) ((s)->cset->strntoll((s),(a),(b),(c),(d),(e)))
|
|
||||||
#define my_strntoull(s, a, b, c,d, e) ((s)->cset->strntoull((s),(a),(b),(c),(d),(e)))
|
|
||||||
#define my_strntod(s, a, b, c, d) ((s)->cset->strntod((s),(a),(b),(c),(d)))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _m_ctype_h */
|
|
||||||
@ -1,348 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef _m_string_h
|
|
||||||
#define _m_string_h
|
|
||||||
|
|
||||||
#include "my_global.h" /* HAVE_* */
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define bfill please_use_memset_rather_than_bfill
|
|
||||||
#define bzero please_use_memset_rather_than_bzero
|
|
||||||
#define bmove please_use_memmove_rather_than_bmove
|
|
||||||
#define strmov please_use_my_stpcpy_or_my_stpmov_rather_than_strmov
|
|
||||||
#define strnmov please_use_my_stpncpy_or_my_stpnmov_rather_than_strnmov
|
|
||||||
|
|
||||||
#include "mysql/service_my_snprintf.h"
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
my_str_malloc(), my_str_realloc() and my_str_free() are assigned to
|
|
||||||
implementations in strings/alloc.c, but can be overridden in
|
|
||||||
the calling program.
|
|
||||||
*/
|
|
||||||
extern void *(*my_str_malloc)(size_t);
|
|
||||||
extern void *(*my_str_realloc)(void *, size_t);
|
|
||||||
extern void (*my_str_free)(void *);
|
|
||||||
|
|
||||||
/* Declared in int2str() */
|
|
||||||
extern char _dig_vec_upper[];
|
|
||||||
extern char _dig_vec_lower[];
|
|
||||||
|
|
||||||
/* Prototypes for string functions */
|
|
||||||
|
|
||||||
extern void bchange(uchar *dst,size_t old_len,const uchar *src,
|
|
||||||
size_t new_len,size_t tot_len);
|
|
||||||
extern void strappend(char *s,size_t len,pchar fill);
|
|
||||||
extern char *strend(const char *s);
|
|
||||||
extern char *strcend(const char *, pchar);
|
|
||||||
extern char *strfill(char * s,size_t len,pchar fill);
|
|
||||||
extern char *strmake(char *dst,const char *src,size_t length);
|
|
||||||
|
|
||||||
extern char *my_stpmov(char *dst,const char *src);
|
|
||||||
extern char *my_stpnmov(char *dst, const char *src, size_t n);
|
|
||||||
extern char *strcont(const char *src, const char *set);
|
|
||||||
extern char *strxmov(char *dst, const char *src, ...);
|
|
||||||
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Copy a string from src to dst until (and including) terminating null byte.
|
|
||||||
|
|
||||||
@param dst Destination
|
|
||||||
@param src Source
|
|
||||||
|
|
||||||
@note src and dst cannot overlap.
|
|
||||||
Use my_stpmov() if src and dst overlaps.
|
|
||||||
|
|
||||||
@note Unsafe, consider using my_stpnpy() instead.
|
|
||||||
|
|
||||||
@return pointer to terminating null byte.
|
|
||||||
*/
|
|
||||||
static inline char *my_stpcpy(char *dst, const char *src)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_BUILTIN_STPCPY)
|
|
||||||
return __builtin_stpcpy(dst, src);
|
|
||||||
#elif defined(HAVE_STPCPY)
|
|
||||||
return stpcpy(dst, src);
|
|
||||||
#else
|
|
||||||
/* Fallback to implementation supporting overlap. */
|
|
||||||
return my_stpmov(dst, src);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Copy fixed-size string from src to dst.
|
|
||||||
|
|
||||||
@param dst Destination
|
|
||||||
@param src Source
|
|
||||||
@param n Maximum number of characters to copy.
|
|
||||||
|
|
||||||
@note src and dst cannot overlap
|
|
||||||
Use my_stpnmov() if src and dst overlaps.
|
|
||||||
|
|
||||||
@return pointer to terminating null byte.
|
|
||||||
*/
|
|
||||||
static inline char *my_stpncpy(char *dst, const char *src, size_t n)
|
|
||||||
{
|
|
||||||
#if defined(HAVE_STPNCPY)
|
|
||||||
return stpncpy(dst, src, n);
|
|
||||||
#else
|
|
||||||
/* Fallback to implementation supporting overlap. */
|
|
||||||
return my_stpnmov(dst, src, n);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline longlong my_strtoll(const char *nptr, char **endptr, int base)
|
|
||||||
{
|
|
||||||
#if defined _WIN32
|
|
||||||
return _strtoi64(nptr, endptr, base);
|
|
||||||
#else
|
|
||||||
return strtoll(nptr, endptr, base);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong my_strtoull(const char *nptr, char **endptr, int base)
|
|
||||||
{
|
|
||||||
#if defined _WIN32
|
|
||||||
return _strtoui64(nptr, endptr, base);
|
|
||||||
#else
|
|
||||||
return strtoull(nptr, endptr, base);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline char *my_strtok_r(char *str, const char *delim, char **saveptr)
|
|
||||||
{
|
|
||||||
#if defined _WIN32
|
|
||||||
return strtok_s(str, delim, saveptr);
|
|
||||||
#else
|
|
||||||
return strtok_r(str, delim, saveptr);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* native_ rather than my_ since my_strcasecmp already exists */
|
|
||||||
static inline int native_strcasecmp(const char *s1, const char *s2)
|
|
||||||
{
|
|
||||||
#if defined _WIN32
|
|
||||||
return _stricmp(s1, s2);
|
|
||||||
#else
|
|
||||||
return strcasecmp(s1, s2);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* native_ rather than my_ for consistency with native_strcasecmp */
|
|
||||||
static inline int native_strncasecmp(const char *s1, const char *s2, size_t n)
|
|
||||||
{
|
|
||||||
#if defined _WIN32
|
|
||||||
return _strnicmp(s1, s2, n);
|
|
||||||
#else
|
|
||||||
return strncasecmp(s1, s2, n);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Prototypes of normal stringfunctions (with may ours) */
|
|
||||||
#ifndef HAVE_STRNLEN
|
|
||||||
extern size_t strnlen(const char *s, size_t n);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern int is_prefix(const char *, const char *);
|
|
||||||
|
|
||||||
/* Conversion routines */
|
|
||||||
typedef enum {
|
|
||||||
MY_GCVT_ARG_FLOAT,
|
|
||||||
MY_GCVT_ARG_DOUBLE
|
|
||||||
} my_gcvt_arg_type;
|
|
||||||
|
|
||||||
double my_strtod(const char *str, char **end, int *error);
|
|
||||||
double my_atof(const char *nptr);
|
|
||||||
size_t my_fcvt(double x, int precision, char *to, my_bool *error);
|
|
||||||
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
|
|
||||||
my_bool *error);
|
|
||||||
|
|
||||||
#define NOT_FIXED_DEC 31
|
|
||||||
|
|
||||||
/*
|
|
||||||
The longest string my_fcvt can return is 311 + "precision" bytes.
|
|
||||||
Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC
|
|
||||||
(+ 1 byte for the terminating '\0').
|
|
||||||
*/
|
|
||||||
#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
|
|
||||||
|
|
||||||
/*
|
|
||||||
We want to use the 'e' format in some cases even if we have enough space
|
|
||||||
for the 'f' one just to mimic sprintf("%.15g") behavior for large integers,
|
|
||||||
and to improve it for numbers < 10^(-4).
|
|
||||||
That is, for |x| < 1 we require |x| >= 10^(-15), and for |x| > 1 we require
|
|
||||||
it to be integer and be <= 10^DBL_DIG for the 'f' format to be used.
|
|
||||||
We don't lose precision, but make cases like "1e200" or "0.00001" look nicer.
|
|
||||||
*/
|
|
||||||
#define MAX_DECPT_FOR_F_FORMAT DBL_DIG
|
|
||||||
|
|
||||||
/*
|
|
||||||
The maximum possible field width for my_gcvt() conversion.
|
|
||||||
(DBL_DIG + 2) significant digits + sign + "." + ("e-NNN" or
|
|
||||||
MAX_DECPT_FOR_F_FORMAT zeros for cases when |x|<1 and the 'f' format is used).
|
|
||||||
*/
|
|
||||||
#define MY_GCVT_MAX_FIELD_WIDTH (DBL_DIG + 4 + MY_MAX(5, MAX_DECPT_FOR_F_FORMAT)) \
|
|
||||||
|
|
||||||
extern char *llstr(longlong value,char *buff);
|
|
||||||
extern char *ullstr(longlong value,char *buff);
|
|
||||||
|
|
||||||
extern char *int2str(long val, char *dst, int radix, int upcase);
|
|
||||||
extern char *int10_to_str(long val,char *dst,int radix);
|
|
||||||
extern char *str2int(const char *src,int radix,long lower,long upper,
|
|
||||||
long *val);
|
|
||||||
longlong my_strtoll10(const char *nptr, char **endptr, int *error);
|
|
||||||
#if SIZEOF_LONG == SIZEOF_LONG_LONG
|
|
||||||
#define ll2str(A,B,C,D) int2str((A),(B),(C),(D))
|
|
||||||
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
|
|
||||||
#undef strtoll
|
|
||||||
#define strtoll(A,B,C) strtol((A),(B),(C))
|
|
||||||
#define strtoull(A,B,C) strtoul((A),(B),(C))
|
|
||||||
#else
|
|
||||||
extern char *ll2str(longlong val,char *dst,int radix, int upcase);
|
|
||||||
extern char *longlong10_to_str(longlong val,char *dst,int radix);
|
|
||||||
#endif
|
|
||||||
#define longlong2str(A,B,C) ll2str((A),(B),(C),1)
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
LEX_STRING -- a pair of a C-string and its length.
|
|
||||||
(it's part of the plugin API as a MYSQL_LEX_STRING)
|
|
||||||
Ditto LEX_CSTRING/MYSQL_LEX_CSTRING.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <mysql/mysql_lex_string.h>
|
|
||||||
typedef struct st_mysql_lex_string LEX_STRING;
|
|
||||||
typedef struct st_mysql_const_lex_string LEX_CSTRING;
|
|
||||||
|
|
||||||
#define STRING_WITH_LEN(X) (X), ((sizeof(X) - 1))
|
|
||||||
#define USTRING_WITH_LEN(X) ((uchar*) X), ((sizeof(X) - 1))
|
|
||||||
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((sizeof(X) - 1))
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Skip trailing space.
|
|
||||||
|
|
||||||
On most systems reading memory in larger chunks (ideally equal to the size of
|
|
||||||
the chinks that the machine physically reads from memory) causes fewer memory
|
|
||||||
access loops and hence increased performance.
|
|
||||||
This is why the 'int' type is used : it's closest to that (according to how
|
|
||||||
it's defined in C).
|
|
||||||
So when we determine the amount of whitespace at the end of a string we do
|
|
||||||
the following :
|
|
||||||
1. We divide the string into 3 zones :
|
|
||||||
a) from the start of the string (__start) to the first multiple
|
|
||||||
of sizeof(int) (__start_words)
|
|
||||||
b) from the end of the string (__end) to the last multiple of sizeof(int)
|
|
||||||
(__end_words)
|
|
||||||
c) a zone that is aligned to sizeof(int) and can be safely accessed
|
|
||||||
through an int *
|
|
||||||
2. We start comparing backwards from (c) char-by-char. If all we find is
|
|
||||||
space then we continue
|
|
||||||
3. If there are elements in zone (b) we compare them as unsigned ints to a
|
|
||||||
int mask (SPACE_INT) consisting of all spaces
|
|
||||||
4. Finally we compare the remaining part (a) of the string char by char.
|
|
||||||
This covers for the last non-space unsigned int from 3. (if any)
|
|
||||||
|
|
||||||
This algorithm works well for relatively larger strings, but it will slow
|
|
||||||
the things down for smaller strings (because of the additional calculations
|
|
||||||
and checks compared to the naive method). Thus the barrier of length 20
|
|
||||||
is added.
|
|
||||||
|
|
||||||
@param ptr pointer to the input string
|
|
||||||
@param len the length of the string
|
|
||||||
@return the last non-space character
|
|
||||||
*/
|
|
||||||
#if defined(__sparc) || defined(__sparcv9)
|
|
||||||
static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len)
|
|
||||||
{
|
|
||||||
/* SPACE_INT is a word that contains only spaces */
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
const unsigned SPACE_INT= 0x20202020U;
|
|
||||||
#elif SIZEOF_INT == 8
|
|
||||||
const unsigned SPACE_INT= 0x2020202020202020ULL;
|
|
||||||
#else
|
|
||||||
#error define the appropriate constant for a word full of spaces
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const uchar *end= ptr + len;
|
|
||||||
|
|
||||||
if (len > 20)
|
|
||||||
{
|
|
||||||
const uchar *end_words= (const uchar *)(intptr)
|
|
||||||
(((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT);
|
|
||||||
const uchar *start_words= (const uchar *)(intptr)
|
|
||||||
((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT);
|
|
||||||
|
|
||||||
DBUG_ASSERT(end_words > ptr);
|
|
||||||
while (end > end_words && end[-1] == 0x20)
|
|
||||||
end--;
|
|
||||||
if (end[-1] == 0x20 && start_words < end_words)
|
|
||||||
while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT)
|
|
||||||
end -= SIZEOF_INT;
|
|
||||||
}
|
|
||||||
while (end > ptr && end[-1] == 0x20)
|
|
||||||
end--;
|
|
||||||
return (end);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
Reads 8 bytes at a time, ignoring alignment.
|
|
||||||
We use uint8korr, which is fast (it simply reads a *ulonglong)
|
|
||||||
on all platforms, except sparc.
|
|
||||||
*/
|
|
||||||
static inline const uchar *skip_trailing_space(const uchar *ptr, size_t len)
|
|
||||||
{
|
|
||||||
const uchar *end= ptr + len;
|
|
||||||
while (end - ptr >= 8)
|
|
||||||
{
|
|
||||||
if (uint8korr(end-8) != 0x2020202020202020ULL)
|
|
||||||
break;
|
|
||||||
end-= 8;
|
|
||||||
}
|
|
||||||
while (end > ptr && end[-1] == 0x20)
|
|
||||||
end--;
|
|
||||||
return (end);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str)
|
|
||||||
{
|
|
||||||
lex_str->str= (char *) c_str;
|
|
||||||
lex_str->length= strlen(c_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void lex_cstring_set(LEX_CSTRING *lex_str, const char *c_str)
|
|
||||||
{
|
|
||||||
lex_str->str= c_str;
|
|
||||||
lex_str->length= strlen(c_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,90 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Data structures for mysys/my_alloc.c (root memory allocator)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _my_alloc_h
|
|
||||||
#define _my_alloc_h
|
|
||||||
|
|
||||||
#define ALLOC_MAX_BLOCK_TO_DROP 4096
|
|
||||||
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
|
|
||||||
|
|
||||||
/* PSI_memory_key */
|
|
||||||
#include "mysql/psi/psi_memory.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct st_used_mem
|
|
||||||
{ /* struct for once_alloc (block) */
|
|
||||||
struct st_used_mem *next; /* Next block in use */
|
|
||||||
unsigned int left; /* memory left in block */
|
|
||||||
unsigned int size; /* size of block */
|
|
||||||
} USED_MEM;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct st_mem_root
|
|
||||||
{
|
|
||||||
USED_MEM *free; /* blocks with free memory in it */
|
|
||||||
USED_MEM *used; /* blocks almost without free memory */
|
|
||||||
USED_MEM *pre_alloc; /* preallocated block */
|
|
||||||
/* if block have less memory it will be put in 'used' list */
|
|
||||||
size_t min_malloc;
|
|
||||||
size_t block_size; /* initial block size */
|
|
||||||
unsigned int block_num; /* allocated blocks counter */
|
|
||||||
/*
|
|
||||||
first free block in queue test counter (if it exceed
|
|
||||||
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
|
|
||||||
*/
|
|
||||||
unsigned int first_block_usage;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Maximum amount of memory this mem_root can hold. A value of 0
|
|
||||||
implies there is no limit.
|
|
||||||
*/
|
|
||||||
size_t max_capacity;
|
|
||||||
|
|
||||||
/* Allocated size for this mem_root */
|
|
||||||
|
|
||||||
size_t allocated_size;
|
|
||||||
|
|
||||||
/* Enable this for error reporting if capacity is exceeded */
|
|
||||||
my_bool error_for_capacity_exceeded;
|
|
||||||
|
|
||||||
void (*error_handler)(void);
|
|
||||||
|
|
||||||
PSI_memory_key m_psi_key;
|
|
||||||
} MEM_ROOT;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,225 +0,0 @@
|
|||||||
#ifndef MY_BYTEORDER_INCLUDED
|
|
||||||
#define MY_BYTEORDER_INCLUDED
|
|
||||||
|
|
||||||
/* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Functions for reading and storing in machine independent
|
|
||||||
format (low byte first). There are 'korr' (assume 'corrector') variants
|
|
||||||
for integer types, but 'get' (assume 'getter') for floating point types.
|
|
||||||
*/
|
|
||||||
#if defined(__i386__) || defined(_WIN32) || defined(__x86_64__)
|
|
||||||
#include "byte_order_generic_x86.h"
|
|
||||||
#else
|
|
||||||
#include "byte_order_generic.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int32 sint3korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
((int32) (((A[2]) & 128) ?
|
|
||||||
(((uint32) 255L << 24) |
|
|
||||||
(((uint32) A[2]) << 16) |
|
|
||||||
(((uint32) A[1]) << 8) |
|
|
||||||
((uint32) A[0])) :
|
|
||||||
(((uint32) A[2]) << 16) |
|
|
||||||
(((uint32) A[1]) << 8) |
|
|
||||||
((uint32) A[0])))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32 uint3korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
(uint32) (((uint32) (A[0])) +
|
|
||||||
(((uint32) (A[1])) << 8) +
|
|
||||||
(((uint32) (A[2])) << 16))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong uint5korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
((ulonglong)(((uint32) (A[0])) +
|
|
||||||
(((uint32) (A[1])) << 8) +
|
|
||||||
(((uint32) (A[2])) << 16) +
|
|
||||||
(((uint32) (A[3])) << 24)) +
|
|
||||||
(((ulonglong) (A[4])) << 32))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong uint6korr(const uchar *A)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
((ulonglong)(((uint32) (A[0])) +
|
|
||||||
(((uint32) (A[1])) << 8) +
|
|
||||||
(((uint32) (A[2])) << 16) +
|
|
||||||
(((uint32) (A[3])) << 24)) +
|
|
||||||
(((ulonglong) (A[4])) << 32) +
|
|
||||||
(((ulonglong) (A[5])) << 40))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int3store(uchar *T, uint A)
|
|
||||||
{
|
|
||||||
*(T)= (uchar) (A);
|
|
||||||
*(T+1)= (uchar) (A >> 8);
|
|
||||||
*(T+2)= (uchar) (A >> 16);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int5store(uchar *T, ulonglong A)
|
|
||||||
{
|
|
||||||
*(T)= (uchar) (A);
|
|
||||||
*(T+1)= (uchar) (A >> 8);
|
|
||||||
*(T+2)= (uchar) (A >> 16);
|
|
||||||
*(T+3)= (uchar) (A >> 24);
|
|
||||||
*(T+4)= (uchar) (A >> 32);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int6store(uchar *T, ulonglong A)
|
|
||||||
{
|
|
||||||
*(T)= (uchar) (A);
|
|
||||||
*(T+1)= (uchar) (A >> 8);
|
|
||||||
*(T+2)= (uchar) (A >> 16);
|
|
||||||
*(T+3)= (uchar) (A >> 24);
|
|
||||||
*(T+4)= (uchar) (A >> 32);
|
|
||||||
*(T+5)= (uchar) (A >> 40);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
static inline int16 sint2korr(const char *pT)
|
|
||||||
{
|
|
||||||
return sint2korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint16 uint2korr(const char *pT)
|
|
||||||
{
|
|
||||||
return uint2korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32 uint3korr(const char *pT)
|
|
||||||
{
|
|
||||||
return uint3korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int32 sint3korr(const char *pT)
|
|
||||||
{
|
|
||||||
return sint3korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline uint32 uint4korr(const char *pT)
|
|
||||||
{
|
|
||||||
return uint4korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int32 sint4korr(const char *pT)
|
|
||||||
{
|
|
||||||
return sint4korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong uint6korr(const char *pT)
|
|
||||||
{
|
|
||||||
return uint6korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong uint8korr(const char *pT)
|
|
||||||
{
|
|
||||||
return uint8korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline longlong sint8korr(const char *pT)
|
|
||||||
{
|
|
||||||
return sint8korr(static_cast<const uchar*>(static_cast<const void*>(pT)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline void int2store(char *pT, uint16 A)
|
|
||||||
{
|
|
||||||
int2store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int3store(char *pT, uint A)
|
|
||||||
{
|
|
||||||
int3store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int4store(char *pT, uint32 A)
|
|
||||||
{
|
|
||||||
int4store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int5store(char *pT, ulonglong A)
|
|
||||||
{
|
|
||||||
int5store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int6store(char *pT, ulonglong A)
|
|
||||||
{
|
|
||||||
int6store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void int8store(char *pT, ulonglong A)
|
|
||||||
{
|
|
||||||
int8store(static_cast<uchar*>(static_cast<void*>(pT)), A);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Functions for reading and storing in machine format from/to
|
|
||||||
short/long to/from some place in memory V should be a variable
|
|
||||||
and M a pointer to byte.
|
|
||||||
*/
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
#include "big_endian.h"
|
|
||||||
#else
|
|
||||||
#include "little_endian.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
static inline void float4store(char *V, float M)
|
|
||||||
{
|
|
||||||
float4store(static_cast<uchar*>(static_cast<void*>(V)), M);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void float8get(double *V, const char *M)
|
|
||||||
{
|
|
||||||
float8get(V, static_cast<const uchar*>(static_cast<const void*>(M)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void float8store(char *V, double M)
|
|
||||||
{
|
|
||||||
float8store(static_cast<uchar*>(static_cast<void*>(V)), M);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* MY_BYTEORDER_INCLUDED */
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef _mysql_command_h
|
|
||||||
#define _mysql_command_h
|
|
||||||
|
|
||||||
/**
|
|
||||||
@enum enum_server_command
|
|
||||||
@brief You should add new commands to the end of this list, otherwise old
|
|
||||||
servers won't be able to handle them as 'unsupported'.
|
|
||||||
*/
|
|
||||||
enum enum_server_command
|
|
||||||
{
|
|
||||||
COM_SLEEP,
|
|
||||||
COM_QUIT,
|
|
||||||
COM_INIT_DB,
|
|
||||||
COM_QUERY,
|
|
||||||
COM_FIELD_LIST,
|
|
||||||
COM_CREATE_DB,
|
|
||||||
COM_DROP_DB,
|
|
||||||
COM_REFRESH,
|
|
||||||
COM_SHUTDOWN,
|
|
||||||
COM_STATISTICS,
|
|
||||||
COM_PROCESS_INFO,
|
|
||||||
COM_CONNECT,
|
|
||||||
COM_PROCESS_KILL,
|
|
||||||
COM_DEBUG,
|
|
||||||
COM_PING,
|
|
||||||
COM_TIME,
|
|
||||||
COM_DELAYED_INSERT,
|
|
||||||
COM_CHANGE_USER,
|
|
||||||
COM_BINLOG_DUMP,
|
|
||||||
COM_TABLE_DUMP,
|
|
||||||
COM_CONNECT_OUT,
|
|
||||||
COM_REGISTER_SLAVE,
|
|
||||||
COM_STMT_PREPARE,
|
|
||||||
COM_STMT_EXECUTE,
|
|
||||||
COM_STMT_SEND_LONG_DATA,
|
|
||||||
COM_STMT_CLOSE,
|
|
||||||
COM_STMT_RESET,
|
|
||||||
COM_SET_OPTION,
|
|
||||||
COM_STMT_FETCH,
|
|
||||||
COM_DAEMON,
|
|
||||||
COM_BINLOG_DUMP_GTID,
|
|
||||||
COM_RESET_CONNECTION,
|
|
||||||
/* don't forget to update const char *command_name[] in sql_parse.cc */
|
|
||||||
|
|
||||||
/* Must be last */
|
|
||||||
COM_END
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* _mysql_command_h */
|
|
||||||
@ -1,190 +0,0 @@
|
|||||||
#ifndef MY_COMPILER_INCLUDED
|
|
||||||
#define MY_COMPILER_INCLUDED
|
|
||||||
|
|
||||||
/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
/**
|
|
||||||
Header for compiler-dependent features.
|
|
||||||
|
|
||||||
Intended to contain a set of reusable wrappers for preprocessor
|
|
||||||
macros, attributes, pragmas, and any other features that are
|
|
||||||
specific to a target compiler.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stddef.h> /* size_t */
|
|
||||||
|
|
||||||
#if defined __GNUC__
|
|
||||||
/*
|
|
||||||
Convenience macro to test the minimum required GCC version.
|
|
||||||
These should be used with care as Clang also sets __GNUC__ and
|
|
||||||
__GNUC_MINOR__ (currently to 4.2). Prefer using feature specific
|
|
||||||
CMake checks in configure.cmake instead.
|
|
||||||
*/
|
|
||||||
# define MY_GNUC_PREREQ(maj, min) \
|
|
||||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
|
||||||
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
|
||||||
#else
|
|
||||||
# define MY_GNUC_PREREQ(maj, min) (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
The macros below are borrowed from include/linux/compiler.h in the
|
|
||||||
Linux kernel. Use them to indicate the likelyhood of the truthfulness
|
|
||||||
of a condition. This serves two purposes - newer versions of gcc will be
|
|
||||||
able to optimize for branch predication, which could yield siginficant
|
|
||||||
performance gains in frequently executed sections of the code, and the
|
|
||||||
other reason to use them is for documentation
|
|
||||||
*/
|
|
||||||
#ifdef HAVE_BUILTIN_EXPECT
|
|
||||||
|
|
||||||
// likely/unlikely are likely to clash with other symbols, do not #define
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
inline bool likely(bool expr)
|
|
||||||
{
|
|
||||||
return __builtin_expect(expr, true);
|
|
||||||
}
|
|
||||||
inline bool unlikely(bool expr)
|
|
||||||
{
|
|
||||||
return __builtin_expect(expr, false);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# define likely(x) __builtin_expect((x),1)
|
|
||||||
# define unlikely(x) __builtin_expect((x),0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* HAVE_BUILTIN_EXPECT */
|
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
|
||||||
inline bool likely(bool expr)
|
|
||||||
{
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
inline bool unlikely(bool expr)
|
|
||||||
{
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
# define likely(x) (x)
|
|
||||||
# define unlikely(x) (x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* HAVE_BUILTIN_EXPECT */
|
|
||||||
|
|
||||||
/* Comunicate to the compiler the unreachability of the code. */
|
|
||||||
#ifdef HAVE_BUILTIN_UNREACHABLE
|
|
||||||
# define MY_ASSERT_UNREACHABLE() __builtin_unreachable()
|
|
||||||
#else
|
|
||||||
# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC
|
|
||||||
/* Specifies the minimum alignment of a type. */
|
|
||||||
# define MY_ALIGNOF(type) __alignof__(type)
|
|
||||||
/* Determine the alignment requirement of a type. */
|
|
||||||
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
|
|
||||||
/* Microsoft Visual C++ */
|
|
||||||
#elif defined _MSC_VER
|
|
||||||
# define MY_ALIGNOF(type) __alignof(type)
|
|
||||||
# define MY_ALIGNED(n) __declspec(align(n))
|
|
||||||
#else /* Make sure they are defined for other compilers. */
|
|
||||||
# define MY_ALIGNOF(type)
|
|
||||||
# define MY_ALIGNED(size)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Visual Studio requires '__inline' for C code */
|
|
||||||
#if !defined(__cplusplus) && defined(_MSC_VER)
|
|
||||||
# define inline __inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Provide __func__ macro definition for Visual Studio. */
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
# define __func__ __FUNCTION__
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
C++ Type Traits
|
|
||||||
*/
|
|
||||||
#ifdef __cplusplus
|
|
||||||
|
|
||||||
/**
|
|
||||||
Opaque storage with a particular alignment.
|
|
||||||
Partial specialization used due to MSVC++.
|
|
||||||
*/
|
|
||||||
template<size_t alignment> struct my_alignment_imp;
|
|
||||||
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
|
|
||||||
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
|
|
||||||
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
|
|
||||||
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
|
|
||||||
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
A POD type with a given size and alignment.
|
|
||||||
|
|
||||||
@remark If the compiler does not support a alignment attribute
|
|
||||||
(MY_ALIGN macro), the default alignment of a double is
|
|
||||||
used instead.
|
|
||||||
|
|
||||||
@tparam size The minimum size.
|
|
||||||
@tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
|
|
||||||
*/
|
|
||||||
template <size_t size, size_t alignment>
|
|
||||||
struct my_aligned_storage
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
char data[size];
|
|
||||||
my_alignment_imp<alignment> align;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Disable MY_ATTRIBUTE for Sun Studio and Visual Studio.
|
|
||||||
Note that Sun Studio supports some __attribute__ variants,
|
|
||||||
but not format or unused which we use quite a lot.
|
|
||||||
*/
|
|
||||||
#ifndef MY_ATTRIBUTE
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
# define MY_ATTRIBUTE(A) __attribute__(A)
|
|
||||||
#else
|
|
||||||
# define MY_ATTRIBUTE(A)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __has_attribute
|
|
||||||
# define __has_attribute(x) 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if __has_attribute(no_sanitize_undefined)
|
|
||||||
# define SUPPRESS_UBSAN __attribute__((no_sanitize_undefined))
|
|
||||||
#else
|
|
||||||
# define SUPPRESS_UBSAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* MY_COMPILER_INCLUDED */
|
|
||||||
@ -1,468 +0,0 @@
|
|||||||
/* Copyright (c) 2009, 2020, Oracle and/or its affiliates.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef MY_CONFIG_H
|
|
||||||
#define MY_CONFIG_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* From configure.cmake, in order of appearance
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_LLVM_LIBCPP */
|
|
||||||
#define _LARGEFILE_SOURCE 1
|
|
||||||
|
|
||||||
/* Libraries */
|
|
||||||
/* #undef HAVE_LIBM */
|
|
||||||
/* #undef HAVE_LIBNSL */
|
|
||||||
/* #undef HAVE_LIBCRYPT */
|
|
||||||
/* #undef HAVE_LIBSOCKET */
|
|
||||||
/* #undef HAVE_LIBDL */
|
|
||||||
/* #undef HAVE_LIBRT */
|
|
||||||
/* #undef HAVE_LIBWRAP */
|
|
||||||
/* #undef HAVE_LIBWRAP_PROTOTYPES */
|
|
||||||
|
|
||||||
/* Header files */
|
|
||||||
/* #undef HAVE_ALLOCA_H */
|
|
||||||
/* #undef HAVE_ARPA_INET_H */
|
|
||||||
/* #undef HAVE_CRYPT_H */
|
|
||||||
/* #undef HAVE_DLFCN_H */
|
|
||||||
/* #undef HAVE_EXECINFO_H */
|
|
||||||
/* #undef HAVE_FPU_CONTROL_H */
|
|
||||||
/* #undef HAVE_GRP_H */
|
|
||||||
/* #undef HAVE_IEEEFP_H */
|
|
||||||
/* #undef HAVE_LANGINFO_H */
|
|
||||||
#define HAVE_MALLOC_H 1
|
|
||||||
/* #undef HAVE_NETINET_IN_H */
|
|
||||||
/* #undef HAVE_POLL_H */
|
|
||||||
/* #undef HAVE_PWD_H */
|
|
||||||
/* #undef HAVE_STRINGS_H */
|
|
||||||
/* #undef HAVE_SYS_CDEFS_H */
|
|
||||||
/* #undef HAVE_SYS_IOCTL_H */
|
|
||||||
/* #undef HAVE_SYS_MMAN_H */
|
|
||||||
/* #undef HAVE_SYS_RESOURCE_H */
|
|
||||||
/* #undef HAVE_SYS_SELECT_H */
|
|
||||||
/* #undef HAVE_SYS_SOCKET_H */
|
|
||||||
/* #undef HAVE_TERM_H */
|
|
||||||
/* #undef HAVE_TERMIOS_H */
|
|
||||||
/* #undef HAVE_TERMIO_H */
|
|
||||||
/* #undef HAVE_UNISTD_H */
|
|
||||||
/* #undef HAVE_SYS_WAIT_H */
|
|
||||||
/* #undef HAVE_SYS_PARAM_H */
|
|
||||||
/* #undef HAVE_FNMATCH_H */
|
|
||||||
/* #undef HAVE_SYS_UN_H */
|
|
||||||
/* #undef HAVE_SASL_SASL_H */
|
|
||||||
|
|
||||||
/* Libevent */
|
|
||||||
/* #undef HAVE_DEVPOLL */
|
|
||||||
/* #undef HAVE_SYS_DEVPOLL_H */
|
|
||||||
/* #undef HAVE_SYS_EPOLL_H */
|
|
||||||
/* #undef HAVE_TAILQFOREACH */
|
|
||||||
|
|
||||||
/* Functions */
|
|
||||||
#define HAVE_ALIGNED_MALLOC 1
|
|
||||||
/* #undef HAVE_BACKTRACE */
|
|
||||||
/* #undef HAVE_PRINTSTACK */
|
|
||||||
/* #undef HAVE_INDEX */
|
|
||||||
/* #undef HAVE_CLOCK_GETTIME */
|
|
||||||
/* #undef HAVE_CUSERID */
|
|
||||||
/* #undef HAVE_DIRECTIO */
|
|
||||||
/* #undef HAVE_FTRUNCATE */
|
|
||||||
#define HAVE_COMPRESS 1
|
|
||||||
/* #undef HAVE_CRYPT */
|
|
||||||
/* #undef HAVE_DLOPEN */
|
|
||||||
/* #undef HAVE_FCHMOD */
|
|
||||||
/* #undef HAVE_FCNTL */
|
|
||||||
/* #undef HAVE_FDATASYNC */
|
|
||||||
/* #undef HAVE_DECL_FDATASYNC */
|
|
||||||
/* #undef HAVE_FEDISABLEEXCEPT */
|
|
||||||
/* #undef HAVE_FSEEKO */
|
|
||||||
/* #undef HAVE_FSYNC */
|
|
||||||
/* #undef HAVE_GETHOSTBYADDR_R */
|
|
||||||
/* #undef HAVE_GETHRTIME */
|
|
||||||
/* #undef HAVE_GETNAMEINFO */
|
|
||||||
/* #undef HAVE_GETPASS */
|
|
||||||
/* #undef HAVE_GETPASSPHRASE */
|
|
||||||
/* #undef HAVE_GETPWNAM */
|
|
||||||
/* #undef HAVE_GETPWUID */
|
|
||||||
/* #undef HAVE_GETRLIMIT */
|
|
||||||
/* #undef HAVE_GETRUSAGE */
|
|
||||||
/* #undef HAVE_INITGROUPS */
|
|
||||||
/* #undef HAVE_ISSETUGID */
|
|
||||||
/* #undef HAVE_GETUID */
|
|
||||||
/* #undef HAVE_GETEUID */
|
|
||||||
/* #undef HAVE_GETGID */
|
|
||||||
/* #undef HAVE_GETEGID */
|
|
||||||
/* #undef HAVE_LSTAT */
|
|
||||||
/* #undef HAVE_MADVISE */
|
|
||||||
/* #undef HAVE_MALLOC_INFO */
|
|
||||||
/* #undef HAVE_MEMRCHR */
|
|
||||||
/* #undef HAVE_MLOCK */
|
|
||||||
/* #undef HAVE_MLOCKALL */
|
|
||||||
/* #undef HAVE_MMAP64 */
|
|
||||||
/* #undef HAVE_POLL */
|
|
||||||
/* #undef HAVE_POSIX_FALLOCATE */
|
|
||||||
/* #undef HAVE_POSIX_MEMALIGN */
|
|
||||||
/* #undef HAVE_PREAD */
|
|
||||||
/* #undef HAVE_PTHREAD_CONDATTR_SETCLOCK */
|
|
||||||
/* #undef HAVE_PTHREAD_SIGMASK */
|
|
||||||
/* #undef HAVE_READLINK */
|
|
||||||
/* #undef HAVE_REALPATH */
|
|
||||||
/* #undef HAVE_SETFD */
|
|
||||||
/* #undef HAVE_SIGACTION */
|
|
||||||
/* #undef HAVE_SLEEP */
|
|
||||||
/* #undef HAVE_STPCPY */
|
|
||||||
/* #undef HAVE_STPNCPY */
|
|
||||||
/* #undef HAVE_STRLCPY */
|
|
||||||
#define HAVE_STRNLEN 1
|
|
||||||
/* #undef HAVE_STRLCAT */
|
|
||||||
/* #undef HAVE_STRSIGNAL */
|
|
||||||
/* #undef HAVE_FGETLN */
|
|
||||||
/* #undef HAVE_STRSEP */
|
|
||||||
#define HAVE_TELL 1
|
|
||||||
/* #undef HAVE_VASPRINTF */
|
|
||||||
/* #undef HAVE_MEMALIGN */
|
|
||||||
/* #undef HAVE_NL_LANGINFO */
|
|
||||||
/* #undef HAVE_HTONLL */
|
|
||||||
/* #undef DNS_USE_CPU_CLOCK_FOR_ID */
|
|
||||||
/* #undef HAVE_EPOLL */
|
|
||||||
/* #undef HAVE_EVENT_PORTS */
|
|
||||||
/* #undef HAVE_INET_NTOP */
|
|
||||||
/* #undef HAVE_WORKING_KQUEUE */
|
|
||||||
/* #undef HAVE_TIMERADD */
|
|
||||||
/* #undef HAVE_TIMERCLEAR */
|
|
||||||
/* #undef HAVE_TIMERCMP */
|
|
||||||
/* #undef HAVE_TIMERISSET */
|
|
||||||
|
|
||||||
/* WL2373 */
|
|
||||||
/* #undef HAVE_SYS_TIME_H */
|
|
||||||
/* #undef HAVE_SYS_TIMES_H */
|
|
||||||
/* #undef HAVE_TIMES */
|
|
||||||
/* #undef HAVE_GETTIMEOFDAY */
|
|
||||||
|
|
||||||
/* Symbols */
|
|
||||||
/* #undef HAVE_LRAND48 */
|
|
||||||
/* #undef GWINSZ_IN_SYS_IOCTL */
|
|
||||||
/* #undef FIONREAD_IN_SYS_IOCTL */
|
|
||||||
/* #undef FIONREAD_IN_SYS_FILIO */
|
|
||||||
/* #undef HAVE_SIGEV_THREAD_ID */
|
|
||||||
/* #undef HAVE_SIGEV_PORT */
|
|
||||||
#define HAVE_LOG2 1
|
|
||||||
|
|
||||||
#define HAVE_ISINF 1
|
|
||||||
|
|
||||||
/* #undef HAVE_KQUEUE_TIMERS */
|
|
||||||
/* #undef HAVE_POSIX_TIMERS */
|
|
||||||
|
|
||||||
/* Endianess */
|
|
||||||
/* #undef WORDS_BIGENDIAN */
|
|
||||||
|
|
||||||
/* Type sizes */
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#define SIZEOF_CHARP 4
|
|
||||||
#define SIZEOF_LONG 4
|
|
||||||
#define SIZEOF_SHORT 2
|
|
||||||
#define SIZEOF_INT 4
|
|
||||||
#define SIZEOF_LONG_LONG 8
|
|
||||||
#define SIZEOF_OFF_T 4
|
|
||||||
#define SIZEOF_TIME_T 8
|
|
||||||
/* #undef HAVE_UINT */
|
|
||||||
/* #undef HAVE_ULONG */
|
|
||||||
/* #undef HAVE_U_INT32_T */
|
|
||||||
/* #undef HAVE_STRUCT_TIMESPEC */
|
|
||||||
|
|
||||||
/* Support for tagging symbols with __attribute__((visibility("hidden"))) */
|
|
||||||
/* #undef HAVE_VISIBILITY_HIDDEN */
|
|
||||||
|
|
||||||
/* Code tests*/
|
|
||||||
#define STACK_DIRECTION -1
|
|
||||||
/* #undef TIME_WITH_SYS_TIME */
|
|
||||||
#define NO_FCNTL_NONBLOCK 1
|
|
||||||
/* #undef HAVE_PAUSE_INSTRUCTION */
|
|
||||||
/* #undef HAVE_FAKE_PAUSE_INSTRUCTION */
|
|
||||||
/* #undef HAVE_HMT_PRIORITY_INSTRUCTION */
|
|
||||||
/* #undef HAVE_ABI_CXA_DEMANGLE */
|
|
||||||
/* #undef HAVE_BUILTIN_UNREACHABLE */
|
|
||||||
/* #undef HAVE_BUILTIN_EXPECT */
|
|
||||||
/* #undef HAVE_BUILTIN_STPCPY */
|
|
||||||
/* #undef HAVE_GCC_ATOMIC_BUILTINS */
|
|
||||||
/* #undef HAVE_GCC_SYNC_BUILTINS */
|
|
||||||
/* #undef HAVE_VALGRIND */
|
|
||||||
/* #undef HAVE_PTHREAD_THREADID_NP */
|
|
||||||
|
|
||||||
/* IPV6 */
|
|
||||||
/* #undef HAVE_NETINET_IN6_H */
|
|
||||||
#define HAVE_STRUCT_SOCKADDR_IN6 1
|
|
||||||
#define HAVE_STRUCT_IN6_ADDR 1
|
|
||||||
#define HAVE_IPV6 1
|
|
||||||
|
|
||||||
/* #undef ss_family */
|
|
||||||
/* #undef HAVE_SOCKADDR_IN_SIN_LEN */
|
|
||||||
/* #undef HAVE_SOCKADDR_IN6_SIN6_LEN */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Platform specific CMake files
|
|
||||||
*/
|
|
||||||
#define MACHINE_TYPE "AMD64"
|
|
||||||
/* #undef HAVE_LINUX_LARGE_PAGES */
|
|
||||||
/* #undef HAVE_SOLARIS_LARGE_PAGES */
|
|
||||||
/* #undef HAVE_SOLARIS_ATOMIC */
|
|
||||||
/* #undef HAVE_SOLARIS_STYLE_GETHOST */
|
|
||||||
#define SYSTEM_TYPE "Win32"
|
|
||||||
/* Windows stuff, mostly functions, that have Posix analogs but named differently */
|
|
||||||
/* #undef IPPROTO_IPV6 */
|
|
||||||
/* #undef IPV6_V6ONLY */
|
|
||||||
/* This should mean case insensitive file system */
|
|
||||||
#define FN_NO_CASE_SENSE 1
|
|
||||||
|
|
||||||
/*
|
|
||||||
* From main CMakeLists.txt
|
|
||||||
*/
|
|
||||||
#define MAX_INDEXES 64U
|
|
||||||
/* #undef WITH_INNODB_MEMCACHED */
|
|
||||||
/* #undef ENABLE_MEMCACHED_SASL */
|
|
||||||
/* #undef ENABLE_MEMCACHED_SASL_PWDB */
|
|
||||||
#define ENABLED_PROFILING 1
|
|
||||||
/* #undef HAVE_ASAN */
|
|
||||||
#define ENABLED_LOCAL_INFILE 1
|
|
||||||
#define OPTIMIZER_TRACE 1
|
|
||||||
#define DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server 5.7"
|
|
||||||
#define SHAREDIR "share"
|
|
||||||
#define DEFAULT_BASEDIR "C:/Program Files/MySQL/MySQL Server 5.7"
|
|
||||||
#define MYSQL_DATADIR "C:/Program Files/MySQL/MySQL Server 5.7/data"
|
|
||||||
#define MYSQL_KEYRINGDIR "C:/Program Files/MySQL/MySQL Server 5.7/keyring"
|
|
||||||
#define DEFAULT_CHARSET_HOME "C:/Program Files/MySQL/MySQL Server 5.7"
|
|
||||||
#define PLUGINDIR "C:/Program Files/MySQL/MySQL Server 5.7/lib/plugin"
|
|
||||||
/* #undef DEFAULT_SYSCONFDIR */
|
|
||||||
#define DEFAULT_TMPDIR ""
|
|
||||||
#define INSTALL_SBINDIR "/bin"
|
|
||||||
#define INSTALL_BINDIR "/bin"
|
|
||||||
#define INSTALL_MYSQLSHAREDIR "/share"
|
|
||||||
#define INSTALL_SHAREDIR "/share"
|
|
||||||
#define INSTALL_PLUGINDIR "/lib/plugin"
|
|
||||||
#define INSTALL_INCLUDEDIR "/include"
|
|
||||||
#define INSTALL_SCRIPTDIR "/scripts"
|
|
||||||
#define INSTALL_MYSQLDATADIR "/data"
|
|
||||||
#define INSTALL_MYSQLKEYRINGDIR "/keyring"
|
|
||||||
/* #undef INSTALL_PLUGINTESTDIR */
|
|
||||||
#define INSTALL_INFODIR "/docs"
|
|
||||||
#define INSTALL_MYSQLTESTDIR "/mysql-test"
|
|
||||||
#define INSTALL_DOCREADMEDIR "/."
|
|
||||||
#define INSTALL_DOCDIR "/docs"
|
|
||||||
#define INSTALL_MANDIR "/man"
|
|
||||||
#define INSTALL_SUPPORTFILESDIR "/support-files"
|
|
||||||
#define INSTALL_LIBDIR "/lib"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Readline
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_MBSTATE_T */
|
|
||||||
/* #undef HAVE_LANGINFO_CODESET */
|
|
||||||
/* #undef HAVE_WCSDUP */
|
|
||||||
/* #undef HAVE_WCHAR_T */
|
|
||||||
/* #undef HAVE_WINT_T */
|
|
||||||
/* #undef HAVE_CURSES_H */
|
|
||||||
/* #undef HAVE_NCURSES_H */
|
|
||||||
/* #undef USE_LIBEDIT_INTERFACE */
|
|
||||||
/* #undef HAVE_HIST_ENTRY */
|
|
||||||
/* #undef USE_NEW_EDITLINE_INTERFACE */
|
|
||||||
/* #undef EDITLINE_HAVE_COMPLETION_CHAR */
|
|
||||||
/* #undef EDITLINE_HAVE_COMPLETION_INT */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Libedit
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_GETLINE */
|
|
||||||
/* #undef HAVE___SECURE_GETENV */
|
|
||||||
/* #undef HAVE_SECURE_GETENV */
|
|
||||||
/* #undef HAVE_VIS */
|
|
||||||
/* #undef HAVE_UNVIS */
|
|
||||||
/* #undef HAVE_GETPW_R_DRAFT */
|
|
||||||
/* #undef HAVE_GETPW_R_POSIX */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* DTrace
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_DTRACE */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Character sets
|
|
||||||
*/
|
|
||||||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
|
||||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
|
||||||
#define HAVE_CHARSET_armscii8 1
|
|
||||||
#define HAVE_CHARSET_ascii 1
|
|
||||||
#define HAVE_CHARSET_big5 1
|
|
||||||
#define HAVE_CHARSET_cp1250 1
|
|
||||||
#define HAVE_CHARSET_cp1251 1
|
|
||||||
#define HAVE_CHARSET_cp1256 1
|
|
||||||
#define HAVE_CHARSET_cp1257 1
|
|
||||||
#define HAVE_CHARSET_cp850 1
|
|
||||||
#define HAVE_CHARSET_cp852 1
|
|
||||||
#define HAVE_CHARSET_cp866 1
|
|
||||||
#define HAVE_CHARSET_cp932 1
|
|
||||||
#define HAVE_CHARSET_dec8 1
|
|
||||||
#define HAVE_CHARSET_eucjpms 1
|
|
||||||
#define HAVE_CHARSET_euckr 1
|
|
||||||
#define HAVE_CHARSET_gb2312 1
|
|
||||||
#define HAVE_CHARSET_gbk 1
|
|
||||||
#define HAVE_CHARSET_gb18030 1
|
|
||||||
#define HAVE_CHARSET_geostd8 1
|
|
||||||
#define HAVE_CHARSET_greek 1
|
|
||||||
#define HAVE_CHARSET_hebrew 1
|
|
||||||
#define HAVE_CHARSET_hp8 1
|
|
||||||
#define HAVE_CHARSET_keybcs2 1
|
|
||||||
#define HAVE_CHARSET_koi8r 1
|
|
||||||
#define HAVE_CHARSET_koi8u 1
|
|
||||||
#define HAVE_CHARSET_latin1 1
|
|
||||||
#define HAVE_CHARSET_latin2 1
|
|
||||||
#define HAVE_CHARSET_latin5 1
|
|
||||||
#define HAVE_CHARSET_latin7 1
|
|
||||||
#define HAVE_CHARSET_macce 1
|
|
||||||
#define HAVE_CHARSET_macroman 1
|
|
||||||
#define HAVE_CHARSET_sjis 1
|
|
||||||
#define HAVE_CHARSET_swe7 1
|
|
||||||
#define HAVE_CHARSET_tis620 1
|
|
||||||
#define HAVE_CHARSET_ucs2 1
|
|
||||||
#define HAVE_CHARSET_ujis 1
|
|
||||||
#define HAVE_CHARSET_utf8mb4 1
|
|
||||||
/* #undef HAVE_CHARSET_utf8mb3 */
|
|
||||||
#define HAVE_CHARSET_utf8 1
|
|
||||||
#define HAVE_CHARSET_utf16 1
|
|
||||||
#define HAVE_CHARSET_utf32 1
|
|
||||||
#define HAVE_UCA_COLLATIONS 1
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Feature set
|
|
||||||
*/
|
|
||||||
#define WITH_PARTITION_STORAGE_ENGINE 1
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Performance schema
|
|
||||||
*/
|
|
||||||
#define WITH_PERFSCHEMA_STORAGE_ENGINE 1
|
|
||||||
/* #undef DISABLE_PSI_THREAD */
|
|
||||||
/* #undef DISABLE_PSI_MUTEX */
|
|
||||||
/* #undef DISABLE_PSI_RWLOCK */
|
|
||||||
/* #undef DISABLE_PSI_COND */
|
|
||||||
/* #undef DISABLE_PSI_FILE */
|
|
||||||
/* #undef DISABLE_PSI_TABLE */
|
|
||||||
/* #undef DISABLE_PSI_SOCKET */
|
|
||||||
/* #undef DISABLE_PSI_STAGE */
|
|
||||||
/* #undef DISABLE_PSI_STATEMENT */
|
|
||||||
/* #undef DISABLE_PSI_SP */
|
|
||||||
/* #undef DISABLE_PSI_PS */
|
|
||||||
/* #undef DISABLE_PSI_IDLE */
|
|
||||||
/* #undef DISABLE_PSI_STATEMENT_DIGEST */
|
|
||||||
/* #undef DISABLE_PSI_METADATA */
|
|
||||||
/* #undef DISABLE_PSI_MEMORY */
|
|
||||||
/* #undef DISABLE_PSI_TRANSACTION */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* syscall
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_SYS_THREAD_SELFID */
|
|
||||||
/* #undef HAVE_SYS_GETTID */
|
|
||||||
/* #undef HAVE_PTHREAD_GETTHREADID_NP */
|
|
||||||
/* #undef HAVE_PTHREAD_SETNAME_NP */
|
|
||||||
/* #undef HAVE_INTEGER_PTHREAD_SELF */
|
|
||||||
|
|
||||||
/* Platform-specific C++ compiler behaviors we rely upon */
|
|
||||||
|
|
||||||
/*
|
|
||||||
This macro defines whether the compiler in use needs a 'typename' keyword
|
|
||||||
to access the types defined inside a class template, such types are called
|
|
||||||
dependent types. Some compilers require it, some others forbid it, and some
|
|
||||||
others may work with or without it. For example, GCC requires the 'typename'
|
|
||||||
keyword whenever needing to access a type inside a template, but msvc
|
|
||||||
forbids it.
|
|
||||||
*/
|
|
||||||
#define HAVE_IMPLICIT_DEPENDENT_NAME_TYPING 1
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MySQL version
|
|
||||||
*/
|
|
||||||
#define DOT_FRM_VERSION 6
|
|
||||||
#define MYSQL_VERSION_MAJOR 5
|
|
||||||
#define MYSQL_VERSION_MINOR 7
|
|
||||||
#define MYSQL_VERSION_PATCH 31
|
|
||||||
#define MYSQL_VERSION_EXTRA ""
|
|
||||||
#define PACKAGE "mysql"
|
|
||||||
#define PACKAGE_BUGREPORT ""
|
|
||||||
#define PACKAGE_NAME "MySQL Server"
|
|
||||||
#define PACKAGE_STRING "MySQL Server 5.7.31"
|
|
||||||
#define PACKAGE_TARNAME "mysql"
|
|
||||||
#define PACKAGE_VERSION "5.7.31"
|
|
||||||
#define VERSION "5.7.31"
|
|
||||||
#define PROTOCOL_VERSION 10
|
|
||||||
|
|
||||||
/*
|
|
||||||
* CPU info
|
|
||||||
*/
|
|
||||||
#define CPU_LEVEL1_DCACHE_LINESIZE 64
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NDB
|
|
||||||
*/
|
|
||||||
/* #undef WITH_NDBCLUSTER_STORAGE_ENGINE */
|
|
||||||
/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Other
|
|
||||||
*/
|
|
||||||
/* #undef EXTRA_DEBUG */
|
|
||||||
/* #undef HAVE_CHOWN */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Hardcoded values needed by libevent/NDB/memcached
|
|
||||||
*/
|
|
||||||
#define HAVE_FCNTL_H 1
|
|
||||||
#define HAVE_GETADDRINFO 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
/* libevent's select.c is not Windows compatible */
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define HAVE_SELECT 1
|
|
||||||
#endif
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRTOK_R 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_SYS_STAT_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define SIZEOF_CHAR 1
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Needed by libevent
|
|
||||||
*/
|
|
||||||
/* #undef HAVE_SOCKLEN_T */
|
|
||||||
|
|
||||||
/* For --secure-file-priv */
|
|
||||||
#define DEFAULT_SECURE_FILE_PRIV_DIR "NULL"
|
|
||||||
#define DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR "NULL"
|
|
||||||
/* #undef HAVE_LIBNUMA */
|
|
||||||
|
|
||||||
/* For default value of --early_plugin_load */
|
|
||||||
/* #undef DEFAULT_EARLY_PLUGIN_LOAD */
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,257 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef MY_DBUG_INCLUDED
|
|
||||||
#define MY_DBUG_INCLUDED
|
|
||||||
|
|
||||||
#include "my_global.h" /* MYSQL_PLUGIN_IMPORT */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
#if !defined(DBUG_OFF)
|
|
||||||
|
|
||||||
struct _db_stack_frame_ {
|
|
||||||
const char *func; /* function name of the previous stack frame */
|
|
||||||
const char *file; /* filename of the function of previous frame */
|
|
||||||
uint level; /* this nesting level, highest bit enables tracing */
|
|
||||||
struct _db_stack_frame_ *prev; /* pointer to the previous frame */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _db_code_state_;
|
|
||||||
extern MYSQL_PLUGIN_IMPORT my_bool _dbug_on_;
|
|
||||||
extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
|
|
||||||
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
|
|
||||||
extern int _db_explain_init_(char *buf, size_t len);
|
|
||||||
extern int _db_is_pushed_(void);
|
|
||||||
extern void _db_setjmp_(void);
|
|
||||||
extern void _db_longjmp_(void);
|
|
||||||
extern void _db_process_(const char *name);
|
|
||||||
extern void _db_push_(const char *control);
|
|
||||||
extern void _db_pop_(void);
|
|
||||||
extern void _db_set_(const char *control);
|
|
||||||
extern void _db_set_init_(const char *control);
|
|
||||||
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
|
|
||||||
struct _db_stack_frame_ *_stack_frame_);
|
|
||||||
extern void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_);
|
|
||||||
extern void _db_pargs_(uint _line_,const char *keyword);
|
|
||||||
extern int _db_enabled_();
|
|
||||||
extern void _db_doprnt_(const char *format,...)
|
|
||||||
MY_ATTRIBUTE((format(printf, 1, 2)));
|
|
||||||
extern void _db_doputs_(const char *log);
|
|
||||||
extern void _db_dump_(uint _line_,const char *keyword,
|
|
||||||
const unsigned char *memory, size_t length);
|
|
||||||
extern void _db_end_(void);
|
|
||||||
extern void _db_lock_file_(void);
|
|
||||||
extern void _db_unlock_file_(void);
|
|
||||||
extern FILE *_db_fp_(void);
|
|
||||||
extern void _db_flush_();
|
|
||||||
extern const char* _db_get_func_(void);
|
|
||||||
|
|
||||||
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
|
|
||||||
_db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
|
|
||||||
#define DBUG_LEAVE _db_return_ (__LINE__, &_db_stack_frame_)
|
|
||||||
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
|
|
||||||
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
|
|
||||||
#define DBUG_EXECUTE(keyword,a1) \
|
|
||||||
do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
|
|
||||||
#define DBUG_EXECUTE_IF(keyword,a1) \
|
|
||||||
do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
|
|
||||||
#define DBUG_EVALUATE(keyword,a1,a2) \
|
|
||||||
(_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
|
|
||||||
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
|
|
||||||
(_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
|
|
||||||
#define DBUG_PRINT(keyword,arglist) \
|
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
if (_dbug_on_) \
|
|
||||||
{ \
|
|
||||||
_db_pargs_(__LINE__,keyword); \
|
|
||||||
if (_db_enabled_()) \
|
|
||||||
{ \
|
|
||||||
_db_doprnt_ arglist; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
/*
|
|
||||||
An alternate to DBUG_PRINT() macro, which takes a single string
|
|
||||||
as the second argument.
|
|
||||||
*/
|
|
||||||
#define DBUG_PUTS(keyword,arg) \
|
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
if (_dbug_on_) \
|
|
||||||
{ \
|
|
||||||
_db_pargs_(__LINE__,keyword); \
|
|
||||||
if (_db_enabled_()) \
|
|
||||||
{ \
|
|
||||||
_db_doputs_(arg); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define DBUG_PUSH(a1) _db_push_ (a1)
|
|
||||||
#define DBUG_POP() _db_pop_ ()
|
|
||||||
#define DBUG_SET(a1) _db_set_ (a1)
|
|
||||||
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
|
|
||||||
#define DBUG_PROCESS(a1) _db_process_(a1)
|
|
||||||
#define DBUG_FILE _db_fp_()
|
|
||||||
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
|
|
||||||
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
|
|
||||||
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
|
|
||||||
#define DBUG_END() _db_end_ ()
|
|
||||||
#define DBUG_LOCK_FILE _db_lock_file_()
|
|
||||||
#define DBUG_UNLOCK_FILE _db_unlock_file_()
|
|
||||||
#define DBUG_ASSERT(A) assert(A)
|
|
||||||
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
|
|
||||||
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
|
|
||||||
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
|
|
||||||
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
|
|
||||||
#ifndef _WIN32
|
|
||||||
#define DBUG_ABORT() (_db_flush_(), abort())
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
|
|
||||||
call abort() instead of _exit(2) (now it would cause a "test signal" popup).
|
|
||||||
*/
|
|
||||||
#include <crtdbg.h>
|
|
||||||
#define DBUG_ABORT() (_db_flush_(),\
|
|
||||||
(void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
|
|
||||||
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
|
|
||||||
_exit(2))
|
|
||||||
#endif
|
|
||||||
#define DBUG_CHECK_CRASH(func, op) \
|
|
||||||
do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \
|
|
||||||
DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0)
|
|
||||||
#define DBUG_CRASH_ENTER(func) \
|
|
||||||
DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter")
|
|
||||||
#define DBUG_CRASH_RETURN(val) \
|
|
||||||
DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return")
|
|
||||||
#define DBUG_CRASH_VOID_RETURN \
|
|
||||||
DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return")
|
|
||||||
|
|
||||||
/*
|
|
||||||
Make the program fail, without creating a core file.
|
|
||||||
abort() will send SIGABRT which (most likely) generates core.
|
|
||||||
Use SIGKILL instead, which cannot be caught.
|
|
||||||
We also pause the current thread, until the signal is actually delivered.
|
|
||||||
An alternative would be to use _exit(EXIT_FAILURE),
|
|
||||||
but then valgrind would report lots of memory leaks.
|
|
||||||
*/
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define DBUG_SUICIDE() DBUG_ABORT()
|
|
||||||
#else
|
|
||||||
extern void _db_suicide_();
|
|
||||||
extern void _db_flush_gcov_();
|
|
||||||
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else /* No debugger */
|
|
||||||
|
|
||||||
#define DBUG_ENTER(a1)
|
|
||||||
#define DBUG_LEAVE
|
|
||||||
#define DBUG_RETURN(a1) do { return(a1); } while(0)
|
|
||||||
#define DBUG_VOID_RETURN do { return; } while(0)
|
|
||||||
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
|
|
||||||
#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
|
|
||||||
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
|
|
||||||
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
|
|
||||||
#define DBUG_PRINT(keyword,arglist) do { } while(0)
|
|
||||||
#define DBUG_PUTS(keyword,arg) do { } while(0)
|
|
||||||
#define DBUG_LOG(keyword,arglist) do { } while(0)
|
|
||||||
#define DBUG_PUSH(a1) do { } while(0)
|
|
||||||
#define DBUG_SET(a1) do { } while(0)
|
|
||||||
#define DBUG_SET_INITIAL(a1) do { } while(0)
|
|
||||||
#define DBUG_POP() do { } while(0)
|
|
||||||
#define DBUG_PROCESS(a1) do { } while(0)
|
|
||||||
#define DBUG_SETJMP(a1) setjmp(a1)
|
|
||||||
#define DBUG_LONGJMP(a1) longjmp(a1)
|
|
||||||
#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
|
|
||||||
#define DBUG_END() do { } while(0)
|
|
||||||
#define DBUG_ASSERT(A) do { } while(0)
|
|
||||||
#define DBUG_LOCK_FILE do { } while(0)
|
|
||||||
#define DBUG_FILE (stderr)
|
|
||||||
#define DBUG_UNLOCK_FILE do { } while(0)
|
|
||||||
#define DBUG_EXPLAIN(buf,len)
|
|
||||||
#define DBUG_EXPLAIN_INITIAL(buf,len)
|
|
||||||
#define DEBUGGER_OFF do { } while(0)
|
|
||||||
#define DEBUGGER_ON do { } while(0)
|
|
||||||
#define DBUG_ABORT() do { } while(0)
|
|
||||||
#define DBUG_CRASH_ENTER(func)
|
|
||||||
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
|
|
||||||
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
|
|
||||||
#define DBUG_SUICIDE() do { } while(0)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EXTRA_DEBUG
|
|
||||||
/**
|
|
||||||
Sync points allow us to force the server to reach a certain line of code
|
|
||||||
and block there until the client tells the server it is ok to go on.
|
|
||||||
The client tells the server to block with SELECT GET_LOCK()
|
|
||||||
and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
|
|
||||||
concurrency problems
|
|
||||||
*/
|
|
||||||
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
|
|
||||||
debug_sync_point(lock_name,lock_timeout)
|
|
||||||
void debug_sync_point(const char* lock_name, uint lock_timeout);
|
|
||||||
#else
|
|
||||||
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
|
|
||||||
#endif /* EXTRA_DEBUG */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#if !defined(DBUG_OFF)
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
/*
|
|
||||||
A C++ interface to the DBUG_PUTS macro. The DBUG_LOG macro also
|
|
||||||
takes two arguments. The first argument is the keyword, as that of the
|
|
||||||
DBUG_PRINT. The 2nd argument 'v' will be passed to a C++ output stream.
|
|
||||||
This enables the use of C++ style output stream operator. In the code, it
|
|
||||||
will be used as follows:
|
|
||||||
|
|
||||||
DBUG_LOG("blob", "space: " << space_id);
|
|
||||||
|
|
||||||
Note: DBUG_PRINT() has a limitation of 1024 bytes for a single
|
|
||||||
print out. This limitation is not there for DBUG_PUTS and DBUG_LOG
|
|
||||||
macros.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define DBUG_LOG(keyword, v) do { \
|
|
||||||
std::ostringstream sout; \
|
|
||||||
sout << v; \
|
|
||||||
DBUG_PUTS(keyword, sout.str().c_str()); \
|
|
||||||
} while(0)
|
|
||||||
#endif /* DBUG_OFF */
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif /* MY_DBUG_INCLUDED */
|
|
||||||
@ -1,100 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef MY_DIR_H
|
|
||||||
#define MY_DIR_H
|
|
||||||
|
|
||||||
#include "my_global.h"
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Defines for my_dir and my_stat */
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define S_IROTH _S_IREAD
|
|
||||||
#define S_IFIFO _S_IFIFO
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_S_IFMT S_IFMT /* type of file */
|
|
||||||
#define MY_S_IFDIR S_IFDIR /* directory */
|
|
||||||
#define MY_S_IFCHR S_IFCHR /* character special */
|
|
||||||
#define MY_S_IFBLK S_IFBLK /* block special */
|
|
||||||
#define MY_S_IFREG S_IFREG /* regular */
|
|
||||||
#define MY_S_IFIFO S_IFIFO /* fifo */
|
|
||||||
#define MY_S_ISUID S_ISUID /* set user id on execution */
|
|
||||||
#define MY_S_ISGID S_ISGID /* set group id on execution */
|
|
||||||
#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */
|
|
||||||
#define MY_S_IREAD S_IREAD /* read permission, owner */
|
|
||||||
#define MY_S_IWRITE S_IWRITE /* write permission, owner */
|
|
||||||
#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */
|
|
||||||
|
|
||||||
#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR)
|
|
||||||
#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR)
|
|
||||||
#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK)
|
|
||||||
#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG)
|
|
||||||
#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO)
|
|
||||||
|
|
||||||
#define MY_DONT_SORT 512 /* my_lib; Don't sort files */
|
|
||||||
#define MY_WANT_STAT 1024 /* my_lib; stat files */
|
|
||||||
|
|
||||||
/* typedefs for my_dir & my_stat */
|
|
||||||
|
|
||||||
#if(_MSC_VER)
|
|
||||||
#define MY_STAT struct _stati64 /* 64 bit file size */
|
|
||||||
#else
|
|
||||||
#define MY_STAT struct stat /* Orginal struct have what we need */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Struct describing one file returned from my_dir */
|
|
||||||
typedef struct fileinfo
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
MY_STAT *mystat;
|
|
||||||
} FILEINFO;
|
|
||||||
|
|
||||||
typedef struct st_my_dir /* Struct returned from my_dir */
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
These members are just copies of parts of DYNAMIC_ARRAY structure,
|
|
||||||
which is allocated right after the end of MY_DIR structure (MEM_ROOT
|
|
||||||
for storing names is also resides there). We've left them here because
|
|
||||||
we don't want to change code that uses my_dir.
|
|
||||||
*/
|
|
||||||
struct fileinfo *dir_entry;
|
|
||||||
uint number_off_files;
|
|
||||||
} MY_DIR;
|
|
||||||
|
|
||||||
extern MY_DIR *my_dir(const char *path,myf MyFlags);
|
|
||||||
extern void my_dirend(MY_DIR *buffer);
|
|
||||||
extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
|
|
||||||
extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* MY_DIR_H */
|
|
||||||
|
|
||||||
@ -1,156 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef _my_getopt_h
|
|
||||||
#define _my_getopt_h
|
|
||||||
|
|
||||||
#include "my_sys.h" /* loglevel */
|
|
||||||
|
|
||||||
C_MODE_START
|
|
||||||
|
|
||||||
#define GET_NO_ARG 1
|
|
||||||
#define GET_BOOL 2
|
|
||||||
#define GET_INT 3
|
|
||||||
#define GET_UINT 4
|
|
||||||
#define GET_LONG 5
|
|
||||||
#define GET_ULONG 6
|
|
||||||
#define GET_LL 7
|
|
||||||
#define GET_ULL 8
|
|
||||||
#define GET_STR 9
|
|
||||||
#define GET_STR_ALLOC 10
|
|
||||||
#define GET_DISABLED 11
|
|
||||||
#define GET_ENUM 12
|
|
||||||
#define GET_SET 13
|
|
||||||
#define GET_DOUBLE 14
|
|
||||||
#define GET_FLAGSET 15
|
|
||||||
#define GET_PASSWORD 16
|
|
||||||
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
#define GET_INT32 GET_INT
|
|
||||||
#define GET_UINT32 GET_UINT
|
|
||||||
#elif SIZEOF_LONG == 4
|
|
||||||
#define GET_INT32 GET_LONG
|
|
||||||
#define GET_UINT32 GET_ULONG
|
|
||||||
#else
|
|
||||||
#error Neither int or long is of 4 bytes width
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define GET_ASK_ADDR 128
|
|
||||||
#define GET_TYPE_MASK 127
|
|
||||||
|
|
||||||
/**
|
|
||||||
Enumeration of the my_option::arg_type attributes.
|
|
||||||
It should be noted that for historical reasons variables with the combination
|
|
||||||
arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts
|
|
||||||
arguments. This is someone counter intuitive and care should be taken
|
|
||||||
if the code is refactored.
|
|
||||||
*/
|
|
||||||
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
|
|
||||||
|
|
||||||
struct st_typelib;
|
|
||||||
|
|
||||||
struct my_option
|
|
||||||
{
|
|
||||||
const char *name; /**< Name of the option. name=NULL
|
|
||||||
marks the end of the my_option[]
|
|
||||||
array.
|
|
||||||
*/
|
|
||||||
int id; /**< For 0<id<=255 it's means one
|
|
||||||
character for a short option
|
|
||||||
(like -A), if >255 no short option
|
|
||||||
is created, but a long option still
|
|
||||||
can be identified uniquely in the
|
|
||||||
my_get_one_option() callback.
|
|
||||||
If an opton needs neither special
|
|
||||||
treatment in the my_get_one_option()
|
|
||||||
nor one-letter short equivalent
|
|
||||||
use id=0.
|
|
||||||
id=-1 is a special case and is used
|
|
||||||
to generate deprecation warnings for
|
|
||||||
plugin options. It should not be
|
|
||||||
used for anything else.
|
|
||||||
*/
|
|
||||||
const char *comment; /**< option comment, for autom. --help.
|
|
||||||
if it's NULL the option is not
|
|
||||||
visible in --help.
|
|
||||||
*/
|
|
||||||
void *value; /**< A pointer to the variable value */
|
|
||||||
void *u_max_value; /**< The user def. max variable value */
|
|
||||||
struct st_typelib *typelib; /**< Pointer to possible values */
|
|
||||||
ulong var_type; /**< GET_BOOL, GET_ULL, etc */
|
|
||||||
enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
|
|
||||||
longlong def_value; /**< Default value */
|
|
||||||
longlong min_value; /**< Min allowed value (for numbers) */
|
|
||||||
ulonglong max_value; /**< Max allowed value (for numbers) */
|
|
||||||
longlong sub_size; /**< Unused */
|
|
||||||
long block_size; /**< Value should be a mult. of this (for numbers) */
|
|
||||||
void *app_type; /**< To be used by an application */
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *);
|
|
||||||
/**
|
|
||||||
Used to retrieve a reference to the object (variable) that holds the value
|
|
||||||
for the given option. For example, if var_type is GET_UINT, the function
|
|
||||||
must return a pointer to a variable of type uint. A argument is stored in
|
|
||||||
the location pointed to by the returned pointer.
|
|
||||||
*/
|
|
||||||
typedef void *(*my_getopt_value)(const char *, size_t, const struct my_option *,
|
|
||||||
int *);
|
|
||||||
|
|
||||||
|
|
||||||
extern char *disabled_my_option;
|
|
||||||
extern my_bool my_getopt_print_errors;
|
|
||||||
extern my_bool my_getopt_skip_unknown;
|
|
||||||
extern my_error_reporter my_getopt_error_reporter;
|
|
||||||
|
|
||||||
extern int handle_options (int *argc, char ***argv,
|
|
||||||
const struct my_option *longopts, my_get_one_option);
|
|
||||||
extern int my_handle_options (int *argc, char ***argv,
|
|
||||||
const struct my_option *longopts,
|
|
||||||
my_get_one_option,
|
|
||||||
const char **command_list, my_bool ignore_unknown_option);
|
|
||||||
extern void print_cmdline_password_warning();
|
|
||||||
extern void my_cleanup_options(const struct my_option *options);
|
|
||||||
extern void my_cleanup_options(const struct my_option *options);
|
|
||||||
extern void my_print_help(const struct my_option *options);
|
|
||||||
extern void my_print_variables(const struct my_option *options);
|
|
||||||
extern void my_print_variables_ex(const struct my_option *options, FILE* file);
|
|
||||||
extern void my_getopt_register_get_addr(my_getopt_value);
|
|
||||||
|
|
||||||
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
|
|
||||||
my_bool *fix);
|
|
||||||
longlong getopt_ll_limit_value(longlong, const struct my_option *,
|
|
||||||
my_bool *fix);
|
|
||||||
double getopt_double_limit_value(double num, const struct my_option *optp,
|
|
||||||
my_bool *fix);
|
|
||||||
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
|
|
||||||
ulonglong max_of_int_range(int var_type);
|
|
||||||
|
|
||||||
ulonglong getopt_double2ulonglong(double);
|
|
||||||
double getopt_ulonglong2double(ulonglong);
|
|
||||||
|
|
||||||
C_MODE_END
|
|
||||||
|
|
||||||
#endif /* _my_getopt_h */
|
|
||||||
|
|
||||||
@ -1,804 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef MY_GLOBAL_INCLUDED
|
|
||||||
#define MY_GLOBAL_INCLUDED
|
|
||||||
|
|
||||||
/*
|
|
||||||
This include file should be included first in every header file.
|
|
||||||
|
|
||||||
This makes sure my_config.h is included to get platform specific
|
|
||||||
symbols defined and it makes sure a lot of platform/compiler
|
|
||||||
differences are mitigated.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "my_config.h"
|
|
||||||
|
|
||||||
#define __STDC_LIMIT_MACROS /* Enable C99 limit macros */
|
|
||||||
#define __STDC_FORMAT_MACROS /* Enable C99 printf format macros */
|
|
||||||
#define _USE_MATH_DEFINES /* Get access to M_PI, M_E, etc. in math.h */
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
/* Include common headers.*/
|
|
||||||
# include <winsock2.h>
|
|
||||||
# include <ws2tcpip.h> /* SOCKET */
|
|
||||||
# include <io.h> /* access(), chmod() */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <float.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <errno.h> /* Recommended by debian */
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#endif
|
|
||||||
#if !defined(_WIN32)
|
|
||||||
#include <netdb.h>
|
|
||||||
#endif
|
|
||||||
#ifdef MY_MSCRT_DEBUG
|
|
||||||
#include <crtdbg.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
A lot of our programs uses asserts, so better to always include it
|
|
||||||
This also fixes a problem when people uses DBUG_ASSERT without including
|
|
||||||
assert.h
|
|
||||||
*/
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
/* Include standard definitions of operator new and delete. */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
# include <new>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "my_compiler.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
InnoDB depends on some MySQL internals which other plugins should not
|
|
||||||
need. This is because of InnoDB's foreign key support, "safe" binlog
|
|
||||||
truncation, and other similar legacy features.
|
|
||||||
|
|
||||||
We define accessors for these internals unconditionally, but do not
|
|
||||||
expose them in mysql/plugin.h. They are declared in ha_innodb.h for
|
|
||||||
InnoDB's use.
|
|
||||||
*/
|
|
||||||
#define INNODB_COMPATIBILITY_HOOKS
|
|
||||||
|
|
||||||
/* Macros to make switching between C and C++ mode easier */
|
|
||||||
#ifdef __cplusplus
|
|
||||||
#define C_MODE_START extern "C" {
|
|
||||||
#define C_MODE_END }
|
|
||||||
#else
|
|
||||||
#define C_MODE_START
|
|
||||||
#define C_MODE_END
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
|
|
||||||
#define HAVE_PSI_INTERFACE
|
|
||||||
#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
|
|
||||||
|
|
||||||
/* Make it easier to add conditional code in _expressions_ */
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define IF_WIN(A,B) A
|
|
||||||
#else
|
|
||||||
#define IF_WIN(A,B) B
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
/*
|
|
||||||
off_t is 32 bit long. We do not use C runtime functions
|
|
||||||
with off_t but native Win32 file IO APIs, that work with
|
|
||||||
64 bit offsets.
|
|
||||||
*/
|
|
||||||
#undef SIZEOF_OFF_T
|
|
||||||
#define SIZEOF_OFF_T 8
|
|
||||||
|
|
||||||
static inline void sleep(unsigned long seconds)
|
|
||||||
{
|
|
||||||
Sleep(seconds * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Define missing access() modes. */
|
|
||||||
#define F_OK 0
|
|
||||||
#define W_OK 2
|
|
||||||
#define R_OK 4 /* Test for read permission. */
|
|
||||||
|
|
||||||
/* Define missing file locking constants. */
|
|
||||||
#define F_RDLCK 1
|
|
||||||
#define F_WRLCK 2
|
|
||||||
#define F_UNLCK 3
|
|
||||||
#define F_TO_EOF 0x3FFFFFFF
|
|
||||||
|
|
||||||
#define O_NONBLOCK 1 /* For emulation of fcntl() */
|
|
||||||
|
|
||||||
/*
|
|
||||||
SHUT_RDWR is called SD_BOTH in windows and
|
|
||||||
is defined to 2 in winsock2.h
|
|
||||||
#define SD_BOTH 0x02
|
|
||||||
*/
|
|
||||||
#define SHUT_RDWR 0x02
|
|
||||||
|
|
||||||
/* Shared memory and named pipe connections are supported. */
|
|
||||||
#define shared_memory_buffer_length 16000
|
|
||||||
#define default_shared_memory_base_name "MYSQL"
|
|
||||||
#endif /* _WIN32*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
Cast a member of a structure to the structure that contains it.
|
|
||||||
|
|
||||||
@param ptr Pointer to the member.
|
|
||||||
@param type Type of the structure that contains the member.
|
|
||||||
@param member Name of the member within the structure.
|
|
||||||
*/
|
|
||||||
#define my_container_of(ptr, type, member) \
|
|
||||||
((type *)((char *)ptr - offsetof(type, member)))
|
|
||||||
|
|
||||||
/* an assert that works at compile-time. only for constant expression */
|
|
||||||
#define compile_time_assert(X) \
|
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
typedef char compile_time_assert[(X) ? 1 : -1] MY_ATTRIBUTE((unused)); \
|
|
||||||
} while(0)
|
|
||||||
|
|
||||||
#define QUOTE_ARG(x) #x /* Quote argument (before cpp) */
|
|
||||||
#define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define SO_EXT ".dll"
|
|
||||||
#elif defined(__APPLE__)
|
|
||||||
#define SO_EXT ".dylib"
|
|
||||||
#else
|
|
||||||
#define SO_EXT ".so"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_UINT)
|
|
||||||
typedef unsigned int uint;
|
|
||||||
typedef unsigned short ushort;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define swap_variables(t, a, b) { t dummy; dummy= a; a= b; b= dummy; }
|
|
||||||
#define MY_TEST(a) ((a) ? 1 : 0)
|
|
||||||
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
|
|
||||||
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
|
|
||||||
#define test_all_bits(a,b) (((a) & (b)) == (b))
|
|
||||||
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
|
|
||||||
|
|
||||||
/* Define some general constants */
|
|
||||||
#ifndef TRUE
|
|
||||||
#define TRUE (1) /* Logical true */
|
|
||||||
#define FALSE (0) /* Logical false */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Some types that is different between systems */
|
|
||||||
|
|
||||||
typedef int File; /* File descriptor */
|
|
||||||
#ifdef _WIN32
|
|
||||||
typedef SOCKET my_socket;
|
|
||||||
#else
|
|
||||||
typedef int my_socket; /* File descriptor for sockets */
|
|
||||||
#define INVALID_SOCKET -1
|
|
||||||
#endif
|
|
||||||
C_MODE_START
|
|
||||||
typedef void (*sig_return)();/* Returns type from signal */
|
|
||||||
C_MODE_END
|
|
||||||
#if defined(__GNUC__)
|
|
||||||
typedef char pchar; /* Mixed prototypes can take char */
|
|
||||||
typedef char pbool; /* Mixed prototypes can take char */
|
|
||||||
#else
|
|
||||||
typedef int pchar; /* Mixed prototypes can't take char */
|
|
||||||
typedef int pbool; /* Mixed prototypes can't take char */
|
|
||||||
#endif
|
|
||||||
C_MODE_START
|
|
||||||
typedef int (*qsort_cmp)(const void *,const void *);
|
|
||||||
typedef int (*qsort_cmp2)(const void*, const void *,const void *);
|
|
||||||
C_MODE_END
|
|
||||||
#ifdef _WIN32
|
|
||||||
typedef int socket_len_t;
|
|
||||||
typedef int sigset_t;
|
|
||||||
typedef int mode_t;
|
|
||||||
typedef SSIZE_T ssize_t;
|
|
||||||
#else
|
|
||||||
typedef socklen_t socket_len_t;
|
|
||||||
#endif
|
|
||||||
typedef socket_len_t SOCKET_SIZE_TYPE; /* Used by NDB */
|
|
||||||
|
|
||||||
/* file create flags */
|
|
||||||
|
|
||||||
#ifndef O_SHARE /* Probably not windows */
|
|
||||||
#define O_SHARE 0 /* Flag to my_open for shared files */
|
|
||||||
#ifndef O_BINARY
|
|
||||||
#define O_BINARY 0 /* Flag to my_open for binary files */
|
|
||||||
#endif
|
|
||||||
#ifndef FILE_BINARY
|
|
||||||
#define FILE_BINARY O_BINARY /* Flag to my_fopen for binary streams */
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_FCNTL
|
|
||||||
#define HAVE_FCNTL_LOCK
|
|
||||||
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
|
|
||||||
#endif
|
|
||||||
#endif /* O_SHARE */
|
|
||||||
|
|
||||||
#ifndef O_TEMPORARY
|
|
||||||
#define O_TEMPORARY 0
|
|
||||||
#endif
|
|
||||||
#ifndef O_SHORT_LIVED
|
|
||||||
#define O_SHORT_LIVED 0
|
|
||||||
#endif
|
|
||||||
#ifndef O_NOFOLLOW
|
|
||||||
#define O_NOFOLLOW 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* additional file share flags for win32 */
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define _SH_DENYRWD 0x110 /* deny read/write mode & delete */
|
|
||||||
#define _SH_DENYWRD 0x120 /* deny write mode & delete */
|
|
||||||
#define _SH_DENYRDD 0x130 /* deny read mode & delete */
|
|
||||||
#define _SH_DENYDEL 0x140 /* deny delete only */
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
|
|
||||||
/* General constants */
|
|
||||||
#define FN_LEN 256 /* Max file name len */
|
|
||||||
#define FN_HEADLEN 253 /* Max length of filepart of file name */
|
|
||||||
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
|
|
||||||
#define FN_REFLEN 512 /* Max length of full path-name */
|
|
||||||
#define FN_REFLEN_SE 4000 /* Max length of full path-name in SE */
|
|
||||||
#define FN_EXTCHAR '.'
|
|
||||||
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
|
|
||||||
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
|
|
||||||
#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define FN_LIBCHAR '\\'
|
|
||||||
#define FN_LIBCHAR2 '/'
|
|
||||||
#define FN_DIRSEP "/\\" /* Valid directory separators */
|
|
||||||
#define FN_EXEEXT ".exe"
|
|
||||||
#define FN_SOEXT ".dll"
|
|
||||||
#define FN_ROOTDIR "\\"
|
|
||||||
#define FN_DEVCHAR ':'
|
|
||||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
|
||||||
#else
|
|
||||||
#define FN_LIBCHAR '/'
|
|
||||||
/*
|
|
||||||
FN_LIBCHAR2 is not defined on !Windows. Use is_directory_separator().
|
|
||||||
*/
|
|
||||||
#define FN_DIRSEP "/" /* Valid directory separators */
|
|
||||||
#define FN_EXEEXT ""
|
|
||||||
#define FN_SOEXT ".so"
|
|
||||||
#define FN_ROOTDIR "/"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline int is_directory_separator(char c)
|
|
||||||
{
|
|
||||||
#ifdef _WIN32
|
|
||||||
return c == FN_LIBCHAR || c == FN_LIBCHAR2;
|
|
||||||
#else
|
|
||||||
return c == FN_LIBCHAR;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
MY_FILE_MIN is Windows speciality and is used to quickly detect
|
|
||||||
the mismatch of CRT and mysys file IO usage on Windows at runtime.
|
|
||||||
CRT file descriptors can be in the range 0-2047, whereas descriptors returned
|
|
||||||
by my_open() will start with 2048. If a file descriptor with value less then
|
|
||||||
MY_FILE_MIN is passed to mysys IO function, chances are it stemms from
|
|
||||||
open()/fileno() and not my_open()/my_fileno.
|
|
||||||
|
|
||||||
For Posix, mysys functions are light wrappers around libc, and MY_FILE_MIN
|
|
||||||
is logically 0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define MY_FILE_MIN 2048
|
|
||||||
#else
|
|
||||||
#define MY_FILE_MIN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
MY_NFILE is the default size of my_file_info array.
|
|
||||||
|
|
||||||
It is larger on Windows, because it all file handles are stored in my_file_info
|
|
||||||
Default size is 16384 and this should be enough for most cases.If it is not
|
|
||||||
enough, --max-open-files with larger value can be used.
|
|
||||||
|
|
||||||
For Posix , my_file_info array is only used to store filenames for
|
|
||||||
error reporting and its size is not a limitation for number of open files.
|
|
||||||
*/
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define MY_NFILE (16384 + MY_FILE_MIN)
|
|
||||||
#else
|
|
||||||
#define MY_NFILE 64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define OS_FILE_LIMIT UINT_MAX
|
|
||||||
|
|
||||||
/*
|
|
||||||
Io buffer size; Must be a power of 2 and a multiple of 512. May be
|
|
||||||
smaller what the disk page size. This influences the speed of the
|
|
||||||
isam btree library. eg to big to slow.
|
|
||||||
*/
|
|
||||||
#define IO_SIZE 4096
|
|
||||||
/*
|
|
||||||
How much overhead does malloc have. The code often allocates
|
|
||||||
something like 1024-MALLOC_OVERHEAD bytes
|
|
||||||
*/
|
|
||||||
#define MALLOC_OVERHEAD 8
|
|
||||||
|
|
||||||
/* get memory in huncs */
|
|
||||||
#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD)
|
|
||||||
/* Typical record cash */
|
|
||||||
#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD)
|
|
||||||
/* Typical key cash */
|
|
||||||
#define KEY_CACHE_SIZE (uint) (8*1024*1024)
|
|
||||||
/* Default size of a key cache block */
|
|
||||||
#define KEY_CACHE_BLOCK_SIZE (uint) 1024
|
|
||||||
|
|
||||||
|
|
||||||
/* Some defines of functions for portability */
|
|
||||||
|
|
||||||
#if (_WIN32)
|
|
||||||
#if !defined(_WIN64)
|
|
||||||
inline double my_ulonglong2double(unsigned long long value)
|
|
||||||
{
|
|
||||||
long long nr=(long long) value;
|
|
||||||
if (nr >= 0)
|
|
||||||
return (double) nr;
|
|
||||||
return (18446744073709551616.0 + (double) nr);
|
|
||||||
}
|
|
||||||
#define ulonglong2double my_ulonglong2double
|
|
||||||
#define my_off_t2double my_ulonglong2double
|
|
||||||
#endif /* _WIN64 */
|
|
||||||
inline unsigned long long my_double2ulonglong(double d)
|
|
||||||
{
|
|
||||||
double t= d - (double) 0x8000000000000000ULL;
|
|
||||||
|
|
||||||
if (t >= 0)
|
|
||||||
return ((unsigned long long) t) + 0x8000000000000000ULL;
|
|
||||||
return (unsigned long long) d;
|
|
||||||
}
|
|
||||||
#define double2ulonglong my_double2ulonglong
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
#ifndef ulonglong2double
|
|
||||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
|
||||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
|
||||||
#endif
|
|
||||||
#ifndef double2ulonglong
|
|
||||||
#define double2ulonglong(A) ((ulonglong) (double) (A))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL)
|
|
||||||
#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL
|
|
||||||
#define INT_MIN32 (~0x7FFFFFFFL)
|
|
||||||
#define INT_MAX32 0x7FFFFFFFL
|
|
||||||
#define UINT_MAX32 0xFFFFFFFFL
|
|
||||||
#define INT_MIN24 (~0x007FFFFF)
|
|
||||||
#define INT_MAX24 0x007FFFFF
|
|
||||||
#define UINT_MAX24 0x00FFFFFF
|
|
||||||
#define INT_MIN16 (~0x7FFF)
|
|
||||||
#define INT_MAX16 0x7FFF
|
|
||||||
#define UINT_MAX16 0xFFFF
|
|
||||||
#define INT_MIN8 (~0x7F)
|
|
||||||
#define INT_MAX8 0x7F
|
|
||||||
#define UINT_MAX8 0xFF
|
|
||||||
|
|
||||||
#ifndef SIZE_T_MAX
|
|
||||||
#define SIZE_T_MAX (~((size_t) 0))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Our ifdef trickery for my_isfinite does not work with gcc/solaris unless we:
|
|
||||||
#ifdef HAVE_IEEEFP_H
|
|
||||||
#include <ieeefp.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (__cplusplus >= 201103L)
|
|
||||||
/* For C++11 use the new std functions rather than C99 macros. */
|
|
||||||
#include <cmath>
|
|
||||||
#define my_isfinite(X) std::isfinite(X)
|
|
||||||
#define my_isnan(X) std::isnan(X)
|
|
||||||
#define my_isinf(X) std::isinf(X)
|
|
||||||
#else
|
|
||||||
#ifdef HAVE_LLVM_LIBCPP /* finite is deprecated in libc++ */
|
|
||||||
#define my_isfinite(X) isfinite(X)
|
|
||||||
#elif defined _WIN32
|
|
||||||
#define my_isfinite(X) _finite(X)
|
|
||||||
#else
|
|
||||||
#define my_isfinite(X) finite(X)
|
|
||||||
#endif
|
|
||||||
#define my_isnan(X) isnan(X)
|
|
||||||
#ifdef HAVE_ISINF
|
|
||||||
/* System-provided isinf() is available and safe to use */
|
|
||||||
#define my_isinf(X) isinf(X)
|
|
||||||
#else /* !HAVE_ISINF */
|
|
||||||
#define my_isinf(X) (!my_isfinite(X) && !my_isnan(X))
|
|
||||||
#endif
|
|
||||||
#endif /* __cplusplus >= 201103L */
|
|
||||||
|
|
||||||
/*
|
|
||||||
Max size that must be added to a so that we know Size to make
|
|
||||||
adressable obj.
|
|
||||||
*/
|
|
||||||
#if SIZEOF_CHARP == 4
|
|
||||||
typedef long my_ptrdiff_t;
|
|
||||||
#else
|
|
||||||
typedef long long my_ptrdiff_t;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
|
|
||||||
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
|
|
||||||
/* Size to make adressable obj. */
|
|
||||||
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
|
|
||||||
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
|
|
||||||
|
|
||||||
/*
|
|
||||||
Custom version of standard offsetof() macro which can be used to get
|
|
||||||
offsets of members in class for non-POD types (according to the current
|
|
||||||
version of C++ standard offsetof() macro can't be used in such cases and
|
|
||||||
attempt to do so causes warnings to be emitted, OTOH in many cases it is
|
|
||||||
still OK to assume that all instances of the class has the same offsets
|
|
||||||
for the same members).
|
|
||||||
|
|
||||||
This is temporary solution which should be removed once File_parser class
|
|
||||||
and related routines are refactored.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define my_offsetof(TYPE, MEMBER) \
|
|
||||||
((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
|
|
||||||
|
|
||||||
#define NullS (char *) 0
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define STDCALL __stdcall
|
|
||||||
#else
|
|
||||||
#define STDCALL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Typdefs for easyier portability */
|
|
||||||
|
|
||||||
typedef unsigned char uchar; /* Short for unsigned char */
|
|
||||||
typedef signed char int8; /* Signed integer >= 8 bits */
|
|
||||||
typedef unsigned char uint8; /* Unsigned integer >= 8 bits */
|
|
||||||
typedef short int16;
|
|
||||||
typedef unsigned short uint16;
|
|
||||||
#if SIZEOF_INT == 4
|
|
||||||
typedef int int32;
|
|
||||||
typedef unsigned int uint32;
|
|
||||||
#elif SIZEOF_LONG == 4
|
|
||||||
typedef long int32;
|
|
||||||
typedef unsigned long uint32;
|
|
||||||
#else
|
|
||||||
#error Neither int or long is of 4 bytes width
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_ULONG)
|
|
||||||
typedef unsigned long ulong; /* Short for unsigned long */
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
Using [unsigned] long long is preferable as [u]longlong because we use
|
|
||||||
[unsigned] long long unconditionally in many places,
|
|
||||||
for example in constants with [U]LL suffix.
|
|
||||||
*/
|
|
||||||
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
|
|
||||||
typedef long long int longlong;
|
|
||||||
typedef longlong int64;
|
|
||||||
typedef ulonglong uint64;
|
|
||||||
|
|
||||||
#if defined (_WIN32)
|
|
||||||
typedef unsigned __int64 my_ulonglong;
|
|
||||||
#else
|
|
||||||
typedef unsigned long long my_ulonglong;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SIZEOF_CHARP == SIZEOF_INT
|
|
||||||
typedef int intptr;
|
|
||||||
#elif SIZEOF_CHARP == SIZEOF_LONG
|
|
||||||
typedef long intptr;
|
|
||||||
#elif SIZEOF_CHARP == SIZEOF_LONG_LONG
|
|
||||||
typedef long long intptr;
|
|
||||||
#else
|
|
||||||
#error sizeof(void *) is neither sizeof(int) nor sizeof(long) nor sizeof(long long)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MY_ERRPTR ((void*)(intptr)1)
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
typedef unsigned long long my_off_t;
|
|
||||||
typedef unsigned long long os_off_t;
|
|
||||||
#else
|
|
||||||
typedef off_t os_off_t;
|
|
||||||
#if SIZEOF_OFF_T > 4
|
|
||||||
typedef ulonglong my_off_t;
|
|
||||||
#else
|
|
||||||
typedef unsigned long my_off_t;
|
|
||||||
#endif
|
|
||||||
#endif /*_WIN32*/
|
|
||||||
#define MY_FILEPOS_ERROR (~(my_off_t) 0)
|
|
||||||
|
|
||||||
/*
|
|
||||||
TODO Convert these to use Bitmap class.
|
|
||||||
*/
|
|
||||||
typedef ulonglong table_map; /* Used for table bits in join */
|
|
||||||
typedef ulonglong nesting_map; /* Used for flags of nesting constructs */
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
#define socket_errno WSAGetLastError()
|
|
||||||
#define SOCKET_EINTR WSAEINTR
|
|
||||||
#define SOCKET_EAGAIN WSAEINPROGRESS
|
|
||||||
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
|
|
||||||
#define SOCKET_EADDRINUSE WSAEADDRINUSE
|
|
||||||
#define SOCKET_ETIMEDOUT WSAETIMEDOUT
|
|
||||||
#define SOCKET_ECONNRESET WSAECONNRESET
|
|
||||||
#define SOCKET_ENFILE ENFILE
|
|
||||||
#define SOCKET_EMFILE EMFILE
|
|
||||||
#else /* Unix */
|
|
||||||
#define socket_errno errno
|
|
||||||
#define closesocket(A) close(A)
|
|
||||||
#define SOCKET_EINTR EINTR
|
|
||||||
#define SOCKET_EAGAIN EAGAIN
|
|
||||||
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
|
||||||
#define SOCKET_EADDRINUSE EADDRINUSE
|
|
||||||
#define SOCKET_ETIMEDOUT ETIMEDOUT
|
|
||||||
#define SOCKET_ECONNRESET ECONNRESET
|
|
||||||
#define SOCKET_ENFILE ENFILE
|
|
||||||
#define SOCKET_EMFILE EMFILE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef int myf; /* Type of MyFlags in my_funcs */
|
|
||||||
typedef char my_bool; /* Small bool */
|
|
||||||
|
|
||||||
/* Macros for converting *constants* to the right type */
|
|
||||||
#define MYF(v) (myf) (v)
|
|
||||||
|
|
||||||
/* Some helper macros */
|
|
||||||
#define YESNO(X) ((X) ? "yes" : "no")
|
|
||||||
|
|
||||||
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
|
|
||||||
|
|
||||||
#include <my_byteorder.h>
|
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET_utf8
|
|
||||||
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
|
|
||||||
#else
|
|
||||||
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
|
||||||
#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name)
|
|
||||||
#define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0)
|
|
||||||
#define dlclose(lib) FreeLibrary((HMODULE)lib)
|
|
||||||
#ifndef HAVE_DLOPEN
|
|
||||||
#define HAVE_DLOPEN
|
|
||||||
#endif
|
|
||||||
#define DLERROR_GENERATE(errmsg, error_number) \
|
|
||||||
char win_errormsg[2048]; \
|
|
||||||
if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, \
|
|
||||||
0, error_number, 0, win_errormsg, 2048, NULL)) \
|
|
||||||
{ \
|
|
||||||
char *ptr; \
|
|
||||||
for (ptr= &win_errormsg[0] + strlen(win_errormsg) - 1; \
|
|
||||||
ptr >= &win_errormsg[0] && strchr("\r\n\t\0x20", *ptr); \
|
|
||||||
ptr--) \
|
|
||||||
*ptr= 0; \
|
|
||||||
errmsg= win_errormsg; \
|
|
||||||
} \
|
|
||||||
else \
|
|
||||||
errmsg= ""
|
|
||||||
#define dlerror() ""
|
|
||||||
#define dlopen_errno GetLastError()
|
|
||||||
|
|
||||||
#else /* _WIN32 */
|
|
||||||
#define DLERROR_GENERATE(errmsg, error_number) errmsg= dlerror()
|
|
||||||
#define dlopen_errno errno
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
/* Length of decimal number represented by INT32. */
|
|
||||||
#define MY_INT32_NUM_DECIMAL_DIGITS 11U
|
|
||||||
|
|
||||||
/* Length of decimal number represented by INT64. */
|
|
||||||
#define MY_INT64_NUM_DECIMAL_DIGITS 21U
|
|
||||||
|
|
||||||
/* Define some useful general macros (should be done after all headers). */
|
|
||||||
#define MY_MAX(a, b) ((a) > (b) ? (a) : (b))
|
|
||||||
#define MY_MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
||||||
|
|
||||||
#if !defined(__cplusplus) && !defined(bool)
|
|
||||||
#define bool In_C_you_should_use_my_bool_instead()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
|
|
||||||
(i.e variables) for usage in storage engine loadable plugins.
|
|
||||||
Outside of Windows, it is dummy.
|
|
||||||
*/
|
|
||||||
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
|
|
||||||
#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
|
|
||||||
#else
|
|
||||||
#define MYSQL_PLUGIN_IMPORT
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <my_dbug.h>
|
|
||||||
|
|
||||||
#ifdef EMBEDDED_LIBRARY
|
|
||||||
#define NO_EMBEDDED_ACCESS_CHECKS
|
|
||||||
/* Things we don't need in the embedded version of MySQL */
|
|
||||||
#undef HAVE_OPENSSL
|
|
||||||
#endif /* EMBEDDED_LIBRARY */
|
|
||||||
|
|
||||||
|
|
||||||
enum loglevel {
|
|
||||||
ERROR_LEVEL= 0,
|
|
||||||
WARNING_LEVEL= 1,
|
|
||||||
INFORMATION_LEVEL= 2
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
/****************************************************************************
|
|
||||||
** Replacements for localtime_r and gmtime_r
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static inline struct tm *localtime_r(const time_t *timep, struct tm *tmp)
|
|
||||||
{
|
|
||||||
localtime_s(tmp, timep);
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct tm *gmtime_r(const time_t *clock, struct tm *res)
|
|
||||||
{
|
|
||||||
gmtime_s(res, clock);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
#ifndef HAVE_STRUCT_TIMESPEC /* Windows before VS2015 */
|
|
||||||
/*
|
|
||||||
Declare a union to make sure FILETIME is properly aligned
|
|
||||||
so it can be used directly as a 64 bit value. The value
|
|
||||||
stored is in 100ns units.
|
|
||||||
*/
|
|
||||||
union ft64 {
|
|
||||||
FILETIME ft;
|
|
||||||
__int64 i64;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct timespec {
|
|
||||||
union ft64 tv;
|
|
||||||
/* The max timeout value in millisecond for native_cond_timedwait */
|
|
||||||
long max_timeout_msec;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* !HAVE_STRUCT_TIMESPEC */
|
|
||||||
|
|
||||||
C_MODE_START
|
|
||||||
extern ulonglong my_getsystime(void);
|
|
||||||
C_MODE_END
|
|
||||||
|
|
||||||
static inline void set_timespec_nsec(struct timespec *abstime, ulonglong nsec)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_STRUCT_TIMESPEC
|
|
||||||
ulonglong now= my_getsystime() + (nsec / 100);
|
|
||||||
ulonglong tv_sec= now / 10000000ULL;
|
|
||||||
#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
|
|
||||||
/* Ensure that the number of seconds don't overflow. */
|
|
||||||
tv_sec= MY_MIN(tv_sec, ((ulonglong)INT_MAX32));
|
|
||||||
#endif
|
|
||||||
abstime->tv_sec= (time_t)tv_sec;
|
|
||||||
abstime->tv_nsec= (now % 10000000ULL) * 100 + (nsec % 100);
|
|
||||||
#else /* !HAVE_STRUCT_TIMESPEC */
|
|
||||||
ulonglong max_timeout_msec= (nsec / 1000000);
|
|
||||||
union ft64 tv;
|
|
||||||
GetSystemTimeAsFileTime(&tv.ft);
|
|
||||||
abstime->tv.i64= tv.i64 + (__int64)(nsec / 100);
|
|
||||||
#if SIZEOF_LONG < SIZEOF_LONG_LONG
|
|
||||||
/* Ensure that the msec value doesn't overflow. */
|
|
||||||
max_timeout_msec= MY_MIN(max_timeout_msec, ((ulonglong)INT_MAX32));
|
|
||||||
#endif
|
|
||||||
abstime->max_timeout_msec= (long)max_timeout_msec;
|
|
||||||
#endif /* !HAVE_STRUCT_TIMESPEC */
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void set_timespec(struct timespec *abstime, ulonglong sec)
|
|
||||||
{
|
|
||||||
set_timespec_nsec(abstime, sec * 1000000000ULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Compare two timespec structs.
|
|
||||||
|
|
||||||
@retval 1 If ts1 ends after ts2.
|
|
||||||
@retval -1 If ts1 ends before ts2.
|
|
||||||
@retval 0 If ts1 is equal to ts2.
|
|
||||||
*/
|
|
||||||
static inline int cmp_timespec(struct timespec *ts1, struct timespec *ts2)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_STRUCT_TIMESPEC
|
|
||||||
if (ts1->tv_sec > ts2->tv_sec ||
|
|
||||||
(ts1->tv_sec == ts2->tv_sec && ts1->tv_nsec > ts2->tv_nsec))
|
|
||||||
return 1;
|
|
||||||
if (ts1->tv_sec < ts2->tv_sec ||
|
|
||||||
(ts1->tv_sec == ts2->tv_sec && ts1->tv_nsec < ts2->tv_nsec))
|
|
||||||
return -1;
|
|
||||||
#else
|
|
||||||
if (ts1->tv.i64 > ts2->tv.i64)
|
|
||||||
return 1;
|
|
||||||
if (ts1->tv.i64 < ts2->tv.i64)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ulonglong diff_timespec(struct timespec *ts1, struct timespec *ts2)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_STRUCT_TIMESPEC
|
|
||||||
return (ts1->tv_sec - ts2->tv_sec) * 1000000000ULL +
|
|
||||||
ts1->tv_nsec - ts2->tv_nsec;
|
|
||||||
#else
|
|
||||||
return (ts1->tv.i64 - ts2->tv.i64) * 100;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
typedef int MY_MODE;
|
|
||||||
#else
|
|
||||||
typedef mode_t MY_MODE;
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
/* File permissions */
|
|
||||||
#define USER_READ (1L << 0)
|
|
||||||
#define USER_WRITE (1L << 1)
|
|
||||||
#define USER_EXECUTE (1L << 2)
|
|
||||||
#define GROUP_READ (1L << 3)
|
|
||||||
#define GROUP_WRITE (1L << 4)
|
|
||||||
#define GROUP_EXECUTE (1L << 5)
|
|
||||||
#define OTHERS_READ (1L << 6)
|
|
||||||
#define OTHERS_WRITE (1L << 7)
|
|
||||||
#define OTHERS_EXECUTE (1L << 8)
|
|
||||||
#define USER_RWX USER_READ | USER_WRITE | USER_EXECUTE
|
|
||||||
#define GROUP_RWX GROUP_READ | GROUP_WRITE | GROUP_EXECUTE
|
|
||||||
#define OTHERS_RWX OTHERS_READ | OTHERS_WRITE | OTHERS_EXECUTE
|
|
||||||
|
|
||||||
/* Defaults */
|
|
||||||
#define DEFAULT_SSL_CA_CERT "ca.pem"
|
|
||||||
#define DEFAULT_SSL_CA_KEY "ca-key.pem"
|
|
||||||
#define DEFAULT_SSL_SERVER_CERT "server-cert.pem"
|
|
||||||
#define DEFAULT_SSL_SERVER_KEY "server-key.pem"
|
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
|
||||||
#define strcasecmp _stricmp
|
|
||||||
#endif
|
|
||||||
#endif // MY_GLOBAL_INCLUDED
|
|
||||||
@ -1,57 +0,0 @@
|
|||||||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License, version 2.0,
|
|
||||||
as published by the Free Software Foundation.
|
|
||||||
|
|
||||||
This program is also distributed with certain software (including
|
|
||||||
but not limited to OpenSSL) that is licensed under separate terms,
|
|
||||||
as designated in a particular file or component or in included license
|
|
||||||
documentation. The authors of MySQL hereby grant you an additional
|
|
||||||
permission to link the program and your derivative works with the
|
|
||||||
separately licensed software that they have included with MySQL.
|
|
||||||
|
|
||||||
Without limiting anything contained in the foregoing, this file,
|
|
||||||
which is part of C Driver for MySQL (Connector/C), is also subject to the
|
|
||||||
Universal FOSS Exception, version 1.0, a copy of which can be found at
|
|
||||||
http://oss.oracle.com/licenses/universal-foss-exception.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License, version 2.0, for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
||||||
|
|
||||||
#ifndef _list_h_
|
|
||||||
#define _list_h_
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct st_list {
|
|
||||||
struct st_list *prev,*next;
|
|
||||||
void *data;
|
|
||||||
} LIST;
|
|
||||||
|
|
||||||
typedef int (*list_walk_action)(void *,void *);
|
|
||||||
|
|
||||||
extern LIST *list_add(LIST *root,LIST *element);
|
|
||||||
extern LIST *list_delete(LIST *root,LIST *element);
|
|
||||||
extern LIST *list_cons(void *data,LIST *root);
|
|
||||||
extern LIST *list_reverse(LIST *root);
|
|
||||||
extern void list_free(LIST *root,unsigned int free_data);
|
|
||||||
extern unsigned int list_length(LIST *);
|
|
||||||
extern int list_walk(LIST *,list_walk_action action,unsigned char * argument);
|
|
||||||
|
|
||||||
#define list_rest(a) ((a)->next)
|
|
||||||
#define list_push(a,b) (a)=list_cons((b),(a))
|
|
||||||
#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); }
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user