com php-src: Make set commands more consistent: phpdbg_set. c phpdbg_utils.c
| From: | Bob Weinand | Date: | Thu, 25 Sep 2014 19:25:18 +0000 |
| Subject: | com php-src: Make set commands more consistent: phpdbg_set. c phpdbg_utils.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82612@lists.php.net to get a copy of this message | ||
Commit: 7beb17f2fd796f5bc5dc0ce7d6afc42122d9e3c3
Author: Bob Weinand <bobwei9@hotmail.com> Thu, 25 Sep 2014 21:25:18 +0200
Parents: 1ad0287499772e4411fb0bcaf607937d6871000f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7beb17f2fd796f5bc5dc0ce7d6afc42122d9e3c3
Log:
Make set commands more consistent
Changed paths:
M phpdbg_set.c
M phpdbg_utils.c
Diff:
diff --git a/phpdbg_set.c b/phpdbg_set.c
index da85071..2efe8ea 100644
--- a/phpdbg_set.c
+++ b/phpdbg_set.c
@@ -48,7 +48,7 @@ const phpdbg_command_t phpdbg_set_commands[] = {
PHPDBG_SET(prompt) /* {{{ */
{
if (!param || param->type == EMPTY_PARAM) {
- phpdbg_writeln("prompt", "str=\"%s\"", "Current prompt:
%s", phpdbg_get_prompt(TSRMLS_C));
+ phpdbg_writeln("setprompt", "str=\"%s\"", "Current prompt:
%s", phpdbg_get_prompt(TSRMLS_C));
} else {
phpdbg_set_prompt(param->str TSRMLS_CC);
}
@@ -107,12 +107,12 @@ PHPDBG_SET(breaks) /* {{{ */
PHPDBG_SET(color) /* {{{ */
{
const phpdbg_color_t *color = phpdbg_get_color(param->next->str, param->next->len
TSRMLS_CC);
-
+
if (!color) {
phpdbg_error("setcolor", "type=\"nocolor\"", "Failed to find
the requested color (%s)", param->next->str);
return SUCCESS;
}
-
+
switch (phpdbg_get_element(param->str, param->len TSRMLS_CC)) {
case PHPDBG_COLOR_PROMPT:
phpdbg_notice("setcolor", "type=\"prompt\" color=\"%s\"
code=\"%s\"", "setting prompt color to %s (%s)", color->name,
color->code);
@@ -122,19 +122,19 @@ PHPDBG_SET(color) /* {{{ */
}
phpdbg_set_color(PHPDBG_COLOR_PROMPT, color TSRMLS_CC);
break;
-
+
case PHPDBG_COLOR_ERROR:
phpdbg_notice("setcolor", "type=\"error\" color=\"%s\"
code=\"%s\"", "setting error color to %s (%s)", color->name,
color->code);
phpdbg_set_color(PHPDBG_COLOR_ERROR, color TSRMLS_CC);
break;
-
+
case PHPDBG_COLOR_NOTICE:
phpdbg_notice("setcolor", "type=\"notice\" color=\"%s\"
code=\"%s\"", "setting notice color to %s (%s)", color->name,
color->code);
phpdbg_set_color(PHPDBG_COLOR_NOTICE, color TSRMLS_CC);
break;
-
+
default:
- phpdbg_error("setcolor", "type=\"invalidelement\"", "Failed
to find the requested element (%s)", param->str);
+ phpdbg_error("setcolor", "type=\"invalidtype\"", "Failed to
find the requested element (%s)", param->str);
}
return SUCCESS;
@@ -152,7 +152,7 @@ PHPDBG_SET(colors) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IS_COLOURED;
}
} break;
-
+
default:
phpdbg_error("setcolors", "type=\"wrongargs\"", "set colors
used incorrectly: set colors <on|off>");
}
@@ -172,7 +172,7 @@ PHPDBG_SET(oplog) /* {{{ */
PHPDBG_G(oplog) = fopen(param->str, "w+");
if (!PHPDBG_G(oplog)) {
- phpdbg_error("setoplog", "file=\"%s\"", "Failed to open %s
for oplog", param->str);
+ phpdbg_error("setoplog", "type=\"openfailure\"
file=\"%s\"", "Failed to open %s for oplog", param->str);
PHPDBG_G(oplog) = old;
} else {
if (old) {
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index d6b7525..bec222e 100644
--- a/phpdbg_utils.c
+++ b/phpdbg_utils.c
@@ -1383,7 +1383,7 @@ PHPDBG_API const phpdbg_color_t* phpdbg_get_colors(TSRMLS_D) /* {{{ */
PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) {
const phpdbg_element_t *element = elements;
-
+
while (element && element->name) {
if (len == element->name_length) {
if (strncasecmp(name, element->name, len) == SUCCESS) {
@@ -1392,7 +1392,7 @@ PHPDBG_API int phpdbg_get_element(const char *name, size_t len TSRMLS_DC) {
}
element++;
}
-
+
return PHPDBG_COLOR_INVALID;
}
@@ -1441,7 +1441,7 @@ PHPDBG_API const char *phpdbg_get_prompt(TSRMLS_D) /* {{{ */
int phpdbg_rebuild_symtable(TSRMLS_D) {
if (!EG(active_op_array)) {
- phpdbg_error("symtable", "type=\"noops\"", "No active op
array!");
+ phpdbg_error("inactive", "type=\"op_array\"", "No active op
array!");
return FAILURE;
}
@@ -1449,7 +1449,7 @@ int phpdbg_rebuild_symtable(TSRMLS_D) {
zend_rebuild_symbol_table(TSRMLS_C);
if (!EG(active_symbol_table)) {
- phpdbg_error("symtable", "type=\"nosymtable\"", "No active
symbol table!");
+ phpdbg_error("inactive", "type=\"symbol_table\"", "No active
symbol table!");
return FAILURE;
}
}
@@ -1459,7 +1459,7 @@ int phpdbg_rebuild_symtable(TSRMLS_D) {
PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D) /* {{{ */
{
- int columns;
+ int columns;
#ifdef _WIN32
CONSOLE_SCREEN_BUFFER_INFO csbi;