c-libp2p/include/libp2p/utils/linked_list.h

22 lines
544 B
C
Raw Normal View History

2017-02-13 18:26:41 +00:00
#pragma once
struct Libp2pLinkedList {
void* item;
2017-03-13 13:53:20 +00:00
struct Libp2pLinkedList* next;
2017-02-13 18:26:41 +00:00
};
2017-02-20 13:19:22 +00:00
/***
* Create a new linked list struct
* @returns a new linked list struct
*/
struct Libp2pLinkedList* libp2p_utils_linked_list_new();
/**
* Free resources from a linked list
2017-02-20 23:53:20 +00:00
* NOTE: if the item is a complex object, free the item before
* you call this method, and set item to NULL. Otherwise, this
* method will call a simple free()
2017-02-20 13:19:22 +00:00
* @param head the top of the linked list
*/
void libp2p_utils_linked_list_free(struct Libp2pLinkedList* head);