diff options
| author | Wez Furlong <wez@php.net> | 2002-10-27 18:15:35 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2002-10-27 18:15:35 +0000 |
| commit | 7a71b3ba38b4030b974a7bfd67182e3c79908c62 (patch) | |
| tree | 32fdd79e661558ca999fb4626d52a61a25b74fd1 /ext/ncurses/ncurses_functions.c | |
| parent | 50dced2eea84ec494fd7efe007035db5d1bb15b4 (diff) | |
| download | php-git-7a71b3ba38b4030b974a7bfd67182e3c79908c62.tar.gz | |
Expose some more ncurses functions.
Diffstat (limited to 'ext/ncurses/ncurses_functions.c')
| -rw-r--r-- | ext/ncurses/ncurses_functions.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c index 81ca3ae479..8252739691 100644 --- a/ext/ncurses/ncurses_functions.c +++ b/ext/ncurses/ncurses_functions.c @@ -583,6 +583,42 @@ PHP_FUNCTION(ncurses_raw) } /* }}} */ +/* {{{ proto long ncurses_meta(resource window, bool 8bit) + Enables/Disable 8-bit meta key information */ +PHP_FUNCTION(ncurses_meta) +{ + zend_bool enable; + zval *handle; + WINDOW **win; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &handle, &enable)==FAILURE) { + return; + } + + FETCH_WINRES(win, &handle); + + RETURN_LONG(meta(*win, enable)); +} +/* }}} */ + +/* {{{ proto long ncurses_werase(resource window) + Erase window contents */ +PHP_FUNCTION(ncurses_werase) +{ + zval *handle; + WINDOW **win; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &handle)==FAILURE) { + return; + } + + FETCH_WINRES(win, &handle); + + RETURN_LONG(werase(*win)); +} +/* }}} */ + + /* {{{ proto bool ncurses_resetty(void) Restores saved terminal state */ PHP_FUNCTION(ncurses_resetty) @@ -1816,6 +1852,27 @@ PHP_FUNCTION(ncurses_getyx) } /* }}} */ +/* {{{ proto void ncurses_getmaxyx(resource window, int &y, int &x) + Returns the size of a window */ +PHP_FUNCTION(ncurses_getmaxyx) +{ + zval **handle, **x, **y; + WINDOW **win; + if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &handle, &y, &x) == FAILURE){ + WRONG_PARAM_COUNT; + } + + FETCH_WINRES(win, handle); + + convert_to_long_ex(x); + convert_to_long_ex(y); + + getmaxyx(*win, Z_LVAL_PP(y), Z_LVAL_PP(x)); +} +/* }}} */ + + + /* {{{ proto int ncurses_wmove(resource window, int y, int x) Moves windows output position */ PHP_FUNCTION(ncurses_wmove) |
