#include <stdio.h>
Go to the source code of this file.
◆ ListTypeList_t
◆ ListTypeListNode_t
◆ ListName_list_begin()
Returns the first node in the list
- Parameters
-
list | the address of the list |
- Returns
- a pointer to the first node in the list
-
NULL
if the list is empty
◆ ListName_list_copy()
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
- Parameters
-
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
◆ ListName_list_data()
Returns the data stored by a node in the list
- Parameters
-
node | the pointer to the node |
- Returns
- a pointer to the data stored in node
◆ ListName_list_destroy()
Destroys the content of the fields of the structure list
The function releases any dynamic memory used by the structure and resets its state calling TTT_list_init .
- Parameters
-
list | the address of the structure to destroy |
◆ ListName_list_end()
Returns the last node in the list
- Parameters
-
list | the address of the list |
- Returns
- a pointer to the last node in the list
-
NULL
if the list is empty
◆ ListName_list_find()
ListType_t * ListName_list_find |
( |
ListTypeList_t * |
list, |
|
|
ListType_t * |
data |
|
) |
| |
Finds an elemnt in the list
- Parameters
-
list | the address of the list |
data | the address of the data to find |
- Returns
- a pointer to the data, if found
-
NULL
if the list does not contain data
◆ ListName_list_init()
Inits the fields of the list structure with default values
- Parameters
-
list | the address of the structure to initalize |
◆ ListName_list_insert_begin()
void ListName_list_insert_begin |
( |
ListTypeList_t * |
list, |
|
|
ListType_t * |
data |
|
) |
| |
Inserts new data at the beginning of the list
The function creates a new node to be added at the beginning of the list. Then, it makes a local copy of data .
- Parameters
-
list | the address of the list |
data | the address of the data to insert |
◆ ListName_list_insert_end()
void ListName_list_insert_end |
( |
ListTypeList_t * |
list, |
|
|
ListType_t * |
data |
|
) |
| |
Inserts new data at the end of the list
The function creates a new node to be added at the end of the list. Then, it makes a local copy of data .
- Parameters
-
list | the address of the list |
data | the address of the data to insert |
◆ ListName_list_next()
Returns the next node in the list
- Parameters
-
node | the pointer to the current position |
- Returns
- a pointer to the node in the list that follows node
-
NULL
if the next node does not exist
◆ ListName_list_prev()
Returns the previous node in the list
- Parameters
-
node | the pointer to the current position |
- Returns
- a pointer to the node in the list that precede node
-
NULL
if the previous node does not exist
◆ ListName_list_print()
Prints the content of the list
- Parameters
-
list | the address of the list to print |
stream | the output stream (must be already open) |
prefix | a string to be printed as prefix at the beginning of each line |