lfds711_list_as_link_start

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_list_addonly_singlylinked.h
    └───src
        └───llfds711_list_addonly_singlylinked
                lfds711_list_addonly_singlylinked_link.c

Prototype

void lfds711_list_as_link_start( struct lfds711_list_as_state *lass,
                                 struct lfds711_list_as_element *lase,
                                 void *key,
                                 void *value,
                                 struct lfds711_liblfds_prng_state *ps );

Parameters

struct lfds711_list_as_state *lass

A pointer to an initialized struct lfds711_list_as_state.

struct lfds711_list_as_element *lase

A pointer to a struct lfds711_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 lfds711_liblfds_prng_state *ps

A pointer to an initialized struct lfds711_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 lfds711_list_as_init and only lfds711_list_as_link_ordered has been used to link new elements) and lfds711_list_as_link_start is used to insert an out-of-order element, then the list will be broken. You were warned.

See Also