Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / icon / freefreelist.c
blob20da60459499d7c532418c8ff6d42980fd2133d7
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include "icon_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/icon.h>
15 AROS_LH1(void, FreeFreeList,
17 /* SYNOPSIS */
18 AROS_LHA(struct FreeList *, freelist, A0),
20 /* LOCATION */
21 struct Library *, IconBase, 9, Icon)
23 /* FUNCTION
24 Frees all memory chunks in the freelist (previously inserted into
25 it via AddFreeList()).
27 INPUTS
28 freelist - pointer to FreeList struct. It is save to use NULL.
30 RESULT
32 NOTES
34 EXAMPLE
36 BUGS
38 SEE ALSO
39 AddFreeList()
41 INTERNALS
43 HISTORY
44 2006-04-10 Test for NULL pointer added
46 *****************************************************************************/
48 AROS_LIBFUNC_INIT
50 if ( ! freelist) return;
52 struct MemList * node,
53 * nextnode;
55 node = (struct MemList*)freelist->fl_MemList.lh_Head;
57 while ( (nextnode = (struct MemList*)node->ml_Node.ln_Succ) )
59 FreeEntry (node);
61 node = nextnode;
64 FreeMem (freelist, sizeof(struct FreeList));
66 AROS_LIBFUNC_EXIT
67 } /* FreeFreeList */