xref: /PHP-7.2/win32/console.h (revision 7a7ec01a)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2018 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Author: Michele Locati <mlocati@gmail.com>                           |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
20 
21 #ifndef PHP_WIN32_CONSOLE_H
22 #define PHP_WIN32_CONSOLE_H
23 
24 #ifndef PHP_WINUTIL_API
25 #ifdef PHP_EXPORTS
26 # define PHP_WINUTIL_API __declspec(dllexport)
27 #else
28 # define PHP_WINUTIL_API __declspec(dllimport)
29 #endif
30 #endif
31 
32 #include "php.h"
33 #include "php_streams.h"
34 #include <windows.h>
35 
36 #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
37 #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
38 #endif
39 
40 
41 /*
42 Check if a file descriptor associated to a stream is a console
43 (valid fileno, neither redirected nor piped)
44 */
45 PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno);
46 
47 /*
48 Check if the console attached to a file descriptor (screen buffer, not STDIN)
49 has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set
50 */
51 PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno);
52 
53 /*
54 Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the screen buffer (STDOUT/STDERR)
55 associated to a file descriptor
56 */
57 PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable);
58 
59 /* Check, whether the program has its own console. If a process was launched
60 	through a GUI, it will have it's own console. For more info see
61 	http://support.microsoft.com/kb/99115 */
62 PHP_WINUTIL_API BOOL php_win32_console_is_own(void);
63 
64 #endif
65 
66 /*
67  * Local variables:
68  * tab-width: 4
69  * c-basic-offset: 4
70  * End:
71  * vim600: sw=4 ts=4 fdm=marker
72  * vim<600: sw=4 ts=4
73  */
74