summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-22 20:19:01 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-22 20:19:01 +0300
commit581319b8cd1f774e5fc42db570d44ec2b4e41485 (patch)
tree42234da7ead10b3f9421602f5636913ffcb35c72 /include
parent3285170a72a34d78e178b2b8117a3622f3a1840a (diff)
temporary return of DbChecker
Diffstat (limited to 'include')
-rw-r--r--include/m_database.h7
-rw-r--r--include/m_db_int.h30
2 files changed, 37 insertions, 0 deletions
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 <m_core.h>
#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;
};