libonion
|
Data Structures | |
struct | onion_ptr_list_t |
List of pointers. More... |
Functions | |
onion_ptr_list * | onion_ptr_list_new () |
Creates a new onion_ptr_list. | |
onion_ptr_list * | onion_ptr_list_add (onion_ptr_list *l, void *ptr) |
Adds a ptr to the list. Elements are added to the head, so must use return value as new list pointer. | |
onion_ptr_list * | onion_ptr_list_remove (onion_ptr_list *l, void *ptr) |
Removes a ptr from the list. Might return a NULL list if all elements removed. | |
void | onion_ptr_list_free (onion_ptr_list *l) |
Free the list, but do nothing on the ptrs. | |
void | onion_ptr_list_foreach (onion_ptr_list *l, void(*f)(void *)) |
Executes a function on all ptrs.Internally is allowed to do this manually. | |
onion_ptr_list * | onion_ptr_list_filter (onion_ptr_list *l, bool(*f)(void *data, void *ptr), void *data) |
Executes a function on all ptrs with some extra data, leaving only those that return trueInternally is allowed to do this manually. | |
size_t | onion_ptr_list_count (onion_ptr_list *l) |
Counts how many elements there are. |
onion_ptr_list* onion_ptr_list_add | ( | onion_ptr_list * | l, |
void * | ptr | ||
) |
Adds a ptr to the list. Elements are added to the head, so must use return value as new list pointer.
References onion_ptr_list_t::next, onion_low_malloc(), and onion_ptr_list_t::ptr.
size_t onion_ptr_list_count | ( | onion_ptr_list * | l | ) |
Counts how many elements there are.
References onion_ptr_list_t::next.
onion_ptr_list* onion_ptr_list_filter | ( | onion_ptr_list * | l, |
bool(*)(void *data, void *ptr) | f, | ||
void * | data | ||
) |
Executes a function on all ptrs with some extra data, leaving only those that return trueInternally is allowed to do this manually.
References onion_ptr_list_t::next, onion_ptr_list_filter(), and onion_ptr_list_t::ptr.
Referenced by onion_ptr_list_filter().
void onion_ptr_list_foreach | ( | onion_ptr_list * | l, |
void(*)(void *) | f | ||
) |
Executes a function on all ptrs.Internally is allowed to do this manually.
References onion_ptr_list_t::next, and onion_ptr_list_t::ptr.
Referenced by onion_request_t::onion_request_clean(), and onion_request_t::onion_request_free().
void onion_ptr_list_free | ( | onion_ptr_list * | l | ) |
Free the list, but do nothing on the ptrs.
References onion_ptr_list_t::next, onion_low_free(), and onion_ptr_list_free().
Referenced by onion_ptr_list_free(), onion_request_t::onion_request_clean(), and onion_request_t::onion_request_free().
onion_ptr_list* onion_ptr_list_new | ( | ) |
Creates a new onion_ptr_list.
onion_ptr_list* onion_ptr_list_remove | ( | onion_ptr_list * | l, |
void * | ptr | ||
) |
Removes a ptr from the list. Might return a NULL list if all elements removed.
References onion_ptr_list_t::next, onion_ptr_list_remove(), and onion_ptr_list_t::ptr.
Referenced by onion_ptr_list_remove().