From 6d6cb956a78b2dbfa7e8d62f4234d8f27b100468 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Nov 2017 22:06:26 +0300 Subject: database enumerators => void* instead of LPARAM --- include/m_database.h | 13 ++++++------- include/m_db_int.h | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index 2292c76513..eb4bd3cbcf 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -99,21 +99,20 @@ EXTERN_C MIR_CORE_DLL(int) db_is_contact(MCONTACT hContact); // Returns the value returned by the last call to dbmep // This service is only really useful for debugging, in conjunction with db/contact/enumsettings // dbmep should return 0 to continue enumeration, or nonzero to stop. -// ofsModuleName is the offset of the module name from the start of the profile -// database, and is only useful for really heavyweight debugging +// // Modules names will be enumerated in no particular order // Writing to the database while module names are being enumerated will cause // unpredictable results in the enumeration, but the write will work. // szModuleName is only guaranteed to be valid for the duration of the callback. // If you want to keep it for longer you must allocation your own storage. -typedef int(*DBMODULEENUMPROC)(const char *szModuleName, DWORD ofsModuleName, LPARAM lParam); +typedef int(*DBMODULEENUMPROC)(const char *szModuleName, void *param); -EXTERN_C MIR_CORE_DLL(int) db_enum_modules(DBMODULEENUMPROC dbmep, const void *param = NULL); +EXTERN_C MIR_CORE_DLL(int) db_enum_modules(DBMODULEENUMPROC dbmep, void *param = nullptr); // Lists all resident settings -EXTERN_C MIR_CORE_DLL(int) db_enum_residents(DBMODULEENUMPROC pFunc, const void *param = NULL); +EXTERN_C MIR_CORE_DLL(int) db_enum_residents(DBMODULEENUMPROC pFunc, void *param = nullptr); // Lists all the settings a specific modules has stored in the database for a specific contact. // Returns the return value of the last call to pfnEnumProc, or -1 if there are @@ -124,9 +123,9 @@ EXTERN_C MIR_CORE_DLL(int) db_enum_residents(DBMODULEENUMPROC pFunc, const void // szSetting is only guaranteed to be valid for the duration of the callback. If // you want to keep it for longer you must allocation your own storage. -typedef int (*DBSETTINGENUMPROC)(const char *szSetting, LPARAM lParam); +typedef int (*DBSETTINGENUMPROC)(const char *szSetting, void *param); -EXTERN_C MIR_CORE_DLL(int) db_enum_settings(MCONTACT hContact, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, const void *param = NULL); +EXTERN_C MIR_CORE_DLL(int) db_enum_settings(MCONTACT hContact, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, void *param = nullptr); ///////////////////////////////////////////////////////////////////////////////////////// // DBVARIANT: used by db/contact/getsetting and db/contact/writesetting diff --git a/include/m_db_int.h b/include/m_db_int.h index 7ab866f884..ba93fad62c 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -109,7 +109,7 @@ interface MIR_APP_EXPORT MIDatabase STDMETHOD_(MEVENT, FindNextEvent)(MCONTACT contactID, MEVENT hDbEvent) PURE; STDMETHOD_(MEVENT, FindPrevEvent)(MCONTACT contactID, MEVENT hDbEvent) PURE; - STDMETHOD_(BOOL, EnumModuleNames)(DBMODULEENUMPROC pFunc, const void *pParam) PURE; + STDMETHOD_(BOOL, EnumModuleNames)(DBMODULEENUMPROC pFunc, void *pParam) PURE; STDMETHOD_(BOOL, GetContactSetting)(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv) PURE; STDMETHOD_(BOOL, GetContactSettingStr)(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting, DBVARIANT *dbv) PURE; @@ -117,9 +117,9 @@ interface MIR_APP_EXPORT MIDatabase STDMETHOD_(BOOL, FreeVariant)(DBVARIANT *dbv) PURE; STDMETHOD_(BOOL, WriteContactSetting)(MCONTACT contactID, DBCONTACTWRITESETTING *dbcws) PURE; STDMETHOD_(BOOL, DeleteContactSetting)(MCONTACT contactID, LPCSTR szModule, LPCSTR szSetting) PURE; - STDMETHOD_(BOOL, EnumContactSettings)(MCONTACT contactID, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, const void *param) PURE; + STDMETHOD_(BOOL, EnumContactSettings)(MCONTACT contactID, DBSETTINGENUMPROC pfnEnumProc, const char *szModule, void *param) PURE; STDMETHOD_(BOOL, SetSettingResident)(BOOL bIsResident, const char *pszSettingName) PURE; - STDMETHOD_(BOOL, EnumResidentSettings)(DBMODULEENUMPROC pFunc, const void *pParam) PURE; + STDMETHOD_(BOOL, EnumResidentSettings)(DBMODULEENUMPROC pFunc, void *pParam) PURE; STDMETHOD_(BOOL, IsSettingEncrypted)(LPCSTR szModule, LPCSTR szSetting) PURE; STDMETHOD_(BOOL, MetaDetouchSub)(DBCachedContact*, int nSub) PURE; -- cgit v1.2.3