Unification of "SEE ALSO" for graphics.library
[cake.git] / rom / graphics / gfxlookup.c
blob83c995242a5001677fb55b1ad647e46028022871
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/gfxnodes.h>
11 #include <graphics/monitor.h>
12 #include <graphics/view.h>
13 #include <graphics/gfxbase.h>
14 #include <proto/exec.h>
15 #include <proto/graphics.h>
16 #include "graphics_intern.h"
18 /*****************************************************************************
20 NAME */
22 AROS_LH1( struct ExtendedNode *, GfxLookUp,
24 /* SYNOPSIS */
26 AROS_LHA( void *, pointer, A0),
28 /* LOCATION */
30 struct GfxBase *, GfxBase, 117, Graphics)
32 /* FUNCTION
33 Finds a special graphics extended data structure (if an) associated
34 with the pointer to a data structure (e.g.: ViewExtra associated with
35 a View structure).
37 INPUTS
38 pointer = a pointer to a data structure which may have an
39 ExtendedNode associated with it (typically a View)
41 RESULT
42 result = a pointer to the ExtendedNode that has previously been
43 associated with the pointer
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
52 graphics/gfxnodes.h, GfxNew(), GfxAssociate(), GfxFree()
54 INTERNALS
56 HISTORY
58 ******************************************************************************/
60 AROS_LIBFUNC_INIT
62 LONG * Hash = GfxBase -> hash_table;
63 ULONG Index = CalcHashIndex((ULONG)pointer);
65 /* Whatever structure we get as node we put the pointer in the space
66 following immediately after the ExtendedNode structure.
67 ViewExtra -> View
68 ViewPortExtra -> ViewPort
71 struct ExtendedNode * node = (struct ExtendedNode *)(Hash[Index]);
72 while (NULL != node)
74 if (pointer == (void *) ((struct ViewExtra *)node)->View )
75 return node;
76 else
77 /* examine the next element */
78 node = (struct ExtendedNode *)node -> xln_Succ;
80 /* no associated pointer was found! */
81 return NULL;
83 AROS_LIBFUNC_EXIT
84 } /* GfxFree */