scripts: add crosstools packages for i386 and armhf
[AROS.git] / rom / oop / unused / findserver.c
blobbc103d927397e600d7cc55b68babf04327f42171
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Add a class to the list of puvlic classes
6 Lang: english
7 */
8 #include <exec/lists.h>
9 #include <proto/exec.h>
10 #include "intern.h"
12 #include <aros/debug.h>
14 /*****************************************************************************
16 NAME */
17 #include <proto/oop.h>
19 AROS_LH1(OOP_Object *, OOP_FindServer,
21 /* SYNOPSIS */
22 AROS_LHA(STRPTR , serverID, A0),
24 /* LOCATION */
25 struct Library *, OOPBase, 14, OOP)
27 /* FUNCTION
28 Find a public server object previously installed with
29 AddServer(). You can use the obtained object to
30 access objects that server is responsible for.
32 INPUTS
33 serverID - The servers public identifier.
35 RESULT
36 Pointer to the server object.
38 NOTES
39 Probably not a good API. Implemented
40 just to show how one can call methods
41 across process-borders.
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 OOP_AddServer(), OOP_RemoveServer()
50 INTERNALS
52 HISTORY
53 29-10-95 digulla automatically created from
54 intuition_lib.fd and clib/intuition_protos.h
56 *****************************************************************************/
58 AROS_LIBFUNC_INIT
60 OOP_Object *server = NULL;
62 EnterFunc(bug("OOP_FindServer(serverID=%s)\n", serverID));
64 if (serverID)
66 struct ServerNode *sn;
68 D(bug("Obtaining semahore\n"));
70 ObtainSemaphoreShared( &GetOBase(OOPBase)->ob_ServerListLock );
72 D(bug("Finding ID\n"));
74 sn = (struct ServerNode *)FindName(
75 (struct List *)&GetOBase(OOPBase)->ob_ServerList,
76 serverID);
78 if (sn)
80 D(bug("Found node: %p\n", sn));
81 server = sn->sn_Server;
84 D(bug("Releasing semaphore\n"));
87 ReleaseSemaphore( &GetOBase(OOPBase)->ob_ServerListLock );
90 ReturnPtr ("OOP_FindServer", Object *, server);
92 AROS_LIBFUNC_EXIT
93 } /* OOP_FindServer */