libfreerdp-utils/list: add list_peek().

This commit is contained in:
Vic Lee 2011-09-19 22:00:56 +08:00
parent 6d6c5062ab
commit 6757c6ea59
2 changed files with 9 additions and 0 deletions

View File

@ -43,6 +43,7 @@ FREERDP_API LIST* list_new(void);
FREERDP_API void list_free(LIST* list);
FREERDP_API void list_enqueue(LIST* list, void* data);
FREERDP_API void* list_dequeue(LIST* list);
FREERDP_API void* list_peek(LIST* list);
#define list_add(_l, _d) list_enqueue(_l, _d)
FREERDP_API void* list_remove(LIST* list, void* data);

View File

@ -97,6 +97,14 @@ void* list_dequeue(LIST* list)
return data;
}
void* list_peek(LIST* list)
{
LIST_ITEM* item;
item = list->head;
return item ? item->data : NULL;
}
void* list_remove(LIST* list, void* data)
{
LIST_ITEM* item;