some fixes to accented characters
[tangerine.git] / rom / intuition / findclass.c
blob75c15bb4f925e12bdc7168340aca9b894bcf2340
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 Find a BOOPSI Class in the class list.
7 */
9 #include <string.h>
10 #include <exec/lists.h>
11 #include <proto/exec.h>
13 #include "intuition_intern.h"
15 #undef SDEBUG
16 #define SDEBUG 0
17 #undef DEBUG
18 #define DEBUG 0
19 #include <aros/debug.h>
21 /*****i************************************************************************
23 NAME */
24 #include <intuition/classes.h>
25 #include <proto/intuition.h>
27 AROS_LH1(struct IClass *, FindClass,
29 /* SYNOPSIS */
30 AROS_LHA(ClassID, classID, A0),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 112, Intuition)
35 /* FUNCTION
37 INPUTS
39 RESULT
41 NOTES
43 EXAMPLE
45 BUGS
47 SEE ALSO
49 INTERNALS
51 HISTORY
53 ******************************************************************************/
55 AROS_LIBFUNC_INIT
57 Class * classPtr = NULL;
59 DEBUG_FINDCLASS(dprintf("FindClass: ClassID <%s>\n",
60 classID ? classID : (UBYTE*)"NULL"));
62 EnterFunc(bug("intuition_boopsi::FindClass()\n"));
64 if (!classID)
65 return NULL;
67 D(bug("class to find: \"%s\"\n", classID));
69 /* Lock the list */
70 ObtainSemaphoreShared (&GetPrivIBase(IntuitionBase)->ClassListLock);
72 /* Search for the class */
73 ForeachNode (&GetPrivIBase(IntuitionBase)->ClassList, classPtr)
75 D(bug("+\"%s\"\n", classPtr->cl_ID));
76 if (!strcmp (classPtr->cl_ID, classID))
77 goto found;
80 classPtr = NULL; /* Nothing found */
81 D(bug("class not found!\n"));
83 found:
84 /* Unlock list */
85 ReleaseSemaphore (&GetPrivIBase(IntuitionBase)->ClassListLock);
87 DEBUG_FINDCLASS(dprintf("FindClass: return 0x%lx\n", classPtr));
89 ReturnPtr("intuition_boopsi::FindClass()", struct IClass *, classPtr);
91 AROS_LIBFUNC_EXIT