mirror of https://github.com/FreeRDP/FreeRDP
libfreerdp-utils/list: add list_peek().
This commit is contained in:
parent
6d6c5062ab
commit
6757c6ea59
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue