Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / boopsi / findclass.c
blobb02e35a13291de3112639be9e0d9e01a62bbcd24
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Find a BOOPSI Class in the class list.
6 Lang: english
7 */
8 #include <exec/lists.h>
9 #include <proto/exec.h>
11 #include "intern.h"
13 #undef SDEBUG
14 #define SDEBUG 0
15 #undef DEBUG
16 #define DEBUG 1
17 #include <aros/debug.h>
19 /*****************************************************************************
21 NAME */
22 #include <intuition/classes.h>
23 #include <proto/boopsi.h>
25 AROS_LH1(struct IClass *, FindClass,
27 /* SYNOPSIS */
28 AROS_LHA(ClassID, classID, A0),
30 /* LOCATION */
31 struct Library *, BOOPSIBase, 7, BOOPSI)
33 /* FUNCTION
35 INPUTS
37 RESULT
39 NOTES
41 EXAMPLE
43 BUGS
45 SEE ALSO
47 INTERNALS
49 HISTORY
51 ******************************************************************************/
53 AROS_LIBFUNC_INIT
54 AROS_LIBBASE_EXT_DECL(struct Library *, BOOPSIBase)
56 Class * classPtr = NULL;
58 EnterFunc(bug("boopsi::FindClass()\n"));
60 if (!classID)
61 return NULL;
63 D(bug("class to find: \"%s\"\n", classID));
65 /* Lock the list */
66 ObtainSemaphoreShared (&GetBBase(BOOPSIBase)->bb_ClassListLock);
68 /* Search for the class */
69 ForeachNode (&GetBBase(BOOPSIBase)->bb_ClassList, classPtr)
71 D(bug("+\"%s\"\n", classPtr->cl_ID));
72 if (!strcmp (classPtr->cl_ID, classID))
73 goto found;
76 classPtr = NULL; /* Nothing found */
77 D(bug("class not found!\n"));
79 found:
80 /* Unlock list */
81 ReleaseSemaphore (&GetBBase(BOOPSIBase)->bb_ClassListLock);
83 ReturnPtr("boopsi::FindClass()", struct IClass *, classPtr);
84 AROS_LIBFUNC_EXIT