Build mono runtime under none desktop Windows API family, adjustments and cleanup.
[mono.git] / mono / metadata / console-win32-uwp.c
1 /*
2  * console-win32-uwp.c: UWP console support for Mono.
3  *
4  * Copyright 2016 Microsoft
5  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
6 */
7 #include <config.h>
8 #include <glib.h>
9 #include "mono/utils/mono-compiler.h"
10
11 #if G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT)
12 #include <windows.h>
13 #include "mono/metadata/console-win32-internals.h"
14
15 MonoBoolean
16 ves_icall_System_ConsoleDriver_Isatty (HANDLE handle)
17 {
18         MonoError mono_error;
19         mono_error_init (&mono_error);
20
21         g_unsupported_api ("Console");
22
23         mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
24         mono_error_set_pending_exception (&mono_error);
25
26         SetLastError (ERROR_NOT_SUPPORTED);
27
28         return FALSE;
29 }
30
31 MonoBoolean
32 ves_icall_System_ConsoleDriver_SetEcho (MonoBoolean want_echo)
33 {
34         MonoError mono_error;
35         mono_error_init (&mono_error);
36
37         g_unsupported_api ("Console");
38
39         mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
40         mono_error_set_pending_exception (&mono_error);
41
42         SetLastError (ERROR_NOT_SUPPORTED);
43
44         return FALSE;
45 }
46
47 MonoBoolean
48 ves_icall_System_ConsoleDriver_SetBreak (MonoBoolean want_break)
49 {
50         MonoError mono_error;
51         mono_error_init (&mono_error);
52
53         g_unsupported_api ("Console");
54
55         mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
56         mono_error_set_pending_exception (&mono_error);
57
58         SetLastError (ERROR_NOT_SUPPORTED);
59
60         return FALSE;
61 }
62
63 gint32
64 ves_icall_System_ConsoleDriver_InternalKeyAvailable (gint32 timeout)
65 {
66         MonoError mono_error;
67         mono_error_init (&mono_error);
68
69         g_unsupported_api ("Console");
70
71         mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
72         mono_error_set_pending_exception (&mono_error);
73
74         SetLastError (ERROR_NOT_SUPPORTED);
75
76         return FALSE;
77 }
78
79 MonoBoolean
80 ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardown, MonoArray **control_chars, int **size)
81 {
82         MonoError mono_error;
83         mono_error_init (&mono_error);
84
85         g_unsupported_api ("Console");
86
87         mono_error_set_not_supported (&mono_error, G_UNSUPPORTED_API, "Console");
88         mono_error_set_pending_exception (&mono_error);
89
90         SetLastError (ERROR_NOT_SUPPORTED);
91
92         return FALSE;
93 }
94
95 #else /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */
96
97 MONO_EMPTY_SOURCE_FILE (console_win32_uwp);
98 #endif /* G_HAVE_API_SUPPORT(HAVE_UWP_WINAPI_SUPPORT) */