]> granicus.if.org Git - php/commitdiff
will now configure out functions not available in ncurses 4.2
authorHartmut Holzgraefe <hholzgra@php.net>
Mon, 17 Sep 2001 16:24:11 +0000 (16:24 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Mon, 17 Sep 2001 16:24:11 +0000 (16:24 +0000)
ext/ncurses/config.m4
ext/ncurses/ncurses_functions.c

index 8111d02f44e5cbaaafeb54f02d04f9c490eb6df5..715388832468a77b0b19a345b6452a92125a89e5 100644 (file)
@@ -40,5 +40,10 @@ if test "$PHP_NCURSES" != "no"; then
    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 dca635a74bfab73c48091f4f3cdf8dab6183e29b..99cfc81b719372d55f7b03f6980bc7ed7d9f3ebf 100644 (file)
@@ -44,6 +44,7 @@ PHP_FUNCTION(ncurses_addch)
     */
 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 @@ PHP_FUNCTION(ncurses_color_set)
        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_attrset)
     */
 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 @@ PHP_FUNCTION(ncurses_slk_color)
        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_vidattr)
     */
 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 @@ PHP_FUNCTION(ncurses_use_extended_names)
        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 
 }
 /* }}} */