• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionf4e524afbc157fd2f7a88a4aa188e8f2a177b8d1 (tree)
Time2013-08-06 17:55:15
Authornagasima <nagasima@user...>
Commiternagasima

Log Message

pcreとmod_cgiを追加

Change Summary

Incremental Difference

--- a/include/config.h
+++ b/include/config.h
@@ -123,6 +123,8 @@ typedef struct
123123 #define HAVE_MEMCPY
124124 #define HAVE_MEMSET
125125 #define HAVE_SOCKLEN_T
126+#define HAVE_PCRE_H
127+#define PCRE_STATIC
126128
127129 #define snprintf _snprintf_c
128130
--- a/liblightcomp/liblightcomp.vcxproj
+++ b/liblightcomp/liblightcomp.vcxproj
@@ -52,7 +52,7 @@
5252 <WarningLevel>Level3</WarningLevel>
5353 <Optimization>Disabled</Optimization>
5454 <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
55- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
55+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5656 </ClCompile>
5757 <Link>
5858 <SubSystem>Windows</SubSystem>
@@ -68,7 +68,7 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
--- a/lighttpd.sln
+++ b/lighttpd.sln
@@ -1,6 +1,6 @@
11 
22 Microsoft Visual Studio Solution File, Format Version 12.00
3-# Visual Studio 2012
3+# Visual Studio Express 2012 for Windows Desktop
44 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lighttpd", "lighttpd\lighttpd.vcxproj", "{24E6D75D-9451-4584-B52B-017EA9CCA8BB}"
55 ProjectSection(ProjectDependencies) = postProject
66 {B6422180-E34D-4513-B8EF-B3B80AF0A82B} = {B6422180-E34D-4513-B8EF-B3B80AF0A82B}
@@ -42,6 +42,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwip", "lwip\lwip.vcxproj",
4242 EndProject
4343 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lwip pcapif", "lwip\lwip_pcapif.vcxproj", "{6F44E49E-9F21-4144-91EC-53B92AEF62CE}"
4444 EndProject
45+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_cgi", "mod_cgi\mod_cgi.vcxproj", "{BE3CF698-C217-4433-9F35-96CCFA7BE2FA}"
46+EndProject
4547 Global
4648 GlobalSection(SolutionConfigurationPlatforms) = preSolution
4749 Debug|Win32 = Debug|Win32
@@ -88,6 +90,10 @@ Global
8890 {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Debug|Win32.Build.0 = Debug|Win32
8991 {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Release|Win32.ActiveCfg = Release|Win32
9092 {6F44E49E-9F21-4144-91EC-53B92AEF62CE}.Release|Win32.Build.0 = Release|Win32
93+ {BE3CF698-C217-4433-9F35-96CCFA7BE2FA}.Debug|Win32.ActiveCfg = Debug|Win32
94+ {BE3CF698-C217-4433-9F35-96CCFA7BE2FA}.Debug|Win32.Build.0 = Debug|Win32
95+ {BE3CF698-C217-4433-9F35-96CCFA7BE2FA}.Release|Win32.ActiveCfg = Release|Win32
96+ {BE3CF698-C217-4433-9F35-96CCFA7BE2FA}.Release|Win32.Build.0 = Release|Win32
9197 EndGlobalSection
9298 GlobalSection(SolutionProperties) = preSolution
9399 HideSolutionNode = FALSE
--- /dev/null
+++ b/lighttpd/conf.d/cgi.conf
@@ -0,0 +1,7 @@
1+server.modules += ( "mod_cgi" )
2+
3+cgi.assign = (
4+ ".cgi" => "C:\Program Files (x86)\Git\bin\perl.exe",
5+ ".pl" => "C:\Program Files (x86)\Git\bin\perl.exe",
6+ ".rb" => "C:\Program Files\It's Freetime Software\Ruby-2.0.0-x64\bin\ruby.exe"
7+)
--- a/lighttpd/lighttpd.vcxproj
+++ b/lighttpd/lighttpd.vcxproj
@@ -52,13 +52,13 @@
5252 <WarningLevel>Level3</WarningLevel>
5353 <Optimization>Disabled</Optimization>
5454 <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
55- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
55+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5656 </ClCompile>
5757 <Link>
5858 <SubSystem>Console</SubSystem>
5959 <GenerateDebugInformation>true</GenerateDebugInformation>
60- <AdditionalDependencies>Iphlpapi.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
61- <AdditionalLibraryDirectories>$(ProjectDir)..\lwip\WpdPack\Lib</AdditionalLibraryDirectories>
60+ <AdditionalDependencies>pcred.lib;Iphlpapi.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
61+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib;$(ProjectDir)..\lwip\WpdPack\Lib</AdditionalLibraryDirectories>
6262 </Link>
6363 </ItemDefinitionGroup>
6464 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -70,13 +70,13 @@
7070 <FunctionLevelLinking>true</FunctionLevelLinking>
7171 <IntrinsicFunctions>true</IntrinsicFunctions>
7272 <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
73- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
73+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7474 </ClCompile>
7575 <Link>
7676 <SubSystem>Console</SubSystem>
7777 <GenerateDebugInformation>true</GenerateDebugInformation>
78- <AdditionalDependencies>Iphlpapi.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
79- <AdditionalLibraryDirectories>$(ProjectDir)..\lwip\WpdPack\Lib</AdditionalLibraryDirectories>
78+ <AdditionalDependencies>pcre.lib;Iphlpapi.lib;Packet.lib;wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib;$(ProjectDir)..\lwip\WpdPack\Lib</AdditionalLibraryDirectories>
8080 <EnableCOMDATFolding>true</EnableCOMDATFolding>
8181 <OptimizeReferences>true</OptimizeReferences>
8282 </Link>
--- a/mod_access/mod_access.vcxproj
+++ b/mod_access/mod_access.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_ACCESS_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>
60- </AdditionalDependencies>
59+ <AdditionalDependencies>pcred.lib</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
6161 </Link>
6262 </ItemDefinitionGroup>
6363 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -68,15 +68,15 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_ACCESS_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
7575 <GenerateDebugInformation>true</GenerateDebugInformation>
7676 <EnableCOMDATFolding>true</EnableCOMDATFolding>
7777 <OptimizeReferences>true</OptimizeReferences>
78- <AdditionalDependencies>
79- </AdditionalDependencies>
78+ <AdditionalDependencies>pcre.lib</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
8080 </Link>
8181 </ItemDefinitionGroup>
8282 <ItemGroup>
--- a/mod_accesslog/mod_accesslog.vcxproj
+++ b/mod_accesslog/mod_accesslog.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_ACCESSLOG_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>
60- </AdditionalDependencies>
59+ <AdditionalDependencies>pcred.lib</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
6161 </Link>
6262 </ItemDefinitionGroup>
6363 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -68,15 +68,15 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_ACCESSLOG_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
7575 <GenerateDebugInformation>true</GenerateDebugInformation>
7676 <EnableCOMDATFolding>true</EnableCOMDATFolding>
7777 <OptimizeReferences>true</OptimizeReferences>
78- <AdditionalDependencies>
79- </AdditionalDependencies>
78+ <AdditionalDependencies>pcre.lib</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
8080 </Link>
8181 </ItemDefinitionGroup>
8282 <ItemGroup>
--- /dev/null
+++ b/mod_cgi/dllmain.c
@@ -0,0 +1,48 @@
1+// dllmain.cpp : DLL アプリケーションのエントリ ポイントを定義します。
2+#include "stdafx.h"
3+
4+pid_t waitpid(pid_t pid, int *status, int options)
5+{
6+ DWORD timeout = INFINITE;
7+ DWORD waitcode;
8+
9+ if(options & WNOHANG)
10+ timeout = 0;
11+
12+ waitcode = WaitForSingleObject((HANDLE)pid, timeout);
13+ switch (waitcode) {
14+ case WAIT_OBJECT_0:
15+ return pid;
16+ case WAIT_TIMEOUT:
17+ return 0;
18+ }
19+
20+ return -1;
21+}
22+
23+int kill(pid_t pid, int sig)
24+{
25+ return TerminateProcess((HANDLE)pid, 0);
26+}
27+
28+int pipe(HANDLE pipefd[2])
29+{
30+ return CreatePipe(&pipefd[0], &pipefd[1], NULL, 0);
31+}
32+
33+BOOL APIENTRY DllMain( HMODULE hModule,
34+ DWORD ul_reason_for_call,
35+ LPVOID lpReserved
36+ )
37+{
38+ switch (ul_reason_for_call)
39+ {
40+ case DLL_PROCESS_ATTACH:
41+ case DLL_THREAD_ATTACH:
42+ case DLL_THREAD_DETACH:
43+ case DLL_PROCESS_DETACH:
44+ break;
45+ }
46+ return TRUE;
47+}
48+
--- /dev/null
+++ b/mod_cgi/mod_cgi.vcxproj
@@ -0,0 +1,117 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup Label="ProjectConfigurations">
4+ <ProjectConfiguration Include="Debug|Win32">
5+ <Configuration>Debug</Configuration>
6+ <Platform>Win32</Platform>
7+ </ProjectConfiguration>
8+ <ProjectConfiguration Include="Release|Win32">
9+ <Configuration>Release</Configuration>
10+ <Platform>Win32</Platform>
11+ </ProjectConfiguration>
12+ </ItemGroup>
13+ <PropertyGroup Label="Globals">
14+ <ProjectGuid>{BE3CF698-C217-4433-9F35-96CCFA7BE2FA}</ProjectGuid>
15+ <Keyword>Win32Proj</Keyword>
16+ <RootNamespace>mod_cgi</RootNamespace>
17+ </PropertyGroup>
18+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
19+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
20+ <ConfigurationType>DynamicLibrary</ConfigurationType>
21+ <UseDebugLibraries>true</UseDebugLibraries>
22+ <PlatformToolset>v110</PlatformToolset>
23+ <CharacterSet>Unicode</CharacterSet>
24+ </PropertyGroup>
25+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
26+ <ConfigurationType>DynamicLibrary</ConfigurationType>
27+ <UseDebugLibraries>false</UseDebugLibraries>
28+ <PlatformToolset>v110</PlatformToolset>
29+ <WholeProgramOptimization>true</WholeProgramOptimization>
30+ <CharacterSet>Unicode</CharacterSet>
31+ </PropertyGroup>
32+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
33+ <ImportGroup Label="ExtensionSettings">
34+ </ImportGroup>
35+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
36+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
37+ </ImportGroup>
38+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
39+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
40+ </ImportGroup>
41+ <PropertyGroup Label="UserMacros" />
42+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
43+ <LinkIncremental>true</LinkIncremental>
44+ </PropertyGroup>
45+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
46+ <LinkIncremental>false</LinkIncremental>
47+ </PropertyGroup>
48+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
49+ <ClCompile>
50+ <PrecompiledHeader>Use</PrecompiledHeader>
51+ <WarningLevel>Level3</WarningLevel>
52+ <Optimization>Disabled</Optimization>
53+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_CGI_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
55+ <SDLCheck>true</SDLCheck>
56+ </ClCompile>
57+ <Link>
58+ <SubSystem>Windows</SubSystem>
59+ <GenerateDebugInformation>true</GenerateDebugInformation>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
61+ <AdditionalDependencies>pcred.lib;%(AdditionalDependencies)</AdditionalDependencies>
62+ </Link>
63+ </ItemDefinitionGroup>
64+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
65+ <ClCompile>
66+ <WarningLevel>Level3</WarningLevel>
67+ <PrecompiledHeader>Use</PrecompiledHeader>
68+ <Optimization>MaxSpeed</Optimization>
69+ <FunctionLevelLinking>true</FunctionLevelLinking>
70+ <IntrinsicFunctions>true</IntrinsicFunctions>
71+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_CGI_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
72+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
73+ <SDLCheck>true</SDLCheck>
74+ </ClCompile>
75+ <Link>
76+ <SubSystem>Windows</SubSystem>
77+ <GenerateDebugInformation>true</GenerateDebugInformation>
78+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
79+ <OptimizeReferences>true</OptimizeReferences>
80+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
81+ <AdditionalDependencies>pcre.lib;%(AdditionalDependencies)</AdditionalDependencies>
82+ </Link>
83+ </ItemDefinitionGroup>
84+ <ItemGroup>
85+ <Text Include="ReadMe.txt" />
86+ </ItemGroup>
87+ <ItemGroup>
88+ <ClInclude Include="stdafx.h" />
89+ <ClInclude Include="targetver.h" />
90+ </ItemGroup>
91+ <ItemGroup>
92+ <ClCompile Include="..\src\mod_cgi.c" />
93+ <ClCompile Include="dllmain.c">
94+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
95+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
96+ </PrecompiledHeader>
97+ <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
98+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
99+ </PrecompiledHeader>
100+ </ClCompile>
101+ <ClCompile Include="stdafx.c">
102+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
103+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
104+ </ClCompile>
105+ </ItemGroup>
106+ <ItemGroup>
107+ <ProjectReference Include="..\liblightcomp\liblightcomp.vcxproj">
108+ <Project>{b6422180-e34d-4513-b8ef-b3b80af0a82b}</Project>
109+ </ProjectReference>
110+ <ProjectReference Include="..\lwip\lwip.vcxproj">
111+ <Project>{2cc276fa-b226-49c9-8f82-7fcd5a228e28}</Project>
112+ </ProjectReference>
113+ </ItemGroup>
114+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
115+ <ImportGroup Label="ExtensionTargets">
116+ </ImportGroup>
117+</Project>
\ No newline at end of file
--- /dev/null
+++ b/mod_cgi/mod_cgi.vcxproj.filters
@@ -0,0 +1,39 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup>
4+ <Filter Include="ソース ファイル">
5+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+ </Filter>
8+ <Filter Include="ヘッダー ファイル">
9+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+ </Filter>
12+ <Filter Include="リソース ファイル">
13+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+ </Filter>
16+ </ItemGroup>
17+ <ItemGroup>
18+ <Text Include="ReadMe.txt" />
19+ </ItemGroup>
20+ <ItemGroup>
21+ <ClInclude Include="stdafx.h">
22+ <Filter>ヘッダー ファイル</Filter>
23+ </ClInclude>
24+ <ClInclude Include="targetver.h">
25+ <Filter>ヘッダー ファイル</Filter>
26+ </ClInclude>
27+ </ItemGroup>
28+ <ItemGroup>
29+ <ClCompile Include="dllmain.c">
30+ <Filter>ソース ファイル</Filter>
31+ </ClCompile>
32+ <ClCompile Include="stdafx.c">
33+ <Filter>ソース ファイル</Filter>
34+ </ClCompile>
35+ <ClCompile Include="..\src\mod_cgi.c">
36+ <Filter>ソース ファイル</Filter>
37+ </ClCompile>
38+ </ItemGroup>
39+</Project>
\ No newline at end of file
--- /dev/null
+++ b/mod_cgi/stdafx.c
@@ -0,0 +1,8 @@
1+// stdafx.cpp : 標準インクルード mod_cgi.pch のみを
2+// 含むソース ファイルは、プリコンパイル済みヘッダーになります。
3+// stdafx.obj にはプリコンパイル済み型情報が含まれます。
4+
5+#include "stdafx.h"
6+
7+// TODO: このファイルではなく、STDAFX.H で必要な
8+// 追加ヘッダーを参照してください。
--- /dev/null
+++ b/mod_cgi/stdafx.h
@@ -0,0 +1,37 @@
1+// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または
2+// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル
3+// を記述します。
4+//
5+
6+#pragma once
7+
8+#include "targetver.h"
9+
10+#define WIN32_LEAN_AND_MEAN // Windows ヘッダーから使用されていない部分を除外します。
11+// Windows ヘッダー ファイル:
12+#include <windows.h>
13+
14+#include <ctype.h>
15+#include <stdlib.h>
16+#include <stdio.h>
17+#include <string.h>
18+
19+#if defined(_USRDLL)
20+#define DLL_EXPORT __declspec(dllexport)
21+#else
22+#define DLL_EXPORT __declspec(dllimport)
23+#endif
24+
25+// TODO: プログラムに必要な追加ヘッダーをここで参照してください。
26+
27+#define pid_t DWORD
28+#define WNOHANG 0
29+
30+#define WIFEXITED(status) (status == 0)
31+#define WEXITSTATUS(status) (status)
32+#define WIFSIGNALED(status) (status != 0)
33+#define WTERMSIG(status) (status)
34+
35+pid_t waitpid(pid_t pid, int *status, int options);
36+int kill(pid_t pid, int sig);
37+int pipe(HANDLE pipefd[2]);
--- /dev/null
+++ b/mod_cgi/targetver.h
@@ -0,0 +1,8 @@
1+#pragma once
2+
3+// SDKDDKVer.h をインクルードすると、利用できる最も上位の Windows プラットフォームが定義されます。
4+
5+// 以前の Windows プラットフォーム用にアプリケーションをビルドする場合は、WinSDKVer.h をインクルードし、
6+// SDKDDKVer.h をインクルードする前に、サポート対象とするプラットフォームを示すように _WIN32_WINNT マクロを設定します。
7+
8+#include <SDKDDKVer.h>
--- a/mod_dirlisting/mod_dirlisting.vcxproj
+++ b/mod_dirlisting/mod_dirlisting.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_DIRLISTING_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>
60- </AdditionalDependencies>
59+ <AdditionalDependencies>pcred.lib</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
6161 </Link>
6262 </ItemDefinitionGroup>
6363 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -68,15 +68,15 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_DIRLISTING_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
7575 <GenerateDebugInformation>true</GenerateDebugInformation>
7676 <EnableCOMDATFolding>true</EnableCOMDATFolding>
7777 <OptimizeReferences>true</OptimizeReferences>
78- <AdditionalDependencies>
79- </AdditionalDependencies>
78+ <AdditionalDependencies>pcre.lib</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
8080 </Link>
8181 </ItemDefinitionGroup>
8282 <ItemGroup>
--- a/mod_indexfile/mod_indexfile.vcxproj
+++ b/mod_indexfile/mod_indexfile.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_INDEXFILE_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>
60- </AdditionalDependencies>
59+ <AdditionalDependencies>pcred.lib</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
6161 </Link>
6262 </ItemDefinitionGroup>
6363 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -68,15 +68,15 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_INDEXFILE_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
7575 <GenerateDebugInformation>true</GenerateDebugInformation>
7676 <EnableCOMDATFolding>true</EnableCOMDATFolding>
7777 <OptimizeReferences>true</OptimizeReferences>
78- <AdditionalDependencies>
79- </AdditionalDependencies>
78+ <AdditionalDependencies>pcre.lib</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
8080 </Link>
8181 </ItemDefinitionGroup>
8282 <ItemGroup>
--- a/mod_staticfile/mod_staticfile.vcxproj
+++ b/mod_staticfile/mod_staticfile.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_STATICFILE_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>
60- </AdditionalDependencies>
59+ <AdditionalDependencies>pcred.lib</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
6161 </Link>
6262 </ItemDefinitionGroup>
6363 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -68,15 +68,15 @@
6868 <FunctionLevelLinking>true</FunctionLevelLinking>
6969 <IntrinsicFunctions>true</IntrinsicFunctions>
7070 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_STATICFILE_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
71- <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
71+ <AdditionalIncludeDirectories>$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7272 </ClCompile>
7373 <Link>
7474 <SubSystem>Windows</SubSystem>
7575 <GenerateDebugInformation>true</GenerateDebugInformation>
7676 <EnableCOMDATFolding>true</EnableCOMDATFolding>
7777 <OptimizeReferences>true</OptimizeReferences>
78- <AdditionalDependencies>
79- </AdditionalDependencies>
78+ <AdditionalDependencies>pcre.lib</AdditionalDependencies>
79+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib</AdditionalLibraryDirectories>
8080 </Link>
8181 </ItemDefinitionGroup>
8282 <ItemGroup>
--- a/mod_websocket/mod_websocket.vcxproj
+++ b/mod_websocket/mod_websocket.vcxproj
@@ -51,13 +51,13 @@
5151 <WarningLevel>Level3</WarningLevel>
5252 <Optimization>Disabled</Optimization>
5353 <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_WEBSOCKET_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;_MOD_WEBSOCKET_SPEC_RFC_6455_;_MOD_WEBSOCKET_WITH_ICU_;LWIP_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
54- <AdditionalIncludeDirectories>$(ProjectDir)..\src;$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\icu\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
54+ <AdditionalIncludeDirectories>$(ProjectDir)..\src;$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\icu\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
5555 </ClCompile>
5656 <Link>
5757 <SubSystem>Windows</SubSystem>
5858 <GenerateDebugInformation>true</GenerateDebugInformation>
59- <AdditionalDependencies>icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
60- <AdditionalLibraryDirectories>$(SolutionDir)\icu\lib\</AdditionalLibraryDirectories>
59+ <AdditionalDependencies>pcred.lib;icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
60+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib;$(ProjectDir)..\icu\lib\</AdditionalLibraryDirectories>
6161 </Link>
6262 <PostBuildEvent>
6363 <Command>wscript update.js ..\icu\bin\icudt50.dll $(OutputPath)icudt50.dll
@@ -73,15 +73,15 @@ wscript update.js ..\icu\bin\icuuc50d.dll $(OutputPath)icuuc50d.dll</Command>
7373 <FunctionLevelLinking>true</FunctionLevelLinking>
7474 <IntrinsicFunctions>true</IntrinsicFunctions>
7575 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_WEBSOCKET_EXPORTS;__WIN32;_HAVE_STDC;HAVE_CONFIG_H;_MOD_WEBSOCKET_SPEC_RFC_6455_;_MOD_WEBSOCKET_WITH_ICU_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
76- <AdditionalIncludeDirectories>$(ProjectDir)..\src;$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\icu\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
76+ <AdditionalIncludeDirectories>$(ProjectDir)..\src;$(ProjectDir)..\include;$(ProjectDir)..\newlib;$(ProjectDir)..\pcre\include;$(ProjectDir)..\icu\include;$(ProjectDir)..\lwip\src\include;$(ProjectDir)..\lwip\src\include\ipv4;$(ProjectDir)..\lwip\ports\win32\include</AdditionalIncludeDirectories>
7777 </ClCompile>
7878 <Link>
7979 <SubSystem>Windows</SubSystem>
8080 <GenerateDebugInformation>true</GenerateDebugInformation>
8181 <EnableCOMDATFolding>true</EnableCOMDATFolding>
8282 <OptimizeReferences>true</OptimizeReferences>
83- <AdditionalDependencies>icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
84- <AdditionalLibraryDirectories>$(SolutionDir)\icu\lib\</AdditionalLibraryDirectories>
83+ <AdditionalDependencies>pcre.lib;icuucd.lib;icuind.lib;%(AdditionalDependencies)</AdditionalDependencies>
84+ <AdditionalLibraryDirectories>$(ProjectDir)..\pcre\lib;$(ProjectDir)..\icu\lib\</AdditionalLibraryDirectories>
8585 </Link>
8686 <PostBuildEvent>
8787 <Command>wscript update.js ..\icu\bin\icudt50.dll $(OutputPath)icudt50.dll
--- /dev/null
+++ b/pcre/include/pcre.h
@@ -0,0 +1,663 @@
1+/*************************************************
2+* Perl-Compatible Regular Expressions *
3+*************************************************/
4+
5+/* This is the public header file for the PCRE library, to be #included by
6+applications that call the PCRE functions.
7+
8+ Copyright (c) 1997-2013 University of Cambridge
9+
10+-----------------------------------------------------------------------------
11+Redistribution and use in source and binary forms, with or without
12+modification, are permitted provided that the following conditions are met:
13+
14+ * Redistributions of source code must retain the above copyright notice,
15+ this list of conditions and the following disclaimer.
16+
17+ * Redistributions in binary form must reproduce the above copyright
18+ notice, this list of conditions and the following disclaimer in the
19+ documentation and/or other materials provided with the distribution.
20+
21+ * Neither the name of the University of Cambridge nor the names of its
22+ contributors may be used to endorse or promote products derived from
23+ this software without specific prior written permission.
24+
25+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35+POSSIBILITY OF SUCH DAMAGE.
36+-----------------------------------------------------------------------------
37+*/
38+
39+#ifndef _PCRE_H
40+#define _PCRE_H
41+
42+/* The current PCRE version information. */
43+
44+#define PCRE_MAJOR 8
45+#define PCRE_MINOR 33
46+#define PCRE_PRERELEASE
47+#define PCRE_DATE 2013-05-28
48+
49+/* When an application links to a PCRE DLL in Windows, the symbols that are
50+imported have to be identified as such. When building PCRE, the appropriate
51+export setting is defined in pcre_internal.h, which includes this file. So we
52+don't change existing definitions of PCRE_EXP_DECL and PCRECPP_EXP_DECL. */
53+
54+#if defined(_WIN32) && !defined(PCRE_STATIC)
55+# ifndef PCRE_EXP_DECL
56+# define PCRE_EXP_DECL extern __declspec(dllimport)
57+# endif
58+# ifdef __cplusplus
59+# ifndef PCRECPP_EXP_DECL
60+# define PCRECPP_EXP_DECL extern __declspec(dllimport)
61+# endif
62+# ifndef PCRECPP_EXP_DEFN
63+# define PCRECPP_EXP_DEFN __declspec(dllimport)
64+# endif
65+# endif
66+#endif
67+
68+/* By default, we use the standard "extern" declarations. */
69+
70+#ifndef PCRE_EXP_DECL
71+# ifdef __cplusplus
72+# define PCRE_EXP_DECL extern "C"
73+# else
74+# define PCRE_EXP_DECL extern
75+# endif
76+#endif
77+
78+#ifdef __cplusplus
79+# ifndef PCRECPP_EXP_DECL
80+# define PCRECPP_EXP_DECL extern
81+# endif
82+# ifndef PCRECPP_EXP_DEFN
83+# define PCRECPP_EXP_DEFN
84+# endif
85+#endif
86+
87+/* Have to include stdlib.h in order to ensure that size_t is defined;
88+it is needed here for malloc. */
89+
90+#include <stdlib.h>
91+
92+/* Allow for C++ users */
93+
94+#ifdef __cplusplus
95+extern "C" {
96+#endif
97+
98+/* Public options. Some are compile-time only, some are run-time only, and some
99+are both. Most of the compile-time options are saved with the compiled regex so
100+that they can be inspected during studying (and therefore JIT compiling). Note
101+that pcre_study() has its own set of options. Originally, all the options
102+defined here used distinct bits. However, almost all the bits in a 32-bit word
103+are now used, so in order to conserve them, option bits that were previously
104+only recognized at matching time (i.e. by pcre_exec() or pcre_dfa_exec()) may
105+also be used for compile-time options that affect only compiling and are not
106+relevant for studying or JIT compiling.
107+
108+Some options for pcre_compile() change its behaviour but do not affect the
109+behaviour of the execution functions. Other options are passed through to the
110+execution functions and affect their behaviour, with or without affecting the
111+behaviour of pcre_compile().
112+
113+Options that can be passed to pcre_compile() are tagged Cx below, with these
114+variants:
115+
116+C1 Affects compile only
117+C2 Does not affect compile; affects exec, dfa_exec
118+C3 Affects compile, exec, dfa_exec
119+C4 Affects compile, exec, dfa_exec, study
120+C5 Affects compile, exec, study
121+
122+Options that can be set for pcre_exec() and/or pcre_dfa_exec() are flagged with
123+E and D, respectively. They take precedence over C3, C4, and C5 settings passed
124+from pcre_compile(). Those that are compatible with JIT execution are flagged
125+with J. */
126+
127+#define PCRE_CASELESS 0x00000001 /* C1 */
128+#define PCRE_MULTILINE 0x00000002 /* C1 */
129+#define PCRE_DOTALL 0x00000004 /* C1 */
130+#define PCRE_EXTENDED 0x00000008 /* C1 */
131+#define PCRE_ANCHORED 0x00000010 /* C4 E D */
132+#define PCRE_DOLLAR_ENDONLY 0x00000020 /* C2 */
133+#define PCRE_EXTRA 0x00000040 /* C1 */
134+#define PCRE_NOTBOL 0x00000080 /* E D J */
135+#define PCRE_NOTEOL 0x00000100 /* E D J */
136+#define PCRE_UNGREEDY 0x00000200 /* C1 */
137+#define PCRE_NOTEMPTY 0x00000400 /* E D J */
138+#define PCRE_UTF8 0x00000800 /* C4 ) */
139+#define PCRE_UTF16 0x00000800 /* C4 ) Synonyms */
140+#define PCRE_UTF32 0x00000800 /* C4 ) */
141+#define PCRE_NO_AUTO_CAPTURE 0x00001000 /* C1 */
142+#define PCRE_NO_UTF8_CHECK 0x00002000 /* C1 E D J ) */
143+#define PCRE_NO_UTF16_CHECK 0x00002000 /* C1 E D J ) Synonyms */
144+#define PCRE_NO_UTF32_CHECK 0x00002000 /* C1 E D J ) */
145+#define PCRE_AUTO_CALLOUT 0x00004000 /* C1 */
146+#define PCRE_PARTIAL_SOFT 0x00008000 /* E D J ) Synonyms */
147+#define PCRE_PARTIAL 0x00008000 /* E D J ) */
148+
149+/* This pair use the same bit. */
150+#define PCRE_NEVER_UTF 0x00010000 /* C1 ) Overlaid */
151+#define PCRE_DFA_SHORTEST 0x00010000 /* D ) Overlaid */
152+
153+#define PCRE_DFA_RESTART 0x00020000 /* D */
154+#define PCRE_FIRSTLINE 0x00040000 /* C3 */
155+#define PCRE_DUPNAMES 0x00080000 /* C1 */
156+#define PCRE_NEWLINE_CR 0x00100000 /* C3 E D */
157+#define PCRE_NEWLINE_LF 0x00200000 /* C3 E D */
158+#define PCRE_NEWLINE_CRLF 0x00300000 /* C3 E D */
159+#define PCRE_NEWLINE_ANY 0x00400000 /* C3 E D */
160+#define PCRE_NEWLINE_ANYCRLF 0x00500000 /* C3 E D */
161+#define PCRE_BSR_ANYCRLF 0x00800000 /* C3 E D */
162+#define PCRE_BSR_UNICODE 0x01000000 /* C3 E D */
163+#define PCRE_JAVASCRIPT_COMPAT 0x02000000 /* C5 */
164+#define PCRE_NO_START_OPTIMIZE 0x04000000 /* C2 E D ) Synonyms */
165+#define PCRE_NO_START_OPTIMISE 0x04000000 /* C2 E D ) */
166+#define PCRE_PARTIAL_HARD 0x08000000 /* E D J */
167+#define PCRE_NOTEMPTY_ATSTART 0x10000000 /* E D J */
168+#define PCRE_UCP 0x20000000 /* C3 */
169+
170+/* Exec-time and get/set-time error codes */
171+
172+#define PCRE_ERROR_NOMATCH (-1)
173+#define PCRE_ERROR_NULL (-2)
174+#define PCRE_ERROR_BADOPTION (-3)
175+#define PCRE_ERROR_BADMAGIC (-4)
176+#define PCRE_ERROR_UNKNOWN_OPCODE (-5)
177+#define PCRE_ERROR_UNKNOWN_NODE (-5) /* For backward compatibility */
178+#define PCRE_ERROR_NOMEMORY (-6)
179+#define PCRE_ERROR_NOSUBSTRING (-7)
180+#define PCRE_ERROR_MATCHLIMIT (-8)
181+#define PCRE_ERROR_CALLOUT (-9) /* Never used by PCRE itself */
182+#define PCRE_ERROR_BADUTF8 (-10) /* Same for 8/16/32 */
183+#define PCRE_ERROR_BADUTF16 (-10) /* Same for 8/16/32 */
184+#define PCRE_ERROR_BADUTF32 (-10) /* Same for 8/16/32 */
185+#define PCRE_ERROR_BADUTF8_OFFSET (-11) /* Same for 8/16 */
186+#define PCRE_ERROR_BADUTF16_OFFSET (-11) /* Same for 8/16 */
187+#define PCRE_ERROR_PARTIAL (-12)
188+#define PCRE_ERROR_BADPARTIAL (-13)
189+#define PCRE_ERROR_INTERNAL (-14)
190+#define PCRE_ERROR_BADCOUNT (-15)
191+#define PCRE_ERROR_DFA_UITEM (-16)
192+#define PCRE_ERROR_DFA_UCOND (-17)
193+#define PCRE_ERROR_DFA_UMLIMIT (-18)
194+#define PCRE_ERROR_DFA_WSSIZE (-19)
195+#define PCRE_ERROR_DFA_RECURSE (-20)
196+#define PCRE_ERROR_RECURSIONLIMIT (-21)
197+#define PCRE_ERROR_NULLWSLIMIT (-22) /* No longer actually used */
198+#define PCRE_ERROR_BADNEWLINE (-23)
199+#define PCRE_ERROR_BADOFFSET (-24)
200+#define PCRE_ERROR_SHORTUTF8 (-25)
201+#define PCRE_ERROR_SHORTUTF16 (-25) /* Same for 8/16 */
202+#define PCRE_ERROR_RECURSELOOP (-26)
203+#define PCRE_ERROR_JIT_STACKLIMIT (-27)
204+#define PCRE_ERROR_BADMODE (-28)
205+#define PCRE_ERROR_BADENDIANNESS (-29)
206+#define PCRE_ERROR_DFA_BADRESTART (-30)
207+#define PCRE_ERROR_JIT_BADOPTION (-31)
208+#define PCRE_ERROR_BADLENGTH (-32)
209+#define PCRE_ERROR_UNSET (-33)
210+
211+/* Specific error codes for UTF-8 validity checks */
212+
213+#define PCRE_UTF8_ERR0 0
214+#define PCRE_UTF8_ERR1 1
215+#define PCRE_UTF8_ERR2 2
216+#define PCRE_UTF8_ERR3 3
217+#define PCRE_UTF8_ERR4 4
218+#define PCRE_UTF8_ERR5 5
219+#define PCRE_UTF8_ERR6 6
220+#define PCRE_UTF8_ERR7 7
221+#define PCRE_UTF8_ERR8 8
222+#define PCRE_UTF8_ERR9 9
223+#define PCRE_UTF8_ERR10 10
224+#define PCRE_UTF8_ERR11 11
225+#define PCRE_UTF8_ERR12 12
226+#define PCRE_UTF8_ERR13 13
227+#define PCRE_UTF8_ERR14 14
228+#define PCRE_UTF8_ERR15 15
229+#define PCRE_UTF8_ERR16 16
230+#define PCRE_UTF8_ERR17 17
231+#define PCRE_UTF8_ERR18 18
232+#define PCRE_UTF8_ERR19 19
233+#define PCRE_UTF8_ERR20 20
234+#define PCRE_UTF8_ERR21 21
235+#define PCRE_UTF8_ERR22 22 /* Unused (was non-character) */
236+
237+/* Specific error codes for UTF-16 validity checks */
238+
239+#define PCRE_UTF16_ERR0 0
240+#define PCRE_UTF16_ERR1 1
241+#define PCRE_UTF16_ERR2 2
242+#define PCRE_UTF16_ERR3 3
243+#define PCRE_UTF16_ERR4 4 /* Unused (was non-character) */
244+
245+/* Specific error codes for UTF-32 validity checks */
246+
247+#define PCRE_UTF32_ERR0 0
248+#define PCRE_UTF32_ERR1 1
249+#define PCRE_UTF32_ERR2 2 /* Unused (was non-character) */
250+#define PCRE_UTF32_ERR3 3
251+
252+/* Request types for pcre_fullinfo() */
253+
254+#define PCRE_INFO_OPTIONS 0
255+#define PCRE_INFO_SIZE 1
256+#define PCRE_INFO_CAPTURECOUNT 2
257+#define PCRE_INFO_BACKREFMAX 3
258+#define PCRE_INFO_FIRSTBYTE 4
259+#define PCRE_INFO_FIRSTCHAR 4 /* For backwards compatibility */
260+#define PCRE_INFO_FIRSTTABLE 5
261+#define PCRE_INFO_LASTLITERAL 6
262+#define PCRE_INFO_NAMEENTRYSIZE 7
263+#define PCRE_INFO_NAMECOUNT 8
264+#define PCRE_INFO_NAMETABLE 9
265+#define PCRE_INFO_STUDYSIZE 10
266+#define PCRE_INFO_DEFAULT_TABLES 11
267+#define PCRE_INFO_OKPARTIAL 12
268+#define PCRE_INFO_JCHANGED 13
269+#define PCRE_INFO_HASCRORLF 14
270+#define PCRE_INFO_MINLENGTH 15
271+#define PCRE_INFO_JIT 16
272+#define PCRE_INFO_JITSIZE 17
273+#define PCRE_INFO_MAXLOOKBEHIND 18
274+#define PCRE_INFO_FIRSTCHARACTER 19
275+#define PCRE_INFO_FIRSTCHARACTERFLAGS 20
276+#define PCRE_INFO_REQUIREDCHAR 21
277+#define PCRE_INFO_REQUIREDCHARFLAGS 22
278+#define PCRE_INFO_MATCHLIMIT 23
279+#define PCRE_INFO_RECURSIONLIMIT 24
280+
281+/* Request types for pcre_config(). Do not re-arrange, in order to remain
282+compatible. */
283+
284+#define PCRE_CONFIG_UTF8 0
285+#define PCRE_CONFIG_NEWLINE 1
286+#define PCRE_CONFIG_LINK_SIZE 2
287+#define PCRE_CONFIG_POSIX_MALLOC_THRESHOLD 3
288+#define PCRE_CONFIG_MATCH_LIMIT 4
289+#define PCRE_CONFIG_STACKRECURSE 5
290+#define PCRE_CONFIG_UNICODE_PROPERTIES 6
291+#define PCRE_CONFIG_MATCH_LIMIT_RECURSION 7
292+#define PCRE_CONFIG_BSR 8
293+#define PCRE_CONFIG_JIT 9
294+#define PCRE_CONFIG_UTF16 10
295+#define PCRE_CONFIG_JITTARGET 11
296+#define PCRE_CONFIG_UTF32 12
297+
298+/* Request types for pcre_study(). Do not re-arrange, in order to remain
299+compatible. */
300+
301+#define PCRE_STUDY_JIT_COMPILE 0x0001
302+#define PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE 0x0002
303+#define PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE 0x0004
304+#define PCRE_STUDY_EXTRA_NEEDED 0x0008
305+
306+/* Bit flags for the pcre[16|32]_extra structure. Do not re-arrange or redefine
307+these bits, just add new ones on the end, in order to remain compatible. */
308+
309+#define PCRE_EXTRA_STUDY_DATA 0x0001
310+#define PCRE_EXTRA_MATCH_LIMIT 0x0002
311+#define PCRE_EXTRA_CALLOUT_DATA 0x0004
312+#define PCRE_EXTRA_TABLES 0x0008
313+#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
314+#define PCRE_EXTRA_MARK 0x0020
315+#define PCRE_EXTRA_EXECUTABLE_JIT 0x0040
316+
317+/* Types */
318+
319+struct real_pcre; /* declaration; the definition is private */
320+typedef struct real_pcre pcre;
321+
322+struct real_pcre16; /* declaration; the definition is private */
323+typedef struct real_pcre16 pcre16;
324+
325+struct real_pcre32; /* declaration; the definition is private */
326+typedef struct real_pcre32 pcre32;
327+
328+struct real_pcre_jit_stack; /* declaration; the definition is private */
329+typedef struct real_pcre_jit_stack pcre_jit_stack;
330+
331+struct real_pcre16_jit_stack; /* declaration; the definition is private */
332+typedef struct real_pcre16_jit_stack pcre16_jit_stack;
333+
334+struct real_pcre32_jit_stack; /* declaration; the definition is private */
335+typedef struct real_pcre32_jit_stack pcre32_jit_stack;
336+
337+/* If PCRE is compiled with 16 bit character support, PCRE_UCHAR16 must contain
338+a 16 bit wide signed data type. Otherwise it can be a dummy data type since
339+pcre16 functions are not implemented. There is a check for this in pcre_internal.h. */
340+#ifndef PCRE_UCHAR16
341+#define PCRE_UCHAR16 unsigned short
342+#endif
343+
344+#ifndef PCRE_SPTR16
345+#define PCRE_SPTR16 const PCRE_UCHAR16 *
346+#endif
347+
348+/* If PCRE is compiled with 32 bit character support, PCRE_UCHAR32 must contain
349+a 32 bit wide signed data type. Otherwise it can be a dummy data type since
350+pcre32 functions are not implemented. There is a check for this in pcre_internal.h. */
351+#ifndef PCRE_UCHAR32
352+#define PCRE_UCHAR32 unsigned int
353+#endif
354+
355+#ifndef PCRE_SPTR32
356+#define PCRE_SPTR32 const PCRE_UCHAR32 *
357+#endif
358+
359+/* When PCRE is compiled as a C++ library, the subject pointer type can be
360+replaced with a custom type. For conventional use, the public interface is a
361+const char *. */
362+
363+#ifndef PCRE_SPTR
364+#define PCRE_SPTR const char *
365+#endif
366+
367+/* The structure for passing additional data to pcre_exec(). This is defined in
368+such as way as to be extensible. Always add new fields at the end, in order to
369+remain compatible. */
370+
371+typedef struct pcre_extra {
372+ unsigned long int flags; /* Bits for which fields are set */
373+ void *study_data; /* Opaque data from pcre_study() */
374+ unsigned long int match_limit; /* Maximum number of calls to match() */
375+ void *callout_data; /* Data passed back in callouts */
376+ const unsigned char *tables; /* Pointer to character tables */
377+ unsigned long int match_limit_recursion; /* Max recursive calls to match() */
378+ unsigned char **mark; /* For passing back a mark pointer */
379+ void *executable_jit; /* Contains a pointer to a compiled jit code */
380+} pcre_extra;
381+
382+/* Same structure as above, but with 16 bit char pointers. */
383+
384+typedef struct pcre16_extra {
385+ unsigned long int flags; /* Bits for which fields are set */
386+ void *study_data; /* Opaque data from pcre_study() */
387+ unsigned long int match_limit; /* Maximum number of calls to match() */
388+ void *callout_data; /* Data passed back in callouts */
389+ const unsigned char *tables; /* Pointer to character tables */
390+ unsigned long int match_limit_recursion; /* Max recursive calls to match() */
391+ PCRE_UCHAR16 **mark; /* For passing back a mark pointer */
392+ void *executable_jit; /* Contains a pointer to a compiled jit code */
393+} pcre16_extra;
394+
395+/* Same structure as above, but with 32 bit char pointers. */
396+
397+typedef struct pcre32_extra {
398+ unsigned long int flags; /* Bits for which fields are set */
399+ void *study_data; /* Opaque data from pcre_study() */
400+ unsigned long int match_limit; /* Maximum number of calls to match() */
401+ void *callout_data; /* Data passed back in callouts */
402+ const unsigned char *tables; /* Pointer to character tables */
403+ unsigned long int match_limit_recursion; /* Max recursive calls to match() */
404+ PCRE_UCHAR32 **mark; /* For passing back a mark pointer */
405+ void *executable_jit; /* Contains a pointer to a compiled jit code */
406+} pcre32_extra;
407+
408+/* The structure for passing out data via the pcre_callout_function. We use a
409+structure so that new fields can be added on the end in future versions,
410+without changing the API of the function, thereby allowing old clients to work
411+without modification. */
412+
413+typedef struct pcre_callout_block {
414+ int version; /* Identifies version of block */
415+ /* ------------------------ Version 0 ------------------------------- */
416+ int callout_number; /* Number compiled into pattern */
417+ int *offset_vector; /* The offset vector */
418+ PCRE_SPTR subject; /* The subject being matched */
419+ int subject_length; /* The length of the subject */
420+ int start_match; /* Offset to start of this match attempt */
421+ int current_position; /* Where we currently are in the subject */
422+ int capture_top; /* Max current capture */
423+ int capture_last; /* Most recently closed capture */
424+ void *callout_data; /* Data passed in with the call */
425+ /* ------------------- Added for Version 1 -------------------------- */
426+ int pattern_position; /* Offset to next item in the pattern */
427+ int next_item_length; /* Length of next item in the pattern */
428+ /* ------------------- Added for Version 2 -------------------------- */
429+ const unsigned char *mark; /* Pointer to current mark or NULL */
430+ /* ------------------------------------------------------------------ */
431+} pcre_callout_block;
432+
433+/* Same structure as above, but with 16 bit char pointers. */
434+
435+typedef struct pcre16_callout_block {
436+ int version; /* Identifies version of block */
437+ /* ------------------------ Version 0 ------------------------------- */
438+ int callout_number; /* Number compiled into pattern */
439+ int *offset_vector; /* The offset vector */
440+ PCRE_SPTR16 subject; /* The subject being matched */
441+ int subject_length; /* The length of the subject */
442+ int start_match; /* Offset to start of this match attempt */
443+ int current_position; /* Where we currently are in the subject */
444+ int capture_top; /* Max current capture */
445+ int capture_last; /* Most recently closed capture */
446+ void *callout_data; /* Data passed in with the call */
447+ /* ------------------- Added for Version 1 -------------------------- */
448+ int pattern_position; /* Offset to next item in the pattern */
449+ int next_item_length; /* Length of next item in the pattern */
450+ /* ------------------- Added for Version 2 -------------------------- */
451+ const PCRE_UCHAR16 *mark; /* Pointer to current mark or NULL */
452+ /* ------------------------------------------------------------------ */
453+} pcre16_callout_block;
454+
455+/* Same structure as above, but with 32 bit char pointers. */
456+
457+typedef struct pcre32_callout_block {
458+ int version; /* Identifies version of block */
459+ /* ------------------------ Version 0 ------------------------------- */
460+ int callout_number; /* Number compiled into pattern */
461+ int *offset_vector; /* The offset vector */
462+ PCRE_SPTR32 subject; /* The subject being matched */
463+ int subject_length; /* The length of the subject */
464+ int start_match; /* Offset to start of this match attempt */
465+ int current_position; /* Where we currently are in the subject */
466+ int capture_top; /* Max current capture */
467+ int capture_last; /* Most recently closed capture */
468+ void *callout_data; /* Data passed in with the call */
469+ /* ------------------- Added for Version 1 -------------------------- */
470+ int pattern_position; /* Offset to next item in the pattern */
471+ int next_item_length; /* Length of next item in the pattern */
472+ /* ------------------- Added for Version 2 -------------------------- */
473+ const PCRE_UCHAR32 *mark; /* Pointer to current mark or NULL */
474+ /* ------------------------------------------------------------------ */
475+} pcre32_callout_block;
476+
477+/* Indirection for store get and free functions. These can be set to
478+alternative malloc/free functions if required. Special ones are used in the
479+non-recursive case for "frames". There is also an optional callout function
480+that is triggered by the (?) regex item. For Virtual Pascal, these definitions
481+have to take another form. */
482+
483+#ifndef VPCOMPAT
484+PCRE_EXP_DECL void *(*pcre_malloc)(size_t);
485+PCRE_EXP_DECL void (*pcre_free)(void *);
486+PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t);
487+PCRE_EXP_DECL void (*pcre_stack_free)(void *);
488+PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *);
489+
490+PCRE_EXP_DECL void *(*pcre16_malloc)(size_t);
491+PCRE_EXP_DECL void (*pcre16_free)(void *);
492+PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t);
493+PCRE_EXP_DECL void (*pcre16_stack_free)(void *);
494+PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *);
495+
496+PCRE_EXP_DECL void *(*pcre32_malloc)(size_t);
497+PCRE_EXP_DECL void (*pcre32_free)(void *);
498+PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t);
499+PCRE_EXP_DECL void (*pcre32_stack_free)(void *);
500+PCRE_EXP_DECL int (*pcre32_callout)(pcre32_callout_block *);
501+#else /* VPCOMPAT */
502+PCRE_EXP_DECL void *pcre_malloc(size_t);
503+PCRE_EXP_DECL void pcre_free(void *);
504+PCRE_EXP_DECL void *pcre_stack_malloc(size_t);
505+PCRE_EXP_DECL void pcre_stack_free(void *);
506+PCRE_EXP_DECL int pcre_callout(pcre_callout_block *);
507+
508+PCRE_EXP_DECL void *pcre16_malloc(size_t);
509+PCRE_EXP_DECL void pcre16_free(void *);
510+PCRE_EXP_DECL void *pcre16_stack_malloc(size_t);
511+PCRE_EXP_DECL void pcre16_stack_free(void *);
512+PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *);
513+
514+PCRE_EXP_DECL void *pcre32_malloc(size_t);
515+PCRE_EXP_DECL void pcre32_free(void *);
516+PCRE_EXP_DECL void *pcre32_stack_malloc(size_t);
517+PCRE_EXP_DECL void pcre32_stack_free(void *);
518+PCRE_EXP_DECL int pcre32_callout(pcre32_callout_block *);
519+#endif /* VPCOMPAT */
520+
521+/* User defined callback which provides a stack just before the match starts. */
522+
523+typedef pcre_jit_stack *(*pcre_jit_callback)(void *);
524+typedef pcre16_jit_stack *(*pcre16_jit_callback)(void *);
525+typedef pcre32_jit_stack *(*pcre32_jit_callback)(void *);
526+
527+/* Exported PCRE functions */
528+
529+PCRE_EXP_DECL pcre *pcre_compile(const char *, int, const char **, int *,
530+ const unsigned char *);
531+PCRE_EXP_DECL pcre16 *pcre16_compile(PCRE_SPTR16, int, const char **, int *,
532+ const unsigned char *);
533+PCRE_EXP_DECL pcre32 *pcre32_compile(PCRE_SPTR32, int, const char **, int *,
534+ const unsigned char *);
535+PCRE_EXP_DECL pcre *pcre_compile2(const char *, int, int *, const char **,
536+ int *, const unsigned char *);
537+PCRE_EXP_DECL pcre16 *pcre16_compile2(PCRE_SPTR16, int, int *, const char **,
538+ int *, const unsigned char *);
539+PCRE_EXP_DECL pcre32 *pcre32_compile2(PCRE_SPTR32, int, int *, const char **,
540+ int *, const unsigned char *);
541+PCRE_EXP_DECL int pcre_config(int, void *);
542+PCRE_EXP_DECL int pcre16_config(int, void *);
543+PCRE_EXP_DECL int pcre32_config(int, void *);
544+PCRE_EXP_DECL int pcre_copy_named_substring(const pcre *, const char *,
545+ int *, int, const char *, char *, int);
546+PCRE_EXP_DECL int pcre16_copy_named_substring(const pcre16 *, PCRE_SPTR16,
547+ int *, int, PCRE_SPTR16, PCRE_UCHAR16 *, int);
548+PCRE_EXP_DECL int pcre32_copy_named_substring(const pcre32 *, PCRE_SPTR32,
549+ int *, int, PCRE_SPTR32, PCRE_UCHAR32 *, int);
550+PCRE_EXP_DECL int pcre_copy_substring(const char *, int *, int, int,
551+ char *, int);
552+PCRE_EXP_DECL int pcre16_copy_substring(PCRE_SPTR16, int *, int, int,
553+ PCRE_UCHAR16 *, int);
554+PCRE_EXP_DECL int pcre32_copy_substring(PCRE_SPTR32, int *, int, int,
555+ PCRE_UCHAR32 *, int);
556+PCRE_EXP_DECL int pcre_dfa_exec(const pcre *, const pcre_extra *,
557+ const char *, int, int, int, int *, int , int *, int);
558+PCRE_EXP_DECL int pcre16_dfa_exec(const pcre16 *, const pcre16_extra *,
559+ PCRE_SPTR16, int, int, int, int *, int , int *, int);
560+PCRE_EXP_DECL int pcre32_dfa_exec(const pcre32 *, const pcre32_extra *,
561+ PCRE_SPTR32, int, int, int, int *, int , int *, int);
562+PCRE_EXP_DECL int pcre_exec(const pcre *, const pcre_extra *, PCRE_SPTR,
563+ int, int, int, int *, int);
564+PCRE_EXP_DECL int pcre16_exec(const pcre16 *, const pcre16_extra *,
565+ PCRE_SPTR16, int, int, int, int *, int);
566+PCRE_EXP_DECL int pcre32_exec(const pcre32 *, const pcre32_extra *,
567+ PCRE_SPTR32, int, int, int, int *, int);
568+PCRE_EXP_DECL int pcre_jit_exec(const pcre *, const pcre_extra *,
569+ PCRE_SPTR, int, int, int, int *, int,
570+ pcre_jit_stack *);
571+PCRE_EXP_DECL int pcre16_jit_exec(const pcre16 *, const pcre16_extra *,
572+ PCRE_SPTR16, int, int, int, int *, int,
573+ pcre16_jit_stack *);
574+PCRE_EXP_DECL int pcre32_jit_exec(const pcre32 *, const pcre32_extra *,
575+ PCRE_SPTR32, int, int, int, int *, int,
576+ pcre32_jit_stack *);
577+PCRE_EXP_DECL void pcre_free_substring(const char *);
578+PCRE_EXP_DECL void pcre16_free_substring(PCRE_SPTR16);
579+PCRE_EXP_DECL void pcre32_free_substring(PCRE_SPTR32);
580+PCRE_EXP_DECL void pcre_free_substring_list(const char **);
581+PCRE_EXP_DECL void pcre16_free_substring_list(PCRE_SPTR16 *);
582+PCRE_EXP_DECL void pcre32_free_substring_list(PCRE_SPTR32 *);
583+PCRE_EXP_DECL int pcre_fullinfo(const pcre *, const pcre_extra *, int,
584+ void *);
585+PCRE_EXP_DECL int pcre16_fullinfo(const pcre16 *, const pcre16_extra *, int,
586+ void *);
587+PCRE_EXP_DECL int pcre32_fullinfo(const pcre32 *, const pcre32_extra *, int,
588+ void *);
589+PCRE_EXP_DECL int pcre_get_named_substring(const pcre *, const char *,
590+ int *, int, const char *, const char **);
591+PCRE_EXP_DECL int pcre16_get_named_substring(const pcre16 *, PCRE_SPTR16,
592+ int *, int, PCRE_SPTR16, PCRE_SPTR16 *);
593+PCRE_EXP_DECL int pcre32_get_named_substring(const pcre32 *, PCRE_SPTR32,
594+ int *, int, PCRE_SPTR32, PCRE_SPTR32 *);
595+PCRE_EXP_DECL int pcre_get_stringnumber(const pcre *, const char *);
596+PCRE_EXP_DECL int pcre16_get_stringnumber(const pcre16 *, PCRE_SPTR16);
597+PCRE_EXP_DECL int pcre32_get_stringnumber(const pcre32 *, PCRE_SPTR32);
598+PCRE_EXP_DECL int pcre_get_stringtable_entries(const pcre *, const char *,
599+ char **, char **);
600+PCRE_EXP_DECL int pcre16_get_stringtable_entries(const pcre16 *, PCRE_SPTR16,
601+ PCRE_UCHAR16 **, PCRE_UCHAR16 **);
602+PCRE_EXP_DECL int pcre32_get_stringtable_entries(const pcre32 *, PCRE_SPTR32,
603+ PCRE_UCHAR32 **, PCRE_UCHAR32 **);
604+PCRE_EXP_DECL int pcre_get_substring(const char *, int *, int, int,
605+ const char **);
606+PCRE_EXP_DECL int pcre16_get_substring(PCRE_SPTR16, int *, int, int,
607+ PCRE_SPTR16 *);
608+PCRE_EXP_DECL int pcre32_get_substring(PCRE_SPTR32, int *, int, int,
609+ PCRE_SPTR32 *);
610+PCRE_EXP_DECL int pcre_get_substring_list(const char *, int *, int,
611+ const char ***);
612+PCRE_EXP_DECL int pcre16_get_substring_list(PCRE_SPTR16, int *, int,
613+ PCRE_SPTR16 **);
614+PCRE_EXP_DECL int pcre32_get_substring_list(PCRE_SPTR32, int *, int,
615+ PCRE_SPTR32 **);
616+PCRE_EXP_DECL const unsigned char *pcre_maketables(void);
617+PCRE_EXP_DECL const unsigned char *pcre16_maketables(void);
618+PCRE_EXP_DECL const unsigned char *pcre32_maketables(void);
619+PCRE_EXP_DECL int pcre_refcount(pcre *, int);
620+PCRE_EXP_DECL int pcre16_refcount(pcre16 *, int);
621+PCRE_EXP_DECL int pcre32_refcount(pcre32 *, int);
622+PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
623+PCRE_EXP_DECL pcre16_extra *pcre16_study(const pcre16 *, int, const char **);
624+PCRE_EXP_DECL pcre32_extra *pcre32_study(const pcre32 *, int, const char **);
625+PCRE_EXP_DECL void pcre_free_study(pcre_extra *);
626+PCRE_EXP_DECL void pcre16_free_study(pcre16_extra *);
627+PCRE_EXP_DECL void pcre32_free_study(pcre32_extra *);
628+PCRE_EXP_DECL const char *pcre_version(void);
629+PCRE_EXP_DECL const char *pcre16_version(void);
630+PCRE_EXP_DECL const char *pcre32_version(void);
631+
632+/* Utility functions for byte order swaps. */
633+PCRE_EXP_DECL int pcre_pattern_to_host_byte_order(pcre *, pcre_extra *,
634+ const unsigned char *);
635+PCRE_EXP_DECL int pcre16_pattern_to_host_byte_order(pcre16 *, pcre16_extra *,
636+ const unsigned char *);
637+PCRE_EXP_DECL int pcre32_pattern_to_host_byte_order(pcre32 *, pcre32_extra *,
638+ const unsigned char *);
639+PCRE_EXP_DECL int pcre16_utf16_to_host_byte_order(PCRE_UCHAR16 *,
640+ PCRE_SPTR16, int, int *, int);
641+PCRE_EXP_DECL int pcre32_utf32_to_host_byte_order(PCRE_UCHAR32 *,
642+ PCRE_SPTR32, int, int *, int);
643+
644+/* JIT compiler related functions. */
645+
646+PCRE_EXP_DECL pcre_jit_stack *pcre_jit_stack_alloc(int, int);
647+PCRE_EXP_DECL pcre16_jit_stack *pcre16_jit_stack_alloc(int, int);
648+PCRE_EXP_DECL pcre32_jit_stack *pcre32_jit_stack_alloc(int, int);
649+PCRE_EXP_DECL void pcre_jit_stack_free(pcre_jit_stack *);
650+PCRE_EXP_DECL void pcre16_jit_stack_free(pcre16_jit_stack *);
651+PCRE_EXP_DECL void pcre32_jit_stack_free(pcre32_jit_stack *);
652+PCRE_EXP_DECL void pcre_assign_jit_stack(pcre_extra *,
653+ pcre_jit_callback, void *);
654+PCRE_EXP_DECL void pcre16_assign_jit_stack(pcre16_extra *,
655+ pcre16_jit_callback, void *);
656+PCRE_EXP_DECL void pcre32_assign_jit_stack(pcre32_extra *,
657+ pcre32_jit_callback, void *);
658+
659+#ifdef __cplusplus
660+} /* extern "C" */
661+#endif
662+
663+#endif /* End of pcre.h */
Binary files /dev/null and b/pcre/lib/pcre.lib differ
Binary files /dev/null and b/pcre/lib/pcred.lib differ
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -1,3 +1,4 @@
1+#include "stdafx.h"
12 #include "server.h"
23 #include "stat_cache.h"
34 #include "keyvalue.h"
@@ -11,20 +12,20 @@
1112 #include <sys/types.h>
1213
1314 #ifdef __WIN32
14-# include <winsock2.h>
15+# include "lwip/sockets.h"
1516 #else
1617 # include <sys/socket.h>
1718 # include <sys/wait.h>
1819 # include <sys/mman.h>
1920 # include <netinet/in.h>
2021 # include <arpa/inet.h>
22+#include <fdevent.h>
2123 #endif
2224
2325 #include <unistd.h>
2426 #include <errno.h>
2527 #include <stdlib.h>
2628 #include <string.h>
27-#include <fdevent.h>
2829 #include <signal.h>
2930 #include <ctype.h>
3031 #include <assert.h>