Nilorea Library

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Macros Groups
Data Structures | Macros | Typedefs | Functions
n_list.h File Reference
`#include "stdio.h"`
`#include "stdlib.h"`
`#include "n_log.h"`
`#include "n_common.h"`
Include dependency graph for n_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures

struct | LIST_NODE
struct | LIST

## Macros

#define | link_node(__NODE_1, __NODE_2)
#define | list_foreach(__ITEM_, __LIST_)
#define | list_pop(__LIST_, __TYPE_) ( __TYPE_ *)list_pop_f( __LIST_ )
#define | list_shift(__LIST_, __TYPE_) (__TYPE_ *)list_shift_f( __LIST_ )
#define | remove_list_node(__LIST_,__NODE_, __TYPE_) (__TYPE_ *)remove_list_node_f( __LIST_ , __NODE_ )

## Typedefs

typedef struct LIST_NODE | LIST_NODE
typedef struct LIST | LIST

## Functions

LIST * | new_generic_list (int max_items)
| Initialiaze a generic list container to max_items pointers. More...
LIST_NODE * | new_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...
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...
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)(void *a, void *b), void(*destructor)(void *ptr))
| Add a pointer sorted in the list , starting by the start of the list. More...
void * | list_pop_f (LIST *list)
| Get a pointer from the end of the list. More...
void * | list_shift_f (LIST *list)
| Get a pointer from the start of the list. 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...
int | list_destroy (LIST **list)
| Empty and Free a list container. Call the destructor each time. More...

## Detailed Description

Pointer list structures and definitions

Author
  Castagnier Mickaël

Version
  1.0

Date
  24/04/13

Definition in file n_list.h.