diff options
author | Georg Richter <georg@php.net> | 2001-12-29 11:48:30 +0000 |
---|---|---|
committer | Georg Richter <georg@php.net> | 2001-12-29 11:48:30 +0000 |
commit | df9dc889e02319a20fb6aaec83089c5acd0a2b1e (patch) | |
tree | 85453e00b30c7d7ccc96f19d705051fb279ca139 /ext/ncurses/ncurses_functions.c | |
parent | c6f1e68e75e12119006e85b6e2fc090dba9c40cb (diff) | |
download | php-git-df9dc889e02319a20fb6aaec83089c5acd0a2b1e.tar.gz |
1) fixed bugs in soft label key functions
2) insert new slk-functions
3) defined new key-constants
Diffstat (limited to 'ext/ncurses/ncurses_functions.c')
-rw-r--r-- | ext/ncurses/ncurses_functions.c | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c index aa59a7328c..3be74f6ba0 100644 --- a/ext/ncurses/ncurses_functions.c +++ b/ext/ncurses/ncurses_functions.c @@ -471,6 +471,9 @@ PHP_FUNCTION(ncurses_use_default_colors) } /* }}} */ +/* {{{ proto bool ncurses_slk_clear(void) + */ + /* {{{ proto bool ncurses_slk_attr(void) */ PHP_FUNCTION(ncurses_slk_attr) @@ -519,6 +522,23 @@ PHP_FUNCTION(ncurses_slk_touch) } /* }}} */ +/* {{{ proto bool ncurses_slk_init(int labelnr, string label, int format) + sets function key labels */ +PHP_FUNCTION(ncurses_slk_set) +{ + char *str; + int len; + long labelnr; + long format; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lsl",&labelnr, &str, &len, &format)==FAILURE) { + return; + } + RETURN_BOOL(slk_set(labelnr, str, format)); +} +/* }}} */ + + /* {{{ proto int ncurses_attroff(int attributes) Turn off the given attributes */ PHP_FUNCTION(ncurses_attroff) @@ -626,7 +646,7 @@ PHP_FUNCTION(ncurses_halfdelay) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } - + RETURN_LONG(halfdelay(intarg)); } /* }}} */ @@ -763,7 +783,7 @@ PHP_FUNCTION(ncurses_slk_color) { #ifdef HAVE_NCURSES_SLK_COLOR long intarg; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } @@ -772,7 +792,7 @@ PHP_FUNCTION(ncurses_slk_color) #else php_error(E_WARNING,"%s not supported in this build"); RETURN_FALSE; -#endif +#endif } /* }}} */ @@ -781,7 +801,7 @@ PHP_FUNCTION(ncurses_slk_color) PHP_FUNCTION(ncurses_slk_init) { long intarg; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } @@ -795,7 +815,7 @@ PHP_FUNCTION(ncurses_slk_init) PHP_FUNCTION(ncurses_typeahead) { long intarg; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } @@ -809,7 +829,7 @@ PHP_FUNCTION(ncurses_typeahead) PHP_FUNCTION(ncurses_ungetch) { long intarg; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } @@ -908,7 +928,7 @@ PHP_FUNCTION(ncurses_timeout) PHP_FUNCTION(ncurses_use_env) { long intarg; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } @@ -1447,7 +1467,7 @@ PHP_FUNCTION(ncurses_mousemask) } /* }}} */ -/* {{{ proto int ncurses_getmouse(array mevent) +/* {{{ proto bool ncurses_getmouse(array mevent) Reads mouse event from queue */ PHP_FUNCTION(ncurses_getmouse) { @@ -1470,12 +1490,12 @@ PHP_FUNCTION(ncurses_getmouse) add_assoc_long(*arg, "z", mevent.z); add_assoc_long(*arg, "mmask", mevent.bstate); - RETURN_LONG(retval); + RETURN_BOOL(retval); } /* }}} */ /* {{{ proto int ncurses_ungetmouse(array mevent) - push mouse event to queue */ + pushes mouse event to queue */ PHP_FUNCTION(ncurses_ungetmouse) { zval **arg, **pvalue; |