console.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #ifndef PHP_WIN32_CONSOLE_H
  19. #define PHP_WIN32_CONSOLE_H
  20. #ifndef PHP_WINUTIL_API
  21. #ifdef PHP_EXPORTS
  22. # define PHP_WINUTIL_API __declspec(dllexport)
  23. #else
  24. # define PHP_WINUTIL_API __declspec(dllimport)
  25. #endif
  26. #endif
  27. #include "php.h"
  28. #include "php_streams.h"
  29. #include <windows.h>
  30. #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
  31. #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
  32. #endif
  33. /*
  34. Check if a file descriptor associated to a stream is a console
  35. (valid fileno, neither redirected nor piped)
  36. */
  37. PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno);
  38. /*
  39. Check if the console attached to a file descriptor (screen buffer, not STDIN)
  40. has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set
  41. */
  42. PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno);
  43. /*
  44. Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the screen buffer (STDOUT/STDERR)
  45. associated to a file descriptor
  46. */
  47. PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable);
  48. /* Check, whether the program has its own console. If a process was launched
  49. through a GUI, it will have it's own console. For more info see
  50. http://support.microsoft.com/kb/99115 */
  51. PHP_WINUTIL_API BOOL php_win32_console_is_own(void);
  52. #endif
  53. /*
  54. * Local variables:
  55. * tab-width: 4
  56. * c-basic-offset: 4
  57. * End:
  58. * vim600: sw=4 ts=4 fdm=marker
  59. * vim<600: sw=4 ts=4
  60. */