From 66526765714b08969548a414d3fa87dbe333242d Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sat, 28 Jul 2012 19:25:08 +0000 Subject: "!Deprecated" folders moved from root directory to plugins git-svn-id: http://svn.miranda-ng.org/main/trunk@1230 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- !NotAdopted/IMO2sProxy/src/imo2skype/queue.c | 94 ---------------------------- 1 file changed, 94 deletions(-) delete mode 100644 !NotAdopted/IMO2sProxy/src/imo2skype/queue.c (limited to '!NotAdopted/IMO2sProxy/src/imo2skype/queue.c') diff --git a/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c b/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c deleted file mode 100644 index a163314c8e..0000000000 --- a/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Module: queue.c - Purpose: Queue management - Author: leecher - Date: 02.09.2009 -*/ - -#include -#include -#include -#include "memlist.h" -#include "queue.h" - -// Maximum threshold for queues (So that we don't leak memory) -#define THRESHOLD 50 - -// ----------------------------------------------------------------------------- -// Interface -// ----------------------------------------------------------------------------- - -void Queue_Exit(TYP_LIST *hList, void (*fpFree)(void *pEntry)) -{ - void *pEntry; - - while (pEntry=List_Pop(hList)) - { - if (fpFree) fpFree(pEntry); - free (pEntry); - } - List_Exit(hList); -} - -// ----------------------------------------------------------------------------- - -void* Queue_InsertEntry (TYP_LIST *hList, unsigned int cbSize, unsigned int uMsgNr, - void (*fpFree)(void *pEntry)) -{ - void *pEntry; - - if (!(pEntry = calloc (1, cbSize))) return NULL; - if (!List_Push(hList, pEntry)) - { - free (pEntry); - return NULL; - } else ((QUEUEHDR*)pEntry)->uMsgNr = uMsgNr; -#ifdef THRESHOLD - if (List_Count(hList)>THRESHOLD) - { - void *pEntry = List_RemoveElementAt(hList, 0); - - if (pEntry) fpFree (pEntry); - free (pEntry); - } -#endif - return pEntry; -} - -// ----------------------------------------------------------------------------- - -BOOL Queue_Remove(TYP_LIST *hList, unsigned int uMsgNr, void (*fpFree)(void *pEntry)) -{ - QUEUEHDR *pListEntry; - unsigned int i; - - for (i=List_Count(hList)-1; (int)i!=-1; i--) - { - pListEntry = List_ElementAt (hList, i); - if (pListEntry->uMsgNr == uMsgNr) - { - if (fpFree) fpFree (pListEntry); - List_RemoveElementAt(hList, i); - free (pListEntry); - return TRUE; - } - } - return FALSE; -} - -// ----------------------------------------------------------------------------- - -void *Queue_Find(TYP_LIST *hList, unsigned int uMsgNr) -{ - unsigned int i; - QUEUEHDR *pEntry; - - for (i=List_Count(hList)-1; (int)i!=-1; i--) - { - pEntry = (QUEUEHDR*)List_ElementAt (hList, i); - if (pEntry->uMsgNr == uMsgNr) - return pEntry; - } - return NULL; -} - -// ----------------------------------------------------------------------------- -- cgit v1.2.3