diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-02 17:42:41 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-08-02 17:42:41 +0000 |
commit | cd6ce3298f1a2a1243e45ae29f52194d06f6d0af (patch) | |
tree | aeb09c09217076b126903f665269d048e806ad31 /plugins | |
parent | a871fd35ad16eca0482a9687d1bbaa77d34d74d6 (diff) |
project cleanup
variables use pcre16
git-svn-id: http://svn.miranda-ng.org/main/trunk@10028 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Pcre16/pcre16_12.vcxproj | 1 | ||||
-rw-r--r-- | plugins/Variables/Variables_12.vcxproj | 21 | ||||
-rw-r--r-- | plugins/Variables/src/parse_regexp.cpp | 30 | ||||
-rw-r--r-- | plugins/Variables/src/variables.h | 5 |
4 files changed, 27 insertions, 30 deletions
diff --git a/plugins/Pcre16/pcre16_12.vcxproj b/plugins/Pcre16/pcre16_12.vcxproj index f76ec24f4d..ae9da49cbe 100644 --- a/plugins/Pcre16/pcre16_12.vcxproj +++ b/plugins/Pcre16/pcre16_12.vcxproj @@ -62,7 +62,6 @@ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir>
- <IgnoreImportLibrary>false</IgnoreImportLibrary>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
diff --git a/plugins/Variables/Variables_12.vcxproj b/plugins/Variables/Variables_12.vcxproj index f660042168..e8e04a9a2f 100644 --- a/plugins/Variables/Variables_12.vcxproj +++ b/plugins/Variables/Variables_12.vcxproj @@ -91,12 +91,12 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>pcred.lib;pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>src\pcre\lib;$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
@@ -119,14 +119,14 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>pcre.lib;pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalLibraryDirectories>src\pcre\lib;$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -144,14 +144,14 @@ <ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
- <AdditionalDependencies>pcre.lib;pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalLibraryDirectories>src\pcre\lib64;$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -171,12 +171,12 @@ <ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<Link>
- <AdditionalDependencies>pcred.lib;pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>pdh.lib;Ws2_32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
- <AdditionalLibraryDirectories>src\pcre\lib64;$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(ProfileDir)..\..\bin12\lib</AdditionalLibraryDirectories>
</Link>
<ResourceCompile>
<AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
@@ -234,6 +234,11 @@ <ResourceCompile Include="res\Variables.rc" />
<ResourceCompile Include="res\version.rc" />
</ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Pcre16\pcre16_12.vcxproj">
+ <Project>{6124e997-426e-4a0b-9617-d6d577d5e7d7}</Project>
+ </ProjectReference>
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/plugins/Variables/src/parse_regexp.cpp b/plugins/Variables/src/parse_regexp.cpp index ee191f95fa..0510464c97 100644 --- a/plugins/Variables/src/parse_regexp.cpp +++ b/plugins/Variables/src/parse_regexp.cpp @@ -34,15 +34,12 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai) ai->flags = AIF_FALSE;
- ptrA arg1(mir_t2a(ai->targv[1]));
- ptrA arg2(mir_t2a(ai->targv[2]));
-
- pcre *ppat = pcre_compile(arg1, 0, &err, &erroffset, NULL);
+ pcre16 *ppat = pcre16_compile(ai->targv[1], 0, &err, &erroffset, NULL);
if (ppat == NULL)
return NULL;
- pcre_extra *extra = pcre_study(ppat, 0, &err);
- int nmat = pcre_exec(ppat, extra, arg2, (int)strlen(arg2), 0, 0, offsets, 99);
+ pcre16_extra *extra = pcre16_study(ppat, 0, &err);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)lstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat > 0) {
ai->flags &= ~AIF_FALSE;
_ltoa(nmat, szVal, 10);
@@ -57,36 +54,33 @@ static TCHAR *parseRegExpCheck(ARGUMENTSINFO *ai) */
static TCHAR *parseRegExpSubstr(ARGUMENTSINFO *ai)
{
- const char *err, *substring;
+ const char *err;
+ const TCHAR *substring;
int erroffset, number;
int offsets[99];
if (ai->argc != 4)
return NULL;
- ptrA arg1(mir_t2a(ai->targv[1]));
- ptrA arg2(mir_t2a(ai->targv[2]));
- ptrA arg3(mir_t2a(ai->targv[3]));
-
- number = atoi(arg3);
+ number = _ttoi(ai->targv[3]);
if (number < 0)
return NULL;
ai->flags = AIF_FALSE;
- pcre *ppat = pcre_compile(arg1, 0, &err, &erroffset, NULL);
+ pcre16 *ppat = pcre16_compile(ai->targv[1], 0, &err, &erroffset, NULL);
if (ppat == NULL)
return NULL;
- pcre_extra *extra = pcre_study(ppat, 0, &err);
- int nmat = pcre_exec(ppat, extra, arg2, (int)strlen(arg2), 0, 0, offsets, 99);
+ pcre16_extra *extra = pcre16_study(ppat, 0, &err);
+ int nmat = pcre16_exec(ppat, extra, ai->targv[2], (int)lstrlen(ai->targv[2]), 0, 0, offsets, 99);
if (nmat >= 0)
ai->flags &= ~AIF_FALSE;
- if (pcre_get_substring(arg2, offsets, nmat, number, &substring) < 0)
+ if (pcre16_get_substring(ai->targv[2], offsets, nmat, number, &substring) < 0)
ai->flags |= AIF_FALSE;
else {
- TCHAR *tres = mir_a2t(substring);
- pcre_free_substring(substring);
+ TCHAR *tres = mir_tstrdup(substring);
+ pcre16_free_substring(substring);
return tres;
}
diff --git a/plugins/Variables/src/variables.h b/plugins/Variables/src/variables.h index 8818f1fdc7..6014c0ba55 100644 --- a/plugins/Variables/src/variables.h +++ b/plugins/Variables/src/variables.h @@ -19,7 +19,6 @@ #define _CRT_NON_CONFORMING_SWPRINTFS
#define _CRT_SECURE_NO_WARNINGS
-#define PCRE_STATIC
#include <malloc.h>
#include <windows.h>
@@ -44,13 +43,13 @@ #include <m_clui.h>
#include <m_clc.h>
#include <m_string.h>
+#include <m_metacontacts.h>
#include <m_variables.h>
-#include <m_metacontacts.h>
#include "..\helpers\gen_helpers.h"
-#include "pcre\include\pcre.h"
+#include "..\pcre16\src\pcre.h"
#include "resource.h"
#include "version.h"
|