mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-17 15:14:48 +02:00
latest changes from main repository; added eclipse cdt project files
This commit is contained in:
parent
d30a402069
commit
adfaac6703
63
Foundation/.cdtproject
Normal file
63
Foundation/.cdtproject
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse-cdt version="2.0"?>
|
||||||
|
|
||||||
|
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||||
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
|
||||||
|
<attribute key="addr2line" value="addr2line"/>
|
||||||
|
<attribute key="cygpath" value="cygpath"/>
|
||||||
|
<attribute key="c++filt" value="c++filt"/>
|
||||||
|
<attribute key="nm" value="nm"/>
|
||||||
|
</extension>
|
||||||
|
<data>
|
||||||
|
<item id="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="true" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="makefileGenerator">
|
||||||
|
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
</item>
|
||||||
|
<item id="org.eclipse.cdt.core.pathentry">
|
||||||
|
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
|
||||||
|
<pathentry kind="src" path="include"/>
|
||||||
|
<pathentry kind="src" path="src"/>
|
||||||
|
<pathentry kind="out" path=""/>
|
||||||
|
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
|
||||||
|
</item>
|
||||||
|
</data>
|
||||||
|
</cdtproject>
|
86
Foundation/.project
Normal file
86
Foundation/.project
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Foundation</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.arguments</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||||
|
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.environment</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
|
<value>false</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.inc</key>
|
||||||
|
<value>-s</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.location</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.command</key>
|
||||||
|
<value>make</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.clean</key>
|
||||||
|
<value>clean</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.auto</key>
|
||||||
|
<value>all</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -32,7 +32,7 @@
|
|||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -96,7 +96,7 @@
|
|||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
DebugInformationFormat="0"
|
DebugInformationFormat="0"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -157,7 +157,7 @@
|
|||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -210,7 +210,7 @@
|
|||||||
RuntimeTypeInfo="TRUE"
|
RuntimeTypeInfo="TRUE"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="TRUE"
|
Detect64BitPortabilityProblems="FALSE"
|
||||||
DebugInformationFormat="0"
|
DebugInformationFormat="0"
|
||||||
CompileAs="0"/>
|
CompileAs="0"/>
|
||||||
<Tool
|
<Tool
|
||||||
@ -1605,28 +1605,52 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="RegExp"
|
Name="RegularExpression"
|
||||||
Filter="">
|
Filter="">
|
||||||
<Filter
|
<Filter
|
||||||
Name="PCRE"
|
Name="PCRE Source Files"
|
||||||
Filter="">
|
Filter="">
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\get.c">
|
RelativePath=".\src\pcre_chartables.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\maketables.c">
|
RelativePath=".\src\pcre_compile.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\pcre.c">
|
RelativePath=".\src\pcre_exec.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\pcre.h">
|
RelativePath=".\src\pcre_fullinfo.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\pcreconfig.h">
|
RelativePath=".\src\pcre_globals.c">
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\study.c">
|
RelativePath=".\src\pcre_maketables.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_newline.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_ord2utf8.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_study.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_tables.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_try_flipped.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_ucp_searchfuncs.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_valid_utf8.c">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_xclass.c">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
@ -1643,6 +1667,28 @@
|
|||||||
RelativePath=".\include\Poco\RegularExpression.h">
|
RelativePath=".\include\Poco\RegularExpression.h">
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="PCRE Header Files"
|
||||||
|
Filter="">
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_config.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_internal.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucp.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucpinternal.h">
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucptable.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Logging"
|
Name="Logging"
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
@ -146,7 +146,7 @@
|
|||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="0"
|
DebugInformationFormat="0"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
@ -241,7 +241,7 @@
|
|||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="0"
|
DebugInformationFormat="0"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
@ -312,7 +312,7 @@
|
|||||||
RuntimeTypeInfo="true"
|
RuntimeTypeInfo="true"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
CompileAs="0"
|
CompileAs="0"
|
||||||
/>
|
/>
|
||||||
@ -2146,33 +2146,33 @@
|
|||||||
</Filter>
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="RegExp"
|
Name="RegularExpression"
|
||||||
>
|
>
|
||||||
<Filter
|
<Filter
|
||||||
Name="PCRE"
|
Name="PCRE Header Files"
|
||||||
>
|
>
|
||||||
<File
|
|
||||||
RelativePath=".\src\get.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\maketables.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath=".\src\pcre.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\pcre.h"
|
RelativePath=".\src\pcre.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\pcreconfig.h"
|
RelativePath=".\src\pcre_config.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\study.c"
|
RelativePath=".\src\pcre_internal.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucp.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucpinternal.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\ucptable.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
@ -2192,6 +2192,66 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="PCRE Source Files"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_chartables.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_compile.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_exec.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_fullinfo.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_globals.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_maketables.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_newline.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_ord2utf8.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_study.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_tables.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_try_flipped.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_ucp_searchfuncs.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_valid_utf8.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\pcre_xclass.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Logging"
|
Name="Logging"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// AsyncChannel.h
|
// AsyncChannel.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/include/Poco/AsyncChannel.h#2 $
|
// $Id: //poco/Main/Foundation/include/Poco/AsyncChannel.h#3 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Logging
|
// Package: Logging
|
||||||
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the AsyncChannel class.
|
// Definition of the AsyncChannel class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -62,7 +62,7 @@ class Foundation_API AsyncChannel: public Channel, public Runnable
|
|||||||
/// then processed by a separate thread.
|
/// then processed by a separate thread.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AsyncChannel(Channel* pChannel = 0);
|
AsyncChannel(Channel* pChannel = 0, Thread::Priority prio = Thread::PRIO_NORMAL);
|
||||||
/// Creates the AsyncChannel and connects it to
|
/// Creates the AsyncChannel and connects it to
|
||||||
/// the given channel.
|
/// the given channel.
|
||||||
|
|
||||||
@ -88,13 +88,24 @@ public:
|
|||||||
void setProperty(const std::string& name, const std::string& value);
|
void setProperty(const std::string& name, const std::string& value);
|
||||||
/// Sets or changes a configuration property.
|
/// Sets or changes a configuration property.
|
||||||
///
|
///
|
||||||
/// Only the "channel" property is supported, which allows
|
/// The "channel" property allows setting the target
|
||||||
/// setting the target channel via the LoggingRegistry.
|
/// channel via the LoggingRegistry.
|
||||||
/// The "channel" property is set-only.
|
/// The "channel" property is set-only.
|
||||||
|
///
|
||||||
|
/// The "priority" property allows setting the thread
|
||||||
|
/// priority. The following values are supported:
|
||||||
|
/// * lowest
|
||||||
|
/// * low
|
||||||
|
/// * normal (default)
|
||||||
|
/// * high
|
||||||
|
/// * highest
|
||||||
|
///
|
||||||
|
/// The "priority" property is set-only.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~AsyncChannel();
|
~AsyncChannel();
|
||||||
void run();
|
void run();
|
||||||
|
void setPriority(const std::string& value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Channel* _pChannel;
|
Channel* _pChannel;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// RegularExpression.h
|
// RegularExpression.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#5 $
|
// $Id: //poco/Main/Foundation/include/Poco/RegularExpression.h#7 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: RegExp
|
// Package: RegExp
|
||||||
@ -67,9 +67,6 @@ class Foundation_API RegularExpression
|
|||||||
/// Implemented using PCRE, the Perl Compatible
|
/// Implemented using PCRE, the Perl Compatible
|
||||||
/// Regular Expressions library by Philip Hazel
|
/// Regular Expressions library by Philip Hazel
|
||||||
/// (see http://www.pcre.org).
|
/// (see http://www.pcre.org).
|
||||||
///
|
|
||||||
/// An overload of operator ^ is provided for
|
|
||||||
/// simple matching.
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Options // These must match the corresponsing options in pcre.h!
|
enum Options // These must match the corresponsing options in pcre.h!
|
||||||
@ -83,22 +80,31 @@ public:
|
|||||||
///
|
///
|
||||||
/// See the PCRE documentation for more information.
|
/// See the PCRE documentation for more information.
|
||||||
{
|
{
|
||||||
RE_CASELESS = 0x00001, /// case insensitive matching (/i) [ctor]
|
RE_CASELESS = 0x00000001, /// case insensitive matching (/i) [ctor]
|
||||||
RE_MULTILINE = 0x00002, /// enable multi-line mode; affects ^ and $ (/m) [ctor]
|
RE_MULTILINE = 0x00000002, /// enable multi-line mode; affects ^ and $ (/m) [ctor]
|
||||||
RE_DOTALL = 0x00004, /// dot matches all characters, including newline (/s) [ctor]
|
RE_DOTALL = 0x00000004, /// dot matches all characters, including newline (/s) [ctor]
|
||||||
RE_EXTENDED = 0x00004, /// totally ignore whitespace (/x) [ctor]
|
RE_EXTENDED = 0x00000004, /// totally ignore whitespace (/x) [ctor]
|
||||||
RE_ANCHORED = 0x00010, /// treat pattern as if it starts with a ^ [ctor, match]
|
RE_ANCHORED = 0x00000010, /// treat pattern as if it starts with a ^ [ctor, match]
|
||||||
RE_DOLLAR_ENDONLY = 0x00020, /// dollar matches end-of-string only, not last newline in string [ctor]
|
RE_DOLLAR_ENDONLY = 0x00000020, /// dollar matches end-of-string only, not last newline in string [ctor]
|
||||||
RE_EXTRA = 0x00040, /// enable optional PCRE functionality [ctor]
|
RE_EXTRA = 0x00000040, /// enable optional PCRE functionality [ctor]
|
||||||
RE_NOTBOL = 0x00080, /// circumflex does not match beginning of string [match]
|
RE_NOTBOL = 0x00000080, /// circumflex does not match beginning of string [match]
|
||||||
RE_NOTEOL = 0x00100, /// $ does not match end of string [match]
|
RE_NOTEOL = 0x00000100, /// $ does not match end of string [match]
|
||||||
RE_UNGREEDY = 0x00200, /// make quantifiers ungreedy [ctor]
|
RE_UNGREEDY = 0x00000200, /// make quantifiers ungreedy [ctor]
|
||||||
RE_NOTEMPTY = 0x00400, /// empty string never matches [match]
|
RE_NOTEMPTY = 0x00000400, /// empty string never matches [match]
|
||||||
RE_UTF8 = 0x00800, /// assume pattern and subject is UTF-8 encoded [ctor]
|
RE_UTF8 = 0x00000800, /// assume pattern and subject is UTF-8 encoded [ctor]
|
||||||
RE_NO_AUTO_CAPTURE = 0x01000, /// disable numbered capturing parentheses [ctor, match]
|
RE_NO_AUTO_CAPTURE = 0x00001000, /// disable numbered capturing parentheses [ctor, match]
|
||||||
RE_NO_UTF8_CHECK = 0x02000, /// do not check validity of UTF-8 code sequences [match]
|
RE_NO_UTF8_CHECK = 0x00002000, /// do not check validity of UTF-8 code sequences [match]
|
||||||
RE_GLOBAL = 0x10000, /// replace all occurences (/g) [subst]
|
RE_FIRSTLINE = 0x00040000, /// an unanchored pattern is required to match
|
||||||
RE_NO_VARS = 0x20000 /// treat dollar in replacement string as ordinary character [subst]
|
/// before or at the first newline in the subject string,
|
||||||
|
/// though the matched text may continue over the newline [ctor]
|
||||||
|
RE_DUPNAMES = 0x00080000, /// names used to identify capturing subpatterns need not be unique [ctor]
|
||||||
|
RE_NEWLINE_CR = 0x00100000, /// assume newline is CR ('\r'), the default [ctor]
|
||||||
|
RE_NEWLINE_LF = 0x00200000, /// assume newline is LF ('\n') [ctor]
|
||||||
|
RE_NEWLINE_CRLF = 0x00300000, /// assume newline is CRLF ("\r\n") [ctor]
|
||||||
|
RE_NEWLINE_ANY = 0x00400000, /// assume newline is any valid Unicode newline character [ctor]
|
||||||
|
RE_NEWLINE_ANYCRLF = 0x00500000, /// assume newline is any of CR, LF, CRLF [ctor]
|
||||||
|
RE_GLOBAL = 0x10000000, /// replace all occurences (/g) [subst]
|
||||||
|
RE_NO_VARS = 0x20000000 /// treat dollar in replacement string as ordinary character [subst]
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Match
|
struct Match
|
||||||
@ -153,6 +159,20 @@ public:
|
|||||||
bool match(const std::string& subject, std::string::size_type offset, int options) const;
|
bool match(const std::string& subject, std::string::size_type offset, int options) const;
|
||||||
/// Returns true if and only if the subject matches the regular expression.
|
/// Returns true if and only if the subject matches the regular expression.
|
||||||
|
|
||||||
|
bool operator == (const std::string& subject) const;
|
||||||
|
/// Returns true if and only if the subject matches the regular expression.
|
||||||
|
///
|
||||||
|
/// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
|
||||||
|
/// matching, which means that the empty string will never match and
|
||||||
|
/// the pattern is treated as if it starts with a ^.
|
||||||
|
|
||||||
|
bool operator != (const std::string& subject) const;
|
||||||
|
/// Returns true if and only if the subject does not match the regular expression.
|
||||||
|
///
|
||||||
|
/// Internally, this method sets the RE_ANCHORED and RE_NOTEMPTY options for
|
||||||
|
/// matching, which means that the empty string will never match and
|
||||||
|
/// the pattern is treated as if it starts with a ^.
|
||||||
|
|
||||||
int extract(const std::string& subject, std::string& str, int options = 0) const;
|
int extract(const std::string& subject, std::string& str, int options = 0) const;
|
||||||
/// Matches the given subject string against the pattern.
|
/// Matches the given subject string against the pattern.
|
||||||
/// Returns the captured string.
|
/// Returns the captured string.
|
||||||
@ -241,6 +261,18 @@ inline int RegularExpression::subst(std::string& subject, const std::string& rep
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool RegularExpression::operator == (const std::string& subject) const
|
||||||
|
{
|
||||||
|
return match(subject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool RegularExpression::operator != (const std::string& subject) const
|
||||||
|
{
|
||||||
|
return !match(subject);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Thread.h
|
// Thread.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/include/Poco/Thread.h#3 $
|
// $Id: //poco/Main/Foundation/include/Poco/Thread.h#4 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Threading
|
// Package: Threading
|
||||||
@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Poco/Foundation.h"
|
#include "Poco/Foundation.h"
|
||||||
|
#include "Poco/Mutex.h"
|
||||||
|
|
||||||
|
|
||||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||||
@ -64,6 +65,7 @@ class Foundation_API Thread: private ThreadImpl
|
|||||||
/// Every Thread object gets a unique (within
|
/// Every Thread object gets a unique (within
|
||||||
/// its process) numeric thread ID.
|
/// its process) numeric thread ID.
|
||||||
/// Furthermore, a thread can be assigned a name.
|
/// Furthermore, a thread can be assigned a name.
|
||||||
|
/// The name of a thread can be changed at any time.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Priority
|
enum Priority
|
||||||
@ -88,9 +90,15 @@ public:
|
|||||||
int id() const;
|
int id() const;
|
||||||
/// Returns the unique thread ID of the thread.
|
/// Returns the unique thread ID of the thread.
|
||||||
|
|
||||||
const std::string& name() const;
|
std::string name() const;
|
||||||
/// Returns the name of the thread.
|
/// Returns the name of the thread.
|
||||||
|
|
||||||
|
std::string getName() const;
|
||||||
|
/// Returns teh name of the thread.
|
||||||
|
|
||||||
|
void setName(const std::string& name);
|
||||||
|
/// Sets the name of the thread.
|
||||||
|
|
||||||
void setPriority(Priority prio);
|
void setPriority(Priority prio);
|
||||||
/// Sets the thread's priority.
|
/// Sets the thread's priority.
|
||||||
///
|
///
|
||||||
@ -145,9 +153,6 @@ protected:
|
|||||||
static int uniqueId();
|
static int uniqueId();
|
||||||
/// Creates and returns a unique id for a thread.
|
/// Creates and returns a unique id for a thread.
|
||||||
|
|
||||||
void setName(const std::string& name);
|
|
||||||
/// Sets the name of the thread.
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Thread(const Thread&);
|
Thread(const Thread&);
|
||||||
Thread& operator = (const Thread&);
|
Thread& operator = (const Thread&);
|
||||||
@ -155,6 +160,7 @@ private:
|
|||||||
int _id;
|
int _id;
|
||||||
std::string _name;
|
std::string _name;
|
||||||
ThreadLocalStorage* _pTLS;
|
ThreadLocalStorage* _pTLS;
|
||||||
|
mutable FastMutex _mutex;
|
||||||
|
|
||||||
friend class ThreadLocalStorage;
|
friend class ThreadLocalStorage;
|
||||||
friend class PooledThread;
|
friend class PooledThread;
|
||||||
@ -170,8 +176,18 @@ inline int Thread::id() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const std::string& Thread::name() const
|
inline std::string Thread::name() const
|
||||||
{
|
{
|
||||||
|
FastMutex::ScopedLock lock(_mutex);
|
||||||
|
|
||||||
|
return _name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline std::string Thread::getName() const
|
||||||
|
{
|
||||||
|
FastMutex::ScopedLock lock(_mutex);
|
||||||
|
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
//
|
//
|
||||||
// AsyncChannel.cpp
|
// AsyncChannel.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/AsyncChannel.cpp#12 $
|
// $Id: //poco/Main/Foundation/src/AsyncChannel.cpp#13 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Logging
|
// Package: Logging
|
||||||
// Module: AsyncChannel
|
// Module: AsyncChannel
|
||||||
//
|
//
|
||||||
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2004-2007, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -40,6 +40,7 @@
|
|||||||
#include "Poco/Formatter.h"
|
#include "Poco/Formatter.h"
|
||||||
#include "Poco/AutoPtr.h"
|
#include "Poco/AutoPtr.h"
|
||||||
#include "Poco/LoggingRegistry.h"
|
#include "Poco/LoggingRegistry.h"
|
||||||
|
#include "Poco/Exception.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@ -67,9 +68,12 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
AsyncChannel::AsyncChannel(Channel* pChannel): _pChannel(pChannel), _thread("AsyncChannel")
|
AsyncChannel::AsyncChannel(Channel* pChannel, Thread::Priority prio):
|
||||||
|
_pChannel(pChannel),
|
||||||
|
_thread("AsyncChannel")
|
||||||
{
|
{
|
||||||
if (_pChannel) _pChannel->duplicate();
|
if (_pChannel) _pChannel->duplicate();
|
||||||
|
_thread.setPriority(prio);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -128,6 +132,8 @@ void AsyncChannel::setProperty(const std::string& name, const std::string& value
|
|||||||
{
|
{
|
||||||
if (name == "channel")
|
if (name == "channel")
|
||||||
setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
|
setChannel(LoggingRegistry::defaultRegistry().channelForName(value));
|
||||||
|
else if (name == "priority")
|
||||||
|
setPriority(value);
|
||||||
else
|
else
|
||||||
Channel::setProperty(name, value);
|
Channel::setProperty(name, value);
|
||||||
}
|
}
|
||||||
@ -148,5 +154,26 @@ void AsyncChannel::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void AsyncChannel::setPriority(const std::string& value)
|
||||||
|
{
|
||||||
|
Thread::Priority prio = Thread::PRIO_NORMAL;
|
||||||
|
|
||||||
|
if (value == "lowest")
|
||||||
|
prio = Thread::PRIO_LOWEST;
|
||||||
|
else if (value == "low")
|
||||||
|
prio = Thread::PRIO_LOW;
|
||||||
|
else if (value == "normal")
|
||||||
|
prio = Thread::PRIO_NORMAL;
|
||||||
|
else if (value == "high")
|
||||||
|
prio = Thread::PRIO_HIGH;
|
||||||
|
else if (value == "highest")
|
||||||
|
prio = Thread::PRIO_HIGHEST;
|
||||||
|
else
|
||||||
|
throw InvalidArgumentException("thread priority", value);
|
||||||
|
|
||||||
|
_thread.setPriority(prio);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Poco
|
} // namespace Poco
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Thread.cpp
|
// Thread.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/Thread.cpp#13 $
|
// $Id: //poco/Main/Foundation/src/Thread.cpp#14 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Threading
|
// Package: Threading
|
||||||
@ -149,6 +149,8 @@ int Thread::uniqueId()
|
|||||||
|
|
||||||
void Thread::setName(const std::string& name)
|
void Thread::setName(const std::string& name)
|
||||||
{
|
{
|
||||||
|
FastMutex::ScopedLock lock(_mutex);
|
||||||
|
|
||||||
_name = name;
|
_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Thread_POSIX.cpp
|
// Thread_POSIX.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/Thread_POSIX.cpp#15 $
|
// $Id: //poco/Main/Foundation/src/Thread_POSIX.cpp#16 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Threading
|
// Package: Threading
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// Thread_WIN32.h
|
// Thread_WIN32.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Foundation/src/Thread_WIN32.cpp#13 $
|
// $Id: //poco/Main/Foundation/src/Thread_WIN32.cpp#14 $
|
||||||
//
|
//
|
||||||
// Library: Foundation
|
// Library: Foundation
|
||||||
// Package: Threading
|
// Package: Threading
|
||||||
|
@ -1,357 +0,0 @@
|
|||||||
/*************************************************
|
|
||||||
* Perl-Compatible Regular Expressions *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/*
|
|
||||||
This is a library of functions to support regular expressions whose syntax
|
|
||||||
and semantics are as close as possible to those of the Perl 5 language. See
|
|
||||||
the file Tech.Notes for some information on the internals.
|
|
||||||
|
|
||||||
Written by: Philip Hazel <ph10@cam.ac.uk>
|
|
||||||
|
|
||||||
Copyright (c) 1997-2003 University of Cambridge
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This module contains some convenience functions for extracting substrings
|
|
||||||
from the subject string after a regex match has succeeded. The original idea
|
|
||||||
for these functions came from Scott Wimer. */
|
|
||||||
|
|
||||||
|
|
||||||
/* Include the internals header, which itself includes Standard C headers plus
|
|
||||||
the external pcre header. */
|
|
||||||
|
|
||||||
#include "pcreinternal.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Find number for named string *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function is used by the two extraction functions below, as well
|
|
||||||
as being generally available.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
code the compiled regex
|
|
||||||
stringname the name whose number is required
|
|
||||||
|
|
||||||
Returns: the number of the named parentheses, or a negative number
|
|
||||||
(PCRE_ERROR_NOSUBSTRING) if not found
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_get_stringnumber(const pcre *code, const char *stringname)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
int entrysize;
|
|
||||||
int top, bot;
|
|
||||||
uschar *nametable;
|
|
||||||
|
|
||||||
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMECOUNT, &top)) != 0)
|
|
||||||
return rc;
|
|
||||||
if (top <= 0) return PCRE_ERROR_NOSUBSTRING;
|
|
||||||
|
|
||||||
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMEENTRYSIZE, &entrysize)) != 0)
|
|
||||||
return rc;
|
|
||||||
if ((rc = pcre_fullinfo(code, NULL, PCRE_INFO_NAMETABLE, &nametable)) != 0)
|
|
||||||
return rc;
|
|
||||||
|
|
||||||
bot = 0;
|
|
||||||
while (top > bot)
|
|
||||||
{
|
|
||||||
int mid = (top + bot) / 2;
|
|
||||||
uschar *entry = nametable + entrysize*mid;
|
|
||||||
int c = strcmp(stringname, (char *)(entry + 2));
|
|
||||||
if (c == 0) return (entry[0] << 8) + entry[1];
|
|
||||||
if (c > 0) bot = mid + 1; else top = mid;
|
|
||||||
}
|
|
||||||
|
|
||||||
return PCRE_ERROR_NOSUBSTRING;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Copy captured string to given buffer *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function copies a single captured substring into a given buffer.
|
|
||||||
Note that we use memcpy() rather than strncpy() in case there are binary zeros
|
|
||||||
in the string.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
subject the subject string that was matched
|
|
||||||
ovector pointer to the offsets table
|
|
||||||
stringcount the number of substrings that were captured
|
|
||||||
(i.e. the yield of the pcre_exec call, unless
|
|
||||||
that was zero, in which case it should be 1/3
|
|
||||||
of the offset table size)
|
|
||||||
stringnumber the number of the required substring
|
|
||||||
buffer where to put the substring
|
|
||||||
size the size of the buffer
|
|
||||||
|
|
||||||
Returns: if successful:
|
|
||||||
the length of the copied string, not including the zero
|
|
||||||
that is put on the end; can be zero
|
|
||||||
if not successful:
|
|
||||||
PCRE_ERROR_NOMEMORY (-6) buffer too small
|
|
||||||
PCRE_ERROR_NOSUBSTRING (-7) no such captured substring
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_copy_substring(const char *subject, int *ovector, int stringcount,
|
|
||||||
int stringnumber, char *buffer, int size)
|
|
||||||
{
|
|
||||||
int yield;
|
|
||||||
if (stringnumber < 0 || stringnumber >= stringcount)
|
|
||||||
return PCRE_ERROR_NOSUBSTRING;
|
|
||||||
stringnumber *= 2;
|
|
||||||
yield = ovector[stringnumber+1] - ovector[stringnumber];
|
|
||||||
if (size < yield + 1) return PCRE_ERROR_NOMEMORY;
|
|
||||||
memcpy(buffer, subject + ovector[stringnumber], yield);
|
|
||||||
buffer[yield] = 0;
|
|
||||||
return yield;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Copy named captured string to given buffer *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function copies a single captured substring into a given buffer,
|
|
||||||
identifying it by name.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
code the compiled regex
|
|
||||||
subject the subject string that was matched
|
|
||||||
ovector pointer to the offsets table
|
|
||||||
stringcount the number of substrings that were captured
|
|
||||||
(i.e. the yield of the pcre_exec call, unless
|
|
||||||
that was zero, in which case it should be 1/3
|
|
||||||
of the offset table size)
|
|
||||||
stringname the name of the required substring
|
|
||||||
buffer where to put the substring
|
|
||||||
size the size of the buffer
|
|
||||||
|
|
||||||
Returns: if successful:
|
|
||||||
the length of the copied string, not including the zero
|
|
||||||
that is put on the end; can be zero
|
|
||||||
if not successful:
|
|
||||||
PCRE_ERROR_NOMEMORY (-6) buffer too small
|
|
||||||
PCRE_ERROR_NOSUBSTRING (-7) no such captured substring
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_copy_named_substring(const pcre *code, const char *subject, int *ovector,
|
|
||||||
int stringcount, const char *stringname, char *buffer, int size)
|
|
||||||
{
|
|
||||||
int n = pcre_get_stringnumber(code, stringname);
|
|
||||||
if (n <= 0) return n;
|
|
||||||
return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Copy all captured strings to new store *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function gets one chunk of store and builds a list of pointers and all
|
|
||||||
of the captured substrings in it. A NULL pointer is put on the end of the list.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
subject the subject string that was matched
|
|
||||||
ovector pointer to the offsets table
|
|
||||||
stringcount the number of substrings that were captured
|
|
||||||
(i.e. the yield of the pcre_exec call, unless
|
|
||||||
that was zero, in which case it should be 1/3
|
|
||||||
of the offset table size)
|
|
||||||
listptr set to point to the list of pointers
|
|
||||||
|
|
||||||
Returns: if successful: 0
|
|
||||||
if not successful:
|
|
||||||
PCRE_ERROR_NOMEMORY (-6) failed to get store
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_get_substring_list(const char *subject, int *ovector, int stringcount,
|
|
||||||
const char ***listptr)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
int size = sizeof(char *);
|
|
||||||
int double_count = stringcount * 2;
|
|
||||||
char **stringlist;
|
|
||||||
char *p;
|
|
||||||
|
|
||||||
for (i = 0; i < double_count; i += 2)
|
|
||||||
size += sizeof(char *) + ovector[i+1] - ovector[i] + 1;
|
|
||||||
|
|
||||||
stringlist = (char **)(pcre_malloc)(size);
|
|
||||||
if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
|
|
||||||
|
|
||||||
*listptr = (const char **)stringlist;
|
|
||||||
p = (char *)(stringlist + stringcount + 1);
|
|
||||||
|
|
||||||
for (i = 0; i < double_count; i += 2)
|
|
||||||
{
|
|
||||||
int len = ovector[i+1] - ovector[i];
|
|
||||||
memcpy(p, subject + ovector[i], len);
|
|
||||||
*stringlist++ = p;
|
|
||||||
p += len;
|
|
||||||
*p++ = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
*stringlist = NULL;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Free store obtained by get_substring_list *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function exists for the benefit of people calling PCRE from non-C
|
|
||||||
programs that can call its functions, but not free() or (pcre_free)() directly.
|
|
||||||
|
|
||||||
Argument: the result of a previous pcre_get_substring_list()
|
|
||||||
Returns: nothing
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
pcre_free_substring_list(const char **pointer)
|
|
||||||
{
|
|
||||||
(pcre_free)((void *)pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Copy captured string to new store *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function copies a single captured substring into a piece of new
|
|
||||||
store
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
subject the subject string that was matched
|
|
||||||
ovector pointer to the offsets table
|
|
||||||
stringcount the number of substrings that were captured
|
|
||||||
(i.e. the yield of the pcre_exec call, unless
|
|
||||||
that was zero, in which case it should be 1/3
|
|
||||||
of the offset table size)
|
|
||||||
stringnumber the number of the required substring
|
|
||||||
stringptr where to put a pointer to the substring
|
|
||||||
|
|
||||||
Returns: if successful:
|
|
||||||
the length of the string, not including the zero that
|
|
||||||
is put on the end; can be zero
|
|
||||||
if not successful:
|
|
||||||
PCRE_ERROR_NOMEMORY (-6) failed to get store
|
|
||||||
PCRE_ERROR_NOSUBSTRING (-7) substring not present
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_get_substring(const char *subject, int *ovector, int stringcount,
|
|
||||||
int stringnumber, const char **stringptr)
|
|
||||||
{
|
|
||||||
int yield;
|
|
||||||
char *substring;
|
|
||||||
if (stringnumber < 0 || stringnumber >= stringcount)
|
|
||||||
return PCRE_ERROR_NOSUBSTRING;
|
|
||||||
stringnumber *= 2;
|
|
||||||
yield = ovector[stringnumber+1] - ovector[stringnumber];
|
|
||||||
substring = (char *)(pcre_malloc)(yield + 1);
|
|
||||||
if (substring == NULL) return PCRE_ERROR_NOMEMORY;
|
|
||||||
memcpy(substring, subject + ovector[stringnumber], yield);
|
|
||||||
substring[yield] = 0;
|
|
||||||
*stringptr = substring;
|
|
||||||
return yield;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Copy named captured string to new store *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function copies a single captured substring, identified by name, into
|
|
||||||
new store.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
code the compiled regex
|
|
||||||
subject the subject string that was matched
|
|
||||||
ovector pointer to the offsets table
|
|
||||||
stringcount the number of substrings that were captured
|
|
||||||
(i.e. the yield of the pcre_exec call, unless
|
|
||||||
that was zero, in which case it should be 1/3
|
|
||||||
of the offset table size)
|
|
||||||
stringname the name of the required substring
|
|
||||||
stringptr where to put the pointer
|
|
||||||
|
|
||||||
Returns: if successful:
|
|
||||||
the length of the copied string, not including the zero
|
|
||||||
that is put on the end; can be zero
|
|
||||||
if not successful:
|
|
||||||
PCRE_ERROR_NOMEMORY (-6) couldn't get memory
|
|
||||||
PCRE_ERROR_NOSUBSTRING (-7) no such captured substring
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
pcre_get_named_substring(const pcre *code, const char *subject, int *ovector,
|
|
||||||
int stringcount, const char *stringname, const char **stringptr)
|
|
||||||
{
|
|
||||||
int n = pcre_get_stringnumber(code, stringname);
|
|
||||||
if (n <= 0) return n;
|
|
||||||
return pcre_get_substring(subject, ovector, stringcount, n, stringptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************
|
|
||||||
* Free store obtained by get_substring *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
/* This function exists for the benefit of people calling PCRE from non-C
|
|
||||||
programs that can call its functions, but not free() or (pcre_free)() directly.
|
|
||||||
|
|
||||||
Argument: the result of a previous pcre_get_substring()
|
|
||||||
Returns: nothing
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
|
||||||
pcre_free_substring(const char *pointer)
|
|
||||||
{
|
|
||||||
(pcre_free)((void *)pointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* End of get.c */
|
|
File diff suppressed because it is too large
Load Diff
@ -2,10 +2,10 @@
|
|||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* In its original form, this is the .in file that is transformed by
|
/* This is the public header file for the PCRE library, to be #included by
|
||||||
"configure" into pcre.h.
|
applications that call the PCRE functions.
|
||||||
|
|
||||||
Copyright (c) 1997-2004 University of Cambridge
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
@ -39,28 +39,34 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#ifndef _PCRE_H
|
#ifndef _PCRE_H
|
||||||
#define _PCRE_H
|
#define _PCRE_H
|
||||||
|
|
||||||
/* The file pcre.h is build by "configure". Do not edit it; instead
|
/* The current PCRE version information. */
|
||||||
make changes to pcre.in. */
|
|
||||||
|
|
||||||
#define PCRE_MAJOR 5
|
#define PCRE_MAJOR 7
|
||||||
#define PCRE_MINOR 0
|
#define PCRE_MINOR 1
|
||||||
#define PCRE_DATE 13-Sep-2004
|
#define PCRE_PRERELEASE
|
||||||
|
#define PCRE_DATE 2007-04-24
|
||||||
|
|
||||||
/* Win32 uses DLL by default */
|
/* When an application links to a PCRE DLL in Windows, the symbols that are
|
||||||
|
imported have to be identified as such. When building PCRE, the appropriate
|
||||||
|
export setting is defined in pcre_internal.h, which includes this file. So we
|
||||||
|
don't change an existing definition of PCRE_EXP_DECL. */
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifndef PCRE_EXP_DECL
|
||||||
# ifdef PCRE_DEFINITION
|
# ifdef _WIN32
|
||||||
# ifdef DLL_EXPORT
|
|
||||||
# define PCRE_DATA_SCOPE __declspec(dllexport)
|
|
||||||
# endif
|
|
||||||
# else
|
|
||||||
# ifndef PCRE_STATIC
|
# ifndef PCRE_STATIC
|
||||||
# define PCRE_DATA_SCOPE extern __declspec(dllimport)
|
# define PCRE_EXP_DECL extern __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef PCRE_DATA_SCOPE
|
|
||||||
# define PCRE_DATA_SCOPE extern
|
/* By default, we use the standard "extern" declarations. */
|
||||||
|
|
||||||
|
#ifndef PCRE_EXP_DECL
|
||||||
|
# ifdef __cplusplus
|
||||||
|
# define PCRE_EXP_DECL extern "C"
|
||||||
|
# else
|
||||||
|
# define PCRE_EXP_DECL extern
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Have to include stdlib.h in order to ensure that size_t is defined;
|
/* Have to include stdlib.h in order to ensure that size_t is defined;
|
||||||
@ -76,22 +82,31 @@ extern "C" {
|
|||||||
|
|
||||||
/* Options */
|
/* Options */
|
||||||
|
|
||||||
#define PCRE_CASELESS 0x0001
|
#define PCRE_CASELESS 0x00000001
|
||||||
#define PCRE_MULTILINE 0x0002
|
#define PCRE_MULTILINE 0x00000002
|
||||||
#define PCRE_DOTALL 0x0004
|
#define PCRE_DOTALL 0x00000004
|
||||||
#define PCRE_EXTENDED 0x0008
|
#define PCRE_EXTENDED 0x00000008
|
||||||
#define PCRE_ANCHORED 0x0010
|
#define PCRE_ANCHORED 0x00000010
|
||||||
#define PCRE_DOLLAR_ENDONLY 0x0020
|
#define PCRE_DOLLAR_ENDONLY 0x00000020
|
||||||
#define PCRE_EXTRA 0x0040
|
#define PCRE_EXTRA 0x00000040
|
||||||
#define PCRE_NOTBOL 0x0080
|
#define PCRE_NOTBOL 0x00000080
|
||||||
#define PCRE_NOTEOL 0x0100
|
#define PCRE_NOTEOL 0x00000100
|
||||||
#define PCRE_UNGREEDY 0x0200
|
#define PCRE_UNGREEDY 0x00000200
|
||||||
#define PCRE_NOTEMPTY 0x0400
|
#define PCRE_NOTEMPTY 0x00000400
|
||||||
#define PCRE_UTF8 0x0800
|
#define PCRE_UTF8 0x00000800
|
||||||
#define PCRE_NO_AUTO_CAPTURE 0x1000
|
#define PCRE_NO_AUTO_CAPTURE 0x00001000
|
||||||
#define PCRE_NO_UTF8_CHECK 0x2000
|
#define PCRE_NO_UTF8_CHECK 0x00002000
|
||||||
#define PCRE_AUTO_CALLOUT 0x4000
|
#define PCRE_AUTO_CALLOUT 0x00004000
|
||||||
#define PCRE_PARTIAL 0x8000
|
#define PCRE_PARTIAL 0x00008000
|
||||||
|
#define PCRE_DFA_SHORTEST 0x00010000
|
||||||
|
#define PCRE_DFA_RESTART 0x00020000
|
||||||
|
#define PCRE_FIRSTLINE 0x00040000
|
||||||
|
#define PCRE_DUPNAMES 0x00080000
|
||||||
|
#define PCRE_NEWLINE_CR 0x00100000
|
||||||
|
#define PCRE_NEWLINE_LF 0x00200000
|
||||||
|
#define PCRE_NEWLINE_CRLF 0x00300000
|
||||||
|
#define PCRE_NEWLINE_ANY 0x00400000
|
||||||
|
#define PCRE_NEWLINE_ANYCRLF 0x00500000
|
||||||
|
|
||||||
/* Exec-time and get/set-time error codes */
|
/* Exec-time and get/set-time error codes */
|
||||||
|
|
||||||
@ -99,7 +114,8 @@ extern "C" {
|
|||||||
#define PCRE_ERROR_NULL (-2)
|
#define PCRE_ERROR_NULL (-2)
|
||||||
#define PCRE_ERROR_BADOPTION (-3)
|
#define PCRE_ERROR_BADOPTION (-3)
|
||||||
#define PCRE_ERROR_BADMAGIC (-4)
|
#define PCRE_ERROR_BADMAGIC (-4)
|
||||||
#define PCRE_ERROR_UNKNOWN_NODE (-5)
|
#define PCRE_ERROR_UNKNOWN_OPCODE (-5)
|
||||||
|
#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */
|
||||||
#define PCRE_ERROR_NOMEMORY (-6)
|
#define PCRE_ERROR_NOMEMORY (-6)
|
||||||
#define PCRE_ERROR_NOSUBSTRING (-7)
|
#define PCRE_ERROR_NOSUBSTRING (-7)
|
||||||
#define PCRE_ERROR_MATCHLIMIT (-8)
|
#define PCRE_ERROR_MATCHLIMIT (-8)
|
||||||
@ -110,6 +126,14 @@ extern "C" {
|
|||||||
#define PCRE_ERROR_BADPARTIAL (-13)
|
#define PCRE_ERROR_BADPARTIAL (-13)
|
||||||
#define PCRE_ERROR_INTERNAL (-14)
|
#define PCRE_ERROR_INTERNAL (-14)
|
||||||
#define PCRE_ERROR_BADCOUNT (-15)
|
#define PCRE_ERROR_BADCOUNT (-15)
|
||||||
|
#define PCRE_ERROR_DFA_UITEM (-16)
|
||||||
|
#define PCRE_ERROR_DFA_UCOND (-17)
|
||||||
|
#define PCRE_ERROR_DFA_UMLIMIT (-18)
|
||||||
|
#define PCRE_ERROR_DFA_WSSIZE (-19)
|
||||||
|
#define PCRE_ERROR_DFA_RECURSE (-20)
|
||||||
|
#define PCRE_ERROR_RECURSIONLIMIT (-21)
|
||||||
|
#define PCRE_ERROR_NULLWSLIMIT (-22)
|
||||||
|
#define PCRE_ERROR_BADNEWLINE (-23)
|
||||||
|
|
||||||
/* Request types for pcre_fullinfo() */
|
/* Request types for pcre_fullinfo() */
|
||||||
|
|
||||||
@ -127,7 +151,8 @@ extern "C" {
|
|||||||
#define PCRE_INFO_STUDYSIZE 10
|
#define PCRE_INFO_STUDYSIZE 10
|
||||||
#define PCRE_INFO_DEFAULT_TABLES 11
|
#define PCRE_INFO_DEFAULT_TABLES 11
|
||||||
|
|
||||||
/* Request types for pcre_config() */
|
/* Request types for pcre_config(). Do not re-arrange, in order to remain
|
||||||
|
compatible. */
|
||||||
|
|
||||||
#define PCRE_CONFIG_UTF8 0
|
#define PCRE_CONFIG_UTF8 0
|
||||||
#define PCRE_CONFIG_NEWLINE 1
|
#define PCRE_CONFIG_NEWLINE 1
|
||||||
@ -136,19 +161,30 @@ extern "C" {
|
|||||||
#define PCRE_CONFIG_MATCH_LIMIT 4
|
#define PCRE_CONFIG_MATCH_LIMIT 4
|
||||||
#define PCRE_CONFIG_STACKRECURSE 5
|
#define PCRE_CONFIG_STACKRECURSE 5
|
||||||
#define PCRE_CONFIG_UNICODE_PROPERTIES 6
|
#define PCRE_CONFIG_UNICODE_PROPERTIES 6
|
||||||
|
#define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7
|
||||||
|
|
||||||
/* Bit flags for the pcre_extra structure */
|
/* Bit flags for the pcre_extra structure. Do not re-arrange or redefine
|
||||||
|
these bits, just add new ones on the end, in order to remain compatible. */
|
||||||
|
|
||||||
#define PCRE_EXTRA_STUDY_DATA 0x0001
|
#define PCRE_EXTRA_STUDY_DATA 0x0001
|
||||||
#define PCRE_EXTRA_MATCH_LIMIT 0x0002
|
#define PCRE_EXTRA_MATCH_LIMIT 0x0002
|
||||||
#define PCRE_EXTRA_CALLOUT_DATA 0x0004
|
#define PCRE_EXTRA_CALLOUT_DATA 0x0004
|
||||||
#define PCRE_EXTRA_TABLES 0x0008
|
#define PCRE_EXTRA_TABLES 0x0008
|
||||||
|
#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
|
||||||
|
|
||||||
/* Types */
|
/* Types */
|
||||||
|
|
||||||
struct real_pcre; /* declaration; the definition is private */
|
struct real_pcre; /* declaration; the definition is private */
|
||||||
typedef struct real_pcre pcre;
|
typedef struct real_pcre pcre;
|
||||||
|
|
||||||
|
/* When PCRE is compiled as a C++ library, the subject pointer type can be
|
||||||
|
replaced with a custom type. For conventional use, the public interface is a
|
||||||
|
const char *. */
|
||||||
|
|
||||||
|
#ifndef PCRE_SPTR
|
||||||
|
#define PCRE_SPTR const char *
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The structure for passing additional data to pcre_exec(). This is defined in
|
/* The structure for passing additional data to pcre_exec(). This is defined in
|
||||||
such as way as to be extensible. Always add new fields at the end, in order to
|
such as way as to be extensible. Always add new fields at the end, in order to
|
||||||
remain compatible. */
|
remain compatible. */
|
||||||
@ -159,6 +195,7 @@ typedef struct pcre_extra {
|
|||||||
unsigned long int match_limit; /* Maximum number of calls to match() */
|
unsigned long int match_limit; /* Maximum number of calls to match() */
|
||||||
void *callout_data; /* Data passed back in callouts */
|
void *callout_data; /* Data passed back in callouts */
|
||||||
const unsigned char *tables; /* Pointer to character tables */
|
const unsigned char *tables; /* Pointer to character tables */
|
||||||
|
unsigned long int match_limit_recursion; /* Max recursive calls to match() */
|
||||||
} pcre_extra;
|
} pcre_extra;
|
||||||
|
|
||||||
/* The structure for passing out data via the pcre_callout_function. We use a
|
/* The structure for passing out data via the pcre_callout_function. We use a
|
||||||
@ -171,7 +208,7 @@ typedef struct pcre_callout_block {
|
|||||||
/* ------------------------ Version 0 ------------------------------- */
|
/* ------------------------ Version 0 ------------------------------- */
|
||||||
int callout_number; /* Number compiled into pattern */
|
int callout_number; /* Number compiled into pattern */
|
||||||
int *offset_vector; /* The offset vector */
|
int *offset_vector; /* The offset vector */
|
||||||
const char *subject; /* The subject being matched */
|
PCRE_SPTR subject; /* The subject being matched */
|
||||||
int subject_length; /* The length of the subject */
|
int subject_length; /* The length of the subject */
|
||||||
int start_match; /* Offset to start of this match attempt */
|
int start_match; /* Offset to start of this match attempt */
|
||||||
int current_position; /* Where we currently are in the subject */
|
int current_position; /* Where we currently are in the subject */
|
||||||
@ -187,50 +224,56 @@ typedef struct pcre_callout_block {
|
|||||||
/* Indirection for store get and free functions. These can be set to
|
/* Indirection for store get and free functions. These can be set to
|
||||||
alternative malloc/free functions if required. Special ones are used in the
|
alternative malloc/free functions if required. Special ones are used in the
|
||||||
non-recursive case for "frames". There is also an optional callout function
|
non-recursive case for "frames". There is also an optional callout function
|
||||||
that is triggered by the (?) regex item. Some magic is required for Win32 DLL;
|
that is triggered by the (?) regex item. For Virtual Pascal, these definitions
|
||||||
it is null on other OS. For Virtual Pascal, these have to be different again.
|
have to take another form. */
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef VPCOMPAT
|
#ifndef VPCOMPAT
|
||||||
PCRE_DATA_SCOPE void *(*pcre_malloc)(size_t);
|
PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
|
||||||
PCRE_DATA_SCOPE void (*pcre_free)(void *);
|
PCRE_EXP_DECL void (*pcre_free)(void *);
|
||||||
PCRE_DATA_SCOPE void *(*pcre_stack_malloc)(size_t);
|
PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
|
||||||
PCRE_DATA_SCOPE void (*pcre_stack_free)(void *);
|
PCRE_EXP_DECL void (*pcre_stack_free)(void *);
|
||||||
PCRE_DATA_SCOPE int (*pcre_callout)(pcre_callout_block *);
|
PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
|
||||||
#else /* VPCOMPAT */
|
#else /* VPCOMPAT */
|
||||||
extern void *pcre_malloc(size_t);
|
PCRE_EXP_DECL void *pcre_malloc(size_t);
|
||||||
extern void pcre_free(void *);
|
PCRE_EXP_DECL void pcre_free(void *);
|
||||||
extern void *pcre_stack_malloc(size_t);
|
PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
|
||||||
extern void pcre_stack_free(void *);
|
PCRE_EXP_DECL void pcre_stack_free(void *);
|
||||||
extern int pcre_callout(pcre_callout_block *);
|
PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
|
||||||
#endif /* VPCOMPAT */
|
#endif /* VPCOMPAT */
|
||||||
|
|
||||||
/* Exported PCRE functions */
|
/* Exported PCRE functions */
|
||||||
|
|
||||||
extern pcre *pcre_compile(const char *, int, const char **,
|
PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
|
||||||
int *, const unsigned char *);
|
const unsigned char *);
|
||||||
extern int pcre_config(int, void *);
|
PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
|
||||||
extern int pcre_copy_named_substring(const pcre *, const char *,
|
int *, const unsigned char *);
|
||||||
int *, int, const char *, char *, int);
|
PCRE_EXP_DECL int pcre_config(int, void *);
|
||||||
extern int pcre_copy_substring(const char *, int *, int, int,
|
PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *,
|
||||||
char *, int);
|
int *, int, const char *, char *, int);
|
||||||
extern int pcre_exec(const pcre *, const pcre_extra *,
|
PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int, char *,
|
||||||
const char *, int, int, int, int *, int);
|
int);
|
||||||
extern void pcre_free_substring(const char *);
|
PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *,
|
||||||
extern void pcre_free_substring_list(const char **);
|
const char *, int, int, int, int *, int , int *, int);
|
||||||
extern int pcre_fullinfo(const pcre *, const pcre_extra *, int,
|
PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
|
||||||
void *);
|
int, int, int, int *, int);
|
||||||
extern int pcre_get_named_substring(const pcre *, const char *,
|
PCRE_EXP_DECL void pcre_free_substring(const char *);
|
||||||
int *, int, const char *, const char **);
|
PCRE_EXP_DECL void pcre_free_substring_list(const char **);
|
||||||
extern int pcre_get_stringnumber(const pcre *, const char *);
|
PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int,
|
||||||
extern int pcre_get_substring(const char *, int *, int, int,
|
void *);
|
||||||
const char **);
|
PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *,
|
||||||
extern int pcre_get_substring_list(const char *, int *, int,
|
int *, int, const char *, const char **);
|
||||||
const char ***);
|
PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *);
|
||||||
extern int pcre_info(const pcre *, int *, int *);
|
PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *,
|
||||||
extern const unsigned char *pcre_maketables(void);
|
char **, char **);
|
||||||
extern pcre_extra *pcre_study(const pcre *, int, const char **);
|
PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int,
|
||||||
extern const char *pcre_version(void);
|
const char **);
|
||||||
|
PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int,
|
||||||
|
const char ***);
|
||||||
|
PCRE_EXP_DECL int pcre_info(const pcre *, int *, int *);
|
||||||
|
PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
|
||||||
|
PCRE_EXP_DECL int pcre_refcount(pcre *, int);
|
||||||
|
PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
|
||||||
|
PCRE_EXP_DECL const char *pcre_version(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
|
@ -1,183 +1,194 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/* This file is automatically written by the dftables auxiliary
|
/* This file contains character tables that are used when no external tables
|
||||||
program. If you edit it by hand, you might like to edit the Makefile to
|
are passed to PCRE by the application that calls it. The tables are used only
|
||||||
prevent its ever being regenerated.
|
for characters whose code values are less than 256.
|
||||||
|
|
||||||
This file is #included in the compilation of pcre.c to build the default
|
This is a default version of the tables that assumes ASCII encoding. A program
|
||||||
character tables which are used when no tables are passed to the compile
|
called dftables (which is distributed with PCRE) can be used to build
|
||||||
function. */
|
alternative versions of this file. This is necessary if you are running in an
|
||||||
|
EBCDIC environment, or if you want to default to a different encoding, for
|
||||||
static unsigned char pcre_default_tables[] = {
|
example ISO-8859-1. When dftables is run, it creates these tables in the
|
||||||
|
current locale. If PCRE is configured with --enable-rebuild-chartables, this
|
||||||
/* This table is a lower casing table. */
|
happens automatically.
|
||||||
|
|
||||||
0, 1, 2, 3, 4, 5, 6, 7,
|
The following #include is present because without it gcc 4.x may remove the
|
||||||
8, 9, 10, 11, 12, 13, 14, 15,
|
array definition from the final binary if PCRE is built into a static library
|
||||||
16, 17, 18, 19, 20, 21, 22, 23,
|
and dead code stripping is activated. This leads to link errors. Pulling in the
|
||||||
24, 25, 26, 27, 28, 29, 30, 31,
|
header ensures that the array gets flagged as "someone outside this compilation
|
||||||
32, 33, 34, 35, 36, 37, 38, 39,
|
unit might reference this" and so it will always be supplied to the linker. */
|
||||||
40, 41, 42, 43, 44, 45, 46, 47,
|
|
||||||
48, 49, 50, 51, 52, 53, 54, 55,
|
#include "pcre_internal.h"
|
||||||
56, 57, 58, 59, 60, 61, 62, 63,
|
|
||||||
64, 97, 98, 99,100,101,102,103,
|
const unsigned char _pcre_default_tables[] = {
|
||||||
104,105,106,107,108,109,110,111,
|
|
||||||
112,113,114,115,116,117,118,119,
|
/* This table is a lower casing table. */
|
||||||
120,121,122, 91, 92, 93, 94, 95,
|
|
||||||
96, 97, 98, 99,100,101,102,103,
|
0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
104,105,106,107,108,109,110,111,
|
8, 9, 10, 11, 12, 13, 14, 15,
|
||||||
112,113,114,115,116,117,118,119,
|
16, 17, 18, 19, 20, 21, 22, 23,
|
||||||
120,121,122,123,124,125,126,127,
|
24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
128,129,130,131,132,133,134,135,
|
32, 33, 34, 35, 36, 37, 38, 39,
|
||||||
136,137,138,139,140,141,142,143,
|
40, 41, 42, 43, 44, 45, 46, 47,
|
||||||
144,145,146,147,148,149,150,151,
|
48, 49, 50, 51, 52, 53, 54, 55,
|
||||||
152,153,154,155,156,157,158,159,
|
56, 57, 58, 59, 60, 61, 62, 63,
|
||||||
160,161,162,163,164,165,166,167,
|
64, 97, 98, 99,100,101,102,103,
|
||||||
168,169,170,171,172,173,174,175,
|
104,105,106,107,108,109,110,111,
|
||||||
176,177,178,179,180,181,182,183,
|
112,113,114,115,116,117,118,119,
|
||||||
184,185,186,187,188,189,190,191,
|
120,121,122, 91, 92, 93, 94, 95,
|
||||||
192,193,194,195,196,197,198,199,
|
96, 97, 98, 99,100,101,102,103,
|
||||||
200,201,202,203,204,205,206,207,
|
104,105,106,107,108,109,110,111,
|
||||||
208,209,210,211,212,213,214,215,
|
112,113,114,115,116,117,118,119,
|
||||||
216,217,218,219,220,221,222,223,
|
120,121,122,123,124,125,126,127,
|
||||||
224,225,226,227,228,229,230,231,
|
128,129,130,131,132,133,134,135,
|
||||||
232,233,234,235,236,237,238,239,
|
136,137,138,139,140,141,142,143,
|
||||||
240,241,242,243,244,245,246,247,
|
144,145,146,147,148,149,150,151,
|
||||||
248,249,250,251,252,253,254,255,
|
152,153,154,155,156,157,158,159,
|
||||||
|
160,161,162,163,164,165,166,167,
|
||||||
/* This table is a case flipping table. */
|
168,169,170,171,172,173,174,175,
|
||||||
|
176,177,178,179,180,181,182,183,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7,
|
184,185,186,187,188,189,190,191,
|
||||||
8, 9, 10, 11, 12, 13, 14, 15,
|
192,193,194,195,196,197,198,199,
|
||||||
16, 17, 18, 19, 20, 21, 22, 23,
|
200,201,202,203,204,205,206,207,
|
||||||
24, 25, 26, 27, 28, 29, 30, 31,
|
208,209,210,211,212,213,214,215,
|
||||||
32, 33, 34, 35, 36, 37, 38, 39,
|
216,217,218,219,220,221,222,223,
|
||||||
40, 41, 42, 43, 44, 45, 46, 47,
|
224,225,226,227,228,229,230,231,
|
||||||
48, 49, 50, 51, 52, 53, 54, 55,
|
232,233,234,235,236,237,238,239,
|
||||||
56, 57, 58, 59, 60, 61, 62, 63,
|
240,241,242,243,244,245,246,247,
|
||||||
64, 97, 98, 99,100,101,102,103,
|
248,249,250,251,252,253,254,255,
|
||||||
104,105,106,107,108,109,110,111,
|
|
||||||
112,113,114,115,116,117,118,119,
|
/* This table is a case flipping table. */
|
||||||
120,121,122, 91, 92, 93, 94, 95,
|
|
||||||
96, 65, 66, 67, 68, 69, 70, 71,
|
0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
72, 73, 74, 75, 76, 77, 78, 79,
|
8, 9, 10, 11, 12, 13, 14, 15,
|
||||||
80, 81, 82, 83, 84, 85, 86, 87,
|
16, 17, 18, 19, 20, 21, 22, 23,
|
||||||
88, 89, 90,123,124,125,126,127,
|
24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
128,129,130,131,132,133,134,135,
|
32, 33, 34, 35, 36, 37, 38, 39,
|
||||||
136,137,138,139,140,141,142,143,
|
40, 41, 42, 43, 44, 45, 46, 47,
|
||||||
144,145,146,147,148,149,150,151,
|
48, 49, 50, 51, 52, 53, 54, 55,
|
||||||
152,153,154,155,156,157,158,159,
|
56, 57, 58, 59, 60, 61, 62, 63,
|
||||||
160,161,162,163,164,165,166,167,
|
64, 97, 98, 99,100,101,102,103,
|
||||||
168,169,170,171,172,173,174,175,
|
104,105,106,107,108,109,110,111,
|
||||||
176,177,178,179,180,181,182,183,
|
112,113,114,115,116,117,118,119,
|
||||||
184,185,186,187,188,189,190,191,
|
120,121,122, 91, 92, 93, 94, 95,
|
||||||
192,193,194,195,196,197,198,199,
|
96, 65, 66, 67, 68, 69, 70, 71,
|
||||||
200,201,202,203,204,205,206,207,
|
72, 73, 74, 75, 76, 77, 78, 79,
|
||||||
208,209,210,211,212,213,214,215,
|
80, 81, 82, 83, 84, 85, 86, 87,
|
||||||
216,217,218,219,220,221,222,223,
|
88, 89, 90,123,124,125,126,127,
|
||||||
224,225,226,227,228,229,230,231,
|
128,129,130,131,132,133,134,135,
|
||||||
232,233,234,235,236,237,238,239,
|
136,137,138,139,140,141,142,143,
|
||||||
240,241,242,243,244,245,246,247,
|
144,145,146,147,148,149,150,151,
|
||||||
248,249,250,251,252,253,254,255,
|
152,153,154,155,156,157,158,159,
|
||||||
|
160,161,162,163,164,165,166,167,
|
||||||
/* This table contains bit maps for various character classes.
|
168,169,170,171,172,173,174,175,
|
||||||
Each map is 32 bytes long and the bits run from the least
|
176,177,178,179,180,181,182,183,
|
||||||
significant end of each byte. The classes that have their own
|
184,185,186,187,188,189,190,191,
|
||||||
maps are: space, xdigit, digit, upper, lower, word, graph
|
192,193,194,195,196,197,198,199,
|
||||||
print, punct, and cntrl. Other classes are built from combinations. */
|
200,201,202,203,204,205,206,207,
|
||||||
|
208,209,210,211,212,213,214,215,
|
||||||
0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
|
216,217,218,219,220,221,222,223,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
224,225,226,227,228,229,230,231,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
232,233,234,235,236,237,238,239,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
240,241,242,243,244,245,246,247,
|
||||||
|
248,249,250,251,252,253,254,255,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
|
||||||
0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
|
/* This table contains bit maps for various character classes. Each map is 32
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
bytes long and the bits run from the least significant end of each byte. The
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
classes that have their own maps are: space, xdigit, digit, upper, lower, word,
|
||||||
|
graph, print, punct, and cntrl. Other classes are built from combinations. */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
|
||||||
0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
|
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
|
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
|
|
||||||
0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
|
0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
|
0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f,
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
/* This table identifies various classes of character by individual bits:
|
|
||||||
0x01 white space character
|
0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc,
|
||||||
0x02 letter
|
0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78,
|
||||||
0x04 decimal digit
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x08 hexadecimal digit
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x10 alphanumeric or '_'
|
|
||||||
0x80 regular expression metacharacter or binary zero
|
0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
|
||||||
*/
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||||
0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
|
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
|
/* This table identifies various classes of character by individual bits:
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
|
0x01 white space character
|
||||||
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
|
0x02 letter
|
||||||
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
|
0x04 decimal digit
|
||||||
0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
|
0x08 hexadecimal digit
|
||||||
0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
|
0x10 alphanumeric or '_'
|
||||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
|
0x80 regular expression metacharacter or binary zero
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
|
*/
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
|
|
||||||
0x12,0x12,0x12,0x80,0x00,0x00,0x80,0x10, /* X - _ */
|
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */
|
||||||
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
|
0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */
|
||||||
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */
|
||||||
0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */
|
0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
|
0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
|
0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
|
0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
|
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
|
0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
|
0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
|
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
|
0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */
|
||||||
/* End of chartables.c */
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */
|
||||||
|
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */
|
||||||
|
|
||||||
|
/* End of pcre_chartables.c */
|
5442
Foundation/src/pcre_compile.c
Normal file
5442
Foundation/src/pcre_compile.c
Normal file
File diff suppressed because it is too large
Load Diff
275
Foundation/src/pcre_config.h
Normal file
275
Foundation/src/pcre_config.h
Normal file
@ -0,0 +1,275 @@
|
|||||||
|
/* config.h. Generated from config.h.in by configure. */
|
||||||
|
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||||
|
|
||||||
|
|
||||||
|
/* On Unix-like systems config.h.in is converted by "configure" into config.h.
|
||||||
|
Some other environments also support the use of "configure". PCRE is written in
|
||||||
|
Standard C, but there are a few non-standard things it can cope with, allowing
|
||||||
|
it to run on SunOS4 and other "close to standard" systems.
|
||||||
|
|
||||||
|
If you are going to build PCRE "by hand" on a system without "configure" you
|
||||||
|
should copy the distributed config.h.generic to config.h, and then set up the
|
||||||
|
macros the way you need them. Alternatively, you can avoid editing by using -D
|
||||||
|
on the compiler command line to set the macro values.
|
||||||
|
|
||||||
|
PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
|
||||||
|
HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
|
||||||
|
them both to 0; an emulation function will be used. */
|
||||||
|
|
||||||
|
/* If you are compiling for a system that uses EBCDIC instead of ASCII
|
||||||
|
character codes, define this macro as 1. On systems that can use
|
||||||
|
"configure", this can be done via --enable-ebcdic. */
|
||||||
|
/* #undef EBCDIC */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `bcopy' function. */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <bits/type_traits.h> header file. */
|
||||||
|
/* #undef HAVE_BITS_TYPE_TRAITS_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dirent.h> header file. */
|
||||||
|
#ifndef HAVE_DIRENT_H
|
||||||
|
#define HAVE_DIRENT_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||||
|
#ifndef HAVE_DLFCN_H
|
||||||
|
#define HAVE_DLFCN_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
|
#ifndef HAVE_INTTYPES_H
|
||||||
|
#define HAVE_INTTYPES_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <limits.h> header file. */
|
||||||
|
#ifndef HAVE_LIMITS_H
|
||||||
|
#define HAVE_LIMITS_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `long long'. */
|
||||||
|
#ifndef HAVE_LONG_LONG
|
||||||
|
#define HAVE_LONG_LONG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `memmove' function. */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
|
#ifndef HAVE_MEMORY_H
|
||||||
|
#define HAVE_MEMORY_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
|
#ifndef HAVE_STDINT_H
|
||||||
|
#define HAVE_STDINT_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||||
|
#ifndef HAVE_STDLIB_H
|
||||||
|
#define HAVE_STDLIB_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strerror' function. */
|
||||||
|
#ifndef HAVE_STRERROR
|
||||||
|
#define HAVE_STRERROR 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string> header file. */
|
||||||
|
#ifndef HAVE_STRING
|
||||||
|
#define HAVE_STRING 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <strings.h> header file. */
|
||||||
|
#ifndef HAVE_STRINGS_H
|
||||||
|
#define HAVE_STRINGS_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <string.h> header file. */
|
||||||
|
#ifndef HAVE_STRING_H
|
||||||
|
#define HAVE_STRING_H 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtoll' function. */
|
||||||
|
#ifndef HAVE_STRTOLL
|
||||||
|
#define HAVE_STRTOLL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `strtoq' function. */
|
||||||
|
#ifndef HAVE_STRTOQ
|
||||||
|
#define HAVE_STRTOQ 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||||
|
#ifndef HAVE_SYS_STAT_H
|
||||||
|
#define HAVE_SYS_STAT_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||||
|
#ifndef HAVE_SYS_TYPES_H
|
||||||
|
#define HAVE_SYS_TYPES_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <type_traits.h> header file. */
|
||||||
|
/* #undef HAVE_TYPE_TRAITS_H */
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
|
#ifndef HAVE_UNISTD_H
|
||||||
|
#define HAVE_UNISTD_H 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if the system has the type `unsigned long long'. */
|
||||||
|
#ifndef HAVE_UNSIGNED_LONG_LONG
|
||||||
|
#define HAVE_UNSIGNED_LONG_LONG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <windows.h> header file. */
|
||||||
|
/* #undef HAVE_WINDOWS_H */
|
||||||
|
|
||||||
|
/* The value of LINK_SIZE determines the number of bytes used to store links
|
||||||
|
as offsets within the compiled regex. The default is 2, which allows for
|
||||||
|
compiled patterns up to 64K long. This covers the vast majority of cases.
|
||||||
|
However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows
|
||||||
|
for longer patterns in extreme cases. On systems that support it,
|
||||||
|
"configure" can be used to override this default. */
|
||||||
|
#ifndef LINK_SIZE
|
||||||
|
#define LINK_SIZE 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The value of MATCH_LIMIT determines the default number of times the
|
||||||
|
internal match() function can be called during a single execution of
|
||||||
|
pcre_exec(). There is a runtime interface for setting a different limit.
|
||||||
|
The limit exists in order to catch runaway regular expressions that take
|
||||||
|
for ever to determine that they do not match. The default is set very large
|
||||||
|
so that it does not accidentally catch legitimate cases. On systems that
|
||||||
|
support it, "configure" can be used to override this default default. */
|
||||||
|
#ifndef MATCH_LIMIT
|
||||||
|
#define MATCH_LIMIT 10000000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The above limit applies to all calls of match(), whether or not they
|
||||||
|
increase the recursion depth. In some environments it is desirable to limit
|
||||||
|
the depth of recursive calls of match() more strictly, in order to restrict
|
||||||
|
the maximum amount of stack (or heap, if NO_RECURSE is defined) that is
|
||||||
|
used. The value of MATCH_LIMIT_RECURSION applies only to recursive calls of
|
||||||
|
match(). To have any useful effect, it must be less than the value of
|
||||||
|
MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT. There is
|
||||||
|
a runtime method for setting a different limit. On systems that support it,
|
||||||
|
"configure" can be used to override the default. */
|
||||||
|
#ifndef MATCH_LIMIT_RECURSION
|
||||||
|
#define MATCH_LIMIT_RECURSION MATCH_LIMIT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
|
Care must be taken if it is increased, because it guards against integer
|
||||||
|
overflow caused by enormously large patterns. */
|
||||||
|
#ifndef MAX_DUPLENGTH
|
||||||
|
#define MAX_DUPLENGTH 30000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
|
Care must be taken if it is increased, because it guards against integer
|
||||||
|
overflow caused by enormously large patterns. */
|
||||||
|
#ifndef MAX_NAME_COUNT
|
||||||
|
#define MAX_NAME_COUNT 10000
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* This limit is parameterized just in case anybody ever wants to change it.
|
||||||
|
Care must be taken if it is increased, because it guards against integer
|
||||||
|
overflow caused by enormously large patterns. */
|
||||||
|
#ifndef MAX_NAME_SIZE
|
||||||
|
#define MAX_NAME_SIZE 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The value of NEWLINE determines the newline character sequence. On
|
||||||
|
Unix-like systems, "configure" can be used to override the default, which
|
||||||
|
is 10. The possible values are 10 (LF), 13 (CR), 3338 (CRLF), -1 (ANY), or
|
||||||
|
-2 (ANYCRLF). */
|
||||||
|
#ifndef NEWLINE
|
||||||
|
#define NEWLINE 10
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* PCRE uses recursive function calls to handle backtracking while matching.
|
||||||
|
This can sometimes be a problem on systems that have stacks of limited
|
||||||
|
size. Define NO_RECURSE to get a version that doesn't use recursion in the
|
||||||
|
match() function; instead it creates its own stack by steam using
|
||||||
|
pcre_recurse_malloc() to obtain memory from the heap. For more detail, see
|
||||||
|
the comments and other stuff just above the match() function. On systems
|
||||||
|
that support it, "configure" can be used to set this in the Makefile (use
|
||||||
|
--disable-stack-for-recursion). */
|
||||||
|
/* #undef NO_RECURSE */
|
||||||
|
|
||||||
|
/* Name of package */
|
||||||
|
#define PACKAGE "pcre"
|
||||||
|
|
||||||
|
/* Define to the address where bug reports for this package should be sent. */
|
||||||
|
#define PACKAGE_BUGREPORT ""
|
||||||
|
|
||||||
|
/* Define to the full name of this package. */
|
||||||
|
#define PACKAGE_NAME "PCRE"
|
||||||
|
|
||||||
|
/* Define to the full name and version of this package. */
|
||||||
|
#define PACKAGE_STRING "PCRE 7.1"
|
||||||
|
|
||||||
|
/* Define to the one symbol short name of this package. */
|
||||||
|
#define PACKAGE_TARNAME "pcre"
|
||||||
|
|
||||||
|
/* Define to the version of this package. */
|
||||||
|
#define PACKAGE_VERSION "7.1"
|
||||||
|
|
||||||
|
|
||||||
|
/* If you are compiling for a system other than a Unix-like system or
|
||||||
|
Win32, and it needs some magic to be inserted before the definition
|
||||||
|
of a function that is exported by the library, define this macro to
|
||||||
|
contain the relevant magic. If you do not define this macro, it
|
||||||
|
defaults to "extern" for a C compiler and "extern C" for a C++
|
||||||
|
compiler on non-Win32 systems. This macro apears at the start of
|
||||||
|
every exported function that is part of the external API. It does
|
||||||
|
not appear on functions that are "external" in the C sense, but
|
||||||
|
which are internal to the library. */
|
||||||
|
/* #undef PCRE_EXP_DEFN */
|
||||||
|
|
||||||
|
/* Define if linking statically (TODO: make nice with Libtool) */
|
||||||
|
#ifndef PCRE_STATIC
|
||||||
|
#define PCRE_STATIC 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* When calling PCRE via the POSIX interface, additional working storage is
|
||||||
|
required for holding the pointers to capturing substrings because PCRE
|
||||||
|
requires three integers per substring, whereas the POSIX interface provides
|
||||||
|
only two. If the number of expected substrings is small, the wrapper
|
||||||
|
function uses space on the stack, because this is faster than using
|
||||||
|
malloc() for each call. The threshold above which the stack is no longer
|
||||||
|
used is defined by POSIX_MALLOC_THRESHOLD. On systems that support it,
|
||||||
|
"configure" can be used to override this default. */
|
||||||
|
#ifndef POSIX_MALLOC_THRESHOLD
|
||||||
|
#define POSIX_MALLOC_THRESHOLD 10
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
|
#ifndef STDC_HEADERS
|
||||||
|
#define STDC_HEADERS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to enable support for Unicode properties */
|
||||||
|
#ifndef SUPPORT_UCP
|
||||||
|
#define SUPPORT_UCP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to enable support for the UTF-8 Unicode encoding. */
|
||||||
|
#ifndef SUPPORT_UTF8
|
||||||
|
#define SUPPORT_UTF8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Version number of package */
|
||||||
|
#ifndef VERSION
|
||||||
|
#define VERSION "7.1"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Define to empty if `const' does not conform to ANSI C. */
|
||||||
|
/* #undef const */
|
||||||
|
|
||||||
|
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||||
|
/* #undef size_t */
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(disable:4018) // signed/unsigned comparison
|
||||||
|
#endif
|
4243
Foundation/src/pcre_exec.c
Normal file
4243
Foundation/src/pcre_exec.c
Normal file
File diff suppressed because it is too large
Load Diff
149
Foundation/src/pcre_fullinfo.c
Normal file
149
Foundation/src/pcre_fullinfo.c
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/*PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains the external function pcre_fullinfo(), which returns
|
||||||
|
information about a compiled pattern. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Return info about compiled pattern *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This is a newer "info" function which has an extensible interface so
|
||||||
|
that additional items can be added compatibly.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
argument_re points to compiled code
|
||||||
|
extra_data points extra data, or NULL
|
||||||
|
what what information is required
|
||||||
|
where where to put the information
|
||||||
|
|
||||||
|
Returns: 0 if data returned, negative on error
|
||||||
|
*/
|
||||||
|
|
||||||
|
PCRE_EXP_DEFN int
|
||||||
|
pcre_fullinfo(const pcre *argument_re, const pcre_extra *extra_data, int what,
|
||||||
|
void *where)
|
||||||
|
{
|
||||||
|
real_pcre internal_re;
|
||||||
|
pcre_study_data internal_study;
|
||||||
|
const real_pcre *re = (const real_pcre *)argument_re;
|
||||||
|
const pcre_study_data *study = NULL;
|
||||||
|
|
||||||
|
if (re == NULL || where == NULL) return PCRE_ERROR_NULL;
|
||||||
|
|
||||||
|
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_STUDY_DATA) != 0)
|
||||||
|
study = (const pcre_study_data *)extra_data->study_data;
|
||||||
|
|
||||||
|
if (re->magic_number != MAGIC_NUMBER)
|
||||||
|
{
|
||||||
|
re = _pcre_try_flipped(re, &internal_re, study, &internal_study);
|
||||||
|
if (re == NULL) return PCRE_ERROR_BADMAGIC;
|
||||||
|
if (study != NULL) study = &internal_study;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (what)
|
||||||
|
{
|
||||||
|
case PCRE_INFO_OPTIONS:
|
||||||
|
*((unsigned long int *)where) = re->options & PUBLIC_OPTIONS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_SIZE:
|
||||||
|
*((size_t *)where) = re->size;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_STUDYSIZE:
|
||||||
|
*((size_t *)where) = (study == NULL)? 0 : study->size;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_CAPTURECOUNT:
|
||||||
|
*((int *)where) = re->top_bracket;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_BACKREFMAX:
|
||||||
|
*((int *)where) = re->top_backref;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_FIRSTBYTE:
|
||||||
|
*((int *)where) =
|
||||||
|
((re->options & PCRE_FIRSTSET) != 0)? re->first_byte :
|
||||||
|
((re->options & PCRE_STARTLINE) != 0)? -1 : -2;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Make sure we pass back the pointer to the bit vector in the external
|
||||||
|
block, not the internal copy (with flipped integer fields). */
|
||||||
|
|
||||||
|
case PCRE_INFO_FIRSTTABLE:
|
||||||
|
*((const uschar **)where) =
|
||||||
|
(study != NULL && (study->options & PCRE_STUDY_MAPPED) != 0)?
|
||||||
|
((const pcre_study_data *)extra_data->study_data)->start_bits : NULL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_LASTLITERAL:
|
||||||
|
*((int *)where) =
|
||||||
|
((re->options & PCRE_REQCHSET) != 0)? re->req_byte : -1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_NAMEENTRYSIZE:
|
||||||
|
*((int *)where) = re->name_entry_size;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_NAMECOUNT:
|
||||||
|
*((int *)where) = re->name_count;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_NAMETABLE:
|
||||||
|
*((const uschar **)where) = (const uschar *)re + re->name_table_offset;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PCRE_INFO_DEFAULT_TABLES:
|
||||||
|
*((const uschar **)where) = (const uschar *)(_pcre_default_tables);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default: return PCRE_ERROR_BADOPTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_fullinfo.c */
|
59
Foundation/src/pcre_globals.c
Normal file
59
Foundation/src/pcre_globals.c
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains global variables that are exported by the PCRE library.
|
||||||
|
PCRE is thread-clean and doesn't use any global variables in the normal sense.
|
||||||
|
However, it calls memory allocation and freeing functions via the four
|
||||||
|
indirections below, and it can optionally do callouts, using the fifth
|
||||||
|
indirection. These values can be changed by the caller, but are shared between
|
||||||
|
all threads. However, when compiling for Virtual Pascal, things are done
|
||||||
|
differently, and global variables are not used (see pcre.in). */
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
#ifndef VPCOMPAT
|
||||||
|
PCRE_EXP_DATA_DEFN void *(*pcre_malloc)(size_t) = malloc;
|
||||||
|
PCRE_EXP_DATA_DEFN void (*pcre_free)(void *) = free;
|
||||||
|
PCRE_EXP_DATA_DEFN void *(*pcre_stack_malloc)(size_t) = malloc;
|
||||||
|
PCRE_EXP_DATA_DEFN void (*pcre_stack_free)(void *) = free;
|
||||||
|
PCRE_EXP_DATA_DEFN int (*pcre_callout)(pcre_callout_block *) = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* End of pcre_globals.c */
|
1107
Foundation/src/pcre_internal.h
Normal file
1107
Foundation/src/pcre_internal.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,146 +1,140 @@
|
|||||||
/*************************************************
|
/*************************************************
|
||||||
* Perl-Compatible Regular Expressions *
|
* Perl-Compatible Regular Expressions *
|
||||||
*************************************************/
|
*************************************************/
|
||||||
|
|
||||||
/*
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
PCRE is a library of functions to support regular expressions whose syntax
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
and semantics are as close as possible to those of the Perl 5 language.
|
|
||||||
|
Written by Philip Hazel
|
||||||
Written by: Philip Hazel <ph10@cam.ac.uk>
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
Copyright (c) 1997-2003 University of Cambridge
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
-----------------------------------------------------------------------------
|
modification, are permitted provided that the following conditions are met:
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
documentation and/or other materials provided with the distribution.
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
this software without specific prior written permission.
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
-----------------------------------------------------------------------------
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
*/
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
/* This module contains the external function pcre_maketables(), which builds
|
||||||
|
character tables for PCRE in the current locale. The file is compiled on its
|
||||||
/* This file is compiled on its own as part of the PCRE library. However,
|
own as part of the PCRE library. However, it is also included in the
|
||||||
it is also included in the compilation of dftables.c, in which case the macro
|
compilation of dftables.c, in which case the macro DFTABLES is defined. */
|
||||||
DFTABLES is defined. */
|
|
||||||
|
|
||||||
#ifndef DFTABLES
|
#ifndef DFTABLES
|
||||||
#include "pcreinternal.h"
|
#include "pcre_internal.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
/*************************************************
|
* Create PCRE character tables *
|
||||||
* Create PCRE character tables *
|
*************************************************/
|
||||||
*************************************************/
|
|
||||||
|
/* This function builds a set of character tables for use by PCRE and returns
|
||||||
/* This function builds a set of character tables for use by PCRE and returns
|
a pointer to them. They are build using the ctype functions, and consequently
|
||||||
a pointer to them. They are build using the ctype functions, and consequently
|
their contents will depend upon the current locale setting. When compiled as
|
||||||
their contents will depend upon the current locale setting. When compiled as
|
part of the library, the store is obtained via pcre_malloc(), but when compiled
|
||||||
part of the library, the store is obtained via pcre_malloc(), but when compiled
|
inside dftables, use malloc().
|
||||||
inside dftables, use malloc().
|
|
||||||
|
Arguments: none
|
||||||
Arguments: none
|
Returns: pointer to the contiguous block of data
|
||||||
Returns: pointer to the contiguous block of data
|
*/
|
||||||
*/
|
|
||||||
|
const unsigned char *
|
||||||
const unsigned char *
|
pcre_maketables(void)
|
||||||
pcre_maketables(void)
|
{
|
||||||
{
|
unsigned char *yield, *p;
|
||||||
unsigned char *yield, *p;
|
int i;
|
||||||
int i;
|
|
||||||
|
#ifndef DFTABLES
|
||||||
#ifndef DFTABLES
|
yield = (unsigned char*)(pcre_malloc)(tables_length);
|
||||||
yield = (unsigned char*)(pcre_malloc)(tables_length);
|
#else
|
||||||
#else
|
yield = (unsigned char*)malloc(tables_length);
|
||||||
yield = (unsigned char*)malloc(tables_length);
|
#endif
|
||||||
#endif
|
|
||||||
|
if (yield == NULL) return NULL;
|
||||||
if (yield == NULL) return NULL;
|
p = yield;
|
||||||
p = yield;
|
|
||||||
|
/* First comes the lower casing table */
|
||||||
/* First comes the lower casing table */
|
|
||||||
|
for (i = 0; i < 256; i++) *p++ = tolower(i);
|
||||||
for (i = 0; i < 256; i++) *p++ = tolower(i);
|
|
||||||
|
/* Next the case-flipping table */
|
||||||
/* Next the case-flipping table */
|
|
||||||
|
for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
|
||||||
for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i);
|
|
||||||
|
/* Then the character class tables. Don't try to be clever and save effort on
|
||||||
/* Then the character class tables. Don't try to be clever and save effort
|
exclusive ones - in some locales things may be different. Note that the table
|
||||||
on exclusive ones - in some locales things may be different. Note that the
|
for "space" includes everything "isspace" gives, including VT in the default
|
||||||
table for "space" includes everything "isspace" gives, including VT in the
|
locale. This makes it work for the POSIX class [:space:]. Note also that it is
|
||||||
default locale. This makes it work for the POSIX class [:space:]. */
|
possible for a character to be alnum or alpha without being lower or upper,
|
||||||
|
such as "male and female ordinals" (\xAA and \xBA) in the fr_FR locale (at
|
||||||
memset(p, 0, cbit_length);
|
least under Debian Linux's locales as of 12/2005). So we must test for alnum
|
||||||
for (i = 0; i < 256; i++)
|
specially. */
|
||||||
{
|
|
||||||
if (isdigit(i))
|
memset(p, 0, cbit_length);
|
||||||
{
|
for (i = 0; i < 256; i++)
|
||||||
p[cbit_digit + i/8] |= 1 << (i&7);
|
{
|
||||||
p[cbit_word + i/8] |= 1 << (i&7);
|
if (isdigit(i)) p[cbit_digit + i/8] |= 1 << (i&7);
|
||||||
}
|
if (isupper(i)) p[cbit_upper + i/8] |= 1 << (i&7);
|
||||||
if (isupper(i))
|
if (islower(i)) p[cbit_lower + i/8] |= 1 << (i&7);
|
||||||
{
|
if (isalnum(i)) p[cbit_word + i/8] |= 1 << (i&7);
|
||||||
p[cbit_upper + i/8] |= 1 << (i&7);
|
if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
|
||||||
p[cbit_word + i/8] |= 1 << (i&7);
|
if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
|
||||||
}
|
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
|
||||||
if (islower(i))
|
if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
|
||||||
{
|
if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
|
||||||
p[cbit_lower + i/8] |= 1 << (i&7);
|
if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
|
||||||
p[cbit_word + i/8] |= 1 << (i&7);
|
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
|
||||||
}
|
}
|
||||||
if (i == '_') p[cbit_word + i/8] |= 1 << (i&7);
|
p += cbit_length;
|
||||||
if (isspace(i)) p[cbit_space + i/8] |= 1 << (i&7);
|
|
||||||
if (isxdigit(i))p[cbit_xdigit + i/8] |= 1 << (i&7);
|
/* Finally, the character type table. In this, we exclude VT from the white
|
||||||
if (isgraph(i)) p[cbit_graph + i/8] |= 1 << (i&7);
|
space chars, because Perl doesn't recognize it as such for \s and for comments
|
||||||
if (isprint(i)) p[cbit_print + i/8] |= 1 << (i&7);
|
within regexes. */
|
||||||
if (ispunct(i)) p[cbit_punct + i/8] |= 1 << (i&7);
|
|
||||||
if (iscntrl(i)) p[cbit_cntrl + i/8] |= 1 << (i&7);
|
for (i = 0; i < 256; i++)
|
||||||
}
|
{
|
||||||
p += cbit_length;
|
int x = 0;
|
||||||
|
if (i != 0x0b && isspace(i)) x += ctype_space;
|
||||||
/* Finally, the character type table. In this, we exclude VT from the white
|
if (isalpha(i)) x += ctype_letter;
|
||||||
space chars, because Perl doesn't recognize it as such for \s and for comments
|
if (isdigit(i)) x += ctype_digit;
|
||||||
within regexes. */
|
if (isxdigit(i)) x += ctype_xdigit;
|
||||||
|
if (isalnum(i) || i == '_') x += ctype_word;
|
||||||
for (i = 0; i < 256; i++)
|
|
||||||
{
|
/* Note: strchr includes the terminating zero in the characters it considers.
|
||||||
int x = 0;
|
In this instance, that is ok because we want binary zero to be flagged as a
|
||||||
if (i != 0x0b && isspace(i)) x += ctype_space;
|
meta-character, which in this sense is any character that terminates a run
|
||||||
if (isalpha(i)) x += ctype_letter;
|
of data characters. */
|
||||||
if (isdigit(i)) x += ctype_digit;
|
|
||||||
if (isxdigit(i)) x += ctype_xdigit;
|
if (strchr("\\*+?{^.$|()[", i) != 0) x += ctype_meta;
|
||||||
if (isalnum(i) || i == '_') x += ctype_word;
|
*p++ = x;
|
||||||
|
}
|
||||||
/* Note: strchr includes the terminating zero in the characters it considers.
|
|
||||||
In this instance, that is ok because we want binary zero to be flagged as a
|
return yield;
|
||||||
meta-character, which in this sense is any character that terminates a run
|
}
|
||||||
of data characters. */
|
|
||||||
|
/* End of pcre_maketables.c */
|
||||||
if (strchr("*+?{^.$|()[", i) != 0) x += ctype_meta; *p++ = x; }
|
|
||||||
|
|
||||||
return yield;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* End of maketables.c */
|
|
156
Foundation/src/pcre_newline.c
Normal file
156
Foundation/src/pcre_newline.c
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains internal functions for testing newlines when more than
|
||||||
|
one kind of newline is to be recognized. When a newline is found, its length is
|
||||||
|
returned. In principle, we could implement several newline "types", each
|
||||||
|
referring to a different set of newline characters. At present, PCRE supports
|
||||||
|
only NLTYPE_FIXED, which gets handled without these functions, NLTYPE_ANYCRLF,
|
||||||
|
and NLTYPE_ANY. The full list of Unicode newline characters is taken from
|
||||||
|
http://unicode.org/unicode/reports/tr18/. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Check for newline at given position *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* It is guaranteed that the initial value of ptr is less than the end of the
|
||||||
|
string that is being processed.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
ptr pointer to possible newline
|
||||||
|
type the newline type
|
||||||
|
endptr pointer to the end of the string
|
||||||
|
lenptr where to return the length
|
||||||
|
utf8 TRUE if in utf8 mode
|
||||||
|
|
||||||
|
Returns: TRUE or FALSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr,
|
||||||
|
int *lenptr, BOOL utf8)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
if (utf8) { GETCHAR(c, ptr); } else c = *ptr;
|
||||||
|
|
||||||
|
if (type == NLTYPE_ANYCRLF) switch(c)
|
||||||
|
{
|
||||||
|
case 0x000a: *lenptr = 1; return TRUE; /* LF */
|
||||||
|
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
||||||
|
return TRUE; /* CR */
|
||||||
|
default: return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* NLTYPE_ANY */
|
||||||
|
|
||||||
|
else switch(c)
|
||||||
|
{
|
||||||
|
case 0x000a: /* LF */
|
||||||
|
case 0x000b: /* VT */
|
||||||
|
case 0x000c: *lenptr = 1; return TRUE; /* FF */
|
||||||
|
case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1;
|
||||||
|
return TRUE; /* CR */
|
||||||
|
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
||||||
|
case 0x2028: /* LS */
|
||||||
|
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
||||||
|
default: return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Check for newline at previous position *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* It is guaranteed that the initial value of ptr is greater than the start of
|
||||||
|
the string that is being processed.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
ptr pointer to possible newline
|
||||||
|
type the newline type
|
||||||
|
startptr pointer to the start of the string
|
||||||
|
lenptr where to return the length
|
||||||
|
utf8 TRUE if in utf8 mode
|
||||||
|
|
||||||
|
Returns: TRUE or FALSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr,
|
||||||
|
int *lenptr, BOOL utf8)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
ptr--;
|
||||||
|
if (utf8)
|
||||||
|
{
|
||||||
|
BACKCHAR(ptr);
|
||||||
|
GETCHAR(c, ptr);
|
||||||
|
}
|
||||||
|
else c = *ptr;
|
||||||
|
|
||||||
|
if (type == NLTYPE_ANYCRLF) switch(c)
|
||||||
|
{
|
||||||
|
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
||||||
|
return TRUE; /* LF */
|
||||||
|
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
||||||
|
default: return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
else switch(c)
|
||||||
|
{
|
||||||
|
case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1;
|
||||||
|
return TRUE; /* LF */
|
||||||
|
case 0x000b: /* VT */
|
||||||
|
case 0x000c: /* FF */
|
||||||
|
case 0x000d: *lenptr = 1; return TRUE; /* CR */
|
||||||
|
case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */
|
||||||
|
case 0x2028: /* LS */
|
||||||
|
case 0x2029: *lenptr = 3; return TRUE; /* PS */
|
||||||
|
default: return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_newline.c */
|
82
Foundation/src/pcre_ord2utf8.c
Normal file
82
Foundation/src/pcre_ord2utf8.c
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This file contains a private PCRE function that converts an ordinal
|
||||||
|
character value into a UTF8 string. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Convert character value to UTF-8 *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This function takes an integer value in the range 0 - 0x7fffffff
|
||||||
|
and encodes it as a UTF-8 character in 0 to 6 bytes.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
cvalue the character value
|
||||||
|
buffer pointer to buffer for result - at least 6 bytes long
|
||||||
|
|
||||||
|
Returns: number of characters placed in the buffer
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
_pcre_ord2utf8(int cvalue, uschar *buffer)
|
||||||
|
{
|
||||||
|
#ifdef SUPPORT_UTF8
|
||||||
|
register int i, j;
|
||||||
|
for (i = 0; i < _pcre_utf8_table1_size; i++)
|
||||||
|
if (cvalue <= _pcre_utf8_table1[i]) break;
|
||||||
|
buffer += i;
|
||||||
|
for (j = i; j > 0; j--)
|
||||||
|
{
|
||||||
|
*buffer-- = 0x80 | (cvalue & 0x3f);
|
||||||
|
cvalue >>= 6;
|
||||||
|
}
|
||||||
|
*buffer = _pcre_utf8_table2[i] | cvalue;
|
||||||
|
return i + 1;
|
||||||
|
#else
|
||||||
|
return 0; /* Keep compiler happy; this function won't ever be */
|
||||||
|
#endif /* called when SUPPORT_UTF8 is not defined. */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_ord2utf8.c */
|
File diff suppressed because it is too large
Load Diff
201
Foundation/src/pcre_tables.c
Normal file
201
Foundation/src/pcre_tables.c
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains some fixed tables that are used by more than one of the
|
||||||
|
PCRE code modules. The tables are also #included by the pcretest program, which
|
||||||
|
uses macros to change their names from _pcre_xxx to xxxx, thereby avoiding name
|
||||||
|
clashes with the library. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* Table of sizes for the fixed-length opcodes. It's defined in a macro so that
|
||||||
|
the definition is next to the definition of the opcodes in pcre_internal.h. */
|
||||||
|
|
||||||
|
const uschar _pcre_OP_lengths[] = { OP_LENGTHS };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Tables for UTF-8 support *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* These are the breakpoints for different numbers of bytes in a UTF-8
|
||||||
|
character. */
|
||||||
|
|
||||||
|
#ifdef SUPPORT_UTF8
|
||||||
|
|
||||||
|
const int _pcre_utf8_table1[] =
|
||||||
|
{ 0x7f, 0x7ff, 0xffff, 0x1fffff, 0x3ffffff, 0x7fffffff};
|
||||||
|
|
||||||
|
const int _pcre_utf8_table1_size = sizeof(_pcre_utf8_table1)/sizeof(int);
|
||||||
|
|
||||||
|
/* These are the indicator bits and the mask for the data bits to set in the
|
||||||
|
first byte of a character, indexed by the number of additional bytes. */
|
||||||
|
|
||||||
|
const int _pcre_utf8_table2[] = { 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc};
|
||||||
|
const int _pcre_utf8_table3[] = { 0xff, 0x1f, 0x0f, 0x07, 0x03, 0x01};
|
||||||
|
|
||||||
|
/* Table of the number of extra bytes, indexed by the first byte masked with
|
||||||
|
0x3f. The highest number for a valid UTF-8 first byte is in fact 0x3d. */
|
||||||
|
|
||||||
|
const uschar _pcre_utf8_table4[] = {
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
||||||
|
3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 };
|
||||||
|
|
||||||
|
/* This table translates Unicode property names into type and code values. It
|
||||||
|
is searched by binary chop, so must be in collating sequence of name. */
|
||||||
|
|
||||||
|
const ucp_type_table _pcre_utt[] = {
|
||||||
|
{ "Any", PT_ANY, 0 },
|
||||||
|
{ "Arabic", PT_SC, ucp_Arabic },
|
||||||
|
{ "Armenian", PT_SC, ucp_Armenian },
|
||||||
|
{ "Balinese", PT_SC, ucp_Balinese },
|
||||||
|
{ "Bengali", PT_SC, ucp_Bengali },
|
||||||
|
{ "Bopomofo", PT_SC, ucp_Bopomofo },
|
||||||
|
{ "Braille", PT_SC, ucp_Braille },
|
||||||
|
{ "Buginese", PT_SC, ucp_Buginese },
|
||||||
|
{ "Buhid", PT_SC, ucp_Buhid },
|
||||||
|
{ "C", PT_GC, ucp_C },
|
||||||
|
{ "Canadian_Aboriginal", PT_SC, ucp_Canadian_Aboriginal },
|
||||||
|
{ "Cc", PT_PC, ucp_Cc },
|
||||||
|
{ "Cf", PT_PC, ucp_Cf },
|
||||||
|
{ "Cherokee", PT_SC, ucp_Cherokee },
|
||||||
|
{ "Cn", PT_PC, ucp_Cn },
|
||||||
|
{ "Co", PT_PC, ucp_Co },
|
||||||
|
{ "Common", PT_SC, ucp_Common },
|
||||||
|
{ "Coptic", PT_SC, ucp_Coptic },
|
||||||
|
{ "Cs", PT_PC, ucp_Cs },
|
||||||
|
{ "Cuneiform", PT_SC, ucp_Cuneiform },
|
||||||
|
{ "Cypriot", PT_SC, ucp_Cypriot },
|
||||||
|
{ "Cyrillic", PT_SC, ucp_Cyrillic },
|
||||||
|
{ "Deseret", PT_SC, ucp_Deseret },
|
||||||
|
{ "Devanagari", PT_SC, ucp_Devanagari },
|
||||||
|
{ "Ethiopic", PT_SC, ucp_Ethiopic },
|
||||||
|
{ "Georgian", PT_SC, ucp_Georgian },
|
||||||
|
{ "Glagolitic", PT_SC, ucp_Glagolitic },
|
||||||
|
{ "Gothic", PT_SC, ucp_Gothic },
|
||||||
|
{ "Greek", PT_SC, ucp_Greek },
|
||||||
|
{ "Gujarati", PT_SC, ucp_Gujarati },
|
||||||
|
{ "Gurmukhi", PT_SC, ucp_Gurmukhi },
|
||||||
|
{ "Han", PT_SC, ucp_Han },
|
||||||
|
{ "Hangul", PT_SC, ucp_Hangul },
|
||||||
|
{ "Hanunoo", PT_SC, ucp_Hanunoo },
|
||||||
|
{ "Hebrew", PT_SC, ucp_Hebrew },
|
||||||
|
{ "Hiragana", PT_SC, ucp_Hiragana },
|
||||||
|
{ "Inherited", PT_SC, ucp_Inherited },
|
||||||
|
{ "Kannada", PT_SC, ucp_Kannada },
|
||||||
|
{ "Katakana", PT_SC, ucp_Katakana },
|
||||||
|
{ "Kharoshthi", PT_SC, ucp_Kharoshthi },
|
||||||
|
{ "Khmer", PT_SC, ucp_Khmer },
|
||||||
|
{ "L", PT_GC, ucp_L },
|
||||||
|
{ "L&", PT_LAMP, 0 },
|
||||||
|
{ "Lao", PT_SC, ucp_Lao },
|
||||||
|
{ "Latin", PT_SC, ucp_Latin },
|
||||||
|
{ "Limbu", PT_SC, ucp_Limbu },
|
||||||
|
{ "Linear_B", PT_SC, ucp_Linear_B },
|
||||||
|
{ "Ll", PT_PC, ucp_Ll },
|
||||||
|
{ "Lm", PT_PC, ucp_Lm },
|
||||||
|
{ "Lo", PT_PC, ucp_Lo },
|
||||||
|
{ "Lt", PT_PC, ucp_Lt },
|
||||||
|
{ "Lu", PT_PC, ucp_Lu },
|
||||||
|
{ "M", PT_GC, ucp_M },
|
||||||
|
{ "Malayalam", PT_SC, ucp_Malayalam },
|
||||||
|
{ "Mc", PT_PC, ucp_Mc },
|
||||||
|
{ "Me", PT_PC, ucp_Me },
|
||||||
|
{ "Mn", PT_PC, ucp_Mn },
|
||||||
|
{ "Mongolian", PT_SC, ucp_Mongolian },
|
||||||
|
{ "Myanmar", PT_SC, ucp_Myanmar },
|
||||||
|
{ "N", PT_GC, ucp_N },
|
||||||
|
{ "Nd", PT_PC, ucp_Nd },
|
||||||
|
{ "New_Tai_Lue", PT_SC, ucp_New_Tai_Lue },
|
||||||
|
{ "Nko", PT_SC, ucp_Nko },
|
||||||
|
{ "Nl", PT_PC, ucp_Nl },
|
||||||
|
{ "No", PT_PC, ucp_No },
|
||||||
|
{ "Ogham", PT_SC, ucp_Ogham },
|
||||||
|
{ "Old_Italic", PT_SC, ucp_Old_Italic },
|
||||||
|
{ "Old_Persian", PT_SC, ucp_Old_Persian },
|
||||||
|
{ "Oriya", PT_SC, ucp_Oriya },
|
||||||
|
{ "Osmanya", PT_SC, ucp_Osmanya },
|
||||||
|
{ "P", PT_GC, ucp_P },
|
||||||
|
{ "Pc", PT_PC, ucp_Pc },
|
||||||
|
{ "Pd", PT_PC, ucp_Pd },
|
||||||
|
{ "Pe", PT_PC, ucp_Pe },
|
||||||
|
{ "Pf", PT_PC, ucp_Pf },
|
||||||
|
{ "Phags_Pa", PT_SC, ucp_Phags_Pa },
|
||||||
|
{ "Phoenician", PT_SC, ucp_Phoenician },
|
||||||
|
{ "Pi", PT_PC, ucp_Pi },
|
||||||
|
{ "Po", PT_PC, ucp_Po },
|
||||||
|
{ "Ps", PT_PC, ucp_Ps },
|
||||||
|
{ "Runic", PT_SC, ucp_Runic },
|
||||||
|
{ "S", PT_GC, ucp_S },
|
||||||
|
{ "Sc", PT_PC, ucp_Sc },
|
||||||
|
{ "Shavian", PT_SC, ucp_Shavian },
|
||||||
|
{ "Sinhala", PT_SC, ucp_Sinhala },
|
||||||
|
{ "Sk", PT_PC, ucp_Sk },
|
||||||
|
{ "Sm", PT_PC, ucp_Sm },
|
||||||
|
{ "So", PT_PC, ucp_So },
|
||||||
|
{ "Syloti_Nagri", PT_SC, ucp_Syloti_Nagri },
|
||||||
|
{ "Syriac", PT_SC, ucp_Syriac },
|
||||||
|
{ "Tagalog", PT_SC, ucp_Tagalog },
|
||||||
|
{ "Tagbanwa", PT_SC, ucp_Tagbanwa },
|
||||||
|
{ "Tai_Le", PT_SC, ucp_Tai_Le },
|
||||||
|
{ "Tamil", PT_SC, ucp_Tamil },
|
||||||
|
{ "Telugu", PT_SC, ucp_Telugu },
|
||||||
|
{ "Thaana", PT_SC, ucp_Thaana },
|
||||||
|
{ "Thai", PT_SC, ucp_Thai },
|
||||||
|
{ "Tibetan", PT_SC, ucp_Tibetan },
|
||||||
|
{ "Tifinagh", PT_SC, ucp_Tifinagh },
|
||||||
|
{ "Ugaritic", PT_SC, ucp_Ugaritic },
|
||||||
|
{ "Yi", PT_SC, ucp_Yi },
|
||||||
|
{ "Z", PT_GC, ucp_Z },
|
||||||
|
{ "Zl", PT_PC, ucp_Zl },
|
||||||
|
{ "Zp", PT_PC, ucp_Zp },
|
||||||
|
{ "Zs", PT_PC, ucp_Zs }
|
||||||
|
};
|
||||||
|
|
||||||
|
const int _pcre_utt_size = sizeof(_pcre_utt)/sizeof(ucp_type_table);
|
||||||
|
|
||||||
|
#endif /* SUPPORT_UTF8 */
|
||||||
|
|
||||||
|
/* End of pcre_tables.c */
|
132
Foundation/src/pcre_try_flipped.c
Normal file
132
Foundation/src/pcre_try_flipped.c
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains an internal function that tests a compiled pattern to
|
||||||
|
see if it was compiled with the opposite endianness. If so, it uses an
|
||||||
|
auxiliary local function to flip the appropriate bytes. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Flip bytes in an integer *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This function is called when the magic number in a regex doesn't match, in
|
||||||
|
order to flip its bytes to see if we are dealing with a pattern that was
|
||||||
|
compiled on a host of different endianness. If so, this function is used to
|
||||||
|
flip other byte values.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
value the number to flip
|
||||||
|
n the number of bytes to flip (assumed to be 2 or 4)
|
||||||
|
|
||||||
|
Returns: the flipped value
|
||||||
|
*/
|
||||||
|
|
||||||
|
static unsigned long int
|
||||||
|
byteflip(unsigned long int value, int n)
|
||||||
|
{
|
||||||
|
if (n == 2) return ((value & 0x00ff) << 8) | ((value & 0xff00) >> 8);
|
||||||
|
return ((value & 0x000000ff) << 24) |
|
||||||
|
((value & 0x0000ff00) << 8) |
|
||||||
|
((value & 0x00ff0000) >> 8) |
|
||||||
|
((value & 0xff000000) >> 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Test for a byte-flipped compiled regex *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This function is called from pcre_exec(), pcre_dfa_exec(), and also from
|
||||||
|
pcre_fullinfo(). Its job is to test whether the regex is byte-flipped - that
|
||||||
|
is, it was compiled on a system of opposite endianness. The function is called
|
||||||
|
only when the native MAGIC_NUMBER test fails. If the regex is indeed flipped,
|
||||||
|
we flip all the relevant values into a different data block, and return it.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
re points to the regex
|
||||||
|
study points to study data, or NULL
|
||||||
|
internal_re points to a new regex block
|
||||||
|
internal_study points to a new study block
|
||||||
|
|
||||||
|
Returns: the new block if is is indeed a byte-flipped regex
|
||||||
|
NULL if it is not
|
||||||
|
*/
|
||||||
|
|
||||||
|
real_pcre *
|
||||||
|
_pcre_try_flipped(const real_pcre *re, real_pcre *internal_re,
|
||||||
|
const pcre_study_data *study, pcre_study_data *internal_study)
|
||||||
|
{
|
||||||
|
if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
*internal_re = *re; /* To copy other fields */
|
||||||
|
internal_re->size = byteflip(re->size, sizeof(re->size));
|
||||||
|
internal_re->options = byteflip(re->options, sizeof(re->options));
|
||||||
|
internal_re->top_bracket =
|
||||||
|
(pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket));
|
||||||
|
internal_re->top_backref =
|
||||||
|
(pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref));
|
||||||
|
internal_re->first_byte =
|
||||||
|
(pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte));
|
||||||
|
internal_re->req_byte =
|
||||||
|
(pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte));
|
||||||
|
internal_re->name_table_offset =
|
||||||
|
(pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset));
|
||||||
|
internal_re->name_entry_size =
|
||||||
|
(pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size));
|
||||||
|
internal_re->name_count =
|
||||||
|
(pcre_uint16)byteflip(re->name_count, sizeof(re->name_count));
|
||||||
|
|
||||||
|
if (study != NULL)
|
||||||
|
{
|
||||||
|
*internal_study = *study; /* To copy other fields */
|
||||||
|
internal_study->size = byteflip(study->size, sizeof(study->size));
|
||||||
|
internal_study->options = byteflip(study->options, sizeof(study->options));
|
||||||
|
}
|
||||||
|
|
||||||
|
return internal_re;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_tryflipped.c */
|
175
Foundation/src/pcre_ucp_searchfuncs.c
Normal file
175
Foundation/src/pcre_ucp_searchfuncs.c
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains code for searching the table of Unicode character
|
||||||
|
properties. */
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
#include "ucp.h" /* Category definitions */
|
||||||
|
#include "ucpinternal.h" /* Internal table details */
|
||||||
|
#include "ucptable.h" /* The table itself */
|
||||||
|
|
||||||
|
|
||||||
|
/* Table to translate from particular type value to the general value. */
|
||||||
|
|
||||||
|
static const int ucp_gentype[] = {
|
||||||
|
ucp_C, ucp_C, ucp_C, ucp_C, ucp_C, /* Cc, Cf, Cn, Co, Cs */
|
||||||
|
ucp_L, ucp_L, ucp_L, ucp_L, ucp_L, /* Ll, Lu, Lm, Lo, Lt */
|
||||||
|
ucp_M, ucp_M, ucp_M, /* Mc, Me, Mn */
|
||||||
|
ucp_N, ucp_N, ucp_N, /* Nd, Nl, No */
|
||||||
|
ucp_P, ucp_P, ucp_P, ucp_P, ucp_P, /* Pc, Pd, Pe, Pf, Pi */
|
||||||
|
ucp_P, ucp_P, /* Ps, Po */
|
||||||
|
ucp_S, ucp_S, ucp_S, ucp_S, /* Sc, Sk, Sm, So */
|
||||||
|
ucp_Z, ucp_Z, ucp_Z /* Zl, Zp, Zs */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Search table and return type *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* Three values are returned: the category is ucp_C, ucp_L, etc. The detailed
|
||||||
|
character type is ucp_Lu, ucp_Nd, etc. The script is ucp_Latin, etc.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
c the character value
|
||||||
|
type_ptr the detailed character type is returned here
|
||||||
|
script_ptr the script is returned here
|
||||||
|
|
||||||
|
Returns: the character type category
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
_pcre_ucp_findprop(const unsigned int c, int *type_ptr, int *script_ptr)
|
||||||
|
{
|
||||||
|
int bot = 0;
|
||||||
|
int top = sizeof(ucp_table)/sizeof(cnode);
|
||||||
|
int mid;
|
||||||
|
|
||||||
|
/* The table is searched using a binary chop. You might think that using
|
||||||
|
intermediate variables to hold some of the common expressions would speed
|
||||||
|
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
||||||
|
makes things a lot slower. */
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if (top <= bot)
|
||||||
|
{
|
||||||
|
*type_ptr = ucp_Cn;
|
||||||
|
*script_ptr = ucp_Common;
|
||||||
|
return ucp_C;
|
||||||
|
}
|
||||||
|
mid = (bot + top) >> 1;
|
||||||
|
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
||||||
|
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
||||||
|
c <= (ucp_table[mid].f0 & f0_charmask) +
|
||||||
|
(ucp_table[mid].f1 & f1_rangemask)) break;
|
||||||
|
bot = mid + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Found an entry in the table. Set the script and detailed type values, and
|
||||||
|
return the general type. */
|
||||||
|
|
||||||
|
*script_ptr = (ucp_table[mid].f0 & f0_scriptmask) >> f0_scriptshift;
|
||||||
|
*type_ptr = (ucp_table[mid].f1 & f1_typemask) >> f1_typeshift;
|
||||||
|
|
||||||
|
return ucp_gentype[*type_ptr];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Search table and return other case *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* If the given character is a letter, and there is another case for the
|
||||||
|
letter, return the other case. Otherwise, return -1.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
c the character value
|
||||||
|
|
||||||
|
Returns: the other case or NOTACHAR if none
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
_pcre_ucp_othercase(const unsigned int c)
|
||||||
|
{
|
||||||
|
int bot = 0;
|
||||||
|
int top = sizeof(ucp_table)/sizeof(cnode);
|
||||||
|
int mid, offset;
|
||||||
|
|
||||||
|
/* The table is searched using a binary chop. You might think that using
|
||||||
|
intermediate variables to hold some of the common expressions would speed
|
||||||
|
things up, but tests with gcc 3.4.4 on Linux showed that, on the contrary, it
|
||||||
|
makes things a lot slower. */
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
if (top <= bot) return -1;
|
||||||
|
mid = (bot + top) >> 1;
|
||||||
|
if (c == (ucp_table[mid].f0 & f0_charmask)) break;
|
||||||
|
if (c < (ucp_table[mid].f0 & f0_charmask)) top = mid;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0 &&
|
||||||
|
c <= (ucp_table[mid].f0 & f0_charmask) +
|
||||||
|
(ucp_table[mid].f1 & f1_rangemask)) break;
|
||||||
|
bot = mid + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Found an entry in the table. Return NOTACHAR for a range entry. Otherwise
|
||||||
|
return the other case if there is one, else NOTACHAR. */
|
||||||
|
|
||||||
|
if ((ucp_table[mid].f0 & f0_rangeflag) != 0) return NOTACHAR;
|
||||||
|
|
||||||
|
offset = ucp_table[mid].f1 & f1_casemask;
|
||||||
|
if ((offset & f1_caseneg) != 0) offset |= f1_caseneg;
|
||||||
|
return (offset == 0)? NOTACHAR : c + offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* End of pcre_ucp_searchfuncs.c */
|
132
Foundation/src/pcre_valid_utf8.c
Normal file
132
Foundation/src/pcre_valid_utf8.c
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains an internal function for validating UTF-8 character
|
||||||
|
strings. */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Validate a UTF-8 string *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This function is called (optionally) at the start of compile or match, to
|
||||||
|
validate that a supposed UTF-8 string is actually valid. The early check means
|
||||||
|
that subsequent code can assume it is dealing with a valid string. The check
|
||||||
|
can be turned off for maximum performance, but the consequences of supplying
|
||||||
|
an invalid string are then undefined.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
string points to the string
|
||||||
|
length length of string, or -1 if the string is zero-terminated
|
||||||
|
|
||||||
|
Returns: < 0 if the string is a valid UTF-8 string
|
||||||
|
>= 0 otherwise; the value is the offset of the bad byte
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
_pcre_valid_utf8(const uschar *string, int length)
|
||||||
|
{
|
||||||
|
#ifdef SUPPORT_UTF8
|
||||||
|
register const uschar *p;
|
||||||
|
|
||||||
|
if (length < 0)
|
||||||
|
{
|
||||||
|
for (p = string; *p != 0; p++);
|
||||||
|
length = p - string;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (p = string; length-- > 0; p++)
|
||||||
|
{
|
||||||
|
register int ab;
|
||||||
|
register int c = *p;
|
||||||
|
if (c < 128) continue;
|
||||||
|
if (c < 0xc0) return p - string;
|
||||||
|
ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */
|
||||||
|
if (length < ab) return p - string;
|
||||||
|
length -= ab;
|
||||||
|
|
||||||
|
/* Check top bits in the second byte */
|
||||||
|
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
||||||
|
|
||||||
|
/* Check for overlong sequences for each different length */
|
||||||
|
switch (ab)
|
||||||
|
{
|
||||||
|
/* Check for xx00 000x */
|
||||||
|
case 1:
|
||||||
|
if ((c & 0x3e) == 0) return p - string;
|
||||||
|
continue; /* We know there aren't any more bytes to check */
|
||||||
|
|
||||||
|
/* Check for 1110 0000, xx0x xxxx */
|
||||||
|
case 2:
|
||||||
|
if (c == 0xe0 && (*p & 0x20) == 0) return p - string;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Check for 1111 0000, xx00 xxxx */
|
||||||
|
case 3:
|
||||||
|
if (c == 0xf0 && (*p & 0x30) == 0) return p - string;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Check for 1111 1000, xx00 0xxx */
|
||||||
|
case 4:
|
||||||
|
if (c == 0xf8 && (*p & 0x38) == 0) return p - string;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */
|
||||||
|
case 5:
|
||||||
|
if (c == 0xfe || c == 0xff ||
|
||||||
|
(c == 0xfc && (*p & 0x3c) == 0)) return p - string;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for valid bytes after the 2nd, if any; all must start 10 */
|
||||||
|
while (--ab > 0)
|
||||||
|
{
|
||||||
|
if ((*(++p) & 0xc0) != 0x80) return p - string;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_valid_utf8.c */
|
144
Foundation/src/pcre_xclass.c
Normal file
144
Foundation/src/pcre_xclass.c
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Perl-Compatible Regular Expressions *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* PCRE is a library of functions to support regular expressions whose syntax
|
||||||
|
and semantics are as close as possible to those of the Perl 5 language.
|
||||||
|
|
||||||
|
Written by Philip Hazel
|
||||||
|
Copyright (c) 1997-2007 University of Cambridge
|
||||||
|
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the University of Cambridge nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||||
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
-----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* This module contains an internal function that is used to match an extended
|
||||||
|
class (one that contains characters whose values are > 255). It is used by both
|
||||||
|
pcre_exec() and pcre_def_exec(). */
|
||||||
|
|
||||||
|
|
||||||
|
#include "pcre_internal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
* Match character against an XCLASS *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
/* This function is called to match a character against an extended class that
|
||||||
|
might contain values > 255.
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
c the character
|
||||||
|
data points to the flag byte of the XCLASS data
|
||||||
|
|
||||||
|
Returns: TRUE if character matches, else FALSE
|
||||||
|
*/
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
_pcre_xclass(int c, const uschar *data)
|
||||||
|
{
|
||||||
|
int t;
|
||||||
|
BOOL negated = (*data & XCL_NOT) != 0;
|
||||||
|
|
||||||
|
/* Character values < 256 are matched against a bitmap, if one is present. If
|
||||||
|
not, we still carry on, because there may be ranges that start below 256 in the
|
||||||
|
additional data. */
|
||||||
|
|
||||||
|
if (c < 256)
|
||||||
|
{
|
||||||
|
if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0)
|
||||||
|
return !negated; /* char found */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* First skip the bit map if present. Then match against the list of Unicode
|
||||||
|
properties or large chars or ranges that end with a large char. We won't ever
|
||||||
|
encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */
|
||||||
|
|
||||||
|
if ((*data++ & XCL_MAP) != 0) data += 32;
|
||||||
|
|
||||||
|
while ((t = *data++) != XCL_END)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
if (t == XCL_SINGLE)
|
||||||
|
{
|
||||||
|
GETCHARINC(x, data);
|
||||||
|
if (c == x) return !negated;
|
||||||
|
}
|
||||||
|
else if (t == XCL_RANGE)
|
||||||
|
{
|
||||||
|
GETCHARINC(x, data);
|
||||||
|
GETCHARINC(y, data);
|
||||||
|
if (c >= x && c <= y) return !negated;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef SUPPORT_UCP
|
||||||
|
else /* XCL_PROP & XCL_NOTPROP */
|
||||||
|
{
|
||||||
|
int chartype, script;
|
||||||
|
int category = _pcre_ucp_findprop(c, &chartype, &script);
|
||||||
|
|
||||||
|
switch(*data)
|
||||||
|
{
|
||||||
|
case PT_ANY:
|
||||||
|
if (t == XCL_PROP) return !negated;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_LAMP:
|
||||||
|
if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) ==
|
||||||
|
(t == XCL_PROP)) return !negated;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_GC:
|
||||||
|
if ((data[1] == category) == (t == XCL_PROP)) return !negated;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_PC:
|
||||||
|
if ((data[1] == chartype) == (t == XCL_PROP)) return !negated;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PT_SC:
|
||||||
|
if ((data[1] == script) == (t == XCL_PROP)) return !negated;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* This should never occur, but compilers may mutter if there is no
|
||||||
|
default. */
|
||||||
|
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += 2;
|
||||||
|
}
|
||||||
|
#endif /* SUPPORT_UCP */
|
||||||
|
}
|
||||||
|
|
||||||
|
return negated; /* char did not match */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of pcre_xclass.c */
|
@ -1,125 +0,0 @@
|
|||||||
|
|
||||||
/* On Unix systems config.in is converted by configure into config.h. PCRE is
|
|
||||||
written in Standard C, but there are a few non-standard things it can cope
|
|
||||||
with, allowing it to run on SunOS4 and other "close to standard" systems.
|
|
||||||
|
|
||||||
On a non-Unix system you should just copy this file into config.h, and set up
|
|
||||||
the macros the way you need them. You should normally change the definitions of
|
|
||||||
HAVE_STRERROR and HAVE_MEMMOVE to 1. Unfortunately, because of the way autoconf
|
|
||||||
works, these cannot be made the defaults. If your system has bcopy() and not
|
|
||||||
memmove(), change the definition of HAVE_BCOPY instead of HAVE_MEMMOVE. If your
|
|
||||||
system has neither bcopy() nor memmove(), leave them both as 0; an emulation
|
|
||||||
function will be used. */
|
|
||||||
|
|
||||||
/* If you are compiling for a system that uses EBCDIC instead of ASCII
|
|
||||||
character codes, define this macro as 1. On systems that can use "configure",
|
|
||||||
this can be done via --enable-ebcdic. */
|
|
||||||
|
|
||||||
#ifndef EBCDIC
|
|
||||||
#define EBCDIC 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If you are compiling for a system that needs some magic to be inserted
|
|
||||||
before the definition of an exported function, define this macro to contain the
|
|
||||||
relevant magic. It apears at the start of every exported function. */
|
|
||||||
|
|
||||||
#define EXPORT
|
|
||||||
|
|
||||||
/* Define to empty if the "const" keyword does not work. */
|
|
||||||
|
|
||||||
#undef const
|
|
||||||
|
|
||||||
/* Define to "unsigned" if <stddef.h> doesn't define size_t. */
|
|
||||||
|
|
||||||
#undef size_t
|
|
||||||
|
|
||||||
/* The following two definitions are mainly for the benefit of SunOS4, which
|
|
||||||
doesn't have the strerror() or memmove() functions that should be present in
|
|
||||||
all Standard C libraries. The macros HAVE_STRERROR and HAVE_MEMMOVE should
|
|
||||||
normally be defined with the value 1 for other systems, but unfortunately we
|
|
||||||
can't make this the default because "configure" files generated by autoconf
|
|
||||||
will only change 0 to 1; they won't change 1 to 0 if the functions are not
|
|
||||||
found. */
|
|
||||||
|
|
||||||
#define HAVE_STRERROR 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
|
|
||||||
/* There are some non-Unix systems that don't even have bcopy(). If this macro
|
|
||||||
is false, an emulation is used. If HAVE_MEMMOVE is set to 1, the value of
|
|
||||||
HAVE_BCOPY is not relevant. */
|
|
||||||
|
|
||||||
#define HAVE_BCOPY 0
|
|
||||||
|
|
||||||
/* The value of NEWLINE determines the newline character. The default is to
|
|
||||||
leave it up to the compiler, but some sites want to force a particular value.
|
|
||||||
On Unix systems, "configure" can be used to override this default. */
|
|
||||||
|
|
||||||
#ifndef NEWLINE
|
|
||||||
#define NEWLINE '\n'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The value of LINK_SIZE determines the number of bytes used to store
|
|
||||||
links as offsets within the compiled regex. The default is 2, which allows for
|
|
||||||
compiled patterns up to 64K long. This covers the vast majority of cases.
|
|
||||||
However, PCRE can also be compiled to use 3 or 4 bytes instead. This allows for
|
|
||||||
longer patterns in extreme cases. On Unix systems, "configure" can be used to
|
|
||||||
override this default. */
|
|
||||||
|
|
||||||
#ifndef LINK_SIZE
|
|
||||||
#define LINK_SIZE 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The value of MATCH_LIMIT determines the default number of times the match()
|
|
||||||
function can be called during a single execution of pcre_exec(). (There is a
|
|
||||||
runtime method of setting a different limit.) The limit exists in order to
|
|
||||||
catch runaway regular expressions that take for ever to determine that they do
|
|
||||||
not match. The default is set very large so that it does not accidentally catch
|
|
||||||
legitimate cases. On Unix systems, "configure" can be used to override this
|
|
||||||
default default. */
|
|
||||||
|
|
||||||
#ifndef MATCH_LIMIT
|
|
||||||
#define MATCH_LIMIT 10000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* When calling PCRE via the POSIX interface, additional working storage is
|
|
||||||
required for holding the pointers to capturing substrings because PCRE requires
|
|
||||||
three integers per substring, whereas the POSIX interface provides only two. If
|
|
||||||
the number of expected substrings is small, the wrapper function uses space on
|
|
||||||
the stack, because this is faster than using malloc() for each call. The
|
|
||||||
threshold above which the stack is no longer use is defined by POSIX_MALLOC_
|
|
||||||
THRESHOLD. On Unix systems, "configure" can be used to override this default.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef POSIX_MALLOC_THRESHOLD
|
|
||||||
#define POSIX_MALLOC_THRESHOLD 10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* PCRE uses recursive function calls to handle backtracking while matching.
|
|
||||||
This can sometimes be a problem on systems that have stacks of limited size.
|
|
||||||
Define NO_RECURSE to get a version that doesn't use recursion in the match()
|
|
||||||
function; instead it creates its own stack by steam using pcre_recurse_malloc
|
|
||||||
to get memory. For more detail, see comments and other stuff just above the
|
|
||||||
match() function. On Unix systems, "configure" can be used to set this in the
|
|
||||||
Makefile (use --disable-stack-for-recursion). */
|
|
||||||
|
|
||||||
/* #define NO_RECURSE */
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef POSIX_MALLOC_THRESHOLD
|
|
||||||
#define POSIX_MALLOC_THRESHOLD 10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SUPPORT_UTF8
|
|
||||||
#define SUPPORT_UTF8 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#pragma warning(disable:4244)
|
|
||||||
#pragma warning(disable:4267)
|
|
||||||
#pragma warning(disable:4090)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* End */
|
|
@ -1,752 +0,0 @@
|
|||||||
/*************************************************
|
|
||||||
* Perl-Compatible Regular Expressions *
|
|
||||||
*************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
/* This is a library of functions to support regular expressions whose syntax
|
|
||||||
and semantics are as close as possible to those of the Perl 5 language. See
|
|
||||||
the file doc/Tech.Notes for some information on the internals.
|
|
||||||
|
|
||||||
Written by: Philip Hazel <ph10@cam.ac.uk>
|
|
||||||
|
|
||||||
Copyright (c) 1997-2004 University of Cambridge
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the name of the University of Cambridge nor the names of its
|
|
||||||
contributors may be used to endorse or promote products derived from
|
|
||||||
this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
||||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
||||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
||||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
||||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
||||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
||||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
||||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
||||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
-----------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* This header contains definitions that are shared between the different
|
|
||||||
modules, but which are not relevant to the outside. */
|
|
||||||
|
|
||||||
/* Get the definitions provided by running "configure" */
|
|
||||||
|
|
||||||
#include "pcreconfig.h"
|
|
||||||
|
|
||||||
/* Standard C headers plus the external interface definition. The only time
|
|
||||||
setjmp and stdarg are used is when NO_RECURSE is set. */
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <limits.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifndef PCRE_SPY
|
|
||||||
#define PCRE_DEFINITION /* Win32 __declspec(export) trigger for .dll */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We need to have types that specify unsigned 16-bit and 32-bit integers. We
|
|
||||||
cannot determine these outside the compilation (e.g. by running a program as
|
|
||||||
part of "configure") because PCRE is often cross-compiled for use on other
|
|
||||||
systems. Instead we make use of the maximum sizes that are available at
|
|
||||||
preprocessor time in standard C environments. */
|
|
||||||
|
|
||||||
#if USHRT_MAX == 65535
|
|
||||||
typedef unsigned short pcre_uint16;
|
|
||||||
#elif UINT_MAX == 65535
|
|
||||||
typedef unsigned int pcre_uint16;
|
|
||||||
#else
|
|
||||||
#error Cannot determine a type for 16-bit unsigned integers
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if UINT_MAX == 4294967295
|
|
||||||
typedef unsigned int pcre_uint32;
|
|
||||||
#elif ULONG_MAX == 4294967295
|
|
||||||
typedef unsigned long int pcre_uint32;
|
|
||||||
#else
|
|
||||||
#error Cannot determine a type for 32-bit unsigned integers
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* All character handling must be done as unsigned characters. Otherwise there
|
|
||||||
are problems with top-bit-set characters and functions such as isspace().
|
|
||||||
However, we leave the interface to the outside world as char *, because that
|
|
||||||
should make things easier for callers. We define a short type for unsigned char
|
|
||||||
to save lots of typing. I tried "uchar", but it causes problems on Digital
|
|
||||||
Unix, where it is defined in sys/types, so use "uschar" instead. */
|
|
||||||
|
|
||||||
typedef unsigned char uschar;
|
|
||||||
|
|
||||||
/* Include the public PCRE header */
|
|
||||||
|
|
||||||
#include "pcre.h"
|
|
||||||
|
|
||||||
/* When compiling for use with the Virtual Pascal compiler, these functions
|
|
||||||
need to have their names changed. PCRE must be compiled with the -DVPCOMPAT
|
|
||||||
option on the command line. */
|
|
||||||
|
|
||||||
#ifdef VPCOMPAT
|
|
||||||
#define strncmp(s1,s2,m) _strncmp(s1,s2,m)
|
|
||||||
#define memcpy(d,s,n) _memcpy(d,s,n)
|
|
||||||
#define memmove(d,s,n) _memmove(d,s,n)
|
|
||||||
#define memset(s,c,n) _memset(s,c,n)
|
|
||||||
#else /* VPCOMPAT */
|
|
||||||
|
|
||||||
/* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),
|
|
||||||
define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY
|
|
||||||
is set. Otherwise, include an emulating function for those systems that have
|
|
||||||
neither (there some non-Unix environments where this is the case). This assumes
|
|
||||||
that all calls to memmove are moving strings upwards in store, which is the
|
|
||||||
case in PCRE. */
|
|
||||||
|
|
||||||
#if ! HAVE_MEMMOVE
|
|
||||||
#undef memmove /* some systems may have a macro */
|
|
||||||
#if HAVE_BCOPY
|
|
||||||
#define memmove(a, b, c) bcopy(b, a, c)
|
|
||||||
#else /* HAVE_BCOPY */
|
|
||||||
void *
|
|
||||||
pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
dest += n;
|
|
||||||
src += n;
|
|
||||||
for (i = 0; i < n; ++i) *(--dest) = *(--src);
|
|
||||||
}
|
|
||||||
#define memmove(a, b, c) pcre_memmove(a, b, c)
|
|
||||||
#endif /* not HAVE_BCOPY */
|
|
||||||
#endif /* not HAVE_MEMMOVE */
|
|
||||||
#endif /* not VPCOMPAT */
|
|
||||||
|
|
||||||
|
|
||||||
/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored
|
|
||||||
in big-endian order) by default. These are used, for example, to link from the
|
|
||||||
start of a subpattern to its alternatives and its end. The use of 2 bytes per
|
|
||||||
offset limits the size of the compiled regex to around 64K, which is big enough
|
|
||||||
for almost everybody. However, I received a request for an even bigger limit.
|
|
||||||
For this reason, and also to make the code easier to maintain, the storing and
|
|
||||||
loading of offsets from the byte string is now handled by the macros that are
|
|
||||||
defined here.
|
|
||||||
|
|
||||||
The macros are controlled by the value of LINK_SIZE. This defaults to 2 in
|
|
||||||
the config.h file, but can be overridden by using -D on the command line. This
|
|
||||||
is automated on Unix systems via the "configure" command. */
|
|
||||||
|
|
||||||
#if LINK_SIZE == 2
|
|
||||||
|
|
||||||
#define PUT(a,n,d) \
|
|
||||||
(a[n] = (d) >> 8), \
|
|
||||||
(a[(n)+1] = (d) & 255)
|
|
||||||
|
|
||||||
#define GET(a,n) \
|
|
||||||
(((a)[n] << 8) | (a)[(n)+1])
|
|
||||||
|
|
||||||
#define MAX_PATTERN_SIZE (1 << 16)
|
|
||||||
|
|
||||||
|
|
||||||
#elif LINK_SIZE == 3
|
|
||||||
|
|
||||||
#define PUT(a,n,d) \
|
|
||||||
(a[n] = (d) >> 16), \
|
|
||||||
(a[(n)+1] = (d) >> 8), \
|
|
||||||
(a[(n)+2] = (d) & 255)
|
|
||||||
|
|
||||||
#define GET(a,n) \
|
|
||||||
(((a)[n] << 16) | ((a)[(n)+1] << 8) | (a)[(n)+2])
|
|
||||||
|
|
||||||
#define MAX_PATTERN_SIZE (1 << 24)
|
|
||||||
|
|
||||||
|
|
||||||
#elif LINK_SIZE == 4
|
|
||||||
|
|
||||||
#define PUT(a,n,d) \
|
|
||||||
(a[n] = (d) >> 24), \
|
|
||||||
(a[(n)+1] = (d) >> 16), \
|
|
||||||
(a[(n)+2] = (d) >> 8), \
|
|
||||||
(a[(n)+3] = (d) & 255)
|
|
||||||
|
|
||||||
#define GET(a,n) \
|
|
||||||
(((a)[n] << 24) | ((a)[(n)+1] << 16) | ((a)[(n)+2] << 8) | (a)[(n)+3])
|
|
||||||
|
|
||||||
#define MAX_PATTERN_SIZE (1 << 30) /* Keep it positive */
|
|
||||||
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error LINK_SIZE must be either 2, 3, or 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Convenience macro defined in terms of the others */
|
|
||||||
|
|
||||||
#define PUTINC(a,n,d) PUT(a,n,d), a += LINK_SIZE
|
|
||||||
|
|
||||||
|
|
||||||
/* PCRE uses some other 2-byte quantities that do not change when the size of
|
|
||||||
offsets changes. There are used for repeat counts and for other things such as
|
|
||||||
capturing parenthesis numbers in back references. */
|
|
||||||
|
|
||||||
#define PUT2(a,n,d) \
|
|
||||||
a[n] = (d) >> 8; \
|
|
||||||
a[(n)+1] = (d) & 255
|
|
||||||
|
|
||||||
#define GET2(a,n) \
|
|
||||||
(((a)[n] << 8) | (a)[(n)+1])
|
|
||||||
|
|
||||||
#define PUT2INC(a,n,d) PUT2(a,n,d), a += 2
|
|
||||||
|
|
||||||
|
|
||||||
/* In case there is no definition of offsetof() provided - though any proper
|
|
||||||
Standard C system should have one. */
|
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(p_type,field) ((size_t)&(((p_type *)0)->field))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* These are the public options that can change during matching. */
|
|
||||||
|
|
||||||
#define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)
|
|
||||||
|
|
||||||
/* Private options flags start at the most significant end of the four bytes,
|
|
||||||
but skip the top bit so we can use ints for convenience without getting tangled
|
|
||||||
with negative values. The public options defined in pcre.h start at the least
|
|
||||||
significant end. Make sure they don't overlap, though now that we have expanded
|
|
||||||
to four bytes, there is plenty of space. */
|
|
||||||
|
|
||||||
#define PCRE_FIRSTSET 0x40000000 /* first_byte is set */
|
|
||||||
#define PCRE_REQCHSET 0x20000000 /* req_byte is set */
|
|
||||||
#define PCRE_STARTLINE 0x10000000 /* start after \n for multiline */
|
|
||||||
#define PCRE_ICHANGED 0x08000000 /* i option changes within regex */
|
|
||||||
#define PCRE_NOPARTIAL 0x04000000 /* can't use partial with this regex */
|
|
||||||
|
|
||||||
/* Options for the "extra" block produced by pcre_study(). */
|
|
||||||
|
|
||||||
#define PCRE_STUDY_MAPPED 0x01 /* a map of starting chars exists */
|
|
||||||
|
|
||||||
/* Masks for identifying the public options which are permitted at compile
|
|
||||||
time, run time or study time, respectively. */
|
|
||||||
|
|
||||||
#define PUBLIC_OPTIONS \
|
|
||||||
(PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \
|
|
||||||
PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \
|
|
||||||
PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT)
|
|
||||||
|
|
||||||
#define PUBLIC_EXEC_OPTIONS \
|
|
||||||
(PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \
|
|
||||||
PCRE_PARTIAL)
|
|
||||||
|
|
||||||
#define PUBLIC_STUDY_OPTIONS 0 /* None defined */
|
|
||||||
|
|
||||||
/* Magic number to provide a small check against being handed junk. */
|
|
||||||
|
|
||||||
#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */
|
|
||||||
|
|
||||||
/* Negative values for the firstchar and reqchar variables */
|
|
||||||
|
|
||||||
#define REQ_UNSET (-2)
|
|
||||||
#define REQ_NONE (-1)
|
|
||||||
|
|
||||||
/* Flags added to firstbyte or reqbyte; a "non-literal" item is either a
|
|
||||||
variable-length repeat, or a anything other than literal characters. */
|
|
||||||
|
|
||||||
#define REQ_CASELESS 0x0100 /* indicates caselessness */
|
|
||||||
#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */
|
|
||||||
|
|
||||||
/* Miscellaneous definitions */
|
|
||||||
|
|
||||||
typedef int BOOL;
|
|
||||||
|
|
||||||
#define FALSE 0
|
|
||||||
#define TRUE 1
|
|
||||||
|
|
||||||
/* Escape items that are just an encoding of a particular data value. Note that
|
|
||||||
ESC_n is defined as yet another macro, which is set in config.h to either \n
|
|
||||||
(the default) or \r (which some people want). */
|
|
||||||
|
|
||||||
#ifndef ESC_e
|
|
||||||
#define ESC_e 27
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ESC_f
|
|
||||||
#define ESC_f '\f'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ESC_n
|
|
||||||
#define ESC_n NEWLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef ESC_r
|
|
||||||
#define ESC_r '\r'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* We can't officially use ESC_t because it is a POSIX reserved identifier
|
|
||||||
(presumably because of all the others like size_t). */
|
|
||||||
|
|
||||||
#ifndef ESC_tee
|
|
||||||
#define ESC_tee '\t'
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* These are escaped items that aren't just an encoding of a particular data
|
|
||||||
value such as \n. They must have non-zero values, as check_escape() returns
|
|
||||||
their negation. Also, they must appear in the same order as in the opcode
|
|
||||||
definitions below, up to ESC_z. There's a dummy for OP_ANY because it
|
|
||||||
corresponds to "." rather than an escape sequence. The final one must be
|
|
||||||
ESC_REF as subsequent values are used for \1, \2, \3, etc. There is are two
|
|
||||||
tests in the code for an escape greater than ESC_b and less than ESC_Z to
|
|
||||||
detect the types that may be repeated. These are the types that consume
|
|
||||||
characters. If any new escapes are put in between that don't consume a
|
|
||||||
character, that code will have to change. */
|
|
||||||
|
|
||||||
enum { ESC_A = 1, ESC_G, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, ESC_W,
|
|
||||||
ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_X, ESC_Z, ESC_z, ESC_E,
|
|
||||||
ESC_Q, ESC_REF };
|
|
||||||
|
|
||||||
/* Flag bits and data types for the extended class (OP_XCLASS) for classes that
|
|
||||||
contain UTF-8 characters with values greater than 255. */
|
|
||||||
|
|
||||||
#define XCL_NOT 0x01 /* Flag: this is a negative class */
|
|
||||||
#define XCL_MAP 0x02 /* Flag: a 32-byte map is present */
|
|
||||||
|
|
||||||
#define XCL_END 0 /* Marks end of individual items */
|
|
||||||
#define XCL_SINGLE 1 /* Single item (one multibyte char) follows */
|
|
||||||
#define XCL_RANGE 2 /* A range (two multibyte chars) follows */
|
|
||||||
#define XCL_PROP 3 /* Unicode property (one property code) follows */
|
|
||||||
#define XCL_NOTPROP 4 /* Unicode inverted property (ditto) */
|
|
||||||
|
|
||||||
|
|
||||||
/* Opcode table: OP_BRA must be last, as all values >= it are used for brackets
|
|
||||||
that extract substrings. Starting from 1 (i.e. after OP_END), the values up to
|
|
||||||
OP_EOD must correspond in order to the list of escapes immediately above.
|
|
||||||
Note that whenever this list is updated, the two macro definitions that follow
|
|
||||||
must also be updated to match. */
|
|
||||||
|
|
||||||
enum {
|
|
||||||
OP_END, /* 0 End of pattern */
|
|
||||||
|
|
||||||
/* Values corresponding to backslashed metacharacters */
|
|
||||||
|
|
||||||
OP_SOD, /* 1 Start of data: \A */
|
|
||||||
OP_SOM, /* 2 Start of match (subject + offset): \G */
|
|
||||||
OP_NOT_WORD_BOUNDARY, /* 3 \B */
|
|
||||||
OP_WORD_BOUNDARY, /* 4 \b */
|
|
||||||
OP_NOT_DIGIT, /* 5 \D */
|
|
||||||
OP_DIGIT, /* 6 \d */
|
|
||||||
OP_NOT_WHITESPACE, /* 7 \S */
|
|
||||||
OP_WHITESPACE, /* 8 \s */
|
|
||||||
OP_NOT_WORDCHAR, /* 9 \W */
|
|
||||||
OP_WORDCHAR, /* 10 \w */
|
|
||||||
OP_ANY, /* 11 Match any character */
|
|
||||||
OP_ANYBYTE, /* 12 Match any byte (\C); different to OP_ANY for UTF-8 */
|
|
||||||
OP_NOTPROP, /* 13 \P (not Unicode property) */
|
|
||||||
OP_PROP, /* 14 \p (Unicode property) */
|
|
||||||
OP_EXTUNI, /* 15 \X (extended Unicode sequence */
|
|
||||||
OP_EODN, /* 16 End of data or \n at end of data: \Z. */
|
|
||||||
OP_EOD, /* 17 End of data: \z */
|
|
||||||
|
|
||||||
OP_OPT, /* 18 Set runtime options */
|
|
||||||
OP_CIRC, /* 19 Start of line - varies with multiline switch */
|
|
||||||
OP_DOLL, /* 20 End of line - varies with multiline switch */
|
|
||||||
OP_CHAR, /* 21 Match one character, casefully */
|
|
||||||
OP_CHARNC, /* 22 Match one character, caselessly */
|
|
||||||
OP_NOT, /* 23 Match anything but the following char */
|
|
||||||
|
|
||||||
OP_STAR, /* 24 The maximizing and minimizing versions of */
|
|
||||||
OP_MINSTAR, /* 25 all these opcodes must come in pairs, with */
|
|
||||||
OP_PLUS, /* 26 the minimizing one second. */
|
|
||||||
OP_MINPLUS, /* 27 This first set applies to single characters */
|
|
||||||
OP_QUERY, /* 28 */
|
|
||||||
OP_MINQUERY, /* 29 */
|
|
||||||
OP_UPTO, /* 30 From 0 to n matches */
|
|
||||||
OP_MINUPTO, /* 31 */
|
|
||||||
OP_EXACT, /* 32 Exactly n matches */
|
|
||||||
|
|
||||||
OP_NOTSTAR, /* 33 The maximizing and minimizing versions of */
|
|
||||||
OP_NOTMINSTAR, /* 34 all these opcodes must come in pairs, with */
|
|
||||||
OP_NOTPLUS, /* 35 the minimizing one second. */
|
|
||||||
OP_NOTMINPLUS, /* 36 This set applies to "not" single characters */
|
|
||||||
OP_NOTQUERY, /* 37 */
|
|
||||||
OP_NOTMINQUERY, /* 38 */
|
|
||||||
OP_NOTUPTO, /* 39 From 0 to n matches */
|
|
||||||
OP_NOTMINUPTO, /* 40 */
|
|
||||||
OP_NOTEXACT, /* 41 Exactly n matches */
|
|
||||||
|
|
||||||
OP_TYPESTAR, /* 42 The maximizing and minimizing versions of */
|
|
||||||
OP_TYPEMINSTAR, /* 43 all these opcodes must come in pairs, with */
|
|
||||||
OP_TYPEPLUS, /* 44 the minimizing one second. These codes must */
|
|
||||||
OP_TYPEMINPLUS, /* 45 be in exactly the same order as those above. */
|
|
||||||
OP_TYPEQUERY, /* 46 This set applies to character types such as \d */
|
|
||||||
OP_TYPEMINQUERY, /* 47 */
|
|
||||||
OP_TYPEUPTO, /* 48 From 0 to n matches */
|
|
||||||
OP_TYPEMINUPTO, /* 49 */
|
|
||||||
OP_TYPEEXACT, /* 50 Exactly n matches */
|
|
||||||
|
|
||||||
OP_CRSTAR, /* 51 The maximizing and minimizing versions of */
|
|
||||||
OP_CRMINSTAR, /* 52 all these opcodes must come in pairs, with */
|
|
||||||
OP_CRPLUS, /* 53 the minimizing one second. These codes must */
|
|
||||||
OP_CRMINPLUS, /* 54 be in exactly the same order as those above. */
|
|
||||||
OP_CRQUERY, /* 55 These are for character classes and back refs */
|
|
||||||
OP_CRMINQUERY, /* 56 */
|
|
||||||
OP_CRRANGE, /* 57 These are different to the three sets above. */
|
|
||||||
OP_CRMINRANGE, /* 58 */
|
|
||||||
|
|
||||||
OP_CLASS, /* 59 Match a character class, chars < 256 only */
|
|
||||||
OP_NCLASS, /* 60 Same, but the bitmap was created from a negative
|
|
||||||
class - the difference is relevant only when a UTF-8
|
|
||||||
character > 255 is encountered. */
|
|
||||||
|
|
||||||
OP_XCLASS, /* 61 Extended class for handling UTF-8 chars within the
|
|
||||||
class. This does both positive and negative. */
|
|
||||||
|
|
||||||
OP_REF, /* 62 Match a back reference */
|
|
||||||
OP_RECURSE, /* 63 Match a numbered subpattern (possibly recursive) */
|
|
||||||
OP_CALLOUT, /* 64 Call out to external function if provided */
|
|
||||||
|
|
||||||
OP_ALT, /* 65 Start of alternation */
|
|
||||||
OP_KET, /* 66 End of group that doesn't have an unbounded repeat */
|
|
||||||
OP_KETRMAX, /* 67 These two must remain together and in this */
|
|
||||||
OP_KETRMIN, /* 68 order. They are for groups the repeat for ever. */
|
|
||||||
|
|
||||||
/* The assertions must come before ONCE and COND */
|
|
||||||
|
|
||||||
OP_ASSERT, /* 69 Positive lookahead */
|
|
||||||
OP_ASSERT_NOT, /* 70 Negative lookahead */
|
|
||||||
OP_ASSERTBACK, /* 71 Positive lookbehind */
|
|
||||||
OP_ASSERTBACK_NOT, /* 72 Negative lookbehind */
|
|
||||||
OP_REVERSE, /* 73 Move pointer back - used in lookbehind assertions */
|
|
||||||
|
|
||||||
/* ONCE and COND must come after the assertions, with ONCE first, as there's
|
|
||||||
a test for >= ONCE for a subpattern that isn't an assertion. */
|
|
||||||
|
|
||||||
OP_ONCE, /* 74 Once matched, don't back up into the subpattern */
|
|
||||||
OP_COND, /* 75 Conditional group */
|
|
||||||
OP_CREF, /* 76 Used to hold an extraction string number (cond ref) */
|
|
||||||
|
|
||||||
OP_BRAZERO, /* 77 These two must remain together and in this */
|
|
||||||
OP_BRAMINZERO, /* 78 order. */
|
|
||||||
|
|
||||||
OP_BRANUMBER, /* 79 Used for extracting brackets whose number is greater
|
|
||||||
than can fit into an opcode. */
|
|
||||||
|
|
||||||
OP_BRA /* 80 This and greater values are used for brackets that
|
|
||||||
extract substrings up to EXTRACT_BASIC_MAX. After
|
|
||||||
that, use is made of OP_BRANUMBER. */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* WARNING WARNING WARNING: There is an implicit assumption in pcre.c and
|
|
||||||
study.c that all opcodes are less than 128 in value. This makes handling UTF-8
|
|
||||||
character sequences easier. */
|
|
||||||
|
|
||||||
/* The highest extraction number before we have to start using additional
|
|
||||||
bytes. (Originally PCRE didn't have support for extraction counts highter than
|
|
||||||
this number.) The value is limited by the number of opcodes left after OP_BRA,
|
|
||||||
i.e. 255 - OP_BRA. We actually set it a bit lower to leave room for additional
|
|
||||||
opcodes. */
|
|
||||||
|
|
||||||
#define EXTRACT_BASIC_MAX 100
|
|
||||||
|
|
||||||
|
|
||||||
/* This macro defines textual names for all the opcodes. There are used only
|
|
||||||
for debugging, in pcre.c when DEBUG is defined, and also in pcretest.c. The
|
|
||||||
macro is referenced only in printint.c. */
|
|
||||||
|
|
||||||
#define OP_NAME_LIST \
|
|
||||||
"End", "\\A", "\\G", "\\B", "\\b", "\\D", "\\d", \
|
|
||||||
"\\S", "\\s", "\\W", "\\w", "Any", "Anybyte", \
|
|
||||||
"notprop", "prop", "extuni", \
|
|
||||||
"\\Z", "\\z", \
|
|
||||||
"Opt", "^", "$", "char", "charnc", "not", \
|
|
||||||
"*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
|
|
||||||
"*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
|
|
||||||
"*", "*?", "+", "+?", "?", "??", "{", "{", "{", \
|
|
||||||
"*", "*?", "+", "+?", "?", "??", "{", "{", \
|
|
||||||
"class", "nclass", "xclass", "Ref", "Recurse", "Callout", \
|
|
||||||
"Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \
|
|
||||||
"AssertB", "AssertB not", "Reverse", "Once", "Cond", "Cond ref",\
|
|
||||||
"Brazero", "Braminzero", "Branumber", "Bra"
|
|
||||||
|
|
||||||
|
|
||||||
/* This macro defines the length of fixed length operations in the compiled
|
|
||||||
regex. The lengths are used when searching for specific things, and also in the
|
|
||||||
debugging printing of a compiled regex. We use a macro so that it can be
|
|
||||||
incorporated both into pcre.c and pcretest.c without being publicly exposed.
|
|
||||||
|
|
||||||
As things have been extended, some of these are no longer fixed lenths, but are
|
|
||||||
minima instead. For example, the length of a single-character repeat may vary
|
|
||||||
in UTF-8 mode. The code that uses this table must know about such things. */
|
|
||||||
|
|
||||||
#define OP_LENGTHS \
|
|
||||||
1, /* End */ \
|
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* \A, \G, \B, \B, \D, \d, \S, \s, \W, \w */ \
|
|
||||||
1, 1, /* Any, Anybyte */ \
|
|
||||||
2, 2, 1, /* NOTPROP, PROP, EXTUNI */ \
|
|
||||||
1, 1, 2, 1, 1, /* \Z, \z, Opt, ^, $ */ \
|
|
||||||
2, /* Char - the minimum length */ \
|
|
||||||
2, /* Charnc - the minimum length */ \
|
|
||||||
2, /* not */ \
|
|
||||||
/* Positive single-char repeats ** These are */ \
|
|
||||||
2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \
|
|
||||||
4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \
|
|
||||||
/* Negative single-char repeats - only for chars < 256 */ \
|
|
||||||
2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \
|
|
||||||
4, 4, 4, /* NOT upto, minupto, exact */ \
|
|
||||||
/* Positive type repeats */ \
|
|
||||||
2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \
|
|
||||||
4, 4, 4, /* Type upto, minupto, exact */ \
|
|
||||||
/* Character class & ref repeats */ \
|
|
||||||
1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \
|
|
||||||
5, 5, /* CRRANGE, CRMINRANGE */ \
|
|
||||||
33, /* CLASS */ \
|
|
||||||
33, /* NCLASS */ \
|
|
||||||
0, /* XCLASS - variable length */ \
|
|
||||||
3, /* REF */ \
|
|
||||||
1+LINK_SIZE, /* RECURSE */ \
|
|
||||||
2+2*LINK_SIZE, /* CALLOUT */ \
|
|
||||||
1+LINK_SIZE, /* Alt */ \
|
|
||||||
1+LINK_SIZE, /* Ket */ \
|
|
||||||
1+LINK_SIZE, /* KetRmax */ \
|
|
||||||
1+LINK_SIZE, /* KetRmin */ \
|
|
||||||
1+LINK_SIZE, /* Assert */ \
|
|
||||||
1+LINK_SIZE, /* Assert not */ \
|
|
||||||
1+LINK_SIZE, /* Assert behind */ \
|
|
||||||
1+LINK_SIZE, /* Assert behind not */ \
|
|
||||||
1+LINK_SIZE, /* Reverse */ \
|
|
||||||
1+LINK_SIZE, /* Once */ \
|
|
||||||
1+LINK_SIZE, /* COND */ \
|
|
||||||
3, /* CREF */ \
|
|
||||||
1, 1, /* BRAZERO, BRAMINZERO */ \
|
|
||||||
3, /* BRANUMBER */ \
|
|
||||||
1+LINK_SIZE /* BRA */ \
|
|
||||||
|
|
||||||
|
|
||||||
/* A magic value for OP_CREF to indicate the "in recursion" condition. */
|
|
||||||
|
|
||||||
#define CREF_RECURSE 0xffff
|
|
||||||
|
|
||||||
/* The texts of compile-time error messages are defined as macros here so that
|
|
||||||
they can be accessed by the POSIX wrapper and converted into error codes. Yes,
|
|
||||||
I could have used error codes in the first place, but didn't feel like changing
|
|
||||||
just to accommodate the POSIX wrapper. */
|
|
||||||
|
|
||||||
#define ERR1 "\\ at end of pattern"
|
|
||||||
#define ERR2 "\\c at end of pattern"
|
|
||||||
#define ERR3 "unrecognized character follows \\"
|
|
||||||
#define ERR4 "numbers out of order in {} quantifier"
|
|
||||||
#define ERR5 "number too big in {} quantifier"
|
|
||||||
#define ERR6 "missing terminating ] for character class"
|
|
||||||
#define ERR7 "invalid escape sequence in character class"
|
|
||||||
#define ERR8 "range out of order in character class"
|
|
||||||
#define ERR9 "nothing to repeat"
|
|
||||||
#define ERR10 "operand of unlimited repeat could match the empty string"
|
|
||||||
#define ERR11 "internal error: unexpected repeat"
|
|
||||||
#define ERR12 "unrecognized character after (?"
|
|
||||||
#define ERR13 "POSIX named classes are supported only within a class"
|
|
||||||
#define ERR14 "missing )"
|
|
||||||
#define ERR15 "reference to non-existent subpattern"
|
|
||||||
#define ERR16 "erroffset passed as NULL"
|
|
||||||
#define ERR17 "unknown option bit(s) set"
|
|
||||||
#define ERR18 "missing ) after comment"
|
|
||||||
#define ERR19 "parentheses nested too deeply"
|
|
||||||
#define ERR20 "regular expression too large"
|
|
||||||
#define ERR21 "failed to get memory"
|
|
||||||
#define ERR22 "unmatched parentheses"
|
|
||||||
#define ERR23 "internal error: code overflow"
|
|
||||||
#define ERR24 "unrecognized character after (?<"
|
|
||||||
#define ERR25 "lookbehind assertion is not fixed length"
|
|
||||||
#define ERR26 "malformed number after (?("
|
|
||||||
#define ERR27 "conditional group contains more than two branches"
|
|
||||||
#define ERR28 "assertion expected after (?("
|
|
||||||
#define ERR29 "(?R or (?digits must be followed by )"
|
|
||||||
#define ERR30 "unknown POSIX class name"
|
|
||||||
#define ERR31 "POSIX collating elements are not supported"
|
|
||||||
#define ERR32 "this version of PCRE is not compiled with PCRE_UTF8 support"
|
|
||||||
#define ERR33 "spare error"
|
|
||||||
#define ERR34 "character value in \\x{...} sequence is too large"
|
|
||||||
#define ERR35 "invalid condition (?(0)"
|
|
||||||
#define ERR36 "\\C not allowed in lookbehind assertion"
|
|
||||||
#define ERR37 "PCRE does not support \\L, \\l, \\N, \\U, or \\u"
|
|
||||||
#define ERR38 "number after (?C is > 255"
|
|
||||||
#define ERR39 "closing ) for (?C expected"
|
|
||||||
#define ERR40 "recursive call could loop indefinitely"
|
|
||||||
#define ERR41 "unrecognized character after (?P"
|
|
||||||
#define ERR42 "syntax error after (?P"
|
|
||||||
#define ERR43 "two named groups have the same name"
|
|
||||||
#define ERR44 "invalid UTF-8 string"
|
|
||||||
#define ERR45 "support for \\P, \\p, and \\X has not been compiled"
|
|
||||||
#define ERR46 "malformed \\P or \\p sequence"
|
|
||||||
#define ERR47 "unknown property name after \\P or \\p"
|
|
||||||
|
|
||||||
/* The real format of the start of the pcre block; the index of names and the
|
|
||||||
code vector run on as long as necessary after the end. We store an explicit
|
|
||||||
offset to the name table so that if a regex is compiled on one host, saved, and
|
|
||||||
then run on another where the size of pointers is different, all might still
|
|
||||||
be well. For the case of compiled-on-4 and run-on-8, we include an extra
|
|
||||||
pointer that is always NULL. For future-proofing, we also include a few dummy
|
|
||||||
fields - even though you can never get this planning right!
|
|
||||||
|
|
||||||
NOTE NOTE NOTE:
|
|
||||||
Because people can now save and re-use compiled patterns, any additions to this
|
|
||||||
structure should be made at the end, and something earlier (e.g. a new
|
|
||||||
flag in the options or one of the dummy fields) should indicate that the new
|
|
||||||
fields are present. Currently PCRE always sets the dummy fields to zero.
|
|
||||||
NOTE NOTE NOTE:
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct real_pcre {
|
|
||||||
pcre_uint32 magic_number;
|
|
||||||
pcre_uint32 size; /* Total that was malloced */
|
|
||||||
pcre_uint32 options;
|
|
||||||
pcre_uint32 dummy1; /* For future use, maybe */
|
|
||||||
|
|
||||||
pcre_uint16 top_bracket;
|
|
||||||
pcre_uint16 top_backref;
|
|
||||||
pcre_uint16 first_byte;
|
|
||||||
pcre_uint16 req_byte;
|
|
||||||
pcre_uint16 name_table_offset; /* Offset to name table that follows */
|
|
||||||
pcre_uint16 name_entry_size; /* Size of any name items */
|
|
||||||
pcre_uint16 name_count; /* Number of name items */
|
|
||||||
pcre_uint16 dummy2; /* For future use, maybe */
|
|
||||||
|
|
||||||
const unsigned char *tables; /* Pointer to tables or NULL for std */
|
|
||||||
const unsigned char *nullpad; /* NULL padding */
|
|
||||||
} real_pcre;
|
|
||||||
|
|
||||||
/* The format of the block used to store data from pcre_study(). The same
|
|
||||||
remark (see NOTE above) about extending this structure applies. */
|
|
||||||
|
|
||||||
typedef struct pcre_study_data {
|
|
||||||
pcre_uint32 size; /* Total that was malloced */
|
|
||||||
pcre_uint32 options;
|
|
||||||
uschar start_bits[32];
|
|
||||||
} pcre_study_data;
|
|
||||||
|
|
||||||
/* Structure for passing "static" information around between the functions
|
|
||||||
doing the compiling, so that they are thread-safe. */
|
|
||||||
|
|
||||||
typedef struct compile_data {
|
|
||||||
const uschar *lcc; /* Points to lower casing table */
|
|
||||||
const uschar *fcc; /* Points to case-flipping table */
|
|
||||||
const uschar *cbits; /* Points to character type table */
|
|
||||||
const uschar *ctypes; /* Points to table of type maps */
|
|
||||||
const uschar *start_code; /* The start of the compiled code */
|
|
||||||
const uschar *start_pattern; /* The start of the pattern */
|
|
||||||
uschar *name_table; /* The name/number table */
|
|
||||||
int names_found; /* Number of entries so far */
|
|
||||||
int name_entry_size; /* Size of each entry */
|
|
||||||
int top_backref; /* Maximum back reference */
|
|
||||||
unsigned int backref_map; /* Bitmap of low back refs */
|
|
||||||
int req_varyopt; /* "After variable item" flag for reqbyte */
|
|
||||||
BOOL nopartial; /* Set TRUE if partial won't work */
|
|
||||||
} compile_data;
|
|
||||||
|
|
||||||
/* Structure for maintaining a chain of pointers to the currently incomplete
|
|
||||||
branches, for testing for left recursion. */
|
|
||||||
|
|
||||||
typedef struct branch_chain {
|
|
||||||
struct branch_chain *outer;
|
|
||||||
uschar *current;
|
|
||||||
} branch_chain;
|
|
||||||
|
|
||||||
/* Structure for items in a linked list that represents an explicit recursive
|
|
||||||
call within the pattern. */
|
|
||||||
|
|
||||||
typedef struct recursion_info {
|
|
||||||
struct recursion_info *prevrec; /* Previous recursion record (or NULL) */
|
|
||||||
int group_num; /* Number of group that was called */
|
|
||||||
const uschar *after_call; /* "Return value": points after the call in the expr */
|
|
||||||
const uschar *save_start; /* Old value of md->start_match */
|
|
||||||
int *offset_save; /* Pointer to start of saved offsets */
|
|
||||||
int saved_max; /* Number of saved offsets */
|
|
||||||
} recursion_info;
|
|
||||||
|
|
||||||
/* When compiling in a mode that doesn't use recursive calls to match(),
|
|
||||||
a structure is used to remember local variables on the heap. It is defined in
|
|
||||||
pcre.c, close to the match() function, so that it is easy to keep it in step
|
|
||||||
with any changes of local variable. However, the pointer to the current frame
|
|
||||||
must be saved in some "static" place over a longjmp(). We declare the
|
|
||||||
structure here so that we can put a pointer in the match_data structure.
|
|
||||||
NOTE: This isn't used for a "normal" compilation of pcre. */
|
|
||||||
|
|
||||||
struct heapframe;
|
|
||||||
|
|
||||||
/* Structure for passing "static" information around between the functions
|
|
||||||
doing the matching, so that they are thread-safe. */
|
|
||||||
|
|
||||||
typedef struct match_data {
|
|
||||||
unsigned long int match_call_count; /* As it says */
|
|
||||||
unsigned long int match_limit;/* As it says */
|
|
||||||
int *offset_vector; /* Offset vector */
|
|
||||||
int offset_end; /* One past the end */
|
|
||||||
int offset_max; /* The maximum usable for return data */
|
|
||||||
const uschar *lcc; /* Points to lower casing table */
|
|
||||||
const uschar *ctypes; /* Points to table of type maps */
|
|
||||||
BOOL offset_overflow; /* Set if too many extractions */
|
|
||||||
BOOL notbol; /* NOTBOL flag */
|
|
||||||
BOOL noteol; /* NOTEOL flag */
|
|
||||||
BOOL utf8; /* UTF8 flag */
|
|
||||||
BOOL endonly; /* Dollar not before final \n */
|
|
||||||
BOOL notempty; /* Empty string match not wanted */
|
|
||||||
BOOL partial; /* PARTIAL flag */
|
|
||||||
BOOL hitend; /* Hit the end of the subject at some point */
|
|
||||||
const uschar *start_code; /* For use when recursing */
|
|
||||||
const uschar *start_subject; /* Start of the subject string */
|
|
||||||
const uschar *end_subject; /* End of the subject string */
|
|
||||||
const uschar *start_match; /* Start of this match attempt */
|
|
||||||
const uschar *end_match_ptr; /* Subject position at end match */
|
|
||||||
int end_offset_top; /* Highwater mark at end of match */
|
|
||||||
int capture_last; /* Most recent capture number */
|
|
||||||
int start_offset; /* The start offset value */
|
|
||||||
recursion_info *recursive; /* Linked list of recursion data */
|
|
||||||
void *callout_data; /* To pass back to callouts */
|
|
||||||
struct heapframe *thisframe; /* Used only when compiling for no recursion */
|
|
||||||
} match_data;
|
|
||||||
|
|
||||||
/* Bit definitions for entries in the pcre_ctypes table. */
|
|
||||||
|
|
||||||
#define ctype_space 0x01
|
|
||||||
#define ctype_letter 0x02
|
|
||||||
#define ctype_digit 0x04
|
|
||||||
#define ctype_xdigit 0x08
|
|
||||||
#define ctype_word 0x10 /* alphameric or '_' */
|
|
||||||
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */
|
|
||||||
|
|
||||||
/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
|
|
||||||
of bits for a class map. Some classes are built by combining these tables. */
|
|
||||||
|
|
||||||
#define cbit_space 0 /* [:space:] or \s */
|
|
||||||
#define cbit_xdigit 32 /* [:xdigit:] */
|
|
||||||
#define cbit_digit 64 /* [:digit:] or \d */
|
|
||||||
#define cbit_upper 96 /* [:upper:] */
|
|
||||||
#define cbit_lower 128 /* [:lower:] */
|
|
||||||
#define cbit_word 160 /* [:word:] or \w */
|
|
||||||
#define cbit_graph 192 /* [:graph:] */
|
|
||||||
#define cbit_print 224 /* [:print:] */
|
|
||||||
#define cbit_punct 256 /* [:punct:] */
|
|
||||||
#define cbit_cntrl 288 /* [:cntrl:] */
|
|
||||||
#define cbit_length 320 /* Length of the cbits table */
|
|
||||||
|
|
||||||
/* Offsets of the various tables from the base tables pointer, and
|
|
||||||
total length. */
|
|
||||||
|
|
||||||
#define lcc_offset 0
|
|
||||||
#define fcc_offset 256
|
|
||||||
#define cbits_offset 512
|
|
||||||
#define ctypes_offset (cbits_offset + cbit_length)
|
|
||||||
#define tables_length (ctypes_offset + 256)
|
|
||||||
|
|
||||||
/* End of internal.h */
|
|
133
Foundation/src/ucp.h
Normal file
133
Foundation/src/ucp.h
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Unicode Property Table handler *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
#ifndef _UCP_H
|
||||||
|
#define _UCP_H
|
||||||
|
|
||||||
|
/* This file contains definitions of the property values that are returned by
|
||||||
|
the function _pcre_ucp_findprop(). New values that are added for new releases
|
||||||
|
of Unicode should always be at the end of each enum, for backwards
|
||||||
|
compatibility. */
|
||||||
|
|
||||||
|
/* These are the general character categories. */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ucp_C, /* Other */
|
||||||
|
ucp_L, /* Letter */
|
||||||
|
ucp_M, /* Mark */
|
||||||
|
ucp_N, /* Number */
|
||||||
|
ucp_P, /* Punctuation */
|
||||||
|
ucp_S, /* Symbol */
|
||||||
|
ucp_Z /* Separator */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* These are the particular character types. */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ucp_Cc, /* Control */
|
||||||
|
ucp_Cf, /* Format */
|
||||||
|
ucp_Cn, /* Unassigned */
|
||||||
|
ucp_Co, /* Private use */
|
||||||
|
ucp_Cs, /* Surrogate */
|
||||||
|
ucp_Ll, /* Lower case letter */
|
||||||
|
ucp_Lm, /* Modifier letter */
|
||||||
|
ucp_Lo, /* Other letter */
|
||||||
|
ucp_Lt, /* Title case letter */
|
||||||
|
ucp_Lu, /* Upper case letter */
|
||||||
|
ucp_Mc, /* Spacing mark */
|
||||||
|
ucp_Me, /* Enclosing mark */
|
||||||
|
ucp_Mn, /* Non-spacing mark */
|
||||||
|
ucp_Nd, /* Decimal number */
|
||||||
|
ucp_Nl, /* Letter number */
|
||||||
|
ucp_No, /* Other number */
|
||||||
|
ucp_Pc, /* Connector punctuation */
|
||||||
|
ucp_Pd, /* Dash punctuation */
|
||||||
|
ucp_Pe, /* Close punctuation */
|
||||||
|
ucp_Pf, /* Final punctuation */
|
||||||
|
ucp_Pi, /* Initial punctuation */
|
||||||
|
ucp_Po, /* Other punctuation */
|
||||||
|
ucp_Ps, /* Open punctuation */
|
||||||
|
ucp_Sc, /* Currency symbol */
|
||||||
|
ucp_Sk, /* Modifier symbol */
|
||||||
|
ucp_Sm, /* Mathematical symbol */
|
||||||
|
ucp_So, /* Other symbol */
|
||||||
|
ucp_Zl, /* Line separator */
|
||||||
|
ucp_Zp, /* Paragraph separator */
|
||||||
|
ucp_Zs /* Space separator */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* These are the script identifications. */
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ucp_Arabic,
|
||||||
|
ucp_Armenian,
|
||||||
|
ucp_Bengali,
|
||||||
|
ucp_Bopomofo,
|
||||||
|
ucp_Braille,
|
||||||
|
ucp_Buginese,
|
||||||
|
ucp_Buhid,
|
||||||
|
ucp_Canadian_Aboriginal,
|
||||||
|
ucp_Cherokee,
|
||||||
|
ucp_Common,
|
||||||
|
ucp_Coptic,
|
||||||
|
ucp_Cypriot,
|
||||||
|
ucp_Cyrillic,
|
||||||
|
ucp_Deseret,
|
||||||
|
ucp_Devanagari,
|
||||||
|
ucp_Ethiopic,
|
||||||
|
ucp_Georgian,
|
||||||
|
ucp_Glagolitic,
|
||||||
|
ucp_Gothic,
|
||||||
|
ucp_Greek,
|
||||||
|
ucp_Gujarati,
|
||||||
|
ucp_Gurmukhi,
|
||||||
|
ucp_Han,
|
||||||
|
ucp_Hangul,
|
||||||
|
ucp_Hanunoo,
|
||||||
|
ucp_Hebrew,
|
||||||
|
ucp_Hiragana,
|
||||||
|
ucp_Inherited,
|
||||||
|
ucp_Kannada,
|
||||||
|
ucp_Katakana,
|
||||||
|
ucp_Kharoshthi,
|
||||||
|
ucp_Khmer,
|
||||||
|
ucp_Lao,
|
||||||
|
ucp_Latin,
|
||||||
|
ucp_Limbu,
|
||||||
|
ucp_Linear_B,
|
||||||
|
ucp_Malayalam,
|
||||||
|
ucp_Mongolian,
|
||||||
|
ucp_Myanmar,
|
||||||
|
ucp_New_Tai_Lue,
|
||||||
|
ucp_Ogham,
|
||||||
|
ucp_Old_Italic,
|
||||||
|
ucp_Old_Persian,
|
||||||
|
ucp_Oriya,
|
||||||
|
ucp_Osmanya,
|
||||||
|
ucp_Runic,
|
||||||
|
ucp_Shavian,
|
||||||
|
ucp_Sinhala,
|
||||||
|
ucp_Syloti_Nagri,
|
||||||
|
ucp_Syriac,
|
||||||
|
ucp_Tagalog,
|
||||||
|
ucp_Tagbanwa,
|
||||||
|
ucp_Tai_Le,
|
||||||
|
ucp_Tamil,
|
||||||
|
ucp_Telugu,
|
||||||
|
ucp_Thaana,
|
||||||
|
ucp_Thai,
|
||||||
|
ucp_Tibetan,
|
||||||
|
ucp_Tifinagh,
|
||||||
|
ucp_Ugaritic,
|
||||||
|
ucp_Yi,
|
||||||
|
ucp_Balinese, /* New for Unicode 5.0.0 */
|
||||||
|
ucp_Cuneiform, /* New for Unicode 5.0.0 */
|
||||||
|
ucp_Nko, /* New for Unicode 5.0.0 */
|
||||||
|
ucp_Phags_Pa, /* New for Unicode 5.0.0 */
|
||||||
|
ucp_Phoenician /* New for Unicode 5.0.0 */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* End of ucp.h */
|
92
Foundation/src/ucpinternal.h
Normal file
92
Foundation/src/ucpinternal.h
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*************************************************
|
||||||
|
* Unicode Property Table handler *
|
||||||
|
*************************************************/
|
||||||
|
|
||||||
|
#ifndef _UCPINTERNAL_H
|
||||||
|
#define _UCPINTERNAL_H
|
||||||
|
|
||||||
|
/* Internal header file defining the layout of the bits in each pair of 32-bit
|
||||||
|
words that form a data item in the table. */
|
||||||
|
|
||||||
|
typedef struct cnode {
|
||||||
|
pcre_uint32 f0;
|
||||||
|
pcre_uint32 f1;
|
||||||
|
} cnode;
|
||||||
|
|
||||||
|
/* Things for the f0 field */
|
||||||
|
|
||||||
|
#define f0_scriptmask 0xff000000 /* Mask for script field */
|
||||||
|
#define f0_scriptshift 24 /* Shift for script value */
|
||||||
|
#define f0_rangeflag 0x00f00000 /* Flag for a range item */
|
||||||
|
#define f0_charmask 0x001fffff /* Mask for code point value */
|
||||||
|
|
||||||
|
/* Things for the f1 field */
|
||||||
|
|
||||||
|
#define f1_typemask 0xfc000000 /* Mask for char type field */
|
||||||
|
#define f1_typeshift 26 /* Shift for the type field */
|
||||||
|
#define f1_rangemask 0x0000ffff /* Mask for a range offset */
|
||||||
|
#define f1_casemask 0x0000ffff /* Mask for a case offset */
|
||||||
|
#define f1_caseneg 0xffff8000 /* Bits for negation */
|
||||||
|
|
||||||
|
/* The data consists of a vector of structures of type cnode. The two unsigned
|
||||||
|
32-bit integers are used as follows:
|
||||||
|
|
||||||
|
(f0) (1) The most significant byte holds the script number. The numbers are
|
||||||
|
defined by the enum in ucp.h.
|
||||||
|
|
||||||
|
(2) The 0x00800000 bit is set if this entry defines a range of characters.
|
||||||
|
It is not set if this entry defines a single character
|
||||||
|
|
||||||
|
(3) The 0x00600000 bits are spare.
|
||||||
|
|
||||||
|
(4) The 0x001fffff bits contain the code point. No Unicode code point will
|
||||||
|
ever be greater than 0x0010ffff, so this should be OK for ever.
|
||||||
|
|
||||||
|
(f1) (1) The 0xfc000000 bits contain the character type number. The numbers are
|
||||||
|
defined by an enum in ucp.h.
|
||||||
|
|
||||||
|
(2) The 0x03ff0000 bits are spare.
|
||||||
|
|
||||||
|
(3) The 0x0000ffff bits contain EITHER the unsigned offset to the top of
|
||||||
|
range if this entry defines a range, OR the *signed* offset to the
|
||||||
|
character's "other case" partner if this entry defines a single
|
||||||
|
character. There is no partner if the value is zero.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| script (8) |.|.|.| codepoint (21) || type (6) |.|.| spare (8) | offset (16) |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
| | | | |
|
||||||
|
| | |-> spare | |-> spare
|
||||||
|
| | |
|
||||||
|
| |-> spare |-> spare
|
||||||
|
|
|
||||||
|
|-> range flag
|
||||||
|
|
||||||
|
The upper/lower casing information is set only for characters that come in
|
||||||
|
pairs. The non-one-to-one mappings in the Unicode data are ignored.
|
||||||
|
|
||||||
|
When searching the data, proceed as follows:
|
||||||
|
|
||||||
|
(1) Set up for a binary chop search.
|
||||||
|
|
||||||
|
(2) If the top is not greater than the bottom, the character is not in the
|
||||||
|
table. Its type must therefore be "Cn" ("Undefined").
|
||||||
|
|
||||||
|
(3) Find the middle vector element.
|
||||||
|
|
||||||
|
(4) Extract the code point and compare. If equal, we are done.
|
||||||
|
|
||||||
|
(5) If the test character is smaller, set the top to the current point, and
|
||||||
|
goto (2).
|
||||||
|
|
||||||
|
(6) If the current entry defines a range, compute the last character by adding
|
||||||
|
the offset, and see if the test character is within the range. If it is,
|
||||||
|
we are done.
|
||||||
|
|
||||||
|
(7) Otherwise, set the bottom to one element past the current point and goto
|
||||||
|
(2).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* _UCPINTERNAL_H */
|
||||||
|
|
||||||
|
/* End of ucpinternal.h */
|
3068
Foundation/src/ucptable.h
Normal file
3068
Foundation/src/ucptable.h
Normal file
File diff suppressed because it is too large
Load Diff
63
Net/.cdtproject
Normal file
63
Net/.cdtproject
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse-cdt version="2.0"?>
|
||||||
|
|
||||||
|
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||||
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
|
||||||
|
<attribute key="addr2line" value="addr2line"/>
|
||||||
|
<attribute key="cygpath" value="cygpath"/>
|
||||||
|
<attribute key="c++filt" value="c++filt"/>
|
||||||
|
<attribute key="nm" value="nm"/>
|
||||||
|
</extension>
|
||||||
|
<data>
|
||||||
|
<item id="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="true" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="makefileGenerator">
|
||||||
|
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
</item>
|
||||||
|
<item id="org.eclipse.cdt.core.pathentry">
|
||||||
|
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
|
||||||
|
<pathentry kind="src" path="include"/>
|
||||||
|
<pathentry kind="src" path="src"/>
|
||||||
|
<pathentry kind="out" path=""/>
|
||||||
|
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
|
||||||
|
</item>
|
||||||
|
</data>
|
||||||
|
</cdtproject>
|
88
Net/.project
Normal file
88
Net/.project
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Net</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
<project>Foundation</project>
|
||||||
|
<project>XML</project>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.arguments</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||||
|
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.environment</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
|
<value>false</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.inc</key>
|
||||||
|
<value>-s</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.location</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.command</key>
|
||||||
|
<value>make</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.clean</key>
|
||||||
|
<value>clean</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.auto</key>
|
||||||
|
<value>all</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// TCPServerParams.h
|
// TCPServerParams.h
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/include/Poco/Net/TCPServerParams.h#2 $
|
// $Id: //poco/Main/Net/include/Poco/Net/TCPServerParams.h#3 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: TCPServer
|
// Package: TCPServer
|
||||||
@ -9,7 +9,7 @@
|
|||||||
//
|
//
|
||||||
// Definition of the TCPServerParams class.
|
// Definition of the TCPServerParams class.
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -43,6 +43,7 @@
|
|||||||
#include "Poco/Net/Net.h"
|
#include "Poco/Net/Net.h"
|
||||||
#include "Poco/RefCountedObject.h"
|
#include "Poco/RefCountedObject.h"
|
||||||
#include "Poco/Timespan.h"
|
#include "Poco/Timespan.h"
|
||||||
|
#include "Poco/Thread.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Poco {
|
namespace Poco {
|
||||||
@ -101,6 +102,14 @@ public:
|
|||||||
int getMaxThreads() const;
|
int getMaxThreads() const;
|
||||||
/// Returns the maximum number of simultaneous threads
|
/// Returns the maximum number of simultaneous threads
|
||||||
/// available for this TCPServerDispatcher.
|
/// available for this TCPServerDispatcher.
|
||||||
|
|
||||||
|
void setThreadPriority(Poco::Thread::Priority prio);
|
||||||
|
/// Sets the priority of TCP server threads
|
||||||
|
/// created by TCPServer.
|
||||||
|
|
||||||
|
Poco::Thread::Priority getThreadPriority() const;
|
||||||
|
/// Returns the priority of TCP server threads
|
||||||
|
/// created by TCPServer.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~TCPServerParams();
|
virtual ~TCPServerParams();
|
||||||
@ -110,6 +119,7 @@ private:
|
|||||||
Poco::Timespan _threadIdleTime;
|
Poco::Timespan _threadIdleTime;
|
||||||
int _maxThreads;
|
int _maxThreads;
|
||||||
int _maxQueued;
|
int _maxQueued;
|
||||||
|
Poco::Thread::Priority _threadPriority;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -134,6 +144,12 @@ inline int TCPServerParams::getMaxQueued() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Poco::Thread::Priority TCPServerParams::getThreadPriority() const
|
||||||
|
{
|
||||||
|
return _threadPriority;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
//
|
//
|
||||||
// TCPServerDispatcher.cpp
|
// TCPServerDispatcher.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/TCPServerDispatcher.cpp#8 $
|
// $Id: //poco/Main/Net/src/TCPServerDispatcher.cpp#9 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: TCPServer
|
// Package: TCPServer
|
||||||
// Module: TCPServerDispatcher
|
// Module: TCPServerDispatcher
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -163,7 +163,7 @@ void TCPServerDispatcher::enqueue(const StreamSocket& socket)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
static const std::string threadName("TCPServerConnection");
|
static const std::string threadName("TCPServerConnection");
|
||||||
_threadPool.start(*this, threadName);
|
_threadPool.startWithPriority(_pParams->getThreadPriority(), *this, threadName);
|
||||||
++_currentThreads;
|
++_currentThreads;
|
||||||
}
|
}
|
||||||
catch (Poco::Exception&)
|
catch (Poco::Exception&)
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
//
|
//
|
||||||
// TCPServerParams.cpp
|
// TCPServerParams.cpp
|
||||||
//
|
//
|
||||||
// $Id: //poco/Main/Net/src/TCPServerParams.cpp#6 $
|
// $Id: //poco/Main/Net/src/TCPServerParams.cpp#7 $
|
||||||
//
|
//
|
||||||
// Library: Net
|
// Library: Net
|
||||||
// Package: TCPServer
|
// Package: TCPServer
|
||||||
// Module: TCPServerParams
|
// Module: TCPServerParams
|
||||||
//
|
//
|
||||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
// Copyright (c) 2005-2007, Applied Informatics Software Engineering GmbH.
|
||||||
// and Contributors.
|
// and Contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person or organization
|
// Permission is hereby granted, free of charge, to any person or organization
|
||||||
@ -44,7 +44,8 @@ namespace Net {
|
|||||||
TCPServerParams::TCPServerParams():
|
TCPServerParams::TCPServerParams():
|
||||||
_threadIdleTime(10000000),
|
_threadIdleTime(10000000),
|
||||||
_maxThreads(0),
|
_maxThreads(0),
|
||||||
_maxQueued(64)
|
_maxQueued(64),
|
||||||
|
_threadPriority(Poco::Thread::PRIO_NORMAL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,4 +77,10 @@ void TCPServerParams::setMaxQueued(int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TCPServerParams::setThreadPriority(Poco::Thread::Priority prio)
|
||||||
|
{
|
||||||
|
_threadPriority = prio;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Net
|
} } // namespace Poco::Net
|
||||||
|
63
NetSSL_OpenSSL/.cdtproject
Normal file
63
NetSSL_OpenSSL/.cdtproject
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse-cdt version="2.0"?>
|
||||||
|
|
||||||
|
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||||
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
|
||||||
|
<attribute key="addr2line" value="addr2line"/>
|
||||||
|
<attribute key="cygpath" value="cygpath"/>
|
||||||
|
<attribute key="c++filt" value="c++filt"/>
|
||||||
|
<attribute key="nm" value="nm"/>
|
||||||
|
</extension>
|
||||||
|
<data>
|
||||||
|
<item id="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="true" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="makefileGenerator">
|
||||||
|
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
</item>
|
||||||
|
<item id="org.eclipse.cdt.core.pathentry">
|
||||||
|
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
|
||||||
|
<pathentry kind="src" path="include"/>
|
||||||
|
<pathentry kind="src" path="src"/>
|
||||||
|
<pathentry kind="out" path=""/>
|
||||||
|
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
|
||||||
|
</item>
|
||||||
|
</data>
|
||||||
|
</cdtproject>
|
88
NetSSL_OpenSSL/.project
Normal file
88
NetSSL_OpenSSL/.project
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Net</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
<project>Foundation</project>
|
||||||
|
<project>NetSSL_OpenSSL</project>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.arguments</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||||
|
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.environment</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
|
<value>false</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.inc</key>
|
||||||
|
<value>-s</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.location</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.command</key>
|
||||||
|
<value>make</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.clean</key>
|
||||||
|
<value>clean</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.auto</key>
|
||||||
|
<value>all</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
63
Util/.cdtproject
Normal file
63
Util/.cdtproject
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse-cdt version="2.0"?>
|
||||||
|
|
||||||
|
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||||
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
|
||||||
|
<attribute key="addr2line" value="addr2line"/>
|
||||||
|
<attribute key="cygpath" value="cygpath"/>
|
||||||
|
<attribute key="c++filt" value="c++filt"/>
|
||||||
|
<attribute key="nm" value="nm"/>
|
||||||
|
</extension>
|
||||||
|
<data>
|
||||||
|
<item id="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="true" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="makefileGenerator">
|
||||||
|
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
</item>
|
||||||
|
<item id="org.eclipse.cdt.core.pathentry">
|
||||||
|
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
|
||||||
|
<pathentry kind="src" path="include"/>
|
||||||
|
<pathentry kind="src" path="src"/>
|
||||||
|
<pathentry kind="out" path=""/>
|
||||||
|
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
|
||||||
|
</item>
|
||||||
|
</data>
|
||||||
|
</cdtproject>
|
86
Util/.project
Normal file
86
Util/.project
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>Util</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.arguments</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||||
|
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.environment</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
|
<value>false</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.inc</key>
|
||||||
|
<value>-s</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.location</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.command</key>
|
||||||
|
<value>make</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.clean</key>
|
||||||
|
<value>clean</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.auto</key>
|
||||||
|
<value>all</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
63
XML/.cdtproject
Normal file
63
XML/.cdtproject
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?eclipse-cdt version="2.0"?>
|
||||||
|
|
||||||
|
<cdtproject id="org.eclipse.cdt.make.core.make">
|
||||||
|
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser">
|
||||||
|
<attribute key="addr2line" value="addr2line"/>
|
||||||
|
<attribute key="cygpath" value="cygpath"/>
|
||||||
|
<attribute key="c++filt" value="c++filt"/>
|
||||||
|
<attribute key="nm" value="nm"/>
|
||||||
|
</extension>
|
||||||
|
<data>
|
||||||
|
<item id="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="true" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="makefileGenerator">
|
||||||
|
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
|
||||||
|
<buildOutputProvider>
|
||||||
|
<openAction enabled="false" filePath=""/>
|
||||||
|
<parser enabled="true"/>
|
||||||
|
</buildOutputProvider>
|
||||||
|
<scannerInfoProvider id="specsFile">
|
||||||
|
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
|
||||||
|
<parser enabled="false"/>
|
||||||
|
</scannerInfoProvider>
|
||||||
|
</profile>
|
||||||
|
</item>
|
||||||
|
<item id="org.eclipse.cdt.core.pathentry">
|
||||||
|
<pathentry excluding="*.vmsbuild|*.sln|*.vcproj|*.ncb|*.suo|*.vcproj.*|include/|src/|testsuite/src/" kind="src" path=""/>
|
||||||
|
<pathentry kind="src" path="include"/>
|
||||||
|
<pathentry kind="src" path="src"/>
|
||||||
|
<pathentry kind="out" path=""/>
|
||||||
|
<pathentry kind="con" path="org.eclipse.cdt.make.core.DISCOVERED_SCANNER_INFO"/>
|
||||||
|
</item>
|
||||||
|
</data>
|
||||||
|
</cdtproject>
|
86
XML/.project
Normal file
86
XML/.project
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>XML</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.makeBuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.arguments</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.core.errorOutputParser</key>
|
||||||
|
<value>org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;org.eclipse.cdt.core.GASErrorParser;org.eclipse.cdt.core.GLDErrorParser;org.eclipse.cdt.core.VCErrorParser;</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
|
||||||
|
<value>false</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.environment</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.inc</key>
|
||||||
|
<value>-s</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enabledIncrementalBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.location</key>
|
||||||
|
<value></value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.clean</key>
|
||||||
|
<value>clean</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.command</key>
|
||||||
|
<value>make</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.build.target.auto</key>
|
||||||
|
<value>all</value>
|
||||||
|
</dictionary>
|
||||||
|
<dictionary>
|
||||||
|
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||||
|
<value>true</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.make.core.ScannerConfigBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.makeNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.make.core.ScannerConfigNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
Loading…
x
Reference in New Issue
Block a user