grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / freecoplist.c
blob45e99bb56c4c1bb7c06819bac326f8448feadf01
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function FreeCopList()
6 Lang: english
7 */
8 #include <exec/types.h>
9 #include <graphics/copper.h>
10 #include <proto/exec.h>
11 #include "graphics_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/graphics.h>
18 AROS_LH1(void, FreeCopList,
20 /* SYNOPSIS */
21 AROS_LHA(struct CopList *, coplist, A0),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 91, Graphics)
26 /* FUNCTION
27 Deallocate all memory associated with this copper list.
29 INPUTS
30 coplist - pointer to a CopList structure
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
41 graphics/copper.h
43 INTERNALS
45 HISTORY
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct CopList * NextCopList = coplist;
52 while (NULL != NextCopList)
54 coplist = NextCopList;
55 /* get the pointer to the next CopList BEFORE we return it to free
56 * memory
58 NextCopList = coplist -> Next;
59 FreeMem(coplist->CopIns, sizeof(struct CopIns) * coplist->MaxCount);
60 FreeMem(coplist, sizeof(struct CopList));
63 AROS_LIBFUNC_EXIT
64 } /* FreeCopList */