diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-27 15:33:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-27 15:33:58 +0000 |
commit | df77e258df8cec689a001ec92031538298661b1b (patch) | |
tree | 56ec236ca9675f049c4806e8d41986c40b537f07 /plugins/Db3x | |
parent | 414ffc78d69f09d48fc43051e0806a30e8fb5c67 (diff) |
merge of dbtool & database plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@1213 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x')
-rw-r--r-- | plugins/Db3x/db3x_10.vcxproj | 27 | ||||
-rw-r--r-- | plugins/Db3x/db3x_10.vcxproj.filters | 30 | ||||
-rw-r--r-- | plugins/Db3x/src/init.cpp | 23 |
3 files changed, 79 insertions, 1 deletions
diff --git a/plugins/Db3x/db3x_10.vcxproj b/plugins/Db3x/db3x_10.vcxproj index ca0c4a5cbd..a3424d5068 100644 --- a/plugins/Db3x/db3x_10.vcxproj +++ b/plugins/Db3x/db3x_10.vcxproj @@ -206,6 +206,33 @@ <ClCompile Include="..\db3x_mmap\src\dbintf.cpp" />
<ClCompile Include="..\db3x_mmap\src\dbmodulechain.cpp" />
<ClCompile Include="..\db3x_mmap\src\dbsettings.cpp" />
+ <ClCompile Include="..\db3x_mmap\src\dbtool\aggressive.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\contactchain.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\disk.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\eventchain.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\finaltasks.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\initialchecks.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\modulechain.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\settingschain.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\user.cpp">
+ <PrecompiledHeaderFile>..\commonheaders.h</PrecompiledHeaderFile>
+ </ClCompile>
<ClCompile Include="src\dbcache3x.cpp" />
<ClCompile Include="src\dbintf3x.cpp" />
<ClCompile Include="src\init.cpp">
diff --git a/plugins/Db3x/db3x_10.vcxproj.filters b/plugins/Db3x/db3x_10.vcxproj.filters index a5829dde98..59595fa5ab 100644 --- a/plugins/Db3x/db3x_10.vcxproj.filters +++ b/plugins/Db3x/db3x_10.vcxproj.filters @@ -16,6 +16,9 @@ <Filter Include="Mmap">
<UniqueIdentifier>{640c5715-0e22-4240-8520-f7dedfc9fb87}</UniqueIdentifier>
</Filter>
+ <Filter Include="Mmap\Checker">
+ <UniqueIdentifier>{1603e383-8555-4ad2-b245-83442f3c44ee}</UniqueIdentifier>
+ </Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\init.cpp">
@@ -48,6 +51,33 @@ <ClCompile Include="..\db3x_mmap\src\dbsettings.cpp">
<Filter>Mmap</Filter>
</ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\aggressive.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\user.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\contactchain.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\disk.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\eventchain.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\finaltasks.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\initialchecks.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\modulechain.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
+ <ClCompile Include="..\db3x_mmap\src\dbtool\settingschain.cpp">
+ <Filter>Mmap\Checker</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\commonheaders.h">
diff --git a/plugins/Db3x/src/init.cpp b/plugins/Db3x/src/init.cpp index 406db891a6..6f021aa283 100644 --- a/plugins/Db3x/src/init.cpp +++ b/plugins/Db3x/src/init.cpp @@ -121,6 +121,26 @@ static int UnloadDatabase(MIDatabase* db) return 0;
}
+MIDatabaseChecker* CheckDb(const TCHAR* ptszFileName, int *error)
+{
+ CDb3x *tmp = new CDb3x(ptszFileName);
+ if (tmp->Load(true) != ERROR_SUCCESS) {
+ delete tmp;
+ if (error != NULL) *error = EGROKPRF_CANTREAD;
+ return NULL;
+ }
+
+ int chk = tmp->CheckDbHeaders();
+ if (chk != ERROR_SUCCESS) {
+ delete tmp;
+ *error = chk;
+ return NULL;
+ }
+
+ *error = 0;
+ return tmp;
+}
+
static DATABASELINK dblink =
{
sizeof(DATABASELINK),
@@ -129,7 +149,8 @@ static DATABASELINK dblink = makeDatabase,
grokHeader,
LoadDatabase,
- UnloadDatabase
+ UnloadDatabase,
+ CheckDb
};
/////////////////////////////////////////////////////////////////////////////////////////
|