cvs: php4 /ext/readline config.m4 php_readline.h readline.c
| From: | Jani Taskinen | Date: | Wed, 22 Aug 2001 10:25:24 +0000 |
| Subject: | cvs: php4 /ext/readline config.m4 php_readline.h readline.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7022@lists.php.net to get a copy of this message | ||
sniper Wed Aug 22 06:25:24 2001 EDT
Modified files:
/php4/ext/readline config.m4 php_readline.h readline.c
Log:
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)
Index: php4/ext/readline/config.m4
diff -u php4/ext/readline/config.m4:1.10 php4/ext/readline/config.m4:1.11
--- php4/ext/readline/config.m4:1.10 Tue Mar 27 15:34:41 2001
+++ php4/ext/readline/config.m4 Wed Aug 22 06:25:24 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.10 2001/03/27 20:34:41 sniper Exp $
+dnl $Id: config.m4,v 1.11 2001/08/22 10:25:24 sniper Exp $
dnl config.m4 for extension readline
dnl don't forget to call PHP_EXTENSION(readline)
@@ -8,6 +8,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
Index: php4/ext/readline/php_readline.h
diff -u php4/ext/readline/php_readline.h:1.10 php4/ext/readline/php_readline.h:1.11
--- php4/ext/readline/php_readline.h:1.10 Mon Feb 26 01:07:14 2001
+++ php4/ext/readline/php_readline.h Wed Aug 22 06:25:24 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_readline.h,v 1.10 2001/02/26 06:07:14 andi Exp $ */
+/* $Id: php_readline.h,v 1.11 2001/08/22 10:25:24 sniper Exp $ */
#ifndef PHP_READLINE_H
#define PHP_READLINE_H
@@ -24,10 +24,6 @@
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
#ifdef ZTS
#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;
Index: php4/ext/readline/readline.c
diff -u php4/ext/readline/readline.c:1.22 php4/ext/readline/readline.c:1.23
--- php4/ext/readline/readline.c:1.22 Mon Jul 30 04:24:33 2001
+++ php4/ext/readline/readline.c Wed Aug 22 06:25:24 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: readline.c,v 1.22 2001/07/30 08:24:33 zeev Exp $ */
+/* $Id: readline.c,v 1.23 2001/08/22 10:25:24 sniper Exp $ */
/* {{{ includes & prototypes */
@@ -57,7 +57,7 @@
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 @@
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 @@
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 @@
/* }}} */
/* {{{ proto array readline_list_history(void)
Lists the history */
-#ifdef HAVE_READLINE
+#ifdef HAVE_LIBREADLINE
PHP_FUNCTION(readline_list_history)
{
HIST_ENTRY **history;