libmove3d  3.13.0
Defines | Functions
/home/slemaign/softs-local/BioMove3D-git/util/dyna_list.c File Reference

Dynamic double chained list. More...

#include "Util-pkg.h"

Defines

#define STACK_DEPTH   (8)

Functions

void * dbl_copy_link (void *data)
void dbl_delete_link (void *data)
dbl_listdbl_list_init (dbl_clone_function clone_func, dbl_destroy_function destroy_func, size_t size)
dbl_listdbl_list_pointer_init ()
int dbl_list_empty (dbl_list *l)
int dbl_list_is_error (dbl_list *l)
int dbl_list_get_error (dbl_list *l)
void dbl_list_clear_error (dbl_list *l)
void dbl_list_destroy (dbl_list *l)
dbl_list_nodedbl_list_insert_after (dbl_list *l, void *data)
dbl_list_nodedbl_list_insert_before (dbl_list *l, void *data)
dbl_list_nodedbl_list_append (dbl_list *l, void *data)
dbl_list_nodedbl_list_concat (dbl_list *l, void *data)
dbl_list_nodedbl_list_add_link (dbl_list *l, void *data)
dbl_list_nodedbl_list_insert_link_after (dbl_list *l, void *data)
dbl_list_nodedbl_list_insert_link_before (dbl_list *l, void *data)
dbl_list_nodedbl_list_append_link (dbl_list *l, void *data)
dbl_list_nodedbl_list_concat_link (dbl_list *l, void *data)
void dbl_list_insert_sorted_link (dbl_list *l, void *data, int(*sortFn)(void *, void *))
 Insert a node in a sorted list. The list is supposed sorted.
dbl_list_nodedbl_list_get_current (dbl_list *l)
int dbl_list_get_current_indice (dbl_list *l)
 Get the indice of the current node.
dbl_list_nodedbl_list_first (dbl_list *l)
dbl_list_nodedbl_list_last (dbl_list *l)
int dbl_list_more (dbl_list *l)
int dbl_list_no_more (dbl_list *l)
dbl_list_nodedbl_list_next (dbl_list *l)
dbl_list_nodedbl_list_prev (dbl_list *l)
void dbl_list_clear (dbl_list *l)
dbl_list_nodedbl_list_remove (dbl_list *l)
dbl_list_nodedbl_list_remove_link (dbl_list *l)
 Remove the current node but do not destroy the data.
dbl_list_nodedbl_list_remove_data (dbl_list *l, void *data)
dbl_list_nodedbl_list_remove_link_data (dbl_list *l, void *data)
void dbl_list_remove_first (dbl_list *l)
void dbl_list_remove_last (dbl_list *l)
int dbl_list_swap_next (dbl_list *l)
int dbl_list_swap_prev (dbl_list *l)
dbl_list_nodedbl_list_goto_first (dbl_list *l)
dbl_list_nodedbl_list_goto_last (dbl_list *l)
dbl_list_nodedbl_list_goto_n (dbl_list *l, int n)
 Set the current position on the element n.
void * dbl_list_get_data (dbl_list *l)
dbl_list_nodedbl_list_get_node_n (dbl_list *l, int n)
 Get the adresse of nTh node.
void * dbl_list_get_data_n (dbl_list *l, int n)
int dbl_list_get_data_indice (dbl_list *l, void *data)
 Get the indice of the data in the list.
void dbl_list_push (dbl_list *l)
int dbl_list_pop (dbl_list *l)
void dbl_list_flush_stack (dbl_list *l)
dbl_listdbl_list_copy (const dbl_list *l)
int dbl_list_concat_list (dbl_list *l_dest, const dbl_list *l_src)
 Concat all the list element and clone them.
int dbl_list_concat_list_link (dbl_list *l_dest, const dbl_list *l_src)
 Concat all the list element but do only links.
int dbl_list_count (dbl_list *l)
void dbl_list_sort (dbl_list *l, int(*call_func)(void *, void *))
dbl_list_nodedbl_list_find_by_data (dbl_list *l, void *data, int(*FctEqualData)(void *, void *))
int dbl_list_test_equal (dbl_list *list1Pt, dbl_list *list2Pt, int(*FctEqualData)(void *, void *))
 Test the equality of two lists.
int dbl_list_test_included (dbl_list *main_listPt, dbl_list *sub_listPt, int(*FctEqualData)(void *, void *))
 Test if the data of one sub-list is included in the main list.

Detailed Description

Dynamic double chained list.


Function Documentation

int dbl_list_concat_list ( dbl_list l_dest,
const dbl_list l_src 
)

Concat all the list element and clone them.

Parameters:
l_dest,:the destination list
l_src,:the source list
Returns:
TRUE if success
int dbl_list_concat_list_link ( dbl_list l_dest,
const dbl_list l_src 
)

Concat all the list element but do only links.

Parameters:
l_dest,:the destination list
l_src,:the source list
Returns:
TRUE if success
int dbl_list_get_current_indice ( dbl_list l)

Get the indice of the current node.

Parameters:
l,:the list
Returns:
the indice of the current node (-1 if no current node is defined)
int dbl_list_get_data_indice ( dbl_list l,
void *  data 
)

Get the indice of the data in the list.

Parameters:
l,:the list
data,:the data searched
Returns:
the indice of the data node (-1 if the data is not found)
dbl_list_node* dbl_list_get_node_n ( dbl_list l,
int  n 
)

Get the adresse of nTh node.

Parameters:
l,:the list
n,:the node number
Returns:
the node adresse
dbl_list_node* dbl_list_goto_n ( dbl_list l,
int  n 
)

Set the current position on the element n.

Parameters:
l,:The list
n,:The indice to reach
void dbl_list_insert_sorted_link ( dbl_list l,
void *  data,
int(*)(void *, void *)  sortFn 
)

Insert a node in a sorted list. The list is supposed sorted.

Parameters:
lThe list
dataData to insert
(*sortFn)( void *, void * ) Compare fonction
dbl_list_node* dbl_list_remove_link ( dbl_list l)

Remove the current node but do not destroy the data.

Parameters:
l,:The list
Returns:
The new current node
int dbl_list_test_equal ( dbl_list list1Pt,
dbl_list list2Pt,
int(*)(void *, void *)  FctEqualData 
)

Test the equality of two lists.

Parameters:
list1Pt,:the first list
list2Pt,:the second list
FctEqualData,:A function to compare two data. If it return a number <0 then the first element is the previous. If it return 0 then both are equal. If it return a number >0 then the second element is the previous. If it is a NULL pointeur, it compares data pointer adress value
Returns:
<0 if list1Pt is smaller, 0 if they are equal, >0 if list2Pt is smaller
int dbl_list_test_included ( dbl_list main_listPt,
dbl_list sub_listPt,
int(*)(void *, void *)  FctEqualData 
)

Test if the data of one sub-list is included in the main list.

Parameters:
main_listPt,:the main list
sub_listPt,:the sub-list list
FctEqualData,:A function to compare two data. TRUE if the data are equals
Returns:
TRUE if the sub-list data are included in the main list
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines