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/src | |
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/src')
-rw-r--r-- | plugins/Db3x/src/init.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
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
};
/////////////////////////////////////////////////////////////////////////////////////////
|