]> granicus.if.org Git - php/commitdiff
Fixed two problems:
authorfoobar <sniper@php.net>
Wed, 22 Aug 2001 10:25:24 +0000 (10:25 +0000)
committerfoobar <sniper@php.net>
Wed, 22 Aug 2001 10:25:24 +0000 (10:25 +0000)
- CGI_BINARY was defined always thus this extension
  could be compiled with even when not building CGI binary.

- HAVE_READLINE => HAVE_LIBREADLINE (typo)

ext/readline/config.m4
ext/readline/php_readline.h
ext/readline/readline.c

index b17ed05552619f60ef408cc86202288f35807689..ba136d2a8e9d1527c8107fe27c32611a749c3887 100644 (file)
@@ -9,6 +9,12 @@ PHP_ARG_WITH(readline,for readline support,
 [  --with-readline[=DIR]   Include readline support.  DIR is the readline
                           install directory.])
 
+if test "$PHP_READLINE" != "no" -o "$PHP_LIBEDIT" != "no"; then
+  if test "$PHP_SAPI" != "cgi"; then
+    AC_MSG_ERROR([readline extension can only be used with CGI build!])
+  fi
+fi
+
 if test "$PHP_READLINE" != "no"; then
   for i in /usr/local /usr $PHP_READLINE; do
     if test -f $i/include/readline/readline.h; then
index 72913200fcb3639e34a08a819c1c9b84b34d609d..f5803fbd4936563417c1f6d06a2c795f86d6714a 100644 (file)
 #warning Readline module will *NEVER* be thread-safe
 #endif
 
-#ifndef CGI_BINARY
-#error Readline module only useable in standalone-binary
-#endif
-
 extern zend_module_entry readline_module_entry;
 #define phpext_readline_ptr &readline_module_entry
 
index 560eec8e0b1c31a77db86f6ed328448fd4904d49..0acd4139bb42ac509a897b09919f2ade38bb2d3b 100644 (file)
@@ -57,7 +57,7 @@ static zend_function_entry php_readline_functions[] = {
        PHP_FE(readline_info,               NULL)
        PHP_FE(readline_add_history,            NULL)
        PHP_FE(readline_clear_history,          NULL)
-#ifdef HAVE_READLINE
+#ifdef HAVE_LIBREADLINE
        PHP_FE(readline_list_history,           NULL)
 #else
        PHP_FALIAS(readline_list_history, warn_not_available,                   NULL)
@@ -147,7 +147,7 @@ PHP_FUNCTION(readline_info)
                add_assoc_string(return_value,"line_buffer",SAFE_STRING(rl_line_buffer),1);
                add_assoc_long(return_value,"point",rl_point);
                add_assoc_long(return_value,"end",rl_end);
-#ifdef HAVE_READLINE
+#ifdef HAVE_LIBREADLINE
                add_assoc_long(return_value,"mark",rl_mark);
                add_assoc_long(return_value,"done",rl_done);
                add_assoc_long(return_value,"pending_input",rl_pending_input);
@@ -174,7 +174,7 @@ PHP_FUNCTION(readline_info)
                        RETVAL_LONG(rl_point);
                } else if (! strcasecmp((*what)->value.str.val,"end")) {
                        RETVAL_LONG(rl_end);
-#ifdef HAVE_READLINE
+#ifdef HAVE_LIBREADLINE
                } else if (! strcasecmp((*what)->value.str.val,"mark")) {
                        RETVAL_LONG(rl_mark);
                } else if (! strcasecmp((*what)->value.str.val,"done")) {
@@ -256,7 +256,7 @@ PHP_FUNCTION(readline_clear_history)
 /* }}} */
 /* {{{ proto array readline_list_history(void) 
    Lists the history */
-#ifdef HAVE_READLINE
+#ifdef HAVE_LIBREADLINE
 PHP_FUNCTION(readline_list_history)
 {
        HIST_ENTRY **history;