2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Find a BOOPSI Class in the class list.
8 #include <exec/lists.h>
9 #include <proto/exec.h>
17 #include <aros/debug.h>
19 /*****************************************************************************
22 #include <intuition/classes.h>
23 #include <proto/boopsi.h>
25 AROS_LH1(struct IClass
*, FindClass
,
28 AROS_LHA(ClassID
, classID
, A0
),
31 struct Library
*, BOOPSIBase
, 7, BOOPSI
)
51 ******************************************************************************/
55 Class
* classPtr
= NULL
;
57 EnterFunc(bug("boopsi::FindClass()\n"));
62 D(bug("class to find: \"%s\"\n", classID
));
65 ObtainSemaphoreShared (&GetBBase(BOOPSIBase
)->bb_ClassListLock
);
67 /* Search for the class */
68 ForeachNode (&GetBBase(BOOPSIBase
)->bb_ClassList
, classPtr
)
70 D(bug("+\"%s\"\n", classPtr
->cl_ID
));
71 if (!strcmp (classPtr
->cl_ID
, classID
))
75 classPtr
= NULL
; /* Nothing found */
76 D(bug("class not found!\n"));
80 ReleaseSemaphore (&GetBBase(BOOPSIBase
)->bb_ClassListLock
);
82 ReturnPtr("boopsi::FindClass()", struct IClass
*, classPtr
);