refactored some code. compiles now without suppresing any warning with gcc-6.3.0.
[AROS.git] / rom / graphics / closemonitor.c
blob3a50139004eb45ab2339457ae4e2dcaeb54aa93f
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Graphics function CloseMonitor()
6 Lang: english
7 */
8 #include <aros/debug.h>
9 #include <graphics/monitor.h>
11 #include "graphics_intern.h"
13 /*****************************************************************************
15 NAME */
16 #include <proto/graphics.h>
18 AROS_LH1(LONG, CloseMonitor,
20 /* SYNOPSIS */
21 AROS_LHA(struct MonitorSpec *, monitor_spec, A0),
23 /* LOCATION */
24 struct GfxBase *, GfxBase, 120, Graphics)
26 /* FUNCTION
28 INPUTS
29 monitor_spec - pointer to a MonitorSpec opened via OpenMonitor(),
30 or NULL
32 RESULT
33 error - FALSE if MonitorSpec closed uneventfully
34 TRUE if MonitorSpec could not be closed
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 OpenMonitor(), graphics/monitor.h
45 INTERNALS
47 HISTORY
50 ******************************************************************************/
52 AROS_LIBFUNC_INIT
54 BOOL res = TRUE;
56 if (monitor_spec != NULL) {
57 ObtainSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
59 if (monitor_spec->ms_OpenCount) {
60 monitor_spec->ms_OpenCount--;
61 res = FALSE;
64 ReleaseSemaphore(&monitor_spec->DisplayInfoDataBaseSemaphore);
67 return res;
69 AROS_LIBFUNC_EXIT
70 } /* CloseMonitor */