wez Sun Oct 27 13:15:36 2002 EDT Modified files: /php4/ext/ncurses ncurses_fe.c ncurses_functions.c php_ncurses_fe.h Log: Expose some more ncurses functions. Index: php4/ext/ncurses/ncurses_fe.c diff -u php4/ext/ncurses/ncurses_fe.c:1.17 php4/ext/ncurses/ncurses_fe.c:1.18 --- php4/ext/ncurses/ncurses_fe.c:1.17 Sat Sep 28 18:50:23 2002 +++ php4/ext/ncurses/ncurses_fe.c Sun Oct 27 13:15:35 2002 @@ -63,6 +63,7 @@ PHP_FE(ncurses_doupdate, NULL) PHP_FE(ncurses_echo, NULL) PHP_FE(ncurses_erase, NULL) + PHP_FE(ncurses_werase, NULL) PHP_FE(ncurses_erasechar, NULL) PHP_FE(ncurses_flash, NULL) PHP_FE(ncurses_flushinp, NULL) @@ -78,6 +79,7 @@ PHP_FE(ncurses_nonl, NULL) PHP_FE(ncurses_noraw, NULL) PHP_FE(ncurses_raw, NULL) + PHP_FE(ncurses_meta, NULL) PHP_FE(ncurses_resetty, NULL) PHP_FE(ncurses_savetty, NULL) PHP_FE(ncurses_termattrs, NULL) @@ -176,6 +178,7 @@ PHP_FE(ncurses_whline, NULL) PHP_FE(ncurses_wvline, NULL) PHP_FE(ncurses_getyx, secondandthird_args_force_ref) + PHP_FE(ncurses_getmaxyx, secondandthird_args_force_ref) #if HAVE_NCURSES_PANEL PHP_FE(ncurses_update_panels, NULL) Index: php4/ext/ncurses/ncurses_functions.c diff -u php4/ext/ncurses/ncurses_functions.c:1.24 php4/ext/ncurses/ncurses_functions.c:1.25 --- php4/ext/ncurses/ncurses_functions.c:1.24 Sun Sep 29 18:55:09 2002 +++ php4/ext/ncurses/ncurses_functions.c Sun Oct 27 13:15:35 2002 @@ -583,6 +583,42 @@ } /* }}} */ +/* {{{ 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) @@ -1815,6 +1851,27 @@ getyx(*win, Z_LVAL_PP(y), Z_LVAL_PP(x)); } /* }}} */ + +/* {{{ 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 */ Index: php4/ext/ncurses/php_ncurses_fe.h diff -u php4/ext/ncurses/php_ncurses_fe.h:1.17 php4/ext/ncurses/php_ncurses_fe.h:1.18 --- php4/ext/ncurses/php_ncurses_fe.h:1.17 Sat Sep 28 18:50:23 2002 +++ php4/ext/ncurses/php_ncurses_fe.h Sun Oct 27 13:15:35 2002 @@ -48,6 +48,7 @@ PHP_FUNCTION(ncurses_doupdate); PHP_FUNCTION(ncurses_echo); PHP_FUNCTION(ncurses_erase); +PHP_FUNCTION(ncurses_werase); PHP_FUNCTION(ncurses_erasechar); PHP_FUNCTION(ncurses_flash); PHP_FUNCTION(ncurses_flushinp); @@ -63,6 +64,7 @@ PHP_FUNCTION(ncurses_nonl); PHP_FUNCTION(ncurses_noraw); PHP_FUNCTION(ncurses_raw); +PHP_FUNCTION(ncurses_meta); PHP_FUNCTION(ncurses_resetty); PHP_FUNCTION(ncurses_savetty); PHP_FUNCTION(ncurses_termattrs); @@ -162,6 +164,7 @@ PHP_FUNCTION(ncurses_whline); PHP_FUNCTION(ncurses_wvline); PHP_FUNCTION(ncurses_getyx); +PHP_FUNCTION(ncurses_getmaxyx); #if HAVE_NCURSES_PANEL PHP_FUNCTION(ncurses_update_panels); PHP_FUNCTION(ncurses_panel_window);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php