Patch patch_commit_9cf169630e1f.patch for ncurses Bug #64182
Patch version 2013-02-10 11:53 UTC
Return to Bug #64182 |
Download this patch
Patch Revisions:
Developer: harald.lapp@gmail.com
diff --git a/ncurses_fe.c b/ncurses_fe.c
index 3b523df6f9190984ce8a06ae954b15a07dd6d1af..8a200b72f50b1122cb6300e93ba82325101e8a35 100644
--- a/ncurses_fe.c
+++ b/ncurses_fe.c
@@ -205,6 +205,10 @@ zend_function_entry ncurses_functions[] = {
PHP_FE(ncurses_waddstr, NULL)
PHP_FE(ncurses_wnoutrefresh, NULL)
PHP_FE(ncurses_wclear, NULL)
+ PHP_FE(ncurses_wscrl, NULL)
+ PHP_FE(ncurses_wsetscrreg, NULL)
+ PHP_FE(ncurses_scrollok, NULL)
+
#ifdef HAVE_NCURSES_COLOR_SET
PHP_FE(ncurses_wcolor_set, NULL)
#endif
diff --git a/ncurses_functions.c b/ncurses_functions.c
index 90f6ed563fbbe7bd15240b212d2719c902497b37..2b10ed1c70bb760f1498fe97778094363eb73337 100644
--- a/ncurses_functions.c
+++ b/ncurses_functions.c
@@ -1761,6 +1761,66 @@ PHP_FUNCTION(ncurses_wrefresh)
}
/* }}} */
+/* {{{ proto int ncurses_wscrl(resource window, int count)
+ Scrolls window content up or down without changing current position */
+PHP_FUNCTION(ncurses_wscrl)
+{
+ zval *handle;
+ long intarg;
+ WINDOW **w;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &handle, &intarg) == FAILURE) {
+ return;
+ }
+
+ IS_NCURSES_INITIALIZED();
+
+ FETCH_WINRES(w, &handle);
+
+ RETURN_LONG(wscrl(*w, intarg));
+}
+/* }}} */
+
+/* {{{ proto int ncurses_wsetscrreg(resource window, int top, int bot)
+ Set region for scrolling */
+PHP_FUNCTION(ncurses_wsetscrreg)
+{
+ zval *handle;
+ long top, bot;
+ WINDOW **w;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &handle, &top, &bot) == FAILURE) {
+ return;
+ }
+
+ IS_NCURSES_INITIALIZED();
+
+ FETCH_WINRES(w, &handle);
+
+ RETURN_LONG(wsetscrreg(*w, top, bot));
+}
+/* }}} */
+
+/* {{{ proto int ncurses_scrollok(resource window, bool bf)
+ Enable or disable scrolling of window content */
+PHP_FUNCTION(ncurses_scrollok)
+{
+ zval *handle;
+ zend_bool bf;
+ WINDOW **w;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &handle, &bf) == FAILURE) {
+ return;
+ }
+
+ IS_NCURSES_INITIALIZED();
+
+ FETCH_WINRES(w, &handle);
+
+ RETURN_LONG(scrollok(*w, bf));
+}
+/* }}} */
+
/* {{{ proto string ncurses_termname(void)
Returns terminal name */
PHP_FUNCTION(ncurses_termname)
diff --git a/php_ncurses_fe.h b/php_ncurses_fe.h
index 42eb203fe9b258ebcd5ffcaa39e8b08bb17053bd..11ecb349787a57aa759cf90971b7fa7bf409a84d 100644
--- a/php_ncurses_fe.h
+++ b/php_ncurses_fe.h
@@ -158,6 +158,9 @@ PHP_FUNCTION(ncurses_newpad);
PHP_FUNCTION(ncurses_prefresh);
PHP_FUNCTION(ncurses_pnoutrefresh);
+PHP_FUNCTION(ncurses_wscrl);
+PHP_FUNCTION(ncurses_wsetscrreg);
+PHP_FUNCTION(ncurses_scrollok);
PHP_FUNCTION(ncurses_wstandout);
PHP_FUNCTION(ncurses_wstandend);
PHP_FUNCTION(ncurses_wattrset);
|