Go to the source code of this file.
◆ JST_List
◆ LST_assign_t
typedef void( * LST_assign_t) (void *dest, unsigned index, void *src) |
◆ JST_List_move_to()
For each item in list, call assign to transfert ownership of items and free the list, node by node.
- Parameters
-
from | the list to clear |
dest | the destination of transfert, a data structure (opaque here) |
assign | the callback able to make the transfert from JST_List to another data structure (opaque here) |
- Returns
- JST_ERR_NONE or JST_ERR_NULL_ARGUMENT when from, dest or assign are null.
Definition at line 25 of file JST_list.c.
26 if(( from == NULL )||( dest == NULL )||( assign == NULL )) {
30 for(
unsigned i = 0; iter; ++i ) {
31 assign( dest, i, iter->
item );
◆ JST_List_push_back()
- Returns
- JST_ERR_NONE or JST_ERR_NULL_ARGUMENT when first or current are null.
Definition at line 7 of file JST_list.c.
8 if(( first == NULL )||( current == NULL )) {
11 if( *first == NULL ) {
12 *first = *current = calloc( 1,
sizeof(
JST_List ));
15 if( *current == NULL ) {
18 (*current)->next = calloc( 1,
sizeof(
JST_List ));
19 *current = (*current)->
next;
21 (*current)->
item = data;
◆ JST_List_Zero