diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-12-24 17:20:33 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-12-24 17:20:33 +0000 |
commit | 59b6ffee1ef833543b76e831d5fac19ba68b7f39 (patch) | |
tree | b4c9b02481e484dbc3dba49b19491f371a63fbc2 /ext/ncurses/ncurses_fe.c | |
parent | eb668bcd9b2f33cae1ba4495ba6f7f350d56359a (diff) | |
download | php-git-59b6ffee1ef833543b76e831d5fac19ba68b7f39.tar.gz |
A variety of CS style fixes, which include:
* Changed all argument parsing to use the new zend_parse_parameters()
* If a function is unavailable due to lack of support for a certain feature,
do not make the function avaliable, rather then making it print an error
saying that the functionality offered by the function is not avaliable.
* Lots of WS fixes all over the file.
* Change strcpy() to strncpy() to prevent possible buffer overflows.
Fixed a bug in ncurses_pair_content(), 1st parameter was wrong.
Fixed several function prototypes that failed to indicate that functions
accepted arguments by reference.
Diffstat (limited to 'ext/ncurses/ncurses_fe.c')
-rw-r--r-- | ext/ncurses/ncurses_fe.c | 288 |
1 files changed, 149 insertions, 139 deletions
diff --git a/ext/ncurses/ncurses_fe.c b/ext/ncurses/ncurses_fe.c index 4e0da6ff46..1598b8196d 100644 --- a/ext/ncurses/ncurses_fe.c +++ b/ext/ncurses/ncurses_fe.c @@ -36,154 +36,164 @@ static unsigned char second_thru_fourth_args_force_ref[] = {4, BYREF_NONE, BYREF * Every user visible function must have an entry in ncurses_functions[]. */ function_entry ncurses_functions[] = { - PHP_FE(ncurses_addch, NULL) - PHP_FE(ncurses_color_set, NULL) - PHP_FE(ncurses_delwin, NULL) - PHP_FE(ncurses_end, NULL) - PHP_FE(ncurses_getch, NULL) - PHP_FE(ncurses_has_colors, NULL) - PHP_FE(ncurses_init, NULL) - PHP_FE(ncurses_init_pair, NULL) - PHP_FE(ncurses_color_content, second_thru_fourth_args_force_ref) - PHP_FE(ncurses_pair_content, secondandthird_args_force_ref) - PHP_FE(ncurses_move, NULL) - PHP_FE(ncurses_newwin, NULL) - PHP_FE(ncurses_refresh, NULL) - PHP_FE(ncurses_start_color, NULL) - PHP_FE(ncurses_standout, NULL) - PHP_FE(ncurses_standend, NULL) - PHP_FE(ncurses_baudrate, NULL) - PHP_FE(ncurses_beep, NULL) - PHP_FE(ncurses_can_change_color, NULL) - PHP_FE(ncurses_cbreak, NULL) - PHP_FE(ncurses_clear, NULL) - PHP_FE(ncurses_clrtobot, NULL) - PHP_FE(ncurses_clrtoeol, NULL) - PHP_FE(ncurses_def_prog_mode, NULL) - PHP_FE(ncurses_reset_prog_mode, NULL) - PHP_FE(ncurses_def_shell_mode, NULL) - PHP_FE(ncurses_reset_shell_mode, NULL) - PHP_FE(ncurses_delch, NULL) - PHP_FE(ncurses_deleteln, NULL) - 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) - PHP_FE(ncurses_has_ic, NULL) - PHP_FE(ncurses_has_il, NULL) - PHP_FE(ncurses_inch, NULL) - PHP_FE(ncurses_insertln, NULL) - PHP_FE(ncurses_isendwin, NULL) - PHP_FE(ncurses_killchar, NULL) - PHP_FE(ncurses_nl, NULL) - PHP_FE(ncurses_nocbreak, NULL) - PHP_FE(ncurses_noecho, NULL) - 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) - PHP_FE(ncurses_use_default_colors, NULL) - PHP_FE(ncurses_slk_attr, NULL) - PHP_FE(ncurses_slk_clear, NULL) - PHP_FE(ncurses_slk_noutrefresh, NULL) - PHP_FE(ncurses_slk_refresh, NULL) - PHP_FE(ncurses_slk_restore, NULL) - PHP_FE(ncurses_slk_touch, NULL) - PHP_FE(ncurses_attroff, NULL) - PHP_FE(ncurses_attron, NULL) - PHP_FE(ncurses_attrset, NULL) - PHP_FE(ncurses_bkgd, NULL) - PHP_FE(ncurses_curs_set, NULL) - PHP_FE(ncurses_delay_output, NULL) - PHP_FE(ncurses_echochar, NULL) - PHP_FE(ncurses_halfdelay, NULL) - PHP_FE(ncurses_has_key, NULL) - PHP_FE(ncurses_insch, NULL) - PHP_FE(ncurses_insdelln, NULL) - PHP_FE(ncurses_mouseinterval, NULL) - PHP_FE(ncurses_napms, NULL) - PHP_FE(ncurses_scrl, NULL) - PHP_FE(ncurses_slk_attroff, NULL) - PHP_FE(ncurses_slk_attron, NULL) - PHP_FE(ncurses_slk_attrset, NULL) - PHP_FE(ncurses_slk_color, NULL) - PHP_FE(ncurses_slk_init, NULL) - PHP_FE(ncurses_slk_set, NULL) - PHP_FE(ncurses_typeahead, NULL) - PHP_FE(ncurses_ungetch, NULL) - PHP_FE(ncurses_vidattr, NULL) - PHP_FE(ncurses_wrefresh, NULL) - PHP_FE(ncurses_use_extended_names, NULL) - PHP_FE(ncurses_bkgdset, NULL) - PHP_FE(ncurses_filter, NULL) - PHP_FE(ncurses_noqiflush, NULL) - PHP_FE(ncurses_qiflush, NULL) - PHP_FE(ncurses_timeout, NULL) - PHP_FE(ncurses_use_env, NULL) - PHP_FE(ncurses_addstr, NULL) - PHP_FE(ncurses_putp, NULL) - PHP_FE(ncurses_scr_dump, NULL) - PHP_FE(ncurses_scr_init, NULL) - PHP_FE(ncurses_scr_restore, NULL) - PHP_FE(ncurses_scr_set, NULL) - PHP_FE(ncurses_mvaddch, NULL) - PHP_FE(ncurses_mvaddchnstr, NULL) - PHP_FE(ncurses_addchnstr, NULL) - PHP_FE(ncurses_mvaddchstr, NULL) - PHP_FE(ncurses_addchstr, NULL) - PHP_FE(ncurses_mvaddnstr, NULL) - PHP_FE(ncurses_addnstr, NULL) - PHP_FE(ncurses_mvaddstr, NULL) - PHP_FE(ncurses_mvdelch, NULL) - PHP_FE(ncurses_mvgetch, NULL) - PHP_FE(ncurses_mvinch, NULL) - PHP_FE(ncurses_mvwaddstr, NULL) - PHP_FE(ncurses_insstr, NULL) - PHP_FE(ncurses_instr, first_args_force_ref) - PHP_FE(ncurses_mvhline, NULL) - PHP_FE(ncurses_mvcur, NULL) - PHP_FE(ncurses_init_color, NULL) - PHP_FE(ncurses_border, NULL) - PHP_FE(ncurses_assume_default_colors, NULL) - PHP_FE(ncurses_define_key, NULL) - PHP_FE(ncurses_hline, NULL) - PHP_FE(ncurses_vline, NULL) - PHP_FE(ncurses_keyok, NULL) - PHP_FE(ncurses_termname, NULL) - PHP_FE(ncurses_longname, NULL) - PHP_FE(ncurses_mousemask, second_args_force_ref) - PHP_FE(ncurses_getmouse, first_args_force_ref) - PHP_FE(ncurses_ungetmouse, NULL) - PHP_FE(ncurses_mouse_trafo, firstandsecond_args_force_ref) - PHP_FE(ncurses_wmouse_trafo, secondandthird_args_force_ref) - PHP_FE(ncurses_waddstr, NULL) - PHP_FE(ncurses_wnoutrefresh, NULL) - PHP_FE(ncurses_wclear, NULL) - PHP_FE(ncurses_wcolor_set, NULL) - PHP_FE(ncurses_wgetch, NULL) - PHP_FE(ncurses_keypad, NULL) - PHP_FE(ncurses_wmove, NULL) + PHP_FE(ncurses_addch, NULL) +#ifdef HAVE_NCURSES_COLOR_SET + PHP_FE(ncurses_color_set, NULL) +#endif + PHP_FE(ncurses_delwin, NULL) + PHP_FE(ncurses_end, NULL) + PHP_FE(ncurses_getch, NULL) + PHP_FE(ncurses_has_colors, NULL) + PHP_FE(ncurses_init, NULL) + PHP_FE(ncurses_init_pair, NULL) + PHP_FE(ncurses_color_content, second_thru_fourth_args_force_ref) + PHP_FE(ncurses_pair_content, secondandthird_args_force_ref) + PHP_FE(ncurses_move, NULL) + PHP_FE(ncurses_newwin, NULL) + PHP_FE(ncurses_refresh, NULL) + PHP_FE(ncurses_start_color, NULL) + PHP_FE(ncurses_standout, NULL) + PHP_FE(ncurses_standend, NULL) + PHP_FE(ncurses_baudrate, NULL) + PHP_FE(ncurses_beep, NULL) + PHP_FE(ncurses_can_change_color, NULL) + PHP_FE(ncurses_cbreak, NULL) + PHP_FE(ncurses_clear, NULL) + PHP_FE(ncurses_clrtobot, NULL) + PHP_FE(ncurses_clrtoeol, NULL) + PHP_FE(ncurses_def_prog_mode, NULL) + PHP_FE(ncurses_reset_prog_mode, NULL) + PHP_FE(ncurses_def_shell_mode, NULL) + PHP_FE(ncurses_reset_shell_mode, NULL) + PHP_FE(ncurses_delch, NULL) + PHP_FE(ncurses_deleteln, NULL) + 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) + PHP_FE(ncurses_has_ic, NULL) + PHP_FE(ncurses_has_il, NULL) + PHP_FE(ncurses_inch, NULL) + PHP_FE(ncurses_insertln, NULL) + PHP_FE(ncurses_isendwin, NULL) + PHP_FE(ncurses_killchar, NULL) + PHP_FE(ncurses_nl, NULL) + PHP_FE(ncurses_nocbreak, NULL) + PHP_FE(ncurses_noecho, NULL) + 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) + PHP_FE(ncurses_use_default_colors, NULL) + PHP_FE(ncurses_slk_attr, NULL) + PHP_FE(ncurses_slk_clear, NULL) + PHP_FE(ncurses_slk_noutrefresh, NULL) + PHP_FE(ncurses_slk_refresh, NULL) + PHP_FE(ncurses_slk_restore, NULL) + PHP_FE(ncurses_slk_touch, NULL) + PHP_FE(ncurses_attroff, NULL) + PHP_FE(ncurses_attron, NULL) + PHP_FE(ncurses_attrset, NULL) + PHP_FE(ncurses_bkgd, NULL) + PHP_FE(ncurses_curs_set, NULL) + PHP_FE(ncurses_delay_output, NULL) + PHP_FE(ncurses_echochar, NULL) + PHP_FE(ncurses_halfdelay, NULL) + PHP_FE(ncurses_has_key, NULL) + PHP_FE(ncurses_insch, NULL) + PHP_FE(ncurses_insdelln, NULL) + PHP_FE(ncurses_mouseinterval, NULL) + PHP_FE(ncurses_napms, NULL) + PHP_FE(ncurses_scrl, NULL) + PHP_FE(ncurses_slk_attroff, NULL) + PHP_FE(ncurses_slk_attron, NULL) + PHP_FE(ncurses_slk_attrset, NULL) +#ifdef HAVE_NCURSES_SLK_COLOR + PHP_FE(ncurses_slk_color, NULL) +#endif + PHP_FE(ncurses_slk_init, NULL) + PHP_FE(ncurses_slk_set, NULL) + PHP_FE(ncurses_typeahead, NULL) + PHP_FE(ncurses_ungetch, NULL) + PHP_FE(ncurses_vidattr, NULL) + PHP_FE(ncurses_wrefresh, NULL) +#ifdef HAVE_NCURSES_USE_EXTENDED_NAMES + PHP_FE(ncurses_use_extended_names, NULL) +#endif + PHP_FE(ncurses_bkgdset, NULL) + PHP_FE(ncurses_filter, NULL) + PHP_FE(ncurses_noqiflush, NULL) + PHP_FE(ncurses_qiflush, NULL) + PHP_FE(ncurses_timeout, NULL) + PHP_FE(ncurses_use_env, NULL) + PHP_FE(ncurses_addstr, NULL) + PHP_FE(ncurses_putp, NULL) + PHP_FE(ncurses_scr_dump, NULL) + PHP_FE(ncurses_scr_init, NULL) + PHP_FE(ncurses_scr_restore, NULL) + PHP_FE(ncurses_scr_set, NULL) + PHP_FE(ncurses_mvaddch, NULL) + PHP_FE(ncurses_mvaddchnstr, NULL) + PHP_FE(ncurses_addchnstr, NULL) + PHP_FE(ncurses_mvaddchstr, NULL) + PHP_FE(ncurses_addchstr, NULL) + PHP_FE(ncurses_mvaddnstr, NULL) + PHP_FE(ncurses_addnstr, NULL) + PHP_FE(ncurses_mvaddstr, NULL) + PHP_FE(ncurses_mvdelch, NULL) + PHP_FE(ncurses_mvgetch, NULL) + PHP_FE(ncurses_mvinch, NULL) + PHP_FE(ncurses_mvwaddstr, NULL) + PHP_FE(ncurses_insstr, NULL) + PHP_FE(ncurses_instr, first_args_force_ref) + PHP_FE(ncurses_mvhline, NULL) + PHP_FE(ncurses_mvcur, NULL) + PHP_FE(ncurses_init_color, NULL) + PHP_FE(ncurses_border, NULL) +#ifdef HAVE_NCURSES_ASSUME_DEFAULT_COLORS + PHP_FE(ncurses_assume_default_colors, NULL) +#endif + PHP_FE(ncurses_define_key, NULL) + PHP_FE(ncurses_hline, NULL) + PHP_FE(ncurses_vline, NULL) + PHP_FE(ncurses_keyok, NULL) + PHP_FE(ncurses_termname, NULL) + PHP_FE(ncurses_longname, NULL) + PHP_FE(ncurses_mousemask, second_args_force_ref) + PHP_FE(ncurses_getmouse, first_args_force_ref) + PHP_FE(ncurses_ungetmouse, NULL) + PHP_FE(ncurses_mouse_trafo, firstandsecond_args_force_ref) + PHP_FE(ncurses_wmouse_trafo, secondandthird_args_force_ref) + PHP_FE(ncurses_waddstr, NULL) + PHP_FE(ncurses_wnoutrefresh, NULL) + PHP_FE(ncurses_wclear, NULL) +#ifdef HAVE_NCURSES_COLOR_SET + PHP_FE(ncurses_wcolor_set, NULL) +#endif + PHP_FE(ncurses_wgetch, NULL) + PHP_FE(ncurses_keypad, NULL) + PHP_FE(ncurses_wmove, NULL) PHP_FE(ncurses_newpad, NULL) PHP_FE(ncurses_prefresh, NULL) PHP_FE(ncurses_pnoutrefresh, NULL) - PHP_FE(ncurses_wstandout, NULL) - PHP_FE(ncurses_wstandend, NULL) - PHP_FE(ncurses_wattrset, NULL) + PHP_FE(ncurses_wstandout, NULL) + PHP_FE(ncurses_wstandend, NULL) + PHP_FE(ncurses_wattrset, NULL) PHP_FE(ncurses_wattron, NULL) - PHP_FE(ncurses_wattroff, NULL) + PHP_FE(ncurses_wattroff, NULL) PHP_FE(ncurses_waddch, NULL) PHP_FE(ncurses_wborder, NULL) 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) + PHP_FE(ncurses_getmaxyx, secondandthird_args_force_ref) #if HAVE_NCURSES_PANEL PHP_FE(ncurses_update_panels, NULL) @@ -199,7 +209,7 @@ function_entry ncurses_functions[] = { PHP_FE(ncurses_del_panel, NULL) PHP_FE(ncurses_new_panel, NULL) #endif - + {NULL, NULL, NULL} /* Must be the last line in ncurses_functions[] */ }; |