summaryrefslogtreecommitdiff
path: root/plugins/!NotAdopted/Skype/msglist.c
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-12-22 17:37:29 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-12-22 17:37:29 +0000
commitfee81607c448feaa85024f056c54c6a020d10884 (patch)
treed1d0207137dc4841896dd44df711dd603c0e372e /plugins/!NotAdopted/Skype/msglist.c
parent10c393c65b72884e874254f276c81adcea9f01b9 (diff)
not needed anymore
git-svn-id: http://svn.miranda-ng.org/main/trunk@2805 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!NotAdopted/Skype/msglist.c')
-rw-r--r--plugins/!NotAdopted/Skype/msglist.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/plugins/!NotAdopted/Skype/msglist.c b/plugins/!NotAdopted/Skype/msglist.c
deleted file mode 100644
index 113d6e5a5d..0000000000
--- a/plugins/!NotAdopted/Skype/msglist.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#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 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TYP_MSGLENTRY));
- else pEntry = 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 = 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; i<List_Count(m_hMsgList); i++)
- {
- pEntry = List_ElementAt (m_hMsgList, i);
- if (pEntry->t < t)
- {
- LOG (("MsgList_CollectGarbage throwing out msg %d", pEntry->uMsgNum));
- HeapFree (GetProcessHeap(), 0, List_RemoveElementAt (m_hMsgList, i));
- i--;
- }
- }
-}
-