diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:12:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:12:06 +0000 |
commit | fee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (patch) | |
tree | 436277f178110f563b35d32f9138995f4b65b045 | |
parent | 70a64eeacc569df929b8c502e069355e203194be (diff) |
12 binary replacements for MS_DB_EVENT_* services:
HANDLE db_event_add(HANDLE hContact, DBEVENTINFO *dbei);
int db_event_count(HANDLE hContact);
int db_event_delete(HANDLE hContact, HANDLE hDbEvent);
HANDLE db_event_first(HANDLE hContact);
HANDLE db_event_firstUnread(HANDLE hContact);
int db_event_get(HANDLE hDbEvent, DBEVENTINFO *dbei);
int db_event_getBlobSize(HANDLE hDbEvent);
HANDLE db_event_getContact(HANDLE hDbEvent);
HANDLE db_event_last(HANDLE hDbEvent);
int db_event_markRead(HANDLE hContact, HANDLE hDbEvent);
HANDLE db_event_next(HANDLE hDbEvent);
HANDLE db_event_prev(HANDLE hDbEvent);
git-svn-id: http://svn.miranda-ng.org/main/trunk@4254 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | bin10/lib/mir_core.lib | bin | 32224 -> 34880 bytes | |||
-rw-r--r-- | bin10/lib/mir_core64.lib | bin | 29424 -> 31852 bytes | |||
-rw-r--r-- | bin11/lib/mir_core.lib | bin | 32224 -> 34880 bytes | |||
-rw-r--r-- | bin11/lib/mir_core64.lib | bin | 29424 -> 31852 bytes | |||
-rw-r--r-- | include/delphi/m_core.inc | 348 | ||||
-rw-r--r-- | include/delphi/m_database.inc | 31 | ||||
-rw-r--r-- | include/m_core.h | 35 | ||||
-rw-r--r-- | include/m_database.h | 27 | ||||
-rw-r--r-- | include/m_protosvc.h | 4 | ||||
-rw-r--r-- | src/mir_core/db.cpp | 63 | ||||
-rw-r--r-- | src/mir_core/mir_core.def | 12 |
11 files changed, 317 insertions, 203 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 76c63681c7..93fe2e26e3 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib Binary files differindex db6ff56939..4e05648914 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib Binary files differindex 44aa9504ae..875cf1ce32 100644 --- a/bin11/lib/mir_core.lib +++ b/bin11/lib/mir_core.lib diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib Binary files differindex bf5c841786..bcff920f11 100644 --- a/bin11/lib/mir_core64.lib +++ b/bin11/lib/mir_core64.lib diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 3d29c24b77..cff99d5b69 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -32,10 +32,10 @@ const // Parse ptszCmdLine. it must NOT be a constant (content will be patched)
procedure CmdLine_Parse(ptszCmdLine:PWideChar); stdcall;
- external CoreDLL name 'CmdLine_Parse';
+ external CoreDLL name 'CmdLine_Parse';
function CmdLine_GetOption(ptszParameter:PWideChar):PWideChar; stdcall;
- external CoreDLL name 'CmdLine_GetOption';
+ external CoreDLL name 'CmdLine_GetOption';
///////////////////////////////////////////////////////////////////////////////
// database functions
@@ -74,82 +74,132 @@ type );
end;
+const
+ DBEF_FIRST = 1; // internally only, do not use
+ DBEF_SENT = 2; // if set, the event was sent by the user, otherwise it was received
+ DBEF_READ = 4; // event has been read by the user -- only needed for history
+ DBEF_RTL = 8; // event contains the right-to-left aligned text
+ DBEF_UTF = 16; // event contains a text in utf-8
+
+ EVENTTYPE_MESSAGE = 0;
+ EVENTTYPE_URL = 1;
+ EVENTTYPE_CONTACTS = 2; // v0.1.2.2+
+ EVENTTYPE_ADDED = 1000; // v0.1.1.0+: these used to be module-
+ EVENTTYPE_AUTHREQUEST = 1001; // specific codes, hence the module-
+ EVENTTYPE_FILE = 1002; // specific limit has been raised to 2000
+
+type
+ PDBEVENTINFO = ^TDBEVENTINFO;
+ TDBEVENTINFO = record
+ cbSize : int; // size of the structure
+ szModule : PAnsiChar; // module that 'owns' this event and controls the data format
+ timestamp: DWORD; // timestamp in UNIX time
+ flags : DWORD; // the DBEF_* flags above
+ eventType: WORD; // event type, such as message, can be module defined
+ cbBlob : DWORD; // size in bytes of pBlob^
+ pBlob : PByte; // pointer to buffer containing the module defined event data
+ end;
+
+function db_event_add(hContact:THANDLE; dbei:PDBEVENTINFO):THANDLE; stdcall;
+ external CoreDLL name 'db_event_add';
+function db_event_count(hContact:THANDLE):int; stdcall;
+ external CoreDLL name 'db_event_count';
+function db_event_delete(hContact:THANDLE; hDbEvent:THANDLE):int; stdcall;
+ external CoreDLL name 'db_event_delete';
+function db_event_first(hContact:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_first';
+function db_event_firstUnread(hContact:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_firstUnread';
+function db_event_get(hDbEvent:THANDLE; dbei:PDBEVENTINFO):int; stdcall;
+ external CoreDLL name 'db_event_get';
+function db_event_getBlobSize(hDbEvent:THANDLE):int; stdcall;
+ external CoreDLL name 'db_event_getBlobSize';
+function db_event_getContact(hDbEvent:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_getContact';
+function db_event_last(hDbEvent:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_last';
+function db_event_markRead(hContact, hDbEvent:THANDLE):int; stdcall;
+ external CoreDLL name 'db_event_markRead';
+function db_event_next(hDbEvent:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_next';
+function db_event_prev(hDbEvent:THANDLE):THANDLE; stdcall;
+ external CoreDLL name 'db_event_prev';
function db_free(dbv:PDBVARIANT):int_ptr; stdcall;
external CoreDLL name 'db_free';
function db_unset(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_unset';
+ external CoreDLL name 'db_unset';
function db_find_first(const szModule:pAnsiChar=nil):THANDLE; stdcall;
external CoreDLL name 'db_find_first';
function db_find_next(hContact:THANDLE; const szModule:pAnsiChar=nil):THANDLE; stdcall;
- external CoreDLL name 'db_find_next';
+ external CoreDLL name 'db_find_next';
function db_get_b(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall;
- external CoreDLL name 'db_get_b';
+ external CoreDLL name 'db_get_b';
function db_get_w(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall;
- external CoreDLL name 'db_get_w';
+ external CoreDLL name 'db_get_w';
function db_get_dw(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall;
- external CoreDLL name 'db_get_dw';
+ external CoreDLL name 'db_get_dw';
function db_get(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall;
- external CoreDLL name 'db_get';
+ external CoreDLL name 'db_get';
function db_get_s(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall;
- external CoreDLL name 'db_get_s';
+ external CoreDLL name 'db_get_s';
function db_get_sa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall;
- external CoreDLL name 'db_get_sa';
+ external CoreDLL name 'db_get_sa';
function db_get_wsa(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall;
- external CoreDLL name 'db_get_wsa';
+ external CoreDLL name 'db_get_wsa';
function db_set_b(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall;
- external CoreDLL name 'db_set_b';
+ external CoreDLL name 'db_set_b';
function db_set_w(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall;
- external CoreDLL name 'db_set_w';
+ external CoreDLL name 'db_set_w';
function db_set_dw(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall;
- external CoreDLL name 'db_set_dw';
+ external CoreDLL name 'db_set_dw';
function db_set_s(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_s';
+ external CoreDLL name 'db_set_s';
function db_set_ws(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_ws';
+ external CoreDLL name 'db_set_ws';
function db_set_utf(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_utf';
+ external CoreDLL name 'db_set_utf';
function db_set_blob(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall;
- external CoreDLL name 'db_set_blob';
+ external CoreDLL name 'db_set_blob';
// Aliases
function DBFreeVariant(dbv:PDBVARIANT):int_ptr; stdcall;
external CoreDLL name 'db_free';
function DBDeleteContactSetting(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_unset';
+ external CoreDLL name 'db_unset';
function DBGetContactSettingByte(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall;
- external CoreDLL name 'db_get_b';
+ external CoreDLL name 'db_get_b';
function DBGetContactSettingWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:int):int; stdcall;
- external CoreDLL name 'db_get_w';
+ external CoreDLL name 'db_get_w';
function DBGetContactSettingDWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; errorValue:dword):dword; stdcall;
- external CoreDLL name 'db_get_dw';
+ external CoreDLL name 'db_get_dw';
function DBGetContactSetting(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT):int_ptr; stdcall;
- external CoreDLL name 'db_get';
+ external CoreDLL name 'db_get';
function DBGetContactSettingStr(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; dbv:PDBVARIANT; const nType:int=DBVT_ASCIIZ):int_ptr; stdcall;
- external CoreDLL name 'db_get_s';
+ external CoreDLL name 'db_get_s';
function DBGetContactSettingString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pAnsiChar; stdcall;
- external CoreDLL name 'db_get_sa';
+ external CoreDLL name 'db_get_sa';
function DBGetContactSettingWString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar):pWideChar; stdcall;
- external CoreDLL name 'db_get_wsa';
+ external CoreDLL name 'db_get_wsa';
function DBWriteContactSettingByte(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:byte):int_ptr; stdcall;
- external CoreDLL name 'db_set_b';
+ external CoreDLL name 'db_set_b';
function DBWriteContactSettingWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:word):int_ptr; stdcall;
- external CoreDLL name 'db_set_w';
+ external CoreDLL name 'db_set_w';
function DBWriteContactSettingDWord(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:dword):int_ptr; stdcall;
- external CoreDLL name 'db_set_dw';
+ external CoreDLL name 'db_set_dw';
function DBWriteContactSettingString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_s';
+ external CoreDLL name 'db_set_s';
function DBWriteContactSettingWString(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pWideChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_ws';
+ external CoreDLL name 'db_set_ws';
function DBWriteContactSettingUTF8String(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; const val:pAnsiChar):int_ptr; stdcall;
- external CoreDLL name 'db_set_utf';
+ external CoreDLL name 'db_set_utf';
function DBWriteContactSettingBlob(hContact:THANDLE; const szModule:pAnsiChar; const szSetting:pAnsiChar; val:pointer; len:uint):int_ptr; stdcall;
- external CoreDLL name 'db_set_blob';
+ external CoreDLL name 'db_set_blob';
///////////////////////////////////////////////////////////////////////////////
@@ -177,71 +227,71 @@ const {$ENDIF}
function CreateHookableEvent(const name: PAnsiChar): THANDLE; stdcall;
- external CoreDLL name 'CreateHookableEvent';
+ external CoreDLL name 'CreateHookableEvent';
function DestroyHookableEvent(hEvent:THANDLE): int; stdcall;
- external CoreDLL name 'DestroyHookableEvent';
+ external CoreDLL name 'DestroyHookableEvent';
function SetHookDefaultForHookableEvent(hEvent:THANDLE; pfnHook:TMIRANDAHOOK):int; stdcall;
- external CoreDLL name 'SetHookDefaultForHookableEvent';
+ external CoreDLL name 'SetHookDefaultForHookableEvent';
function CallPluginEventHook(hInst:HINST; hEvent:THANDLE; wParam:WPARAM; lParam:LPARAM):int; stdcall;
- external CoreDLL name 'CallPluginEventHook';
+ external CoreDLL name 'CallPluginEventHook';
function NotifyEventHooks(hEvent:THANDLE; wParam:WPARAM; lParam:LPARAM): int; stdcall;
- external CoreDLL name 'NotifyEventHooks';
+ external CoreDLL name 'NotifyEventHooks';
function NotifyFastHook(hEvent:THANDLE; wParam:WPARAM; lParam:LPARAM): int; stdcall;
- external CoreDLL name 'NotifyFastHook';
+ external CoreDLL name 'NotifyFastHook';
function HookEvent(const name:PAnsiChar; hookProc: TMIRANDAHOOK): THANDLE; stdcall;
- external CoreDLL name 'HookEvent';
+ external CoreDLL name 'HookEvent';
function HookEventParam(const name:PAnsiChar; hookProc:TMIRANDAHOOKPARAM;lParam:LPARAM):THANDLE; stdcall;
- external CoreDLL name 'HookEventParam';
+ external CoreDLL name 'HookEventParam';
function HookEventObj(const name:PAnsiChar; hookProc:TMIRANDAHOOKOBJ;ptr:pointer):THANDLE; stdcall;
- external CoreDLL name 'HookEventObj';
+ external CoreDLL name 'HookEventObj';
function HookEventObjParam(const name:PAnsiChar; hookProc:TMIRANDAHOOKOBJPARAM;ptr:pointer;lParam:LPARAM):THANDLE; stdcall;
- external CoreDLL name 'HookEventObjParam';
+ external CoreDLL name 'HookEventObjParam';
function HookEventMessage(const name:PAnsiChar; Wnd:HWND; wMsg:uint):THANDLE; stdcall;
- external CoreDLL name 'HookEventMessage';
+ external CoreDLL name 'HookEventMessage';
function UnhookEvent(hHook:THANDLE): int; stdcall;
- external CoreDLL name 'UnhookEvent';
+ external CoreDLL name 'UnhookEvent';
procedure KillObjectEventHooks(var ptr); stdcall;
- external CoreDLL name 'KillObjectEventHooks';
+ external CoreDLL name 'KillObjectEventHooks';
procedure KillModuleEventHooks(pModule:HINST); stdcall;
- external CoreDLL name 'KillModuleEventHooks';
+ external CoreDLL name 'KillModuleEventHooks';
function CreateServiceFunction(const name:PAnsiChar; serviceProc:TMIRANDASERVICE): THANDLE; stdcall;
- external CoreDLL name 'CreateServiceFunction';
+ external CoreDLL name 'CreateServiceFunction';
function CreateServiceFunctionParam(const name:PAnsiChar; serviceProc:TMIRANDASERVICEPARAM;lParam:LPARAM):THANDLE; stdcall;
- external CoreDLL name 'CreateServiceFunctionParam';
+ external CoreDLL name 'CreateServiceFunctionParam';
function CreateServiceFunctionObj(const name:PAnsiChar; serviceProc:TMIRANDASERVICEOBJ;ptr:pointer):THANDLE; stdcall;
- external CoreDLL name 'CreateServiceFunctionObj';
+ external CoreDLL name 'CreateServiceFunctionObj';
function CreateServiceFunctionObjParam(const name:PAnsiChar; serviceProc:TMIRANDASERVICEOBJPARAM;ptr:pointer;lParam:LPARAM):THANDLE; stdcall;
- external CoreDLL name 'CreateServiceFunctionObjParam';
+ external CoreDLL name 'CreateServiceFunctionObjParam';
function DestroyServiceFunction(hService:THANDLE):int; stdcall;
- external CoreDLL name 'DestroyServiceFunction';
+ external CoreDLL name 'DestroyServiceFunction';
function ServiceExists(const name:PAnsiChar):int; stdcall;
- external CoreDLL name 'ServiceExists';
+ external CoreDLL name 'ServiceExists';
function CallService(const name:PAnsiChar; wParam:WPARAM; lParam:LPARAM):uint_ptr; stdcall;
- external CoreDLL name 'CallService';
+ external CoreDLL name 'CallService';
function CallServiceSync(const name:PAnsiChar; wParam:WPARAM; lParam:LPARAM):uint_ptr; stdcall;
- external CoreDLL name 'CallServiceSync';
+ external CoreDLL name 'CallServiceSync';
function CallFunctionAsync(ptr1,ptr2:pointer):int; stdcall;
- external CoreDLL name 'CallFunctionAsync';
+ external CoreDLL name 'CallFunctionAsync';
procedure KillModuleServices(hInst:HINST); stdcall;
- external CoreDLL name 'KillModuleServices';
+ external CoreDLL name 'KillModuleServices';
procedure KillObjectServices(var ptr); stdcall;
- external CoreDLL name 'KillObjectServices';
+ external CoreDLL name 'KillObjectServices';
function CallContactService(hContact:THANDLE;const name:PAnsiChar;wParam:WPARAM;lParam:LPARAM):uint_ptr; cdecl;
- external CoreDLL name 'CallContactService';
+ external CoreDLL name 'CallContactService';
function CallProtoService(const szModule:PAnsiChar;const szService:PAnsiChar;wParam:WPARAM;lParam:LPARAM):uint_ptr; cdecl;
- external CoreDLL name 'CallProtoService';
+ external CoreDLL name 'CallProtoService';
///////////////////////////////////////////////////////////////////////////////
// http
// returned result must be freed using mir_free()
function mir_urlEncode(url:pAnsiChar):pAnsiChar; stdcall;
- external CoreDLL name 'mir_urlEncode';
+ external CoreDLL name 'mir_urlEncode';
///////////////////////////////////////////////////////////////////////////////
// exceptions
@@ -251,9 +301,9 @@ type pfnExceptionFilter = function(code:dword; info:PEXCEPTION_POINTERS):dword; cdecl;
function GetExceptionFilter():pfnExceptionFilter; stdcall;
- external CoreDLL name 'GetExceptionFilter';
+ external CoreDLL name 'GetExceptionFilter';
function SetExceptionFilter(pMirandaExceptFilter:pfnExceptionFilter):pfnExceptionFilter; stdcall;
- external CoreDLL name 'SetExceptionFilter';
+ external CoreDLL name 'SetExceptionFilter';
///////////////////////////////////////////////////////////////////////////////
@@ -282,10 +332,10 @@ type procedure mir_Icon_Register(hInst:HINST; const szSection:pAnsiChar; pIcons:pIconItem;
iCount:size_t; prefix:PAnsiChar; hLangpack:int); stdcall;
- external CoreDLL name 'Icon_Register';
+ external CoreDLL name 'Icon_Register';
procedure mir_Icon_RegisterW(hInst:HINST; const szSection:pWideChar; pIcons:pIconItemW;
iCount:size_t; prefix:PAnsiChar; hLangpack:int); stdcall;
- external CoreDLL name 'Icon_RegisterT';
+ external CoreDLL name 'Icon_RegisterT';
///////////////////////////////////////////////////////////////////////////////
// language packs support
@@ -294,32 +344,32 @@ const LANG_UNICODE = $1000;
procedure Langpack_SortDuplicates(); stdcall;
- external CoreDLL name 'Langpack_SortDuplicates';
+ external CoreDLL name 'Langpack_SortDuplicates';
function Langpack_GetDefaultCodePage():int; stdcall;
- external CoreDLL name 'Langpack_GetDefaultCodePage';
+ external CoreDLL name 'Langpack_GetDefaultCodePage';
function Langpack_GetDefaultLocale():int; stdcall;
- external CoreDLL name 'Langpack_GetDefaultLocale';
+ external CoreDLL name 'Langpack_GetDefaultLocale';
function Langpack_PcharToTchar(const pszStr:pAnsiChar):pWideChar; stdcall;
- external CoreDLL name 'Langpack_PcharToTchar';
+ external CoreDLL name 'Langpack_PcharToTchar';
function LoadLangPackModule():int; stdcall;
- external CoreDLL name 'LoadLangPackModule';
+ external CoreDLL name 'LoadLangPackModule';
function LoadLangPack(const szLangPack:pWideChar):int; stdcall;
- external CoreDLL name 'LoadLangPack';
+ external CoreDLL name 'LoadLangPack';
procedure ReloadLangpack(pszStr:pWideChar); stdcall;
- external CoreDLL name 'ReloadLangpack';
+ external CoreDLL name 'ReloadLangpack';
function TranslateA_LP(const str:pAnsiChar; hLang:int):pAnsiChar; stdcall;
- external CoreDLL name 'TranslateA_LP';
+ external CoreDLL name 'TranslateA_LP';
function TranslateW_LP(const str:pWideChar; hLang:int):pWideChar; stdcall;
- external CoreDLL name 'TranslateW_LP';
+ external CoreDLL name 'TranslateW_LP';
procedure TranslateMenu_LP(hMenu:HMENU; hLang:int); stdcall;
- external CoreDLL name 'TranslateMenu_LP';
+ external CoreDLL name 'TranslateMenu_LP';
procedure TranslateDialog_LP(hDlg:HWND; hLang:int); stdcall;
- external CoreDLL name 'TranslateDialog_LP';
+ external CoreDLL name 'TranslateDialog_LP';
function mir_hash(const key:pointer; len:uint):uint; stdcall;
- external CoreDLL name 'mir_hash';
+ external CoreDLL name 'mir_hash';
///////////////////////////////////////////////////////////////////////////////
@@ -350,28 +400,28 @@ type // BUGGED with limit <> 0. list pointer must befreed by mir_free
function List_Create(limit:int; increment:int):PSortedList;stdcall;
- external CoreDLL name 'List_Create';
+ external CoreDLL name 'List_Create';
procedure List_Destroy(list:PSortedList);stdcall;
- external CoreDLL name 'List_Destroy';
+ external CoreDLL name 'List_Destroy';
function List_Find(list:PSortedList; value:pointer):pointer;stdcall;
- external CoreDLL name 'List_Find';
+ external CoreDLL name 'List_Find';
function List_GetIndex(list:PSortedList; value:pointer; index:Pint):int;stdcall;
- external CoreDLL name 'List_GetIndex';
+ external CoreDLL name 'List_GetIndex';
function List_IndexOf(list:PSortedList; value:pointer):int;stdcall;
- external CoreDLL name 'List_IndexOf';
+ external CoreDLL name 'List_IndexOf';
function List_Insert(list:PSortedList; value:pointer; index:int):int;stdcall;
- external CoreDLL name 'List_Insert';
+ external CoreDLL name 'List_Insert';
function List_InsertPtr(list:PSortedList; p:pointer):int;stdcall;
- external CoreDLL name 'List_InsertPtr';
+ external CoreDLL name 'List_InsertPtr';
function List_Remove(list:PSortedList; index:int):int;stdcall;
- external CoreDLL name 'List_Remove';
+ external CoreDLL name 'List_Remove';
function List_RemovePtr(list:PSortedList; p:pointer):int;stdcall;
- external CoreDLL name 'List_RemovePtr';
+ external CoreDLL name 'List_RemovePtr';
procedure List_Copy(src:PSortedList; dst:PSortedList; size:size_t); stdcall;
- external CoreDLL name 'List_Copy';
+ external CoreDLL name 'List_Copy';
procedure List_ObjCopy(src:PSortedList; dst:PSortedList; size:size_t); stdcall;
- external CoreDLL name 'List_ObjCopy';
+ external CoreDLL name 'List_ObjCopy';
///////////////////////////////////////////////////////////////////////////////
@@ -394,81 +444,81 @@ type TMD5Hash = array [0..15] of mir_md5_byte_t;
procedure mir_md5_init(pms:pmir_md5_state_t); stdcall;
- external CoreDLL name 'mir_md5_init';
+ external CoreDLL name 'mir_md5_init';
procedure mir_md5_append(pms:pmir_md5_state_t; const data:pmir_md5_byte_t; nbytes:int); stdcall;
- external CoreDLL name 'mir_md5_append';
+ external CoreDLL name 'mir_md5_append';
procedure mir_md5_finish(pms:pmir_md5_state_t; digest:TMD5Hash); stdcall;
- external CoreDLL name 'mir_md5_finish';
+ external CoreDLL name 'mir_md5_finish';
procedure mir_md5_hash(const data:pmir_md5_byte_t; len:int; digest:TMD5Hash); stdcall;
- external CoreDLL name 'mir_md5_hash';
+ external CoreDLL name 'mir_md5_hash';
///////////////////////////////////////////////////////////////////////////////
// memory functions
function mir_alloc(para1:size_t):pointer; cdecl;
- external CoreDLL name 'mir_alloc';
+ external CoreDLL name 'mir_alloc';
function mir_calloc(para1:size_t):pointer; cdecl;
- external CoreDLL name 'mir_calloc';
+ external CoreDLL name 'mir_calloc';
function mir_realloc(para1:pointer; para2:size_t):pointer; cdecl;
- external CoreDLL name 'mir_realloc';
+ external CoreDLL name 'mir_realloc';
procedure mir_free(para1:pointer); cdecl;
- external CoreDLL name 'mir_free';
+ external CoreDLL name 'mir_free';
function mir_strdup(const src:PAnsiChar):PAnsiChar; stdcall;
- external CoreDLL name 'mir_strdup';
+ external CoreDLL name 'mir_strdup';
function mir_wstrdup(const src:PWideChar):PWideChar; stdcall;
- external CoreDLL name 'mir_wstrdup';
+ external CoreDLL name 'mir_wstrdup';
function mir_strndup(const src:PAnsiChar; len:size_t):PAnsiChar; stdcall;
- external CoreDLL name 'mir_strndup';
+ external CoreDLL name 'mir_strndup';
function mir_wstrndup(const src:PWideChar; len:size_t):PWideChar; stdcall;
- external CoreDLL name 'mir_wstrndup';
+ external CoreDLL name 'mir_wstrndup';
///////////////////////////////////////////////////////////////////////////////
// modules
procedure RegisterModule(hInst:HINST); stdcall;
- external CoreDLL name 'RegisterModule';
+ external CoreDLL name 'RegisterModule';
procedure UnregisterModule(hInst:HINST); stdcall;
- external CoreDLL name 'UnregisterModule';
+ external CoreDLL name 'UnregisterModule';
function GetInstByAddress(codePtr:pointer):HINST; stdcall;
- external CoreDLL name 'GetInstByAddress';
+ external CoreDLL name 'GetInstByAddress';
///////////////////////////////////////////////////////////////////////////////
// path utils
procedure CreatePathToFile(wszFilePath:pAnsiChar); stdcall;
- external CoreDLL name 'CreatePathToFile';
+ external CoreDLL name 'CreatePathToFile';
function CreateDirectoryTree(const szDir:pAnsiChar):int; stdcall;
- external CoreDLL name 'CreateDirectoryTree';
+ external CoreDLL name 'CreateDirectoryTree';
function PathToAbsolute(const pSrc:pAnsiChar; pOut:pAnsiChar; base:pAnsiChar=nil):int; stdcall;
- external CoreDLL name 'PathToAbsolute';
+ external CoreDLL name 'PathToAbsolute';
function PathToRelative(const pSrc:pAnsiChar; pOut:pAnsiChar):int; stdcall;
- external CoreDLL name 'PathToRelative';
+ external CoreDLL name 'PathToRelative';
procedure CreatePathToFileW(wszFilePath:pWideChar); stdcall;
- external CoreDLL name 'CreatePathToFileW';
+ external CoreDLL name 'CreatePathToFileW';
function CreateDirectoryTreeW(const szDir:pWideChar):int; stdcall;
- external CoreDLL name 'CreateDirectoryTreeW';
+ external CoreDLL name 'CreateDirectoryTreeW';
function PathToAbsoluteW(const pSrc:pWideChar; pOut:pWideChar; base:pWideChar=nil):int; stdcall;
- external CoreDLL name 'PathToAbsoluteW';
+ external CoreDLL name 'PathToAbsoluteW';
function PathToRelativeW(const pSrc:pWideChar; pOut:pWideChar):int; stdcall;
- external CoreDLL name 'PathToRelativeW';
+ external CoreDLL name 'PathToRelativeW';
///////////////////////////////////////////////////////////////////////////////
// print functions
function mir_snprintf(buffer:pAnsiChar;count:size_t;fmt:pAnsiChar{, ...}):int; stdcall;
- external CoreDLL name 'mir_snprintf';
+ external CoreDLL name 'mir_snprintf';
function mir_sntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar{, ...}):int; stdcall;
- external CoreDLL name 'mir_sntprintf';
+ external CoreDLL name 'mir_sntprintf';
function mir_vsnprintf(buffer:pAnsiChar;count:size_t;fmt:pAnsiChar;va:va_list):int; stdcall;
- external CoreDLL name 'mir_vsnprintf';
+ external CoreDLL name 'mir_vsnprintf';
function mir_vsntprintf(buffer:pWideChar;count:size_t;fmt:pWideChar;va:va_list):int; stdcall;
- external CoreDLL name 'mir_vsntprintf';
+ external CoreDLL name 'mir_vsntprintf';
///////////////////////////////////////////////////////////////////////////////
@@ -494,13 +544,13 @@ type SHA1Hash = array [0..MIR_SHA1_HASH_SIZE-1] of mir_sha1_byte_t;
procedure mir_sha1_init(ctx:pmir_sha1_ctx); stdcall;
- external CoreDLL name 'mir_sha1_init';
+ external CoreDLL name 'mir_sha1_init';
procedure mir_sha1_append(ctx:pmir_sha1_ctx; dataIn:pmir_sha1_byte_t; len:int); stdcall;
- external CoreDLL name 'mir_sha1_append';
+ external CoreDLL name 'mir_sha1_append';
procedure mir_sha1_finish(ctx:pmir_sha1_ctx; hashout:SHA1Hash); stdcall;
- external CoreDLL name 'mir_sha1_finish';
+ external CoreDLL name 'mir_sha1_finish';
procedure mir_sha1_hash(dataIn:pmir_sha1_byte_t; len:int;hashout:SHA1Hash); stdcall;
- external CoreDLL name 'mir_sha1_hash';
+ external CoreDLL name 'mir_sha1_hash';
///////////////////////////////////////////////////////////////////////////////
@@ -530,11 +580,11 @@ function replaceStrW(var dest:pWideChar; const src:pWideChar):pWideChar; stdcall // text conversion functions
function mir_a2u_cp(src:PAnsiChar;codepage:int):pWideChar; stdcall;
- external CoreDLL name 'mir_a2u_cp';
+ external CoreDLL name 'mir_a2u_cp';
function mir_a2u(src:PAnsiChar):pWideChar; stdcall;
external CoreDLL name 'mir_a2u';
function mir_u2a_cp(src:pWideChar;codepage:int):PAnsiChar; stdcall;
- external CoreDLL name 'mir_u2a_cp';
+ external CoreDLL name 'mir_u2a_cp';
function mir_u2a(src:pWideChar):PAnsiChar; stdcall;
external CoreDLL name 'mir_u2a';
@@ -547,86 +597,86 @@ type pThreadFuncOwner = function (owner:pointer;param:pointer):uint_ptr; cdecl;
function Thread_Push(hInst:HINST; Owner:pointer):int_ptr; stdcall;
- external CoreDLL name 'Thread_Push';
+ external CoreDLL name 'Thread_Push';
function Thread_Pop():int_ptr; stdcall;
- external CoreDLL name 'Thread_Pop';
+ external CoreDLL name 'Thread_Pop';
procedure Thread_Wait(); stdcall;
- external CoreDLL name 'Thread_Wait';
+ external CoreDLL name 'Thread_Wait';
function forkthread(func:pThreadFunc; stacksize:uint; arg:pointer):uint_ptr; stdcall;
- external CoreDLL name 'forkthread';
+ external CoreDLL name 'forkthread';
function forkthreadex(sec:pointer; stacksize:uint; func:pThreadFuncEx; owner:pointer; arg:pointer; thraddr:puint_ptr):uint_ptr; stdcall;
- external CoreDLL name 'forkthreadex';
+ external CoreDLL name 'forkthreadex';
procedure Thread_SetName(const szThreadName:pAnsiChar); stdcall;
- external CoreDLL name 'Thread_SetName';
+ external CoreDLL name 'Thread_SetName';
procedure KillObjectThreads(pObject:pointer); stdcall;
- external CoreDLL name 'KillObjectThreads';
+ external CoreDLL name 'KillObjectThreads';
///////////////////////////////////////////////////////////////////////////////
// utf8 interface
{ commented to avoid newer Delphi version conflicts
function Utf8Decode(str:PAnsiChar; var ucs2:pWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8Decode';
+ external CoreDLL name 'Utf8Decode';
function Utf8DecodeCP(str:PAnsiChar; codepage:int; var ucs2:pWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8DecodeCP';
+ external CoreDLL name 'Utf8DecodeCP';
function Utf8DecodeW(const str:PAnsiChar):pWideChar;stdcall;
- external CoreDLL name 'Utf8DecodeW';
+ external CoreDLL name 'Utf8DecodeW';
function Utf8Encode(const src:PAnsiChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8Encode';
+ external CoreDLL name 'Utf8Encode';
function Utf8EncodeCP(const src:PAnsiChar;codepage:int):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8EncodeCP';
+ external CoreDLL name 'Utf8EncodeCP';
function Utf8EncodeW(const src:PWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8EncodeW';
+ external CoreDLL name 'Utf8EncodeW';
function Ucs2toUtf8Len(const src:pWideChar):int; stdcall;
- external CoreDLL name 'Ucs2toUtf8Len';
+ external CoreDLL name 'Ucs2toUtf8Len';
function Utf8CheckString(const astr:PAnsiChar):bool;stdcall;
- external CoreDLL name 'Utf8CheckString';
+ external CoreDLL name 'Utf8CheckString';
}
// aliases
function mir_utf8decode(str:PAnsiChar; var ucs2:pWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8Decode';
+ external CoreDLL name 'Utf8Decode';
function mir_utf8decodecp(str:PAnsiChar; codepage:int; var ucs2:pWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8DecodeCP';
+ external CoreDLL name 'Utf8DecodeCP';
function mir_utf8decodew(const str:PAnsiChar):pWideChar;stdcall;
- external CoreDLL name 'Utf8DecodeW';
+ external CoreDLL name 'Utf8DecodeW';
function mir_utf8encode(const src:PAnsiChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8Encode';
+ external CoreDLL name 'Utf8Encode';
function mir_utf8encodecp(const src:PAnsiChar;codepage:int):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8EncodeCP';
+ external CoreDLL name 'Utf8EncodeCP';
function mir_utf8encodew(const src:PWideChar):PAnsiChar;stdcall;
- external CoreDLL name 'Utf8EncodeW';
+ external CoreDLL name 'Utf8EncodeW';
function mir_utf8lenW(const src:pWideChar):int; stdcall;
- external CoreDLL name 'Ucs2toUtf8Len';
+ external CoreDLL name 'Ucs2toUtf8Len';
function mir_utf8checkstring(const astr:PAnsiChar):bool;stdcall;
- external CoreDLL name 'Utf8CheckString';
+ external CoreDLL name 'Utf8CheckString';
///////////////////////////////////////////////////////////////////////////////
// Window subclassing
procedure mir_subclassWindow(Wnd:HWND; WndProc:TWNDPROC); stdcall;
- external CoreDLL name 'mir_subclassWindow';
+ external CoreDLL name 'mir_subclassWindow';
procedure mir_subclassWindowFull(Wnd:HWND; WndProc, OldWndProc:TWNDPROC); stdcall;
- external CoreDLL name 'mir_subclassWindowFull';
+ external CoreDLL name 'mir_subclassWindowFull';
function mir_callNextSubclass(Wnd:HWND; WndProc:TWNDPROC; uMsg:uint; wParam:WPARAM; lParam:LPARAM ):LRESULT; stdcall;
- external CoreDLL name 'mir_callNextSubclass';
+ external CoreDLL name 'mir_callNextSubclass';
procedure mir_unsubclassWindow(Wnd:HWND; WndProc:TWNDPROC); stdcall;
- external CoreDLL name 'mir_unsubclassWindow';
+ external CoreDLL name 'mir_unsubclassWindow';
///////////////////////////////////////////////////////////////////////////////
procedure UnloadCoreModule(); stdcall;
- external CoreDLL name 'UnloadCoreModule';
+ external CoreDLL name 'UnloadCoreModule';
{$ENDIF}
diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc index 784610fe3b..11af089f1a 100644 --- a/include/delphi/m_database.inc +++ b/include/delphi/m_database.inc @@ -242,7 +242,7 @@ const Registers the specified database event type, with module, id & description.
When someone needs to retrieve an event's text, a service named Module/GetEventText<id>
will be called. For example, for module named 'foo' and event id 2000 a service
-foo/GetEventText2000 should be defined to process this request. That handler should
+foo/GetEventText2000 should be defined to process this request. That handler should
decode a blob and return the event text in the required format, its prototype is identical
to a call of MS_DB_EVENT_GETTEXT (see below)
wParam=0
@@ -316,31 +316,6 @@ const DBEVENTINFO.timestamp is in GMT, as returned by time()
}
- DBEF_FIRST = 1; // internally only, do not use
- DBEF_SENT = 2; // if set, the event was sent by the user, otherwise it was received
- DBEF_READ = 4; // event has been read by the user -- only needed for history
- DBEF_RTL = 8; // event contains the right-to-left aligned text
- DBEF_UTF = 16; // event contains a text in utf-8
-
- EVENTTYPE_MESSAGE = 0;
- EVENTTYPE_URL = 1;
- EVENTTYPE_CONTACTS = 2; // v0.1.2.2+
- EVENTTYPE_ADDED = 1000; // v0.1.1.0+: these used to be module-
- EVENTTYPE_AUTHREQUEST = 1001; // specific codes, hence the module-
- EVENTTYPE_FILE = 1002; // specific limit has been raised to 2000
-
-type
- PDBEVENTINFO = ^TDBEVENTINFO;
- TDBEVENTINFO = record
- cbSize : int; // size of the structure
- szModule : PAnsiChar; // module that 'owns' this event and controls the data format
- timestamp: DWORD; // timestamp in UNIX time
- flags : DWORD; // the DBEF_* flags above
- eventType: WORD; // event type, such as message, can be module defined
- cbBlob : DWORD; // size in bytes of pBlob^
- pBlob : PByte; // pointer to buffer containing the module defined event data
- end;
-
const
MS_DB_EVENT_ADD:PAnsiChar = 'DB/Event/Add';
@@ -394,7 +369,7 @@ type datatype:int; // DBVT_ASCIIZ, DBVT_WCHAR (DBVT_TCHAR)
codepage:int;
end;
-const
+const
MS_DB_EVENT_GETTEXT:PAnsiChar = 'DB/Event/GetText';
{ DB/Event/GetIcon (0.7.0.1+)
@@ -585,7 +560,7 @@ const MS_DB_SETSAFETYMODE:PAnsiChar = 'DB/SetSafetyMode';
//*************************** Modules ******************************
-
+
{
wParam : (caller defined data) will be passed to lParam of the call back
lParam : function pointer to TDBMODULEENUMPROC
diff --git a/include/m_core.h b/include/m_core.h index c073cdea66..87595defce 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -84,6 +84,28 @@ typedef struct { };
} DBVARIANT;
+#define DBEF_FIRST 1 //this is the first event in the chain;
+ //internal only: *do not* use this flag
+#define DBEF_SENT 2 //this event was sent by the user. If not set this
+ //event was received.
+#define DBEF_READ 4 //event has been read by the user. It does not need
+ //to be processed any more except for history.
+#define DBEF_RTL 8 //event contains the right-to-left aligned text
+#define DBEF_UTF 16 //event contains a text in utf-8
+
+typedef struct {
+ int cbSize; //size of the structure in bytes
+ char *szModule; //pointer to name of the module that 'owns' this
+ //event, ie the one that is in control of the data format
+ DWORD timestamp; //seconds since 00:00, 01/01/1970. Gives us times until
+ //2106 unless you use the standard C library which is
+ //signed and can only do until 2038. In GMT.
+ DWORD flags; //the omnipresent flags
+ WORD eventType; //module-defined event type field
+ DWORD cbBlob; //size of pBlob in bytes
+ PBYTE pBlob; //pointer to buffer containing module-defined event data
+} DBEVENTINFO;
+
MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv);
MIR_CORE_DLL(INT_PTR) db_unset(HANDLE hContact, const char *szModule, const char *szSetting);
@@ -95,6 +117,19 @@ MIR_CORE_DLL(HANDLE) db_find_first(const char *szProto); MIR_CORE_DLL(HANDLE) db_find_next(HANDLE hContact, const char *szProto);
#endif
+MIR_CORE_DLL(HANDLE) db_event_add(HANDLE hContact, DBEVENTINFO *dbei);
+MIR_CORE_DLL(int) db_event_count(HANDLE hContact);
+MIR_CORE_DLL(int) db_event_delete(HANDLE hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_first(HANDLE hContact);
+MIR_CORE_DLL(HANDLE) db_event_firstUnread(HANDLE hContact);
+MIR_CORE_DLL(int) db_event_get(HANDLE hDbEvent, DBEVENTINFO *dbei);
+MIR_CORE_DLL(int) db_event_getBlobSize(HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_getContact(HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_last(HANDLE hDbEvent);
+MIR_CORE_DLL(int) db_event_markRead(HANDLE hContact, HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_next(HANDLE hDbEvent);
+MIR_CORE_DLL(HANDLE) db_event_prev(HANDLE hDbEvent);
+
MIR_CORE_DLL(int) db_get_b(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue);
MIR_CORE_DLL(int) db_get_w(HANDLE hContact, const char *szModule, const char *szSetting, int errorValue);
MIR_CORE_DLL(DWORD) db_get_dw(HANDLE hContact, const char *szModule, const char *szSetting, DWORD errorValue);
diff --git a/include/m_database.h b/include/m_database.h index 5bd82589f9..6e29b7d3ce 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -413,27 +413,6 @@ modules are free to define their own, beginning at 2000 DBEVENTINFO.timestamp is in GMT, as returned by time(). There are services
db/time/x below with useful stuff for dealing with it.
*/
-#define DBEF_FIRST 1 //this is the first event in the chain;
- //internal only: *do not* use this flag
-#define DBEF_SENT 2 //this event was sent by the user. If not set this
- //event was received.
-#define DBEF_READ 4 //event has been read by the user. It does not need
- //to be processed any more except for history.
-#define DBEF_RTL 8 //event contains the right-to-left aligned text
-#define DBEF_UTF 16 //event contains a text in utf-8
-
-typedef struct {
- int cbSize; //size of the structure in bytes
- char *szModule; //pointer to name of the module that 'owns' this
- //event, ie the one that is in control of the data format
- DWORD timestamp; //seconds since 00:00, 01/01/1970. Gives us times until
- //2106 unless you use the standard C library which is
- //signed and can only do until 2038. In GMT.
- DWORD flags; //the omnipresent flags
- WORD eventType; //module-defined event type field
- DWORD cbBlob; //size of pBlob in bytes
- PBYTE pBlob; //pointer to buffer containing module-defined event data
-} DBEVENTINFO;
#define EVENTTYPE_MESSAGE 0
#define EVENTTYPE_URL 1
@@ -488,7 +467,7 @@ of modules. Look but don't touch. Retrieves the event's text
wParam = (WPARAM)0 (unused)
lParam = (LPARAM)(DBEVENTGETTEXT*)egt - pointer to structure with parameters
- egt->dbei should be the valid database event read via MS_DB_EVENT_GET
+ egt->dbei should be the valid database event read via db_event_get()
egt->datatype = DBVT_WCHAR or DBVT_ASCIIZ or DBVT_TCHAR. If a caller wants to
suppress Unicode part of event in answer, add DBVTF_DENYUNICODE to this field.
egt->codepage is any valid codepage, CP_ACP by default.
@@ -526,7 +505,7 @@ __forceinline TCHAR* DbGetEventTextT(DBEVENTINFO* dbei, int codepage) Retrieves the event's icon
wParam = (WPARAM)(int)flags - use LR_SHARED for shared HICON
lParam = (LPARAM)(DBEVENTINFO*)dbei
-dbei should be a valid database event read via MS_DB_EVENT_GET
+dbei should be a valid database event read via db_event_get()
Function returns HICON (use DestroyIcon to release resources if not LR_SHARED)
@@ -777,7 +756,7 @@ at any particular position in the chain. Called **before** a new event is made of a DBEVENTINFO structure, this
hook is not SAFE unless you know what you're doing with it, the arguments
are passed as-is (with errors, pointer problems, if any) from any arguments
-passed to MS_DB_EVENT_ADD.
+passed to db_event_add.
The point of this hook is to stop any unwanted database events, to stop
an event being added, return 1, to allow the event to pass through return
diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 9bfeda6d70..beb469a83c 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -736,7 +736,7 @@ typedef struct { Copies a message from a PROTORECVEVENT event into the database
wParam = 0 (unused)
lParam = CCSDATA*
-Returns the result of MS_DB_EVENT_ADD
+Returns the result of db_event_add()
*/
#define PSR_MESSAGE "/RecvMessage"
@@ -752,7 +752,7 @@ __forceinline INT_PTR Proto_RecvMessage(HANDLE hContact, PROTORECVEVENT *pcre) Copies the EVENTTYPE_AUTHREQUEST event from PROTORECVEVENT into DBEVENTINFO and adds it
wParam = char* : protocol name
lParam = PROTORECVEVENT*
-Returns the result of MS_DB_EVENT_ADD
+Returns the result of db_event_add()
*/
#define PSR_AUTH "/RecvAuth"
diff --git a/src/mir_core/db.cpp b/src/mir_core/db.cpp index df1a83d83a..82013cc3f3 100644 --- a/src/mir_core/db.cpp +++ b/src/mir_core/db.cpp @@ -217,6 +217,69 @@ MIR_CORE_DLL(INT_PTR) db_set_blob(HANDLE hContact, const char *szModule, const c }
/////////////////////////////////////////////////////////////////////////////////////////
+// events
+
+MIR_CORE_DLL(HANDLE) db_event_add(HANDLE hContact, DBEVENTINFO *dbei)
+{
+ return (currDb == NULL) ? 0 : currDb->AddEvent(hContact, dbei);
+}
+
+MIR_CORE_DLL(int) db_event_count(HANDLE hContact)
+{
+ return (currDb == NULL) ? 0 : currDb->GetEventCount(hContact);
+}
+
+MIR_CORE_DLL(int) db_event_delete(HANDLE hContact, HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->DeleteEvent(hContact, hDbEvent);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_first(HANDLE hContact)
+{
+ return (currDb == NULL) ? 0 : currDb->FindFirstEvent(hContact);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_firstUnread(HANDLE hContact)
+{
+ return (currDb == NULL) ? 0 : currDb->FindFirstUnreadEvent(hContact);
+}
+
+MIR_CORE_DLL(int) db_event_get(HANDLE hDbEvent, DBEVENTINFO *dbei)
+{
+ return (currDb == NULL) ? 1 : currDb->GetEvent(hDbEvent, dbei);
+}
+
+MIR_CORE_DLL(int) db_event_getBlobSize(HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->GetBlobSize(hDbEvent);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_getContact(HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->GetEventContact(hDbEvent);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_last(HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->FindLastEvent(hDbEvent);
+}
+
+MIR_CORE_DLL(int) db_event_markRead(HANDLE hContact, HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->MarkEventRead(hContact, hDbEvent);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_next(HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->FindNextEvent(hDbEvent);
+}
+
+MIR_CORE_DLL(HANDLE) db_event_prev(HANDLE hDbEvent)
+{
+ return (currDb == NULL) ? 0 : currDb->FindPrevEvent(hDbEvent);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// misc functions
MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv)
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def index 6858f16234..6e923548b6 100644 --- a/src/mir_core/mir_core.def +++ b/src/mir_core/mir_core.def @@ -142,3 +142,15 @@ KillModuleSubclassing @139 mir_wstrndup @140
mir_unsubclassWindow @141
mir_urlEncode @142
+db_event_add @143
+db_event_count @144
+db_event_delete @145
+db_event_first @146
+db_event_firstUnread @147
+db_event_get @148
+db_event_getBlobSize @149
+db_event_getContact @150
+db_event_last @151
+db_event_markRead @152
+db_event_next @153
+db_event_prev @154
|