]> pd.if.org Git - liblfds/blob - lfds700_list_addonly_ordered_singlylinked_cleanup.c
580fa9b3ac41c92491b6bb08b3d2a3eb7722dce7
[liblfds] / lfds700_list_addonly_ordered_singlylinked_cleanup.c
1 /***** includes *****/
2 #include "lfds700_list_addonly_ordered_singlylinked_internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 void lfds700_list_aos_cleanup( struct lfds700_list_aos_state *laoss,
10                                void (*element_cleanup_callback)(struct lfds700_list_aos_state *laoss, struct lfds700_list_aos_element *laose) )
11 {
12   struct lfds700_list_aos_element
13     *laose,
14     *temp;
15
16   LFDS700_PAL_ASSERT( laoss != NULL );
17   // TRD : element_cleanup_callback can be NULL
18
19   LFDS700_MISC_BARRIER_LOAD;
20
21   if( element_cleanup_callback == NULL )
22     return;
23
24   laose = LFDS700_LIST_AOS_GET_START( *laoss );
25
26   while( laose != NULL )
27   {
28     temp = laose;
29
30     laose = LFDS700_LIST_AOS_GET_NEXT( *laose );
31
32     element_cleanup_callback( laoss, temp );
33   }
34
35   return;
36 }
37