diff options
author | SVN Migration <svn@php.net> | 2001-08-08 15:06:09 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2001-08-08 15:06:09 +0000 |
commit | 22909a77ef3489ef6be3c860d0002ea66c4436f0 (patch) | |
tree | 480ca7c565161cc36eddc9f8eee073ef10be3019 /ext/ncurses | |
parent | 2f6cd308f9a8c53e0ce359603f4746b27bc32356 (diff) | |
download | php-git-PRE_METHOD_DEREFERENCE_PATCH.tar.gz |
This commit was manufactured by cvs2svn to create tagPRE_METHOD_DEREFERENCE_PATCH
'PRE_METHOD_DEREFERENCE_PATCH'.
Diffstat (limited to 'ext/ncurses')
-rw-r--r-- | ext/ncurses/CREDITS | 2 | ||||
-rw-r--r-- | ext/ncurses/EXPERIMENTAL | 0 | ||||
-rw-r--r-- | ext/ncurses/Makefile.in | 8 | ||||
-rw-r--r-- | ext/ncurses/c-prototypes | 263 | ||||
-rw-r--r-- | ext/ncurses/config.m4 | 44 | ||||
-rw-r--r-- | ext/ncurses/example1.php | 28 | ||||
-rw-r--r-- | ext/ncurses/ncurses.c | 172 | ||||
-rw-r--r-- | ext/ncurses/ncurses.php | 10 | ||||
-rw-r--r-- | ext/ncurses/ncurses_fe.c | 117 | ||||
-rw-r--r-- | ext/ncurses/ncurses_functions.c | 928 | ||||
-rw-r--r-- | ext/ncurses/php_ncurses.h | 83 | ||||
-rw-r--r-- | ext/ncurses/php_ncurses_fe.h | 106 | ||||
-rw-r--r-- | ext/ncurses/tests/001.phpt | 23 |
13 files changed, 0 insertions, 1784 deletions
diff --git a/ext/ncurses/CREDITS b/ext/ncurses/CREDITS deleted file mode 100644 index 05679b8c8a..0000000000 --- a/ext/ncurses/CREDITS +++ /dev/null @@ -1,2 +0,0 @@ -ncurses -Hartmut Holzgraefe diff --git a/ext/ncurses/EXPERIMENTAL b/ext/ncurses/EXPERIMENTAL deleted file mode 100644 index e69de29bb2..0000000000 --- a/ext/ncurses/EXPERIMENTAL +++ /dev/null diff --git a/ext/ncurses/Makefile.in b/ext/ncurses/Makefile.in deleted file mode 100644 index 359ed0f423..0000000000 --- a/ext/ncurses/Makefile.in +++ /dev/null @@ -1,8 +0,0 @@ -# $Id$ - -LTLIBRARY_NAME = libncurses.la -LTLIBRARY_SOURCES = ncurses.c ncurses_fe.c ncurses_functions.c -LTLIBRARY_SHARED_NAME = ncurses.la -LTLIBRARY_SHARED_LIBADD = $(NCURSES_SHARED_LIBADD) - -include $(top_srcdir)/build/dynlib.mk diff --git a/ext/ncurses/c-prototypes b/ext/ncurses/c-prototypes deleted file mode 100644 index c76c8feb51..0000000000 --- a/ext/ncurses/c-prototypes +++ /dev/null @@ -1,263 +0,0 @@ -+ int addch(int); -- int addchnstr(int *,int); -- int addchstr(int *); -- int addnstr(string,int); -- int addstr(string); -- int assume_default_colors (int,int); -- int attr_get(int *,int *,void *); -- int attr_off(int,void *); -- int attr_on(int,void *); -- int attr_set(int,int,void *); -+ int attroff(int); -+ int attron(int); -+ int attrset(int); -+ int baudrate(void); -+ int beep(void); -+ int bkgd(int); -+ void bkgdset(int); -- int border(int,int,int,int,int,int,int,int); -- int box(resource,int,int); -+ bool can_change_color(void); -+ int cbreak(void); -- int chgat(int,int,int,void *); -+ int clear(void); -- int clearok(resource,bool); -+ int clrtobot(void); -+ int clrtoeol(void); -- int color_content(int,int*,int*,int*); -+ int color_set(int,void*); -- int copywin(resource,resource,int,int,int,int,int,int,int); -+ int curs_set(int); -+ int def_prog_mode(void); -+ int def_shell_mode(void); -- int define_key (string,int); -+ int delay_output(int); -+ int delch(void); -+ int deleteln(void); -- void delscreen(SCREEN *); -+ int delwin(resource); -+ int doupdate(void); -+ int echo(void); -+ int echochar(int); -+ int endwin(void); -+ int erase(void); -+ char erasechar(void); -+ void filter(void); -+ int flash(void); -+ int flushinp(void); -- int getbkgd(resource); -+ int getch(void); -- int getmouse(MEVENT *); -- int getnstr(string,int); -- int getstr(string); -+ int halfdelay(int); -+ bool has_colors(void); -+ bool has_ic(void); -+ bool has_il(void); -+ int has_key(int); /* do we have given key? */ -- int hline(int,int); -- void idcok(resource,bool); -- int idlok(resource,bool); -- void immedok(resource,bool); -+ int inch(void); -- int inchnstr(int *,int); -- int inchstr(int *); -- int init_color(int,int,int,int); -+ int init_pair(int,int,int); -- int innstr(string,int); -+ int insch(int); -+ int insdelln(int); -+ int insertln(void); -- int insnstr(string,int); -- int insstr(string); -- int instr(string); -- int intrflush(resource,bool); -- bool is_linetouched(resource,int); -- bool is_wintouched(resource); -+ bool isendwin(void); -- int keyok (int,bool); -- int keypad(resource,bool); -+ char killchar(void); -- int leaveok(resource,bool); -- int mcprint(string,int); /* direct data to printer */ -- int meta(resource,bool); -+ int mouseinterval(int); -- mmask_t mousemask(mmask_t,mmask_t *); -+ int move(int,int); -- int mvaddch(int,int,int); -- int mvaddchnstr(int,int,int *,int); -- int mvaddchstr(int,int,int *); -- int mvaddnstr(int,int,string,int); -- int mvaddstr(int,int,string); -- int mvchgat(int,int,int,int,int,void *); -- int mvcur(int,int,int,int); -- int mvdelch(int,int); -- int mvderwin(resource,int,int); -- int mvgetch(int,int); -- int mvgetnstr(int,int,string,int); -- int mvgetstr(int,int,string); -- int mvhline(int,int,int,int); -- int mvinch(int,int); -- int mvinchnstr(int,int,int *,int); -- int mvinchstr(int,int,int *); -- int mvinnstr(int,int,string,int); -- int mvinsch(int,int,int); -- int mvinsnstr(int,int,string,int); -- int mvinsstr(int,int,string); -- int mvinstr(int,int,string); -- int mvprintw(int,int, string,...); -- int mvscanw(int,int, string,...); -- int mvwaddch(resource,int,int,int); -- int mvwaddchnstr(resource,int,int,int *,int); -- int mvwaddchstr(resource,int,int,int *); -- int mvwaddnstr(resource,int,int,string,int); -- int mvwaddstr(resource,int,int,string); -- int mvwchgat(resource,int,int,int,int,int,void *); -- int mvwdelch(resource,int,int); -- int mvwgetch(resource,int,int); -- int mvwgetnstr(resource,int,int,string,int); -- int mvwgetstr(resource,int,int,string); -- int mvwhline(resource,int,int,int,int); -- int mvwin(resource,int,int); -- int mvwinch(resource,int,int); -- int mvwinchstr(resource,int,int,int *); -- int mvwinnstr(resource,int,int,string,int); -- int mvwinsch(resource,int,int,int); -- int mvwinsnstr(resource,int,int,string,int); -- int mvwinsstr(resource,int,int,string); -- int mvwinstr(resource,int,int,string); -- int mvwinchnstr(resource,int,int,int *,int); -- int mvwprintw(resource,int,int, string,...); -- int mvwscanw(resource,int,int, string,...); -- int mvwvline(resource,int,int,int,int); -+ int napms(int); -+ int nl(void); -+ int nocbreak(void); -- int nodelay(resource,bool); -+ int noecho(void); -+ int nonl(void); -+ void noqiflush(void); -+ int noraw(void); -- int notimeout(resource,bool); -- int overlay(resource,resource); -- int overwrite(resource,resource); -- int pair_content(int,int*,int*); -- int pechochar(resource,int); -- int pnoutrefresh(resource,int,int,int,int,int,int); -- int prefresh(resource,int,int,int,int,int,int); -- int printw( string,...); -- int putp(string); -- int putwin(resource,FILE *); -+ void qiflush(void); -+ int raw(void); -- int redrawwin(resource); -+ int refresh(void); -- int reset_prog_mode(void); -- int reset_shell_mode(void); -+ int resetty(void); -- int resizeterm (int,int); -- int ripoffline(int,int (*init)(resource,int)); -+ int savetty(void); -- int scanw( string,...); -- int scr_dump(string); -- int scr_init(string); -- int scr_restore(string); -- int scr_set(string); -+ int scrl(int); -- int scroll(resource); -- int scrollok(resource,bool); -- int setscrreg(int,int); -+ int slk_attroff(int); -- int slk_attr_off(int,void *); /* generated:WIDEC */ -+ int slk_attron(int); -- int slk_attr_on(int,void*); /* generated:WIDEC */ -+ int slk_attrset(int); -+ int slk_attr(void); -- int slk_attr_set(int,int,void*); -+ int slk_clear(void); -+ int slk_color(int); -+ int slk_init(int); -+ int slk_noutrefresh(void); -- int slk_refresh(void); -- int slk_restore(void); -- int slk_set(int,string,int); -- int slk_touch(void); -+ int standend(void); -+ int standout(void); -+ int start_color(void); -- int syncok(resource,bool); -+ int termattrs(void); -- int tigetflag( string); -- int tigetnum( string); -+ void timeout(int); -+ int typeahead(int); -+ int ungetch(int); -- int ungetmouse(MEVENT *); -- int untouchwin(resource); -+ int use_default_colors (void); -+ void use_env(bool); -+ int use_extended_names (bool); -+ int vidattr(int); -- int vidputs(int,int (*)(int)); -- int vline(int,int); -- int vw_printw(resource, string,va_list); -- int vw_scanw(resource, string,va_list); -- int vwprintw(resource, string,va_list); -- int vwscanw(resource, string,va_list); -- int waddch(resource,int); -- int waddchnstr(resource,int *const,int); -- int waddchstr(resource,int *); -- int waddnstr(resource,stringconst,int); -- int waddstr(resource,string); -- int wattr_get(resource,int *,int *,void *); -- int wattr_off(resource, int,void *); -- int wattr_on(resource, int,void *); -- int wattr_set(resource,int,int,void *); -- int wattroff(resource,int); -- int wattron(resource,int); -- int wattrset(resource,int); -- int wbkgd(resource,int); -- void wbkgdset(resource,int); -- int wborder(resource,int,int,int,int,int,int,int,int); -- int wchgat(resource,int,int,int,void *); -- int wclear(resource); -- int wclrtobot(resource); -- int wclrtoeol(resource); -- int wcolor_set(resource,int,void*); -- void wcursyncup(resource); -- int wdelch(resource); -- int wdeleteln(resource); -- int wechochar(resource,int); -- bool wenclose(resource,int,int); -- int werase(resource); -- int wgetch(resource); -- int wgetnstr(resource,string,int); -- int wgetstr(resource,string); -- int whline(resource,int,int); -- int winch(resource); -- int winchnstr(resource,int *,int); -- int winchstr(resource,int *); -- int winnstr(resource,string,int); -- int winsch(resource,int); -- int winsdelln(resource,int); -- int winsertln(resource); -- int winsnstr(resource,string,int); -- int winsstr(resource,string); -- int winstr(resource,string); -- bool wmouse_trafo(resource win,int* y,int* x,bool to_screen); -- int wmove(resource,int,int); -- int wnoutrefresh(resource); -- int wprintw(resource, string,...); -- int wredrawln(resource,int,int); -- int wrefresh(resource); -- int wresize (resource,int,int); -- int wscanw(resource,string,...); -- int wscrl(resource,int); -- int wsetscrreg(resource,int,int); -- int wstandend(resource); -- int wstandout(resource); -- void wsyncdown(resource); -- void wsyncup(resource); -- void wtimeout(resource,int); -- int wtouchln(resource,int,int,int); -- int wvline(resource,int,int); diff --git a/ext/ncurses/config.m4 b/ext/ncurses/config.m4 deleted file mode 100644 index 8111d02f44..0000000000 --- a/ext/ncurses/config.m4 +++ /dev/null @@ -1,44 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension ncurses - -PHP_ARG_WITH(ncurses, for ncurses support, -[ --with-ncurses Include ncurses support]) - -if test "$PHP_NCURSES" != "no"; then - # --with-ncurses -> check with-path - SEARCH_PATH="/usr/local /usr" - SEARCH_FOR="/include/curses.h" - if test -r $PHP_NCURSES/; then # path given as parameter - NCURSES_DIR=$PHP_NCURSES - else # search default path list - AC_MSG_CHECKING(for ncurses files in default path) - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - NCURSES_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - fi - - if test -z "$NCURSES_DIR"; then - AC_MSG_RESULT(not found) - AC_MSG_ERROR(Please reinstall the ncurses distribution) - fi - - # --with-ncurses -> add include path - PHP_ADD_INCLUDE($NCURSES_DIR/include) - - # --with-ncurses -> chech for lib and symbol presence - LIBNAME=ncurses - LIBSYMBOL=initscr - old_LIBS=$LIBS - LIBS="$LIBS -L$NCURSES_DIR/lib -lm -ldl" - AC_CHECK_LIB($LIBNAME, $LIBSYMBOL, [AC_DEFINE(HAVE_NCURSESLIB,1,[ ])], - [AC_MSG_ERROR(wrong ncurses lib version or lib not found)]) - LIBS=$old_LIBS - - PHP_SUBST(NCURSES_SHARED_LIBADD) - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/lib, SAPRFC_SHARED_LIBADD) - - PHP_EXTENSION(ncurses, $ext_shared) -fi diff --git a/ext/ncurses/example1.php b/ext/ncurses/example1.php deleted file mode 100644 index 0dc689be39..0000000000 --- a/ext/ncurses/example1.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php -$n=0; -ncurses_init(); -if(ncurses_has_colors()){ -ncurses_start_color(); - ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK); - ncurses_init_pair(2,NCURSES_COLOR_GREEN,NCURSES_COLOR_BLACK); - ncurses_init_pair(3,NCURSES_COLOR_YELLOW,NCURSES_COLOR_BLACK); - ncurses_init_pair(4,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK); - ncurses_init_pair(5,NCURSES_COLOR_MAGENTA,NCURSES_COLOR_BLACK); - ncurses_init_pair(6,NCURSES_COLOR_CYAN,NCURSES_COLOR_BLACK); - ncurses_init_pair(7,NCURSES_COLOR_WHITE,NCURSES_COLOR_BLACK); -} -while(1){ -for ($x=0; $x<80; $x++) { -for ($y=0; $y<24; $y++) { - $n++; - ncurses_move($y,$x); - ncurses_addch($n+64); - ncurses_color_set($n%8); - ncurses_refresh(); - if($n>26)$n=0; -} -} -} -ncurses_getch(); -?> - diff --git a/ext/ncurses/ncurses.c b/ext/ncurses/ncurses.c deleted file mode 100644 index 2b7b28c31d..0000000000 --- a/ext/ncurses/ncurses.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Hartmut Holzgraefe <hartmut@six.de> | - | | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" -#include "ext/standard/info.h" - -/* If you declare any globals in php_ncurses.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(ncurses) -*/ - -/* True global resources - no need for thread safety here */ -int le_ncurses; - - -static void ncurses_destruct(zend_rsrc_list_entry *rsrc TSRMLS_DC) -{ - WINDOW **pwin = (WINDOW **)rsrc->ptr; - - delwin(*pwin); - efree(pwin); -} - - -/* {{{ ncurses_module_entry - */ -zend_module_entry ncurses_module_entry = { - "ncurses", - ncurses_functions, - PHP_MINIT(ncurses), - PHP_MSHUTDOWN(ncurses), - PHP_RINIT(ncurses), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(ncurses), /* Replace with NULL if there's nothing to do at request end */ - PHP_MINFO(ncurses), - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_NCURSES -ZEND_GET_MODULE(ncurses) -#endif - -/* {{{ PHP_INI - */ -/* Remove comments and fill if you need to have entries in php.ini -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("ncurses.value", "42", PHP_INI_ALL, OnUpdateInt, global_value, zend_ncurses_globals, ncurses_globals) - STD_PHP_INI_ENTRY("ncurses.string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_ncurses_globals, ncurses_globals) -PHP_INI_END() -*/ -/* }}} */ - -#define PHP_NCURSES_CONST(x) REGISTER_LONG_CONSTANT("NCURSES_"#x, x, CONST_CS | CONST_PERSISTENT) - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(ncurses) -{ - PHP_NCURSES_CONST(COLOR_BLACK); - PHP_NCURSES_CONST(COLOR_RED); - PHP_NCURSES_CONST(COLOR_GREEN); - PHP_NCURSES_CONST(COLOR_YELLOW); - PHP_NCURSES_CONST(COLOR_BLUE); - PHP_NCURSES_CONST(COLOR_MAGENTA); - PHP_NCURSES_CONST(COLOR_CYAN); - PHP_NCURSES_CONST(COLOR_WHITE); - - le_ncurses = zend_register_list_destructors_ex(ncurses_destruct, NULL, "ncurses_hanlde", module_number); - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(ncurses) -{ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request start */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(ncurses) -{ - return SUCCESS; -} -/* }}} */ - -/* Remove if there's nothing to do at request end */ -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(ncurses) -{ - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(ncurses) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "ncurses support", "enabled"); - php_info_print_table_end(); - - /* Remove comments if you have entries in php.ini - DISPLAY_INI_ENTRIES(); - */ -} -/* }}} */ - -/* Remove the following function when you have succesfully modified config.m4 - so that your module can be compiled into PHP, it exists only for testing - purposes. */ - -/* Every user-visible function in PHP should document itself in the source */ -/* {{{ proto string confirm_ncurses_compiled(string arg) - Return a string to confirm that the module is compiled in */ -PHP_FUNCTION(confirm_ncurses_compiled) -{ - zval **arg; - int len; - char string[256]; - - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) { - WRONG_PARAM_COUNT; - } - - convert_to_string_ex(arg); - - len = sprintf(string, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "ncurses", Z_STRVAL_PP(arg)); - RETURN_STRINGL(string, len, 1); -} -/* }}} */ -/* The previous line is meant for vim and emacs, so it can correctly fold and - unfold functions in source code. See the corresponding marks just before - function definition, where the functions purpose is also documented. Please - follow this convention for the convenience of others editing your code. -*/ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: sw=4 ts=4 tw=78 fdm=marker - * vim<600: sw=4 ts=4 tw=78 - */ diff --git a/ext/ncurses/ncurses.php b/ext/ncurses/ncurses.php deleted file mode 100644 index 416b1087e7..0000000000 --- a/ext/ncurses/ncurses.php +++ /dev/null @@ -1,10 +0,0 @@ -<? -$module = 'ncurses'; -$function = 'confirm_' . $module . '_compiled'; -if (extension_loaded($module)) { - $str = $function($module); -} else { - $str = "Module $module is not compiled into PHP"; -} -echo "$str\n"; -?> diff --git a/ext/ncurses/ncurses_fe.c b/ext/ncurses/ncurses_fe.c deleted file mode 100644 index 05512da331..0000000000 --- a/ext/ncurses/ncurses_fe.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Hartmut Holzgraefe <hartmut@six.de> | - | | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" - -/* ncurses_functions[] - * - * Every user visible function must have an entry in ncurses_functions[]. - */ -function_entry ncurses_functions[] = { - PHP_FE(confirm_ncurses_compiled, NULL) /* For testing, remove later. */ - PHP_FE(ncurses_init, NULL) - PHP_FE(ncurses_end, NULL) - PHP_FE(ncurses_getch, NULL) - PHP_FE(ncurses_move, NULL) - PHP_FE(ncurses_addch, NULL) - PHP_FE(ncurses_refresh, NULL) - PHP_FE(ncurses_has_colors, NULL) - PHP_FE(ncurses_start_color, NULL) - PHP_FE(ncurses_color_set, NULL) - PHP_FE(ncurses_init_pair, NULL) - PHP_FE(ncurses_newwin, NULL) - PHP_FE(ncurses_delwin, 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_def_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_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_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_typeahead, NULL) - PHP_FE(ncurses_ungetch, NULL) - PHP_FE(ncurses_vidattr, 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) - {NULL, NULL, NULL} /* Must be the last line in ncurses_functions[] */ -}; diff --git a/ext/ncurses/ncurses_functions.c b/ext/ncurses/ncurses_functions.c deleted file mode 100644 index dca635a74b..0000000000 --- a/ext/ncurses/ncurses_functions.c +++ /dev/null @@ -1,928 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Hartmut Holzgraefe <hartmut@six.de> | - | | - +----------------------------------------------------------------------+ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ini.h" -#include "php_ncurses.h" - -/* {{{ proto int ncurses_addch(int ch) - */ -PHP_FUNCTION(ncurses_addch) -{ - zval **ch; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ch) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(ch); - - RETURN_LONG(addch(_INT(ch))); -} -/* }}} */ - -/* {{{ proto int ncurses_color_set(int pair) - */ -PHP_FUNCTION(ncurses_color_set) -{ - zval **pair; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pair) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pair); - - RETURN_LONG(color_set(_INT(pair),NULL)); -} -/* }}} */ - -/* {{{ proto int ncurses_newwin(int ch) - */ -PHP_FUNCTION(ncurses_delwin) -{ - zval **handle; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &handle) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(handle); - - /* TODO resource type check */ - - zend_list_delete((*handle)->value.lval); -} -/* }}} */ - -/* {{{ proto int ncurses_end() - */ -PHP_FUNCTION(ncurses_end) -{ - RETURN_LONG(endwin()); /* endialize the curses library */ -} -/* }}} */ - -/* {{{ proto int ncurses_getch() - */ -PHP_FUNCTION(ncurses_getch) -{ - RETURN_LONG(getch()); -} -/* }}} */ - -/* {{{ proto int ncurses_has_colors() - */ -PHP_FUNCTION(ncurses_has_colors) -{ - RETURN_LONG(has_colors()); -} -/* }}} */ - -/* {{{ proto int ncurses_init() - */ -PHP_FUNCTION(ncurses_init) -{ - initscr(); /* initialize the curses library */ - keypad(stdscr, TRUE); /* enable keyboard mapping */ - (void) nonl(); /* tell curses not to do NL->CR/NL on output */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */} -/* }}} */ - -/* {{{ proto int ncurses_init_pair(int pair, int fg, int bg) - */ -PHP_FUNCTION(ncurses_init_pair) -{ - zval **pair, **fg, **bg; - if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &pair, &fg, &bg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(pair); - convert_to_long_ex(fg); - convert_to_long_ex(bg); - - RETURN_LONG(init_pair(_INT(pair),_INT(fg),_INT(bg))); -} -/* }}} */ - -/* {{{ proto int ncurses_move(int x, int y) - */ -PHP_FUNCTION(ncurses_move) -{ - zval **x, **y; - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(x); - convert_to_long_ex(y); - - RETURN_LONG(move(_INT(x),_INT(y))); -} -/* }}} */ - -/* {{{ proto int ncurses_newwin(int ch) - */ -PHP_FUNCTION(ncurses_newwin) -{ - zval **rows,**cols,**y,**x; - WINDOW **pwin = (WINDOW **)emalloc(sizeof(WINDOW *)); - - if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &rows,&cols,&y,&x) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(rows); - convert_to_long_ex(cols); - convert_to_long_ex(y); - convert_to_long_ex(x); - - *pwin=newwin(_INT(rows),_INT(cols),_INT(y),_INT(x)); - - if(!*pwin) { - efree(pwin); - RETURN_FALSE; - } - - ZEND_REGISTER_RESOURCE(return_value, pwin, le_ncurses); -} -/* }}} */ - -/* {{{ proto int ncurses_refresh(int ch) - */ -PHP_FUNCTION(ncurses_refresh) -{ - RETURN_LONG(refresh()); -} -/* }}} */ - -/* {{{ proto int ncurses_start_color() - */ -PHP_FUNCTION(ncurses_start_color) -{ - RETURN_LONG(start_color()); -} -/* }}} */ - -/* ----- */ - -/* {{{ proto int ncurses_standout() - */ -PHP_FUNCTION(ncurses_standout) -{ - RETURN_LONG(standout()); -} -/* }}} */ - -/* {{{ proto int ncurses_standend() - */ -PHP_FUNCTION(ncurses_standend) -{ - RETURN_LONG(standend()); -} -/* }}} */ - -/* {{{ proto int ncurses_baudrate() - */ -PHP_FUNCTION(ncurses_baudrate) -{ - RETURN_LONG(baudrate()); -} -/* }}} */ - -/* {{{ proto int ncurses_beep() - */ -PHP_FUNCTION(ncurses_beep) -{ - RETURN_LONG(beep()); -} -/* }}} */ - -/* {{{ proto bool ncurses_can_change_color() - */ -PHP_FUNCTION(ncurses_can_change_color) -{ - RETURN_LONG(can_change_color()); -} -/* }}} */ - -/* {{{ proto bool ncurses_cbreak() - */ -PHP_FUNCTION(ncurses_cbreak) -{ - RETURN_LONG(cbreak()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clear() - */ -PHP_FUNCTION(ncurses_clear) -{ - RETURN_LONG(clear()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clrtobot() - */ -PHP_FUNCTION(ncurses_clrtobot) -{ - RETURN_LONG(clrtobot()); -} -/* }}} */ - -/* {{{ proto bool ncurses_clrtoeol() - */ -PHP_FUNCTION(ncurses_clrtoeol) -{ - RETURN_LONG(clrtoeol()); -} -/* }}} */ - -/* {{{ proto bool ncurses_def_prog_mode() - */ -PHP_FUNCTION(ncurses_def_prog_mode) -{ - RETURN_LONG(def_prog_mode()); -} -/* }}} */ - -/* {{{ proto bool ncurses_def_shell_mode() - */ -PHP_FUNCTION(ncurses_def_shell_mode) -{ - RETURN_LONG(def_shell_mode()); -} -/* }}} */ - -/* {{{ proto bool ncurses_delch() - */ -PHP_FUNCTION(ncurses_delch) -{ - RETURN_LONG(delch()); -} -/* }}} */ - -/* {{{ proto bool ncurses_deleteln() - */ -PHP_FUNCTION(ncurses_deleteln) -{ - RETURN_LONG(deleteln()); -} -/* }}} */ - -/* {{{ proto bool ncurses_doupdate() - */ -PHP_FUNCTION(ncurses_doupdate) -{ - RETURN_LONG(doupdate()); -} -/* }}} */ - -/* {{{ proto bool ncurses_echo() - */ -PHP_FUNCTION(ncurses_echo) -{ - RETURN_LONG(echo()); -} -/* }}} */ - -/* {{{ proto bool ncurses_erase() - */ -PHP_FUNCTION(ncurses_erase) -{ - RETURN_LONG(erase()); -} -/* }}} */ - -/* {{{ proto bool ncurses_erasechar() - */ -PHP_FUNCTION(ncurses_erasechar) -{ - RETURN_LONG(erasechar()); -} -/* }}} */ - -/* {{{ proto bool ncurses_flash() - */ -PHP_FUNCTION(ncurses_flash) -{ - RETURN_LONG(flash()); -} -/* }}} */ - -/* {{{ proto bool ncurses_flushinp() - */ -PHP_FUNCTION(ncurses_flushinp) -{ - RETURN_LONG(flushinp()); -} -/* }}} */ - -/* {{{ proto bool ncurses_has_ic() - */ -PHP_FUNCTION(ncurses_has_ic) -{ - RETURN_LONG(has_ic()); -} -/* }}} */ - - -/* {{{ proto bool ncurses_has_il() - */ -PHP_FUNCTION(ncurses_has_il) -{ - RETURN_LONG(has_il()); -} -/* }}} */ - -/* {{{ proto bool ncurses_inch() - */ -PHP_FUNCTION(ncurses_inch) -{ - RETURN_LONG(inch()); -} -/* }}} */ - -/* {{{ proto bool ncurses_insertln() - */ -PHP_FUNCTION(ncurses_insertln) -{ - RETURN_LONG(insertln()); -} -/* }}} */ - -/* {{{ proto bool ncurses_isendwin() - */ -PHP_FUNCTION(ncurses_isendwin) -{ - RETURN_LONG(isendwin()); -} -/* }}} */ - -/* {{{ proto bool ncurses_killchar() - */ -PHP_FUNCTION(ncurses_killchar) -{ - RETURN_LONG(killchar()); -} -/* }}} */ - -/* {{{ proto bool ncurses_nl() - */ -PHP_FUNCTION(ncurses_nl) -{ - RETURN_LONG(nl()); -} -/* }}} */ - -/* {{{ proto bool ncurses_nocbreak() - */ -PHP_FUNCTION(ncurses_nocbreak) -{ - RETURN_LONG(nocbreak()); -} -/* }}} */ - -/* {{{ proto bool ncurses_noecho() - */ -PHP_FUNCTION(ncurses_noecho) -{ - RETURN_LONG(noecho()); -} -/* }}} */ - -/* {{{ proto bool ncurses_nonl() - */ -PHP_FUNCTION(ncurses_nonl) -{ - RETURN_LONG(nonl()); -} -/* }}} */ - -/* {{{ proto bool ncurses_noraw() - */ -PHP_FUNCTION(ncurses_noraw) -{ - RETURN_LONG(noraw()); -} -/* }}} */ - -/* {{{ proto bool ncurses_raw() - */ -PHP_FUNCTION(ncurses_raw) -{ - RETURN_LONG(raw()); -} -/* }}} */ - -/* {{{ proto bool ncurses_resetty() - */ -PHP_FUNCTION(ncurses_resetty) -{ - RETURN_LONG(resetty()); -} -/* }}} */ - -/* {{{ proto bool ncurses_savetty() - */ -PHP_FUNCTION(ncurses_savetty) -{ - RETURN_LONG(savetty()); -} -/* }}} */ - -/* {{{ proto bool ncurses_termattrs() - */ -PHP_FUNCTION(ncurses_termattrs) -{ - RETURN_LONG(termattrs()); -} -/* }}} */ - -/* {{{ proto bool ncurses_use_default_colors() - */ -PHP_FUNCTION(ncurses_use_default_colors) -{ - RETURN_LONG(use_default_colors()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_attr() - */ -PHP_FUNCTION(ncurses_slk_attr) -{ - RETURN_LONG(slk_attr()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_clear() - */ -PHP_FUNCTION(ncurses_slk_clear) -{ - RETURN_LONG(slk_clear()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_noutrefresh() - */ -PHP_FUNCTION(ncurses_slk_noutrefresh) -{ - RETURN_LONG(slk_noutrefresh()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_refresh() - */ -PHP_FUNCTION(ncurses_slk_refresh) -{ - RETURN_LONG(slk_refresh()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_restore() - */ -PHP_FUNCTION(ncurses_slk_restore) -{ - RETURN_LONG(slk_restore()); -} -/* }}} */ - -/* {{{ proto bool ncurses_slk_touch() - */ -PHP_FUNCTION(ncurses_slk_touch) -{ - RETURN_LONG(slk_touch()); -} -/* }}} */ - -/* {{{ proto int ncurses_attroff(int intarg) - */ -PHP_FUNCTION(ncurses_attroff) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(attroff(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_attron(int intarg) - */ -PHP_FUNCTION(ncurses_attron) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(attron(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_attrset(int intarg) - */ -PHP_FUNCTION(ncurses_attrset) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(attrset(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_bkgd(int intarg) - */ -PHP_FUNCTION(ncurses_bkgd) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(bkgd(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_curs_set(int intarg) - */ -PHP_FUNCTION(ncurses_curs_set) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(curs_set(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_delay_output(int intarg) - */ -PHP_FUNCTION(ncurses_delay_output) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(delay_output(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_echochar(int intarg) - */ -PHP_FUNCTION(ncurses_echochar) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(echochar(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_halfdelay(int intarg) - */ -PHP_FUNCTION(ncurses_halfdelay) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(halfdelay(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_has_key(int intarg) - */ -PHP_FUNCTION(ncurses_has_key) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(has_key(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_insch(int intarg) - */ -PHP_FUNCTION(ncurses_insch) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(insch(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_insdelln(int intarg) - */ -PHP_FUNCTION(ncurses_insdelln) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(insdelln(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_mouseinterval(int intarg) - */ -PHP_FUNCTION(ncurses_mouseinterval) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(mouseinterval(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_napms(int intarg) - */ -PHP_FUNCTION(ncurses_napms) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(napms(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_scrl(int intarg) - */ -PHP_FUNCTION(ncurses_scrl) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(scrl(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attroff(int intarg) - */ -PHP_FUNCTION(ncurses_slk_attroff) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(slk_attroff(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attron(int intarg) - */ -PHP_FUNCTION(ncurses_slk_attron) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(slk_attron(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_attrset(int intarg) - */ -PHP_FUNCTION(ncurses_slk_attrset) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(slk_attrset(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_color(int intarg) - */ -PHP_FUNCTION(ncurses_slk_color) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(slk_color(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_slk_init(int intarg) - */ -PHP_FUNCTION(ncurses_slk_init) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(slk_init(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_typeahead(int intarg) - */ -PHP_FUNCTION(ncurses_typeahead) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(typeahead(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_ungetch(int intarg) - */ -PHP_FUNCTION(ncurses_ungetch) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(ungetch(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_vidattr(int intarg) - */ -PHP_FUNCTION(ncurses_vidattr) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(vidattr(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_use_extended_names(int intarg) - */ -PHP_FUNCTION(ncurses_use_extended_names) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - RETURN_LONG(use_extended_names(_INT(intarg))); -} -/* }}} */ - -/* {{{ proto int ncurses_bkgdset(int intarg) - */ -PHP_FUNCTION(ncurses_bkgdset) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - bkgdset(_INT(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_filter() - */ -PHP_FUNCTION(ncurses_filter) -{ - filter(); -} -/* }}} */ - -/* {{{ proto int ncurses_noqiflush() - */ -PHP_FUNCTION(ncurses_noqiflush) -{ - noqiflush(); -} -/* }}} */ - -/* {{{ proto int ncurses_qiflush() - */ -PHP_FUNCTION(ncurses_qiflush) -{ - qiflush(); -} -/* }}} */ - -/* {{{ proto int ncurses_timeout(int intarg) - */ -PHP_FUNCTION(ncurses_timeout) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - timeout(_INT(intarg)); -} -/* }}} */ - -/* {{{ proto int ncurses_use_env(int intarg) - */ -PHP_FUNCTION(ncurses_use_env) -{ - zval **intarg; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ - WRONG_PARAM_COUNT; - } - - convert_to_long_ex(intarg); - - use_env(_INT(intarg)); -} -/* }}} */ diff --git a/ext/ncurses/php_ncurses.h b/ext/ncurses/php_ncurses.h deleted file mode 100644 index 84cac5a7e8..0000000000 --- a/ext/ncurses/php_ncurses.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Hartmut Holzgraefe <hartmut@six.de> | - | | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_NCURSES_H -#define PHP_NCURSES_H - -#include <curses.h> - -#define _STRING(x) ((*x)->value.str.val) -#define _INT(x) ((*x)->value.lval) -#define _HASH(x) ((*x)->value.ht) - -extern int le_ncurses; - -extern zend_module_entry ncurses_module_entry; -#define phpext_ncurses_ptr &ncurses_module_entry - -extern function_entry ncurses_functions[]; -#include "php_ncurses_fe.h" - -#ifdef PHP_WIN32 -#define PHP_NCURSES_API __declspec(dllexport) -#else -#define PHP_NCURSES_API -#endif - -PHP_MINIT_FUNCTION(ncurses); -PHP_MSHUTDOWN_FUNCTION(ncurses); -PHP_RINIT_FUNCTION(ncurses); -PHP_RSHUTDOWN_FUNCTION(ncurses); -PHP_MINFO_FUNCTION(ncurses); - -/* - Declare any global variables you may need between the BEGIN - and END macros here: - -ZEND_BEGIN_MODULE_GLOBALS(ncurses) - int global_value; - char *global_string; -ZEND_END_MODULE_GLOBALS(ncurses) -*/ - -/* In every function that needs to use variables in php_ncurses_globals, - do call NCURSES_LS_FETCH(); after declaring other variables used by - that function, and always refer to them as NCURSES_G(variable). - You are encouraged to rename these macros something shorter, see - examples in any other php module directory. -*/ - -#ifdef ZTS -#define NCURSES_G(v) (ncurses_globals->v) -#define NCURSES_LS_FETCH() zend_ncurses_globals *ncurses_globals = ts_resource(ncurses_globals_id) -#else -#define NCURSES_G(v) (ncurses_globals.v) -#define NCURSES_LS_FETCH() -#endif - -#endif /* PHP_NCURSES_H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - */ diff --git a/ext/ncurses/php_ncurses_fe.h b/ext/ncurses/php_ncurses_fe.h deleted file mode 100644 index b31faa8414..0000000000 --- a/ext/ncurses/php_ncurses_fe.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP version 4.0 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 2.02 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available at through the world-wide-web at | - | http://www.php.net/license/2_02.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Authors: Hartmut Holzgraefe <hartmut@six.de> | - | | - +----------------------------------------------------------------------+ - */ - -#ifndef PHP_NCURSES_FE_H -#define PHP_NCURSES_FE_H - -PHP_FUNCTION(confirm_ncurses_compiled); /* For testing, remove later. */ -PHP_FUNCTION(ncurses_init); -PHP_FUNCTION(ncurses_end); -PHP_FUNCTION(ncurses_getch); -PHP_FUNCTION(ncurses_move); -PHP_FUNCTION(ncurses_addch); -PHP_FUNCTION(ncurses_refresh); -PHP_FUNCTION(ncurses_has_colors); -PHP_FUNCTION(ncurses_start_color); -PHP_FUNCTION(ncurses_color_set); -PHP_FUNCTION(ncurses_init_pair); -PHP_FUNCTION(ncurses_newwin); -PHP_FUNCTION(ncurses_delwin); -PHP_FUNCTION(ncurses_standout); -PHP_FUNCTION(ncurses_standend); -PHP_FUNCTION(ncurses_baudrate); -PHP_FUNCTION(ncurses_beep); -PHP_FUNCTION(ncurses_can_change_color); -PHP_FUNCTION(ncurses_cbreak); -PHP_FUNCTION(ncurses_clear); -PHP_FUNCTION(ncurses_clrtobot); -PHP_FUNCTION(ncurses_clrtoeol); -PHP_FUNCTION(ncurses_def_prog_mode); -PHP_FUNCTION(ncurses_def_shell_mode); -PHP_FUNCTION(ncurses_delch); -PHP_FUNCTION(ncurses_deleteln); -PHP_FUNCTION(ncurses_doupdate); -PHP_FUNCTION(ncurses_echo); -PHP_FUNCTION(ncurses_echochar); -PHP_FUNCTION(ncurses_erase); -PHP_FUNCTION(ncurses_erasechar); -PHP_FUNCTION(ncurses_flash); -PHP_FUNCTION(ncurses_flushinp); -PHP_FUNCTION(ncurses_has_ic); -PHP_FUNCTION(ncurses_has_il); -PHP_FUNCTION(ncurses_inch); -PHP_FUNCTION(ncurses_insertln); -PHP_FUNCTION(ncurses_isendwin); -PHP_FUNCTION(ncurses_killchar); -PHP_FUNCTION(ncurses_nl); -PHP_FUNCTION(ncurses_nocbreak); -PHP_FUNCTION(ncurses_noecho); -PHP_FUNCTION(ncurses_nonl); -PHP_FUNCTION(ncurses_noraw); -PHP_FUNCTION(ncurses_raw); -PHP_FUNCTION(ncurses_resetty); -PHP_FUNCTION(ncurses_savetty); -PHP_FUNCTION(ncurses_termattrs); -PHP_FUNCTION(ncurses_use_default_colors); -PHP_FUNCTION(ncurses_slk_attr); -PHP_FUNCTION(ncurses_slk_clear); -PHP_FUNCTION(ncurses_slk_noutrefresh); -PHP_FUNCTION(ncurses_slk_refresh); -PHP_FUNCTION(ncurses_slk_restore); -PHP_FUNCTION(ncurses_slk_touch); -PHP_FUNCTION(ncurses_attroff); -PHP_FUNCTION(ncurses_attron); -PHP_FUNCTION(ncurses_attrset); -PHP_FUNCTION(ncurses_bkgd); -PHP_FUNCTION(ncurses_curs_set); -PHP_FUNCTION(ncurses_delay_output); -PHP_FUNCTION(ncurses_halfdelay); -PHP_FUNCTION(ncurses_has_key); -PHP_FUNCTION(ncurses_insch); -PHP_FUNCTION(ncurses_insdelln); -PHP_FUNCTION(ncurses_mouseinterval); -PHP_FUNCTION(ncurses_napms); -PHP_FUNCTION(ncurses_scrl); -PHP_FUNCTION(ncurses_slk_attroff); -PHP_FUNCTION(ncurses_slk_attron); -PHP_FUNCTION(ncurses_slk_attrset); -PHP_FUNCTION(ncurses_slk_color); -PHP_FUNCTION(ncurses_slk_init); -PHP_FUNCTION(ncurses_typeahead); -PHP_FUNCTION(ncurses_ungetch); -PHP_FUNCTION(ncurses_vidattr); -PHP_FUNCTION(ncurses_use_extended_names); -PHP_FUNCTION(ncurses_bkgdset); -PHP_FUNCTION(ncurses_filter); -PHP_FUNCTION(ncurses_noqiflush); -PHP_FUNCTION(ncurses_qiflush); -PHP_FUNCTION(ncurses_timeout); -PHP_FUNCTION(ncurses_use_env); -#endif diff --git a/ext/ncurses/tests/001.phpt b/ext/ncurses/tests/001.phpt deleted file mode 100644 index 90d9c1452f..0000000000 --- a/ext/ncurses/tests/001.phpt +++ /dev/null @@ -1,23 +0,0 @@ ---TEST-- -Check for ncurses presence ---SKIPIF-- -<?php if (!extension_loaded("ncurses")) print "skip"; ?> ---POST-- ---GET-- ---FILE-- -<?php -echo "ncurses extension is available"; -/* - you can add regression tests for your extension here - - the output of your test code has to be equal to the - text in the --EXPECT-- section below for the tests - to pass, differences between the output and the - expected text are interpreted as failure - - see php4/tests/README for further information on - writing regression tests -*/ -?> ---EXPECT-- -ncurses extension is available
\ No newline at end of file |