diff options
author | Wez Furlong <wez@php.net> | 2002-09-28 22:50:23 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-09-28 22:50:23 +0000 |
commit | 18f94ecea48f91117ad12c237ad3c09b329ccd79 (patch) | |
tree | d3266805cf00324561a64d6b74f788e9a43de514 /ext | |
parent | 4f43b74fb889c0998a5a55546a36a0f6e4d86ccd (diff) | |
download | php-git-18f94ecea48f91117ad12c237ad3c09b329ccd79.tar.gz |
Added ncurses_getyx().
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ncurses/ncurses_fe.c | 1 | ||||
-rw-r--r-- | ext/ncurses/ncurses_functions.c | 18 | ||||
-rw-r--r-- | ext/ncurses/php_ncurses_fe.h | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/ext/ncurses/ncurses_fe.c b/ext/ncurses/ncurses_fe.c index 6f56a59341..c19e97c508 100644 --- a/ext/ncurses/ncurses_fe.c +++ b/ext/ncurses/ncurses_fe.c @@ -175,6 +175,7 @@ function_entry ncurses_functions[] = { PHP_FE(ncurses_wborder, NULL) PHP_FE(ncurses_whline, NULL) PHP_FE(ncurses_wvline, NULL) + PHP_FE(ncurses_getyx, secondandthird_args_force_ref) #if HAVE_NCURSES_PANEL PHP_FE(ncurses_update_panels, NULL) diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c index ef4f4d9b95..e4838271ef 100644 --- a/ext/ncurses/ncurses_functions.c +++ b/ext/ncurses/ncurses_functions.c @@ -1797,6 +1797,24 @@ PHP_FUNCTION(ncurses_wmouse_trafo) } /* }}} */ +/* {{{ proto void ncurses_getyx(resource window, int &y, int &x) + Returns the current cursor position for a window */ +PHP_FUNCTION(ncurses_getyx) +{ + 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); + + getyx(*win, Z_LVAL_PP(y), Z_LVAL_PP(x)); +} +/* }}} */ /* {{{ proto int ncurses_wmove(resource window, int y, int x) Moves windows output position */ diff --git a/ext/ncurses/php_ncurses_fe.h b/ext/ncurses/php_ncurses_fe.h index 4facad7d25..49247fbd4a 100644 --- a/ext/ncurses/php_ncurses_fe.h +++ b/ext/ncurses/php_ncurses_fe.h @@ -161,6 +161,7 @@ PHP_FUNCTION(ncurses_waddch); PHP_FUNCTION(ncurses_wborder); PHP_FUNCTION(ncurses_whline); PHP_FUNCTION(ncurses_wvline); +PHP_FUNCTION(ncurses_getyx); #if HAVE_NCURSES_PANEL PHP_FUNCTION(ncurses_update_panels); PHP_FUNCTION(ncurses_panel_window); |