cvs: php4 /ext/ncurses config.m4 ncurses_functions.c

From: Date: Mon, 17 Sep 2001 16:24:12 +0000
Subject: cvs: php4 /ext/ncurses config.m4 ncurses_functions.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7444@lists.php.net to get a copy of this message
hholzgra Mon Sep 17 12:24:12 2001 EDT Modified files: /php4/ext/ncurses config.m4 ncurses_functions.c Log: will now configure out functions not available in ncurses 4.2 Index: php4/ext/ncurses/config.m4 diff -u php4/ext/ncurses/config.m4:1.1 php4/ext/ncurses/config.m4:1.2 --- php4/ext/ncurses/config.m4:1.1 Tue Jun 12 17:15:49 2001 +++ php4/ext/ncurses/config.m4 Mon Sep 17 12:24:11 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.1 2001/06/12 21:15:49 hholzgra Exp $ +dnl $Id: config.m4,v 1.2 2001/09/17 16:24:11 hholzgra Exp $ dnl config.m4 for extension ncurses PHP_ARG_WITH(ncurses, for ncurses support, @@ -39,6 +39,11 @@ PHP_SUBST(NCURSES_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/lib, SAPRFC_SHARED_LIBADD) + + AC_CHECK_LIB(ncurses, color_set, [AC_DEFINE(HAVE_NCURSES_COLOR_SET, 1, [ ])]) + AC_CHECK_LIB(ncurses, slk_color, [AC_DEFINE(HAVE_NCURSES_SLK_COLOR, 1, [ ])]) + AC_CHECK_LIB(ncurses, use_extended_names, [AC_DEFINE(HAVE_NCURSES_USE_EXTENDED_NAMES, 1, [ ])]) + PHP_EXTENSION(ncurses, $ext_shared) fi Index: php4/ext/ncurses/ncurses_functions.c diff -u php4/ext/ncurses/ncurses_functions.c:1.2 php4/ext/ncurses/ncurses_functions.c:1.3 --- php4/ext/ncurses/ncurses_functions.c:1.2 Wed Jun 13 03:26:41 2001 +++ php4/ext/ncurses/ncurses_functions.c Mon Sep 17 12:24:11 2001 @@ -44,6 +44,7 @@ */ PHP_FUNCTION(ncurses_color_set) { +#ifdef HAVE_NCURSES_COLOR_SET zval **pair; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &pair) == FAILURE){ WRONG_PARAM_COUNT; @@ -52,6 +53,10 @@ convert_to_long_ex(pair); RETURN_LONG(color_set(_INT(pair),NULL)); +#else + php_error(E_WARNING,"%s not supported in this build"); + RETURN_FALSE; +#endif } /* }}} */ @@ -772,6 +777,7 @@ */ PHP_FUNCTION(ncurses_slk_color) { +#ifdef HAVE_NCURSES_SLK_COLOR zval **intarg; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ WRONG_PARAM_COUNT; @@ -780,6 +786,10 @@ convert_to_long_ex(intarg); RETURN_LONG(slk_color(_INT(intarg))); +#else + php_error(E_WARNING,"%s not supported in this build"); + RETURN_FALSE; +#endif } /* }}} */ @@ -847,6 +857,7 @@ */ PHP_FUNCTION(ncurses_use_extended_names) { +#ifdef HAVE_NCURSES_USE_EXTENDED_NAMES zval **intarg; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &intarg) == FAILURE){ WRONG_PARAM_COUNT; @@ -855,6 +866,10 @@ convert_to_long_ex(intarg); RETURN_LONG(use_extended_names(_INT(intarg))); +#else + php_error(E_WARNING,"%s not supported in this build"); + RETURN_FALSE; +#endif } /* }}} */

« previous php.cvs (#7444) next »