lfds710_list_as_link_start

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_list_addonly_singlylinked.h
    └───src
        └───llfds710_list_addonly_singlylinked
                lfds710_list_addonly_singlylinked_link.c

Prototype

void lfds710_list_as_link_start( struct lfds710_list_as_state *lass,
                                 struct lfds710_list_as_element *lase,
                                 void *key,
                                 void *value,
                                 struct lfds710_liblfds_prng_state *ps );

Parameters

struct lfds710_list_as_state *lass

A pointer to an initialized struct lfds710_list_as_state.

struct lfds710_list_as_element *lase

A pointer to a struct lfds710_list_as_element.

void *key

A void pointer of user data which will be used as the key for this element.

void *value

A void pointer of user data which will be used as the data for this element.

struct lfds710_liblfds_prng_state *ps

A pointer to an initialized struct lfds710_liblfds_prng_state.

Notes

This function sets key and value into lase, and then links lase as the start of the list.

If a list is ordered (which is to say, key_compare_function was passed into lfds710_list_as_init and only lfds710_list_as_link_ordered has been used to link new elements) and lfds710_list_as_link_start is used to insert an out-of-order element, then the list will be broken. You were warned.

See Also