gdsl
1.6
|
Typedefs | |
typedef _gdsl_node_t | _gdsl_list_t |
GDSL low-level doubly-linked list type. | |
Functions | |
_gdsl_list_t | _gdsl_list_alloc (const gdsl_element_t E) |
Create a new low-level list. | |
void | _gdsl_list_free (_gdsl_list_t L, const gdsl_free_func_t FREE_F) |
Destroy a low-level list. | |
bool | _gdsl_list_is_empty (const _gdsl_list_t L) |
Check if a low-level list is empty. | |
ulong | _gdsl_list_get_size (const _gdsl_list_t L) |
Get the size of a low-level list. | |
void | _gdsl_list_link (_gdsl_list_t L1, _gdsl_list_t L2) |
Link two low-level lists together. | |
void | _gdsl_list_insert_after (_gdsl_list_t L, _gdsl_list_t PREV) |
Insert a low-level list after another one. | |
void | _gdsl_list_insert_before (_gdsl_list_t L, _gdsl_list_t SUCC) |
Insert a low-level list before another one. | |
void | _gdsl_list_remove (_gdsl_node_t NODE) |
Remove a node from a low-level list. | |
_gdsl_list_t | _gdsl_list_search (_gdsl_list_t L, const gdsl_compare_func_t COMP_F, void *VALUE) |
Search for a particular node in a low-level list. | |
_gdsl_list_t | _gdsl_list_map_forward (const _gdsl_list_t L, const _gdsl_node_map_func_t MAP_F, void *USER_DATA) |
Parse a low-level list in forward order. | |
_gdsl_list_t | _gdsl_list_map_backward (const _gdsl_list_t L, const _gdsl_node_map_func_t MAP_F, void *USER_DATA) |
Parse a low-level list in backward order. | |
void | _gdsl_list_write (const _gdsl_list_t L, const _gdsl_node_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write all nodes of a low-level list to a file. | |
void | _gdsl_list_write_xml (const _gdsl_list_t L, const _gdsl_node_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Write all nodes of a low-level list to a file into XML. | |
void | _gdsl_list_dump (const _gdsl_list_t L, const _gdsl_node_write_func_t WRITE_F, FILE *OUTPUT_FILE, void *USER_DATA) |
Dump the internal structure of a low-level list to a file. |
typedef _gdsl_node_t _gdsl_list_t |
GDSL low-level doubly-linked list type.
This type is voluntary opaque. Variables of this kind could'nt be directly used, but by the functions of this module.
Definition at line 54 of file _gdsl_list.h.
_gdsl_list_t _gdsl_list_alloc | ( | const gdsl_element_t | E | ) |
Create a new low-level list.
Allocate a new low-level list data structure which have only one node. The node's content is set to E.
E | The content of the first node of the new low-level list to create. |
void _gdsl_list_free | ( | _gdsl_list_t | L, |
const gdsl_free_func_t | FREE_F | ||
) |
Destroy a low-level list.
Flush and destroy the low-level list L. If FREE_F != NULL, then the FREE_F function is used to deallocated each L's element. Otherwise, nothing is done with L's elements.
L | The low-level list to destroy. |
FREE_F | The function used to deallocated L's nodes contents. |
bool _gdsl_list_is_empty | ( | const _gdsl_list_t | L | ) |
Check if a low-level list is empty.
L | The low-level list to check. |
ulong _gdsl_list_get_size | ( | const _gdsl_list_t | L | ) |
Get the size of a low-level list.
L | The low-level list to use. |
void _gdsl_list_link | ( | _gdsl_list_t | L1, |
_gdsl_list_t | L2 | ||
) |
Link two low-level lists together.
Link the low-level list L2 after the end of the low-level list L1. So L1 is before L2.
L1 | The low-level list to link before L2. |
L2 | The low-level list to link after L1. |
void _gdsl_list_insert_after | ( | _gdsl_list_t | L, |
_gdsl_list_t | PREV | ||
) |
Insert a low-level list after another one.
Insert the low-level list L after the low-level list PREV.
L | The low-level list to link after PREV. |
PREV | The low-level list that will be linked before L. |
void _gdsl_list_insert_before | ( | _gdsl_list_t | L, |
_gdsl_list_t | SUCC | ||
) |
Insert a low-level list before another one.
Insert the low-level list L before the low-level list SUCC.
L | The low-level list to link before SUCC. |
SUCC | The low-level list that will be linked after L. |
void _gdsl_list_remove | ( | _gdsl_node_t | NODE | ) |
Remove a node from a low-level list.
Unlink the node NODE from the low-level list in which it is inserted.
NODE | The low-level node to unlink from the low-level list in which it's linked. |
_gdsl_list_t _gdsl_list_search | ( | _gdsl_list_t | L, |
const gdsl_compare_func_t | COMP_F, | ||
void * | VALUE | ||
) |
Search for a particular node in a low-level list.
Research an element e in the low-level list L, by using COMP_F function to find the first element e equal to VALUE.
L | The low-level list to use |
COMP_F | The comparison function to use to compare L's elements with VALUE to find the element e |
VALUE | The value that must be used by COMP_F to find the element e |
_gdsl_list_t _gdsl_list_map_forward | ( | const _gdsl_list_t | L, |
const _gdsl_node_map_func_t | MAP_F, | ||
void * | USER_DATA | ||
) |
Parse a low-level list in forward order.
Parse all nodes of the low-level list L in forward order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then _gdsl_list_map_forward() stops and returns its last examinated node.
L | Th low-level list to map. |
MAP_F | The map function. |
USER_DATA | User's datas. |
_gdsl_list_t _gdsl_list_map_backward | ( | const _gdsl_list_t | L, |
const _gdsl_node_map_func_t | MAP_F, | ||
void * | USER_DATA | ||
) |
Parse a low-level list in backward order.
Parse all nodes of the low-level list L in backward order. The MAP_F function is called on each node with the USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then _gdsl_list_map_backward() stops and returns its last examinated node.
L | Th low-level list to map. |
MAP_F | The map function. |
USER_DATA | User's datas. |
void _gdsl_list_write | ( | const _gdsl_list_t | L, |
const _gdsl_node_write_func_t | WRITE_F, | ||
FILE * | OUTPUT_FILE, | ||
void * | USER_DATA | ||
) |
Write all nodes of a low-level list to a file.
Write the nodes of the low-level list L to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F.
L | The low-level list to write. |
WRITE_F | The write function. |
OUTPUT_FILE | The file where to write L's nodes. |
USER_DATA | User's datas passed to WRITE_F. |
void _gdsl_list_write_xml | ( | const _gdsl_list_t | L, |
const _gdsl_node_write_func_t | WRITE_F, | ||
FILE * | OUTPUT_FILE, | ||
void * | USER_DATA | ||
) |
Write all nodes of a low-level list to a file into XML.
Write the nodes of the low-level list L to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then uses WRITE_F function to write L's nodes to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
L | The low-level list to write. |
WRITE_F | The write function. |
OUTPUT_FILE | The file where to write L's nodes. |
USER_DATA | User's datas passed to WRITE_F. |
void _gdsl_list_dump | ( | const _gdsl_list_t | L, |
const _gdsl_node_write_func_t | WRITE_F, | ||
FILE * | OUTPUT_FILE, | ||
void * | USER_DATA | ||
) |
Dump the internal structure of a low-level list to a file.
Dump the structure of the low-level list L to OUTPUT_FILE. If WRITE_F != NULL, then uses WRITE_F function to write L's nodes to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F.
L | The low-level list to dump. |
WRITE_F | The write function. |
OUTPUT_FILE | The file where to write L's nodes. |
USER_DATA | User's datas passed to WRITE_F. |