diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-08 18:13:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-08 18:13:03 +0000 |
commit | 4c8d19f8daa2f9b9692d5995226439b2001ad92f (patch) | |
tree | 051c6e2b0bb47040b6458d0347f3a3c97f855466 /plugins/Db3x_mmap/src/dbintf.h | |
parent | 2ccbc4c7f3efc677290f8e1607543676b61c1cbe (diff) |
low-level database access functions rewritten to MCONTACT instead of HANDLE hContact
git-svn-id: http://svn.miranda-ng.org/main/trunk@8067 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbintf.h')
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 284a5842d9..629b2972f8 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -185,34 +185,34 @@ public: STDMETHODIMP_(void) SetCacheSafetyMode(BOOL);
STDMETHODIMP_(LONG) GetContactCount(void);
- STDMETHODIMP_(HANDLE) FindFirstContact(const char* szProto = NULL);
- STDMETHODIMP_(HANDLE) FindNextContact(HANDLE hContact, const char* szProto = NULL);
- STDMETHODIMP_(LONG) DeleteContact(HANDLE hContact);
+ STDMETHODIMP_(MCONTACT) FindFirstContact(const char* szProto = NULL);
+ STDMETHODIMP_(MCONTACT) FindNextContact(MCONTACT contactID, const char* szProto = NULL);
+ STDMETHODIMP_(LONG) DeleteContact(MCONTACT contactID);
STDMETHODIMP_(HANDLE) AddContact(void);
- STDMETHODIMP_(BOOL) IsDbContact(HANDLE hContact);
+ STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
- STDMETHODIMP_(LONG) GetEventCount(HANDLE hContact);
- STDMETHODIMP_(HANDLE) AddEvent(HANDLE hContact, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(HANDLE hContact, HANDLE hDbEvent);
+ STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(HANDLE hContact, HANDLE hDbEvent);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
STDMETHODIMP_(HANDLE) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(HANDLE hContact);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(HANDLE hContact);
- STDMETHODIMP_(HANDLE) FindLastEvent(HANDLE hContact);
+ STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
STDMETHODIMP_(HANDLE) FindNextEvent(HANDLE hDbEvent);
STDMETHODIMP_(HANDLE) FindPrevEvent(HANDLE hDbEvent);
STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
- STDMETHODIMP_(BOOL) GetContactSetting(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStr(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) GetContactSettingStatic(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStr(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
+ STDMETHODIMP_(BOOL) GetContactSettingStatic(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv);
STDMETHODIMP_(BOOL) FreeVariant(DBVARIANT *dbv);
- STDMETHODIMP_(BOOL) WriteContactSetting(HANDLE hContact, DBCONTACTWRITESETTING *dbcws);
- STDMETHODIMP_(BOOL) DeleteContactSetting(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting);
- STDMETHODIMP_(BOOL) EnumContactSettings(HANDLE hContact, DBCONTACTENUMSETTINGS* dbces);
+ STDMETHODIMP_(BOOL) WriteContactSetting(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws);
+ STDMETHODIMP_(BOOL) DeleteContactSetting(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting);
+ STDMETHODIMP_(BOOL) EnumContactSettings(MCONTACT contactID, DBCONTACTENUMSETTINGS* dbces);
STDMETHODIMP_(BOOL) SetSettingResident(BOOL bIsResident, const char *pszSettingName);
STDMETHODIMP_(BOOL) EnumResidentSettings(DBMODULEENUMPROC pFunc, void *pParam);
STDMETHODIMP_(BOOL) IsSettingEncrypted(LPCSTR szModule, LPCSTR szSetting);
@@ -271,15 +271,11 @@ protected: CRITICAL_SECTION m_csDbAccess;
- int CheckProto(HANDLE hContact, const char *proto);
+ int CheckProto(DBCachedContact *cc, const char *proto);
DWORD CreateNewSpace(int bytes);
void DeleteSpace(DWORD ofs, int bytes);
DWORD ReallocSpace(DWORD ofs, int oldSize, int newSize);
-
- __forceinline PBYTE DBRead(HANDLE hContact, int bytesRequired, int *bytesAvail)
- {
- return DBRead((DWORD)hContact, bytesRequired, bytesAvail);
- }
+ DWORD GetContactOffset(MCONTACT contactID);
////////////////////////////////////////////////////////////////////////////
// settings
@@ -293,7 +289,7 @@ protected: LIST<ModuleName> m_lMods, m_lOfs;
LIST<char> m_lResidentSettings;
HANDLE hEventAddedEvent, hEventDeletedEvent, hEventFilterAddedEvent;
- HANDLE m_hLastCachedContact;
+ MCONTACT m_hLastCachedContact;
ModuleName *m_lastmn;
void AddToList(char *name, DWORD len, DWORD ofs);
@@ -314,7 +310,7 @@ protected: DWORD ConvertModuleNameOfs(DWORD ofsOld);
void ConvertOldEvent(DBEvent*& dbei);
- int GetContactSettingWorker(HANDLE hContact, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic);
+ int GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv, int isStatic);
int WorkSettingsChain(DWORD ofsContact, DBContact *dbc, int firstTime);
int WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime);
@@ -331,8 +327,8 @@ protected: void ConvertContacts(void);
int InitCrypt(void);
- void ToggleEventsEncryption(HANDLE hContact);
- void ToggleSettingsEncryption(HANDLE hContact);
+ void ToggleEventsEncryption(MCONTACT contactID);
+ void ToggleSettingsEncryption(MCONTACT contactID);
void InitDialogs();
bool EnterPassword(const BYTE *pKey, const size_t keyLen);
|