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

22 lines
525 B
C
Raw Normal View History

2017-02-13 18:26:41 +00:00
#pragma once
struct Libp2pLinkedList {
void* item;
void* next;
};
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);