From 581319b8cd1f774e5fc42db570d44ec2b4e41485 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2020 20:19:01 +0300 Subject: temporary return of DbChecker --- include/m_database.h | 7 +++++++ include/m_db_int.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index c0df1392e7..cb6d0e55bf 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -432,6 +432,13 @@ bool Profile_GetSetting(const wchar_t *pwszSetting, wchar_t(&pwszBuf)[_Size], co return Profile_GetSetting(pwszSetting, pwszBuf, _Size, pwszDefault); } +// Checks the specified profile like dbtool did. +// Implemented in the dbchecker plugins, thus it might not exist +// wParam = (WPARAM)(wchar_t*)ptszProfileName +// lParam = (BOOL)bConversionMode + +#define MS_DB_CHECKPROFILE "DB/CheckProfile" + ///////////////////////////////////////////////////////////////////////////////////////// // Contact services diff --git a/include/m_db_int.h b/include/m_db_int.h index 775c066b5a..660d5791ac 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -28,6 +28,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif +/////////////////////////////////////////////////////////////////////////////// +// basic database checker interface + +#define STATUS_MESSAGE 0 +#define STATUS_WARNING 1 +#define STATUS_ERROR 2 +#define STATUS_FATAL 3 +#define STATUS_SUCCESS 4 + +struct DBCHeckCallback +{ + int cbSize; + DWORD spaceProcessed, spaceUsed; + HANDLE hOutFile; + bool bCheckOnly, bBackup, bAggressive, bEraseHistory, bMarkRead, bConvertUtf; + + void (*pfnAddLogMessage)(int type, const wchar_t *ptszFormat, ...); +}; + +interface MIDatabaseChecker +{ + STDMETHOD_(BOOL, Start)(DBCHeckCallback *callback) PURE; + STDMETHOD_(BOOL, CheckDb)(int phase, int firstTime) PURE; + STDMETHOD_(VOID, Destroy)() PURE; +}; + ///////////////////////////////////////////////////////////////////////////////////////// // basic database interface @@ -130,6 +156,8 @@ interface MIR_APP_EXPORT MIDatabase STDMETHOD_(BOOL, Compact)(void) PURE; STDMETHOD_(BOOL, Backup)(LPCWSTR) PURE; + + STDMETHOD_(MIDatabaseChecker*, GetChecker)(void) PURE; STDMETHOD_(MEVENT, GetEventById)(LPCSTR szModule, LPCSTR szId) PURE; @@ -187,6 +215,8 @@ public: STDMETHODIMP_(BOOL) Compact(void) override; STDMETHODIMP_(BOOL) Backup(LPCWSTR) override; + STDMETHODIMP_(MIDatabaseChecker*) GetChecker(void) override; + STDMETHODIMP_(DB::EventCursor*) EventCursor(MCONTACT hContact, MEVENT hDbEvent) override; STDMETHODIMP_(DB::EventCursor*) EventCursorRev(MCONTACT hContact, MEVENT hDbEvent) override; }; -- cgit v1.2.3