mirror of
https://github.com/nmap/nmap.git
synced 2025-12-27 18:09:01 +00:00
Redo some changes to the NSE pcre module that were originally done
before pcre was made a C module. Remove the nse_pcrelib.vcproj file, change snprintf to Snprintf, and add a typecast to avoid a warning on Windows. This and r6026 should be considered a unit.
This commit is contained in:
@@ -23,12 +23,6 @@ EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\liblua\liblua.vcproj", "{31FB0767-A71F-4575-8379-002D72B8AF86}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nse_bitlib", "..\nselib\nse_bitlib.vcproj", "{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86} = {31FB0767-A71F-4575-8379-002D72B8AF86}
|
||||
{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85} = {AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nse_pcrelib", "..\nselib\nse_pcrelib.vcproj", "{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{31FB0767-A71F-4575-8379-002D72B8AF86} = {31FB0767-A71F-4575-8379-002D72B8AF86}
|
||||
EndProjectSection
|
||||
@@ -67,10 +61,6 @@ Global
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FB7F6FD2-A39D-40A1-86DD-9B08370BDEA6}.Release|Win32.Build.0 = Release|Win32
|
||||
{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -34,7 +34,7 @@ static int get_startoffset(lua_State *L, int stackpos, size_t len)
|
||||
if(startoffset > 0)
|
||||
startoffset--;
|
||||
else if(startoffset < 0) {
|
||||
startoffset += len;
|
||||
startoffset += (int) len;
|
||||
if(startoffset < 0)
|
||||
startoffset = 0;
|
||||
}
|
||||
@@ -48,11 +48,11 @@ static int udata_tostring (lua_State *L, const char* type_handle,
|
||||
void *udata = luaL_checkudata(L, 1, type_handle);
|
||||
|
||||
if(udata) {
|
||||
(void)snprintf(buf, 255, "%s (%p)", type_name, udata);
|
||||
(void)Snprintf(buf, 255, "%s (%p)", type_name, udata);
|
||||
lua_pushstring(L, buf);
|
||||
}
|
||||
else {
|
||||
(void)snprintf(buf, 255, "must be userdata of type '%s'", type_name);
|
||||
(void)Snprintf(buf, 255, "must be userdata of type '%s'", type_name);
|
||||
(void)luaL_argerror(L, 1, buf);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ static int Lpcre_comp(lua_State *L)
|
||||
|
||||
ud->pr = pcre_compile(pattern, cflags, &error, &erroffset, tables);
|
||||
if(!ud->pr) {
|
||||
(void)snprintf(buf, 255, "%s (pattern offset: %d)", error, erroffset+1);
|
||||
(void)Snprintf(buf, 255, "%s (pattern offset: %d)", error, erroffset+1);
|
||||
/* show offset 1-based as it's common in Lua */
|
||||
L_lua_error(L, buf);
|
||||
}
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="nse_pcrelib"
|
||||
ProjectGUID="{AC2E7983-2E05-4CDB-96E3-7A03B01DCE85}"
|
||||
RootNamespace="nse_pcrelib"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\libpcre;..\liblua"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;NSE_PCRELIB_EXPORTS;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||
MinimalRebuild="false"
|
||||
ExceptionHandling="0"
|
||||
BasicRuntimeChecks="0"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="liblua.lib libpcre.lib"
|
||||
OutputFile=".\pcre.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\libpcre;..\liblua"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\libpcre;..\liblua"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NSE_PCRELIB_EXPORTS;LUA_BUILD_AS_DLL;LUA_LIB"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="liblua.lib libpcre.lib"
|
||||
OutputFile=".\pcre.dll"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="..\libpcre;..\liblua"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pcre.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\pcre.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Reference in New Issue
Block a user