Nilorea Library
C utilities for networking, threading, graphics
n_list.c File Reference

Pointer list functions definitions. More...

#include "nilorea/n_common.h"
#include <pthread.h>
#include "nilorea/n_log.h"
#include "nilorea/n_list.h"
+ Include dependency graph for n_list.c:

Go to the source code of this file.

Functions

int list_destroy (LIST **list)
 Empty and Free a list container. More...
 
int list_empty (LIST *list)
 Empty a LIST list of pointers. More...
 
int list_empty_with_f (LIST *list, void(*free_fnct)(void *ptr))
 Empty a LIST list of pointers. More...
 
LIST_NODElist_node_pop (LIST *list)
 Get a LIST_NODE pointer from the end of the list. More...
 
int list_node_push (LIST *list, LIST_NODE *node)
 Add a filled node to the end of the list. More...
 
LIST_NODElist_node_shift (LIST *list)
 Get a LIST_NODE pointer from the start of the list. More...
 
int list_node_unshift (LIST *list, LIST_NODE *node)
 Add a pointer at the start of the list. More...
 
void * list_pop_f (LIST *list)
 Get a pointer from the end of the list. More...
 
int list_push (LIST *list, void *ptr, void(*destructor)(void *ptr))
 Add a pointer to the end of the list. More...
 
int list_push_sorted (LIST *list, void *ptr, int(*comparator)(const void *a, const void *b), void(*destructor)(void *ptr))
 Add a pointer sorted in the list , starting by the end of the list. More...
 
LIST_NODElist_search (LIST *list, void *ptr)
 search ptr in list More...
 
LIST_NODElist_search_with_f (LIST *list, int(*checkfunk)(void *ptr))
 search ptr in list More...
 
void * list_shift_f (LIST *list)
 Get a pointer from the start of the list. More...
 
int list_unshift (LIST *list, void *ptr, void(*destructor)(void *ptr))
 Add a pointer at the start of the list. More...
 
int list_unshift_sorted (LIST *list, void *ptr, int(*comparator)(const void *a, const void *b), void(*destructor)(void *ptr))
 Add a pointer sorted in the list , starting by the start of the list. More...
 
LISTnew_generic_list (int max_items)
 Initialiaze a generic list container to max_items pointers. More...
 
LIST_NODEnew_list_node (void *ptr, void(*destructor)(void *ptr))
 Allocate a new node to link in a list. More...
 
void * remove_list_node_f (LIST *list, LIST_NODE *node)
 Internal function called each time we need to get a node out of a list. More...
 

Detailed Description

Pointer list functions definitions.

Author
Castagnier Mickael
Version
2.0
Date
24/04/13

Definition in file n_list.c.