list: add list_next() operation
This commit is contained in:
parent
1a302821ec
commit
a512574314
@ -44,6 +44,7 @@ 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);
|
||||
FREERDP_API void* list_next(LIST* list, void* data);
|
||||
#define list_add(_l, _d) list_enqueue(_l, _d)
|
||||
FREERDP_API void* list_remove(LIST* list, void* data);
|
||||
FREERDP_API int list_size(LIST* list);
|
||||
|
@ -108,6 +108,20 @@ void* list_peek(LIST* list)
|
||||
return item ? item->data : NULL;
|
||||
}
|
||||
|
||||
void* list_next(LIST* list, void* data)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
|
||||
item = list_item_find(list, data);
|
||||
data = NULL;
|
||||
if (item != NULL)
|
||||
{
|
||||
if (item->next != NULL)
|
||||
data = item->next->data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
void* list_remove(LIST* list, void* data)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
|
Loading…
Reference in New Issue
Block a user