2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
6 Find a BOOPSI Class in the class list.
10 #include <exec/lists.h>
11 #include <proto/exec.h>
13 #include "intuition_intern.h"
19 #include <aros/debug.h>
21 /*****i************************************************************************
24 #include <intuition/classes.h>
25 #include <proto/intuition.h>
27 AROS_LH1(struct IClass
*, FindClass
,
30 AROS_LHA(ClassID
, classID
, A0
),
33 struct IntuitionBase
*, IntuitionBase
, 112, Intuition
)
42 This function is binary-compatible with AmigaOS v3, however it is
53 ******************************************************************************/
57 struct IntIntuitionBase
*intuitionBase
= GetPrivIBase(IntuitionBase
);
58 Class
* classPtr
= NULL
;
60 DEBUG_FINDCLASS(dprintf("FindClass: ClassID <%s>\n",
61 classID
? classID
: (UBYTE
*)"NULL"));
63 EnterFunc(bug("intuition_boopsi::FindClass()\n"));
68 D(bug("class to find: \"%s\"\n", classID
));
71 ObtainSemaphoreShared (&intuitionBase
->ClassListLock
);
73 /* Search for the class */
74 ForeachNode (&intuitionBase
->ClassList
, classPtr
)
76 D(bug("+\"%s\"\n", classPtr
->cl_ID
));
77 if (!strcmp (classPtr
->cl_ID
, classID
))
81 classPtr
= NULL
; /* Nothing found */
82 D(bug("class not found!\n"));
86 ReleaseSemaphore (&intuitionBase
->ClassListLock
);
88 DEBUG_FINDCLASS(dprintf("FindClass: return 0x%lx\n", classPtr
));
90 ReturnPtr("intuition_boopsi::FindClass()", struct IClass
*, classPtr
);