function lfds710_list_asu_get_by_key

Revision as of 18:23, 30 May 2016 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Source Files

    │   └───liblfds710
    │           lfds710_list_addonly_singlylinked_unordered.h

Opaque Structures

struct lfds710_list_asu_element;
struct lfds710_list_asu_state;


int lfds710_list_asu_get_by_key( struct lfds710_list_asu_state *lasus,
                                 int (*key_compare_function)(void const *new_key, void const *existing_key),
                                 void *key, 
                                 struct lfds710_list_asu_element **lasue );


struct lfds710_list_asu_state *lasus

A pointer to an initialized struct lfds710_list_asu_state.

int (*key_compare_function)(void const *new_key, void const *existing_key)

A callback used by the list to compare keys. The callback returns 0 if the keys are equal, smaller than zero if new_key is smaller than existing_key and greater than zero if new_key is greater than existing_key (i.e. as strcmp).

void *key

A pointer to the key to find in the list.

struct lfds710_list_asu_element **lasue

Set to point to the element containing key, or NULL if this key does not exist in the list.

Return Value

Returns 1 if an element with key is found, otherwise returns 0.


Iterates over the list, searching for the element with key key. Remember that the list is unordered; this is a convenience function only.

See Also