From 96674592dd3493682a6cccb0b3dcf8ca019fd7a4 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Wed, 13 Aug 2014 13:46:55 +0000 Subject: Made SkypeClassic plugin compatible with Miranda IM again so that plugins for both IMs can be maintained with one codebase. Compatibility wrapper for Miranda IM is in ng-compat/m_core.h Changed files back to C and removed C++ code. Changed Miranda NG project files so that the c files compile as C++ in order to be compatible with Miranda NG headers (/TP). Added back build scripts and make file to automatically build Miranda IM version using Makefile. git-svn-id: http://svn.miranda-ng.org/main/trunk@10177 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeClassic/src/msglist.cpp | 86 ---------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 protocols/SkypeClassic/src/msglist.cpp (limited to 'protocols/SkypeClassic/src/msglist.cpp') diff --git a/protocols/SkypeClassic/src/msglist.cpp b/protocols/SkypeClassic/src/msglist.cpp deleted file mode 100644 index aedb4d1257..0000000000 --- a/protocols/SkypeClassic/src/msglist.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#define WIN32_LEAN_AND_MEAN -#include -#include "memlist.h" -#include "debug.h" -#include "msglist.h" - -#define MSGLIST_TIMEOUT 1800 // Chatmessage references will be kept for 30 minutes - -static TYP_LIST *m_hMsgList = NULL; - -static int CmpProc(const void *pstPElement,const void *pstPToFind) -{ - return (DWORD)pstPToFind - ((TYP_MSGLENTRY*)pstPElement)->uMsgNum; -} - -void MsgList_Init(void) -{ - m_hMsgList = List_Init(128); -} - -void MsgList_Exit(void) -{ - if (!m_hMsgList) return; - List_FreeElements (m_hMsgList); - List_Exit(m_hMsgList); - m_hMsgList = NULL; -} - -TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent) -{ - TYP_MSGLENTRY *pEntry; - int iListInd; - BOOL bFound; - - LOG (("MsgList_Add (%d, %08X)", uMsgNum, hEvent)); - if (!m_hMsgList || !hEvent) return FALSE; - bFound = List_BinarySearch(m_hMsgList,CmpProc,(void *)uMsgNum,&iListInd); - if (!bFound) pEntry = (TYP_MSGLENTRY*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TYP_MSGLENTRY)); - else pEntry = (TYP_MSGLENTRY*)List_ElementAt (m_hMsgList, iListInd); - if (!pEntry) return NULL; - pEntry->uMsgNum = uMsgNum; - pEntry->hEvent = hEvent; - pEntry->tEdited = 0; - time(&pEntry->t); - if (!bFound) return List_InsertElementAt (m_hMsgList, pEntry, iListInd)?pEntry:NULL; - return pEntry; -} - - -TYP_MSGLENTRY *MsgList_FindMessage(DWORD uMsgNum) -{ - TYP_MSGLENTRY *pEntry; - int iPos; - - LOG (("MsgList_FindEvent (%d)", uMsgNum)); - if (m_hMsgList && List_BinarySearch(m_hMsgList, CmpProc, (void*)uMsgNum, &iPos)) - { - pEntry = (TYP_MSGLENTRY*)List_ElementAt (m_hMsgList, iPos); - time(&pEntry->t); // Touch it, so that it doesn't get thrown away too soon - LOG (("MsgList_FindEvent(%d): %08X", uMsgNum, pEntry->hEvent)); - return pEntry; - } - return NULL; -} - -void MsgList_CollectGarbage(void) -{ - unsigned int i; - TYP_MSGLENTRY *pEntry; - time_t t; - - if (!m_hMsgList) return; - time(&t); - t-=MSGLIST_TIMEOUT; - for (i=0; it < t) - { - LOG (("MsgList_CollectGarbage throwing out msg %d", pEntry->uMsgNum)); - HeapFree (GetProcessHeap(), 0, List_RemoveElementAt (m_hMsgList, i)); - i--; - } - } -} - -- cgit v1.2.3