mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
- Added more colors
This commit is contained in:
parent
8589c0af91
commit
5b89e181aa
1 changed files with 15 additions and 7 deletions
22
phpdbg_set.c
22
phpdbg_set.c
|
@ -61,14 +61,22 @@ const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
|
|||
|
||||
void phpdbg_set_prompt_color(const char *color TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if (memcmp(color, PHPDBG_STRL("blue")) == 0) {
|
||||
PHPDBG_G(prompt_color) = estrndup("blue", sizeof("blue")-1);
|
||||
phpdbg_set_prompt(PHPDBG_G(prompt_raw), "0;34" TSRMLS_CC);
|
||||
} else if (memcmp(color, PHPDBG_STRL("green")) == 0) {
|
||||
PHPDBG_G(prompt_color) = estrndup("green", sizeof("green")-1);
|
||||
phpdbg_set_prompt(PHPDBG_G(prompt_raw), "0;32" TSRMLS_CC);
|
||||
}
|
||||
static const char *colors[] = {
|
||||
"blue", "0;34",
|
||||
"green", "0;32",
|
||||
"red", "0;31",
|
||||
"cyan", "0;36",
|
||||
"purple", "0;35",
|
||||
NULL, NULL
|
||||
};
|
||||
const char **p = colors;
|
||||
|
||||
do {
|
||||
if (memcmp(color, *p, strlen(*p)+1) == 0) {
|
||||
PHPDBG_G(prompt_color) = estrdup(*p);
|
||||
phpdbg_set_prompt(PHPDBG_G(prompt_raw), *(p+1) TSRMLS_CC);
|
||||
}
|
||||
} while (++p && *(++p));
|
||||
} /* }}} */
|
||||
|
||||
const char* phpdbg_get_prompt_color(TSRMLS_D) /* {{{ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue