summaryrefslogtreecommitdiff
path: root/imo2sproxy/src/imo2skype/queue.c
diff options
context:
space:
mode:
authorwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2012-03-24 16:28:13 +0000
committerwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2012-03-24 16:28:13 +0000
commit4cb109d70f70195be2a1642ad52c16b982fcfd9e (patch)
treea63fbdef68ed24f6e5151c83cfab6ce3a976982a /imo2sproxy/src/imo2skype/queue.c
parent824d1b1f75ad59a30047780ed2571e96094023db (diff)
berlios is still alive so Skype and imo2sproxy hosted there and deleted from this repo
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@283 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'imo2sproxy/src/imo2skype/queue.c')
-rw-r--r--imo2sproxy/src/imo2skype/queue.c94
1 files changed, 0 insertions, 94 deletions
diff --git a/imo2sproxy/src/imo2skype/queue.c b/imo2sproxy/src/imo2skype/queue.c
deleted file mode 100644
index a163314..0000000
--- a/imo2sproxy/src/imo2skype/queue.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Module: queue.c
- Purpose: Queue management
- Author: leecher
- Date: 02.09.2009
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#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;
-}
-
-// -----------------------------------------------------------------------------