📄 ncurses_functions.c
字号:
IS_NCURSES_INITIALIZED(); RETURN_LONG(noecho());}/* }}} *//* {{{ proto bool ncurses_nonl(void) Do not ranslate newline and carriage return / line feed */PHP_FUNCTION(ncurses_nonl){ RETURN_LONG(nonl());}/* }}} *//* {{{ proto bool ncurses_noraw(void) Switches terminal out of raw mode */PHP_FUNCTION(ncurses_noraw){ IS_NCURSES_INITIALIZED(); RETURN_LONG(noraw());}/* }}} *//* {{{ proto bool ncurses_raw(void) Switches terminal into raw mode */PHP_FUNCTION(ncurses_raw){ IS_NCURSES_INITIALIZED(); RETURN_LONG(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){ IS_NCURSES_INITIALIZED(); RETURN_LONG(resetty());}/* }}} *//* {{{ proto bool ncurses_savetty(void) Saves terminal state */PHP_FUNCTION(ncurses_savetty){ IS_NCURSES_INITIALIZED(); RETURN_LONG(savetty());}/* }}} *//* {{{ proto bool ncurses_termattrs(void) Returns a logical OR of all attribute flags supported by terminal */PHP_FUNCTION(ncurses_termattrs){ IS_NCURSES_INITIALIZED(); RETURN_LONG(termattrs());}/* }}} *//* {{{ proto bool ncurses_use_default_colors(void) Assigns terminal default colors to color id -1 */PHP_FUNCTION(ncurses_use_default_colors){ IS_NCURSES_INITIALIZED(); RETURN_LONG(use_default_colors());}/* }}} *//* {{{ proto bool ncurses_slk_attr(void) Returns current soft label keys attribute */PHP_FUNCTION(ncurses_slk_attr){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_attr());}/* }}} *//* {{{ proto bool ncurses_slk_clear(void) Clears soft label keys from screen */PHP_FUNCTION(ncurses_slk_clear){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_clear());}/* }}} *//* {{{ proto bool ncurses_slk_noutrefresh(void) Copies soft label keys to virtual screen */PHP_FUNCTION(ncurses_slk_noutrefresh){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_noutrefresh());}/* }}} *//* {{{ proto bool ncurses_slk_refresh(void) Copies soft label keys to screen */PHP_FUNCTION(ncurses_slk_refresh){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_refresh());}/* }}} *//* {{{ proto bool ncurses_slk_restore(void) Restores soft label keys */PHP_FUNCTION(ncurses_slk_restore){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_restore());}/* }}} *//* {{{ proto bool ncurses_slk_touch(void) Forces output when ncurses_slk_noutrefresh is performed */PHP_FUNCTION(ncurses_slk_touch){ IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_touch());}/* }}} *//* {{{ proto bool ncurses_slk_set(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; } IS_NCURSES_INITIALIZED(); RETURN_BOOL(slk_set(labelnr, str, format));}/* }}} *//* {{{ proto int ncurses_attroff(int attributes) Turns off the given attributes */PHP_FUNCTION(ncurses_attroff){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(attroff(intarg));}/* }}} *//* {{{ proto int ncurses_attron(int attributes) Turns on the given attributes */PHP_FUNCTION(ncurses_attron){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(attron(intarg));}/* }}} *//* {{{ proto int ncurses_attrset(int attributes) Sets given attributes */PHP_FUNCTION(ncurses_attrset){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(attrset(intarg));}/* }}} *//* {{{ proto int ncurses_bkgd(int attrchar) Sets background property for terminal screen */PHP_FUNCTION(ncurses_bkgd){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(bkgd(intarg));}/* }}} *//* {{{ proto int ncurses_curs_set(int visibility) Sets cursor state */PHP_FUNCTION(ncurses_curs_set){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(curs_set(intarg));}/* }}} *//* {{{ proto int ncurses_delay_output(int milliseconds) Delays output on terminal using padding characters */PHP_FUNCTION(ncurses_delay_output){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(delay_output(intarg));}/* }}} *//* {{{ proto int ncurses_echochar(int character) Single character output including refresh */PHP_FUNCTION(ncurses_echochar){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(echochar(intarg));}/* }}} *//* {{{ proto int ncurses_halfdelay(int tenth) Puts terminal into halfdelay mode */PHP_FUNCTION(ncurses_halfdelay){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(halfdelay(intarg));}/* }}} *//* {{{ proto int ncurses_has_key(int keycode) Checks for presence of a function key on terminal keyboard */PHP_FUNCTION(ncurses_has_key){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(has_key(intarg));}/* }}} *//* {{{ proto int ncurses_insch(int character) Inserts character moving rest of line including character at current position */PHP_FUNCTION(ncurses_insch){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(insch(intarg));}/* }}} *//* {{{ proto int ncurses_insdelln(int count) Inserts lines before current line scrolling down (negative numbers delete and scroll up) */PHP_FUNCTION(ncurses_insdelln){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(insdelln(intarg));}/* }}} *//* {{{ proto int ncurses_mouseinterval(int milliseconds) Sets timeout for mouse button clicks */PHP_FUNCTION(ncurses_mouseinterval){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(mouseinterval(intarg));}/* }}} *//* {{{ proto int ncurses_napms(int milliseconds) Sleep */PHP_FUNCTION(ncurses_napms){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(napms(intarg));}/* }}} *//* {{{ proto int ncurses_scrl(int count) Scrolls window content up or down without changing current position */PHP_FUNCTION(ncurses_scrl){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(scrl(intarg));}/* }}} *//* {{{ proto int ncurses_slk_attroff(int intarg) ??? */PHP_FUNCTION(ncurses_slk_attroff){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_attroff(intarg));}/* }}} *//* {{{ proto int ncurses_slk_attron(int intarg) ??? */PHP_FUNCTION(ncurses_slk_attron){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_attron(intarg));}/* }}} *//* {{{ proto int ncurses_slk_attrset(int intarg) ??? */PHP_FUNCTION(ncurses_slk_attrset){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_attrset(intarg));}/* }}} *//* {{{ proto int ncurses_slk_color(int intarg) Sets color for soft label keys*/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; } IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_color(intarg));#else php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in this build"); RETURN_FALSE;#endif}/* }}} *//* {{{ proto int ncurses_slk_init(int intarg) Inits soft label keys */PHP_FUNCTION(ncurses_slk_init){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(slk_init(intarg));}/* }}} *//* {{{ proto int ncurses_typeahead(int fd) Specifys different filedescriptor for typeahead checking */PHP_FUNCTION(ncurses_typeahead){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(typeahead(intarg));}/* }}} *//* {{{ proto int ncurses_ungetch(int keycode) Puts a character back into the input stream */PHP_FUNCTION(ncurses_ungetch){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(ungetch(intarg));}/* }}} *//* {{{ proto int ncurses_vidattr(int intarg) ??? */PHP_FUNCTION(ncurses_vidattr){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(vidattr(intarg));}/* }}} *//* {{{ proto int ncurses_use_extended_names(bool flag) Controls use of extended names in terminfo descriptions */PHP_FUNCTION(ncurses_use_extended_names){#ifdef HAVE_NCURSES_USE_EXTENDED_NAMES long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(use_extended_names(intarg));#else php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not supported in this build"); RETURN_FALSE;#endif }/* }}} *//* {{{ proto void ncurses_bkgdset(int attrchar) Controls screen background */PHP_FUNCTION(ncurses_bkgdset){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); bkgdset(intarg);}/* }}} *//* {{{ proto int ncurses_filter(void) */PHP_FUNCTION(ncurses_filter){ IS_NCURSES_INITIALIZED(); filter();}/* }}} *//* {{{ proto int ncurses_noqiflush(void) Do not flush on signal characters*/PHP_FUNCTION(ncurses_noqiflush){ IS_NCURSES_INITIALIZED(); noqiflush();}/* }}} *//* {{{ proto int ncurses_qiflush(void) Flushes on signal characters */PHP_FUNCTION(ncurses_qiflush){ IS_NCURSES_INITIALIZED(); qiflush();}/* }}} *//* {{{ proto void ncurses_timeout(int millisec) Sets timeout for special key sequences */PHP_FUNCTION(ncurses_timeout){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); timeout(intarg);}/* }}} *//* {{{ proto void ncurses_use_env(bool flag) Controls use of environment information about terminal size */PHP_FUNCTION(ncurses_use_env){ long intarg; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",&intarg)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); use_env(intarg);}/* }}} *//* {{{ proto int ncurses_addstr(string text) Outputs text at current position */PHP_FUNCTION(ncurses_addstr){ char *str; int str_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",&str,&str_len)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(addstr(str));}/* }}} *//* {{{ proto int ncurses_putp(string text) ??? */PHP_FUNCTION(ncurses_putp){ char *str; int str_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",&str,&str_len)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(putp(str));}/* }}} *//* {{{ proto int ncurses_scr_dump(string filename) Dumps screen content to file */PHP_FUNCTION(ncurses_scr_dump){ char *str; int str_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",&str,&str_len)==FAILURE) { return; } IS_NCURSES_INITIALIZED(); RETURN_LONG(scr_dump(str));}/* }}} *//* {{{ proto int ncurses_scr_init(string filename) Initializes screen from file dump */PHP_FUNCTION(ncurses_scr_init){ char *str;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -