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

rpl_list_node* rpl_list_prepend ( rpl_list list_p,
rpl_list_node node_p,
void *  data_ptr 

Inserts the new node at the head of the list.

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

Definition at line 49 of file list.c.

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

Referenced by config_end(), and config_start().

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

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

Generated by  Doxygen 1.6.0   Back to index