diff options
author | foobar <sniper@php.net> | 2001-08-22 10:25:24 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2001-08-22 10:25:24 +0000 |
commit | 93311d93015e6d9a2deab94ad6c6fc557c93d9c9 (patch) | |
tree | 975de546a243004b2e13bc2a37eb516fbeaf95e4 | |
parent | 1f30f907b9dbe215e27c12f44ddab8528b9996a2 (diff) | |
download | php-git-93311d93015e6d9a2deab94ad6c6fc557c93d9c9.tar.gz |
Fixed two problems:
- CGI_BINARY was defined always thus this extension
could be compiled with even when not building CGI binary.
- HAVE_READLINE => HAVE_LIBREADLINE (typo)
-rw-r--r-- | ext/readline/config.m4 | 6 | ||||
-rw-r--r-- | ext/readline/php_readline.h | 4 | ||||
-rw-r--r-- | ext/readline/readline.c | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 index b17ed05552..ba136d2a8e 100644 --- a/ext/readline/config.m4 +++ b/ext/readline/config.m4 @@ -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 diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h index 72913200fc..f5803fbd49 100644 --- a/ext/readline/php_readline.h +++ b/ext/readline/php_readline.h @@ -26,10 +26,6 @@ #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 diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 560eec8e0b..0acd4139bb 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -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; |