Improvements to AutoDocs and comments.
[aros:aros.git] / AROS / workbench / libs / icon / freediskobject.c
1 /*
2     Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3     $Id$
4
5     Desc:
6     Lang: english
7 */
8 #include <proto/arossupport.h>
9 #include "icon_intern.h"
10 #include <stddef.h>
11
12 extern const IPTR IconDesc[];
13
14 /*****************************************************************************
15
16     NAME */
17 #include <clib/icon_protos.h>
18
19         AROS_LH1(void, FreeDiskObject,
20
21 /*  SYNOPSIS */
22         AROS_LHA(struct DiskObject *, diskobj, A0),
23
24 /*  LOCATION */
25         struct IconBase *, IconBase, 15, Icon)
26
27 /*  FUNCTION
28         Frees all memory for a DiskObject structure.
29         
30     INPUTS
31         diskobj --  a pointer to a DiskObject structure. A NULL pointer will be
32                     ignored.
33         
34     RESULT
35
36     NOTES
37
38     EXAMPLE
39
40     BUGS
41
42     SEE ALSO
43         GetDiskObject()
44         
45     INTERNALS
46
47     HISTORY
48         2006-04-09 Test for NULL pointer added
49         
50 *****************************************************************************/
51 {
52     AROS_LIBFUNC_INIT
53     
54     if ( ! diskobj) return;
55
56     struct NativeIcon *nativeicon;
57     
58     nativeicon = NATIVEICON(diskobj);
59    
60     /* Remove all layout specific data
61      * (i.e. displayable bitmaps, pen allocations, etc.)
62      */
63     LayoutIconA(diskobj, NULL, NULL);
64
65     RemoveIconFromList(nativeicon, LB(IconBase));
66
67     /* It's enough to free our FreeList */
68     FreeFreeList(&nativeicon->ni_FreeList);
69
70     AROS_LIBFUNC_EXIT
71     
72 } /* FreeDiskObject */