libonion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
ptr_list.h File Reference
#include <stdbool.h>
#include "types.h"

Functions

onion_ptr_listonion_ptr_list_new ()
 Creates a new onion_ptr_list.
onion_ptr_listonion_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_listonion_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 *ptr))
onion_ptr_listonion_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.

Function Documentation

void onion_ptr_list_foreach ( onion_ptr_list l,
void(*)(void *ptr)  f 
)