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