Unification of "SEE ALSO" for graphics.library
[cake.git] / rom / graphics / gfxfree.c
blobf0a1d1f7cdb69c799e82e29088b3193b08873727
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <exec/types.h>
10 #include <graphics/gfxbase.h>
11 #include <graphics/gfxnodes.h>
12 #include <graphics/monitor.h>
13 #include <graphics/view.h>
14 #include <proto/exec.h>
15 #include <proto/graphics.h>
16 #include "graphics_intern.h"
18 /*****************************************************************************
20 NAME */
22 AROS_LH1( void , GfxFree,
24 /* SYNOPSIS */
25 AROS_LHA(struct ExtendedNode *, node, A0),
27 /* LOCATION */
29 struct GfxBase *, GfxBase, 111, Graphics)
31 /* FUNCTION
32 Free a special graphics extended data structure which was preciously
33 allocated by GfxNew()
35 INPUTS
36 node = pointer to a graphics extended data structure obtained by
37 GfxNew()
39 RESULT
40 The node will be deallocated from memory. Graphics will disassociate
41 this special graphics extended node from any associated data
42 structure, if necessary, before freeing it (see GfxAssociate())
44 NOTES
46 EXAMPLE
48 BUGS
50 SEE ALSO
51 graphics/gfxnodes.h, GfxNew(), GfxAssociate(), GfxLookUp()
53 INTERNALS
55 HISTORY
57 ******************************************************************************/
59 AROS_LIBFUNC_INIT
61 const ULONG GfxNew_memsizes[] = { 0,
62 sizeof(struct ViewExtra),
63 sizeof(struct ViewPortExtra),
64 sizeof(struct SpecialMonitor),
65 sizeof(struct MonitorSpec)
68 if ( SS_GRAPHICS == node->xln_Subsystem &&
69 NT_GRAPHICS == node->xln_Type)
71 /* take the element out of the hashlist, if it is in the
72 hashlist */
74 /* if the element has a Successor */
75 if (NULL != node -> xln_Succ)
76 ((struct ExtendedNode *)(node -> xln_Succ)) -> xln_Pred = (struct Node *) (node -> xln_Pred);
78 /* if the previous Element is not the hashlist itself */
79 /* (the same code works also if the previous entry is the hashlist ) */
80 ((struct ExtendedNode *)(node -> xln_Pred)) -> xln_Succ = (struct Node *) (node -> xln_Succ);
82 FreeMem((void *) node, GfxNew_memsizes[node->xln_Subtype]);
85 AROS_LIBFUNC_EXIT
86 } /* GfxFree */