diff options
author | Felipe Pena <felipensp@gmail.com> | 2015-10-18 12:08:04 -0200 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2015-10-18 12:08:04 -0200 |
commit | f231ddddafa005576e90f9325d31eebc9ea690bf (patch) | |
tree | 38452a7e230501a6e01fcd3206355005e9745343 /sapi/phpdbg/phpdbg_set.c | |
parent | daddb7a832309bb26858d3c069ecf29c0994dbd7 (diff) | |
download | php-git-f231ddddafa005576e90f9325d31eebc9ea690bf.tar.gz |
- Implemented output paging
Diffstat (limited to 'sapi/phpdbg/phpdbg_set.c')
-rw-r--r-- | sapi/phpdbg/phpdbg_set.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index f91156a452..5af2c593c8 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -32,6 +32,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg); const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(prompt, "usage: set prompt [<string>]", 'p', set_prompt, NULL, "|s", 0), + PHPDBG_SET_COMMAND_D(pagination, "usage: set pagination [<on|off>]", 'P', set_pagination, NULL, "|b", PHPDBG_ASYNC_SAFE), #ifndef _WIN32 PHPDBG_SET_COMMAND_D(color, "usage: set color <element> <color>", 'c', set_color, NULL, "ss", PHPDBG_ASYNC_SAFE), PHPDBG_SET_COMMAND_D(colors, "usage: set colors [<on|off>]", 'C', set_colors, NULL, "|b", PHPDBG_ASYNC_SAFE), @@ -42,6 +43,7 @@ const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(quiet, "usage: set quiet [<on|off>]", 'q', set_quiet, NULL, "|b", PHPDBG_ASYNC_SAFE), PHPDBG_SET_COMMAND_D(stepping, "usage: set stepping [<line|op>]", 's', set_stepping, NULL, "|s", PHPDBG_ASYNC_SAFE), PHPDBG_SET_COMMAND_D(refcount, "usage: set refcount [<on|off>]", 'r', set_refcount, NULL, "|b", PHPDBG_ASYNC_SAFE), + PHPDBG_SET_COMMAND_D(lines, "usage: set lines [<number>]", 'l', set_lines, NULL, "|l", PHPDBG_ASYNC_SAFE), PHPDBG_END_COMMAND }; @@ -56,6 +58,42 @@ PHPDBG_SET(prompt) /* {{{ */ return SUCCESS; } /* }}} */ +PHPDBG_SET(pagination) /* {{{ */ +{ + if (!param || param->type == EMPTY_PARAM) { + phpdbg_writeln("setpagination", "active=\"%s\"", "Pagination %s", PHPDBG_G(flags) & PHPDBG_HAS_PAGINATION ? "on" : "off"); + } else switch (param->type) { + case NUMERIC_PARAM: { + if (param->num) { + PHPDBG_G(flags) |= PHPDBG_HAS_PAGINATION; + } else { + PHPDBG_G(flags) &= ~PHPDBG_HAS_PAGINATION; + } + } break; + + default: + phpdbg_error("setpagination", "type=\"wrongargs\"", "set pagination used incorrectly: set pagination <on|off>"); + } + + return SUCCESS; +} /* }}} */ + +PHPDBG_SET(lines) /* {{{ */ +{ + if (!param || param->type == EMPTY_PARAM) { + phpdbg_writeln("setlines", "active=\"%s\"", "Lines %ld", PHPDBG_G(lines)); + } else switch (param->type) { + case NUMERIC_PARAM: { + PHPDBG_G(lines) = param->num; + } break; + + default: + phpdbg_error("setlines", "type=\"wrongargs\"", "set lines used incorrectly: set lines <number>"); + } + + return SUCCESS; +} /* }}} */ + PHPDBG_SET(break) /* {{{ */ { switch (param->type) { |