grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / graphics / disposeregion.c
blobbb30b4408b120550d301d33535b1b7bd7ae6d5ef
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function DisposeRegion()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include "graphics_intern.h"
10 #include <proto/exec.h>
11 #include <proto/graphics.h>
12 #include <graphics/regions.h>
13 #include "intregions.h"
15 /*****************************************************************************
17 NAME */
18 #include <clib/graphics_protos.h>
20 AROS_LH1(void, DisposeRegion,
22 /* SYNOPSIS */
23 AROS_LHA(struct Region *, region, A0),
25 /* LOCATION */
26 struct GfxBase *, GfxBase, 89, Graphics)
28 /* FUNCTION
29 Frees all memory allocated by this region, including its
30 RegionRectangles.
32 INPUTS
33 region - pointer to a Region structure
35 RESULT
36 None.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 NewRegion()
47 INTERNALS
49 HISTORY
50 27-11-96 digulla automatically created from
51 graphics_lib.fd and clib/graphics_protos.h
52 15-01-97 mreckt initial version
54 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 ASSERT_VALID_PTR(region);
60 ClearRegion(region);
62 #if REGIONS_USE_MEMPOOL
63 ObtainSemaphore(&PrivGBase(GfxBase)->regionsem);
64 FreePooled(PrivGBase(GfxBase)->regionpool, region, sizeof(struct Region));
65 ReleaseSemaphore(&PrivGBase(GfxBase)->regionsem);
66 #else
67 FreeMem(region, sizeof(struct Region));
68 #endif
70 AROS_LIBFUNC_EXIT
72 } /* DisposeRegion */