From 89c5b2369413025e1fe7dfe5c5d0bf3bedd8558d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 23 Jul 2012 13:52:57 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@1123 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IMO2sProxy/src/imo2skype/avatarlist.c | 110 -------------------------- 1 file changed, 110 deletions(-) delete mode 100644 plugins/IMO2sProxy/src/imo2skype/avatarlist.c (limited to 'plugins/IMO2sProxy/src/imo2skype/avatarlist.c') diff --git a/plugins/IMO2sProxy/src/imo2skype/avatarlist.c b/plugins/IMO2sProxy/src/imo2skype/avatarlist.c deleted file mode 100644 index f1c78f0567..0000000000 --- a/plugins/IMO2sProxy/src/imo2skype/avatarlist.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Module: avatarlist.c - Purpose: Manages the avatars of your buddies - Author: leecher - Date: 18.08.2011 -*/ - -#include -#include -#include "memlist.h" -#include "avatarlist.h" - -static void SetEntry(AVATARENTRY *pEntry, cJSON *pNick); - -// ----------------------------------------------------------------------------- -// Interface -// ----------------------------------------------------------------------------- - -TYP_LIST *AvatarList_Init(void) -{ - TYP_LIST *hList = List_Init(16); - - return hList; -} - -// ----------------------------------------------------------------------------- - -void AvatarList_Exit(TYP_LIST *hList) -{ - AVATARENTRY *pEntry; - - while (pEntry=(AVATARENTRY*)List_Pop(hList)) - { - AvatarList_FreeEntry(pEntry); - free (pEntry); - } - List_Exit(hList); -} - -// ----------------------------------------------------------------------------- - -BOOL AvatarList_Insert(TYP_LIST *hList, cJSON *pIcon) -{ - AVATARENTRY *pEntry; - - if (pEntry=AvatarList_Find (hList, cJSON_GetObjectItem(pIcon, "buid")->valuestring)) - AvatarList_FreeEntry (pEntry); - else - { - if (!(pEntry = calloc (1, sizeof(AVATARENTRY)))) return FALSE; - if (!List_Push(hList, pEntry)) return FALSE; - } - SetEntry(pEntry, pIcon); - return TRUE; -} - -// ----------------------------------------------------------------------------- - -BOOL AvatarList_Remove(TYP_LIST *hList, AVATARENTRY *pEntry) -{ - AVATARENTRY *pListEntry; - int i, nCount; - - for (i=0, nCount=List_Count(hList); ipszUser, pszUser) == 0) - return pEntry; - } - return NULL; -} - -// ----------------------------------------------------------------------------- - -void AvatarList_FreeEntry(AVATARENTRY *pEntry) -{ - if (pEntry->pszUser) free (pEntry->pszUser); - if (pEntry->pszIcon) free (pEntry->pszIcon); -} - -// ----------------------------------------------------------------------------- -// Static -// ----------------------------------------------------------------------------- - -static void SetEntry(AVATARENTRY *pEntry, cJSON *pNick) -{ - pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring); - pEntry->pszIcon = strdup(cJSON_GetObjectItem(pNick, "icon")->valuestring); -} -- cgit v1.2.3