mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
Work in progress chekpoint of changes to help module. To allow peer review and feedback
This commit is contained in:
parent
261a5305c6
commit
88bd558a73
16 changed files with 948 additions and 723 deletions
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#ifdef _WIN32
|
||||
# include "win32/time.h"
|
||||
#elif defined(HAVE_SYS_IOCTL_H)
|
||||
# include "sys/ioctl.h"
|
||||
#endif
|
||||
|
||||
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
|
||||
|
|
@ -385,3 +387,22 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
|
|||
|
||||
return PHPDBG_G(prompt)[1];
|
||||
} /* }}} */
|
||||
|
||||
PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
int columns;
|
||||
#ifdef _win32
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
|
||||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
|
||||
columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
|
||||
#elif defined(HAVE_SYS_IOCTL_H)
|
||||
struct winsize w;
|
||||
|
||||
columns = ioctl(fileno(stdout), TIOCGWINSZ, &w) == 0 ? w.ws_col : 100;
|
||||
#else
|
||||
columns = 100;
|
||||
#endif
|
||||
return columns;
|
||||
} /* }}} */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue