define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / rom / intuition / addclass.c
blob83096786fe4d7e175aed1da89020f59d40d57760
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
6 Makes a class publically available.
7 */
9 #include <proto/exec.h>
10 #include "intuition_intern.h"
12 /*****************************************************************************
14 NAME */
15 #include <intuition/classes.h>
16 #include <proto/intuition.h>
18 AROS_LH1(void, AddClass,
20 /* SYNOPSIS */
21 AROS_LHA(struct IClass *, classPtr, A0),
23 /* LOCATION */
24 struct IntuitionBase *, IntuitionBase, 114, Intuition)
26 /* FUNCTION
27 Makes a class publically usable. This function must not be called
28 before MakeClass().
30 INPUTS
31 class - The result of MakeClass()
33 RESULT
34 None.
36 NOTES
37 Do not use this function for private classes.
39 EXAMPLE
41 BUGS
42 There is no protection against creating multiple classes with
43 the same name yet. The operation of the system is undefined
44 in this case.
46 SEE ALSO
47 MakeClass(), FreeClass(), RemoveClass(), "Basic Object-Oriented
48 Programming System for Intuition" and "boopsi Class Reference"
50 INTERNALS
52 *****************************************************************************/
54 AROS_LIBFUNC_INIT
56 DEBUG_ADDCLASS(dprintf("AddClass: class 0x%lx super 0x%lx dispatcher 0x%lx ID <%s>\n",
57 classPtr, classPtr->cl_Super, classPtr->cl_Dispatcher, classPtr->cl_ID));
59 SANITY_CHECK(classPtr)
61 ObtainSemaphore (&GetPrivIBase(IntuitionBase)->ClassListLock);
62 AddTail((struct List *)&GetPrivIBase(IntuitionBase)->ClassList, (struct Node *)classPtr);
63 classPtr->cl_Flags |= CLF_INLIST;
64 ReleaseSemaphore (&GetPrivIBase(IntuitionBase)->ClassListLock);
66 AROS_LIBFUNC_EXIT
67 } /* AddClass() */