Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Chained_List.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for Chained_List.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  chained_list
 Basic buffered chained list. More...
 
struct  chained_list_view
 This struct is used to improve performance when sequentially walking through. More...
 
struct  Chained_List
 This a structure wrapps the use of chained_list This is the main chain list structure to use. More...
 

Functions

struct chained_listchained_list_init (uint32_t size_of_trunk, size_t size_of_payload)
 Ininitalizes a buffered chained list. More...
 
void chained_list_release (struct chained_list **list)
 Release a buffered chained list. More...
 
struct chained_listchained_list_alloc_next_chunk (struct chained_list *current_chunk)
 Alocate a new chunk pointing to current_chunk (Recopy MODE ) More...
 
struct chained_listchained_list_alloc_chunk (uint32_t size_of_trunk, size_t size_of_payload)
 Alocate a new chunk ( first chunk ) More...
 
int chained_list_count (struct chained_list *list)
 Count elements in the chained list. More...
 
void * chained_list_push (struct chained_list **list, void *p_payload)
 Push an element in the chained list. More...
 
void cond_chained_list_merge (struct chained_list **dest, struct chained_list *source, int(*condition)(void *))
 Push all element of source satisfying condition in dest. More...
 
void chained_list_walkthrough (struct chained_list *list, void(*action)(void *))
 Call a function uppon each element of the chained list. More...
 
void chained_list_walkthrough_arg (struct chained_list *list, void(*action)(void *, void *), void *arg)
 Call a function uppon each element of the chained list. More...
 
static void chained_list_view_init (struct chained_list_view *clv)
 Initializes a chained_list_view. More...
 
void * chained_list_get_elem (struct chained_list *list, int(*test_func)(void *, void *), void *value)
 Get a pointer to the first element which matches a value. More...
 
static void * chained_list_get_nth (struct chained_list *list, uint64_t n)
 Get a reference to the nth element of the chained list. More...
 
static void * chained_list_get_nth_seq (struct chained_list *list, struct chained_list_view *view, uint64_t n)
 Get a reference to the nth element of the chained list (optimised for sequential) More...
 
static void Chained_List_init (struct Chained_List *list, uint64_t chunk_size, size_t payload_size)
 Initializes a Chained_List. More...
 
static void Chained_List_release (struct Chained_List *list)
 Clears a Chained_List. More...
 
static void * Chained_List_push (struct Chained_List *list, void *payload)
 Adds an element to the list. More...
 
static uint64_t Chained_List_count (struct Chained_List *list)
 Counts the elements in the list. More...
 
static void Chained_List_cond_merge (struct Chained_List *dest, struct Chained_List *source, int(*condition)(void *))
 Push all element of source satisfying condition in dest. More...
 
static void Chained_List_walkthrough (struct Chained_List *list, void(*action)(void *))
 Call a function uppon each element of the chained list. More...
 
static void Chained_List_walkthrough_arg (struct Chained_List *list, void(*action)(void *, void *), void *arg)
 Call a function uppon each element of the chained list. More...
 
static void * Chained_List_get_nth (struct Chained_List *list, uint64_t n)
 Gets the nth element of the list. More...
 
static void * Chained_List_get_nth_seq (struct Chained_List *cl, struct chained_list_view *view, uint64_t n)
 Get a reference to the nth element of the chained list (optimised for sequential) More...
 
static void * Chained_List_get_elem (struct Chained_List *list, int(*test_func)(void *, void *), void *value)
 Get a pointer to the first element which matches a value. More...