2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 Desc: Find a public OOP class
9 #include <exec/lists.h>
10 #include <proto/exec.h>
15 #define MD(x) ((struct metadata *)x)
17 /*****************************************************************************
20 #include <proto/oop.h>
22 AROS_LH1(APTR
, OOP_FindClass
,
25 AROS_LHA(CONST_STRPTR
, classID
, A0
),
28 struct Library
*, OOPBase
, 22, OOP
)
31 Finds a class with given ID in the list of public classes.
34 classID - Public ID of the class to find.
37 Pointer to a public class or NULL if there's no such class
51 V42 - initial implementation
53 *****************************************************************************/
60 /* Class list is public, so we must avoid race conditions */
61 ObtainSemaphoreShared(&GetOBase(OOPBase
)->ob_ClassListLock
);
63 classPtr
= (OOP_Class
*)FindName((struct List
*)&(GetOBase(OOPBase
)->ob_ClassList
), classID
);
65 /* Release lock on list */
66 ReleaseSemaphore(&GetOBase(OOPBase
)->ob_ClassListLock
);