]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/liblfds700/src/lfds700_list_addonly_singlylinked_unordered/lfds700_list_addonly_singlylinked_unordered_get.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / liblfds700 / src / lfds700_list_addonly_singlylinked_unordered / lfds700_list_addonly_singlylinked_unordered_get.c
1 /***** includes *****/
2 #include "lfds700_list_addonly_singlylinked_unordered_internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 int lfds700_list_asu_get_by_key( struct lfds700_list_asu_state *lasus,
10                                  void *key,
11                                  struct lfds700_list_asu_element **lasue )
12 {
13   int
14     cr = !0,
15     rv = 1;
16
17   LFDS700_PAL_ASSERT( lasus != NULL );
18   LFDS700_PAL_ASSERT( key != NULL );
19   LFDS700_PAL_ASSERT( lasue != NULL );
20
21   *lasue = NULL;
22
23   while( cr != 0 and LFDS700_LIST_ASU_GET_START_AND_THEN_NEXT(*lasus, *lasue) )
24     cr = lasus->key_compare_function( key, (*lasue)->key );
25
26   if( *lasue == NULL )
27     rv = 0;
28
29   return( rv );
30 }
31