Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / workbench / unregisterworkbench.c
blob34ffe1a56068db9822968bf02d710ad97f57c24d
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "workbench_intern.h"
7 #include <workbench/workbench.h>
9 /*****************************************************************************
11 NAME */
13 #include <proto/workbench.h>
15 AROS_LH1(BOOL, UnregisterWorkbench,
17 /* SYNOPSIS */
18 AROS_LHA(struct MsgPort *, messageport, A0),
20 /* LOCATION */
22 struct WorkbenchBase *, WorkbenchBase, 24, Workbench)
24 /* FUNCTION
25 The workbench application uses this functions to unregister itself
26 with the library. When it is done, messages will no longer be sent.
28 INPUTS
29 msgport - The message port of that was earlier passed in to
30 RegisterWorkbench().
32 RESULT
33 TRUE if the message port was successfully unregistered, FALSE otherwise.
34 The unregistration will fail if the message port isn't the same that
35 was passed in with RegisterWorkbench() earlier or if the passed
36 in pointer is NULL.
38 NOTES
39 Note that "Workbench Application" in this context means the program that
40 is the file manager and handles the GUI of Workbench, not a program that
41 is started from Workbench!
43 EXAMPLE
45 BUGS
47 SEE ALSO
48 RegisterWorkbench()
50 INTERNALS
52 ******************************************************************************/
54 AROS_LIBFUNC_INIT
55 AROS_LIBBASE_EXT_DECL(struct WorkbenchBase *, WorkbenchBase)
57 BOOL success = FALSE;
59 if (messageport != NULL)
61 ObtainSemaphore(&(WorkbenchBase->wb_WorkbenchPortSemaphore));
63 if (WorkbenchBase->wb_WorkbenchPort == messageport)
65 WorkbenchBase->wb_WorkbenchPort = NULL;
66 success = TRUE;
69 ReleaseSemaphore(&(WorkbenchBase->wb_WorkbenchPortSemaphore));
72 return success;
74 AROS_LIBFUNC_EXIT
75 } /* UnregisterWorkbench() */