diff options
author | krakjoe <joe.watkins@live.co.uk> | 2014-02-23 07:33:48 +0000 |
---|---|---|
committer | krakjoe <joe.watkins@live.co.uk> | 2014-02-23 07:33:48 +0000 |
commit | 4b738cee2b789228b34bc5ef0f246e325890fd78 (patch) | |
tree | b0ca31f89991bdbbcebb6986bfa24616216851fb /phpdbg_utils.c | |
parent | ee6cc5ba603cfc7204d090a7b93b1cd5094396f4 (diff) | |
download | php-git-4b738cee2b789228b34bc5ef0f246e325890fd78.tar.gz |
set colors working
Diffstat (limited to 'phpdbg_utils.c')
-rw-r--r-- | phpdbg_utils.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/phpdbg_utils.c b/phpdbg_utils.c index d64d9ad686..b32fce3478 100644 --- a/phpdbg_utils.c +++ b/phpdbg_utils.c @@ -67,6 +67,14 @@ const static phpdbg_color_t colors[] = { PHPDBG_COLOR_END }; /* }}} */ +/* {{{ */ +const static phpdbg_element_t elements[] = { + PHPDBG_ELEMENT_D("prompt", PHPDBG_COLOR_PROMPT), + PHPDBG_ELEMENT_D("error", PHPDBG_COLOR_ERROR), + PHPDBG_ELEMENT_D("notice", PHPDBG_COLOR_NOTICE), + PHPDBG_ELEMENT_END +}; /* }}} */ + PHPDBG_API int phpdbg_is_numeric(const char *str) /* {{{ */ { if (!str) @@ -349,6 +357,21 @@ PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */ return colors; } /* }}} */ +PHPDBG_API int phpdbg_get_element(const char *name, size_t len) { + const phpdbg_element_t *element = elements; + + while (element && element->name) { + if (len == element->name_length) { + if (strncasecmp(name, element->name, len) == SUCCESS) { + return element->id; + } + } + element++; + } + + return PHPDBG_COLOR_INVALID; +} + PHPDBG_API void phpdbg_set_prompt(const char *prompt TSRMLS_DC) /* {{{ */ { /* free formatted prompt */ |