grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / iffparse / freeiff.c
blob720ffec6a8ea5b943648fca4d09057c794417ffa
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "iffparse_intern.h"
8 /*****************************************************************************
10 NAME */
11 #include <proto/iffparse.h>
13 AROS_LH1(void, FreeIFF,
15 /* SYNOPSIS */
16 AROS_LHA(struct IFFHandle *, iff, A0),
18 /* LOCATION */
19 struct Library *, IFFParseBase, 9, IFFParse)
21 /* FUNCTION
22 Frees an IFFHandle struct previously allocated by AllocIFF.
24 INPUTS
25 iff - pointer to an IFFHandle struct.
26 RESULT
28 NOTES
30 EXAMPLE
32 BUGS
34 SEE ALSO
35 AllocIFF(), CloseIFF()
37 INTERNALS
39 *****************************************************************************/
41 AROS_LIBFUNC_INIT
42 struct IntContextNode * cn;
43 struct LocalContextItem * node,
44 * nextnode;
46 if (iff != NULL)
49 We should free the LCIs of the default context-node
50 ( CollectionItems and such )
52 cn = (struct IntContextNode*)RootChunk (iff);
54 node = (struct LocalContextItem*)cn->cn_LCIList.mlh_Head;
56 while ((nextnode = (struct LocalContextItem*)node->lci_Node.mln_Succ))
58 PurgeLCI (node, IPB(IFFParseBase));
60 node = nextnode;
63 FreeMem (iff, sizeof (struct IntIFFHandle));
66 AROS_LIBFUNC_EXIT
67 } /* FreeIFF */