Logo Search packages:      
Sourcecode: rapple version File versions  Download package

rpl_list_node* rpl_list_append ( rpl_list list_p,
rpl_list_node node_p,
void *  data_ptr 
)

Inserts the new node at the end of the list.

Parameters:
list_p Points to the list.
node_p Points to the new node.
data_ptr Points to the struct being added.
Returns:
Returns pointer to the new tail of the list.

Definition at line 82 of file list.c.

References rpl_list::count, rpl_list::first, and rpl_list::last.

{
    assert(list_p != NULL);
    assert(node_p != NULL);
    assert(data_ptr != NULL);

    node_p->data_ptr = data_ptr;
    node_p->next = NULL;
    if (list_p->count == 0)
    {
        list_p->first = node_p;
    }
    else
    {
        node_p->prev = list_p->last;
        list_p->last->next = node_p;
    }
    list_p->last = node_p;
    list_p->count++;
    return list_p->last;
}


Generated by  Doxygen 1.6.0   Back to index