summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/config.m412
-rw-r--r--ext/readline/php_readline.h8
-rw-r--r--ext/readline/readline.c20
3 files changed, 23 insertions, 17 deletions
diff --git a/ext/readline/config.m4 b/ext/readline/config.m4
index 6f6151df3..a1a9d60b5 100644
--- a/ext/readline/config.m4
+++ b/ext/readline/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.25.2.1 2005/11/18 15:07:39 sniper Exp $
+dnl $Id: config.m4,v 1.25.2.3 2005/11/28 23:04:01 sniper Exp $
dnl
PHP_ARG_WITH(libedit,for libedit readline replacement,
@@ -10,7 +10,7 @@ if test "$PHP_LIBEDIT" = "no"; then
[ --with-readline[=DIR] Include readline support (CLI/CGI only)])
fi
-if test "$PHP_READLINE" != "no"; then
+if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then
for i in $PHP_READLINE /usr/local /usr; do
test -f $i/include/readline/readline.h && READLINE_DIR=$i && break
done
@@ -59,8 +59,6 @@ if test "$PHP_READLINE" != "no"; then
-L$READLINE_DIR/$PHP_LIBDIR $PHP_READLINE_LIBS
])
- PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
- PHP_SUBST(READLINE_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBREADLINE, 1, [ ])
elif test "$PHP_LIBEDIT" != "no"; then
@@ -94,7 +92,11 @@ elif test "$PHP_LIBEDIT" != "no"; then
-L$READLINE_DIR/$PHP_LIBDIR
])
+ AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
+fi
+
+if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then
+ AC_CHECK_FUNCS([rl_completion_matches])
PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
PHP_SUBST(READLINE_SHARED_LIBADD)
- AC_DEFINE(HAVE_LIBEDIT, 1, [ ])
fi
diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h
index 4c8da11ed..f74a19cfa 100644
--- a/ext/readline/php_readline.h
+++ b/ext/readline/php_readline.h
@@ -2,12 +2,12 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_readline.h,v 1.17 2005/08/03 14:07:42 sniper Exp $ */
+/* $Id: php_readline.h,v 1.17.2.1 2006/01/01 12:50:12 sniper Exp $ */
#ifndef PHP_READLINE_H
#define PHP_READLINE_H
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index cfe382c31..31db9eaf0 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -2,12 +2,12 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2005 The PHP Group |
+ | Copyright (c) 1997-2006 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: readline.c,v 1.42 2005/08/03 14:07:42 sniper Exp $ */
+/* $Id: readline.c,v 1.42.2.3 2006/01/01 12:50:12 sniper Exp $ */
/* {{{ includes & prototypes */
@@ -29,6 +29,10 @@
#if HAVE_LIBREADLINE || HAVE_LIBEDIT
+#ifndef HAVE_RL_COMPLETION_MATCHES
+#define rl_completion_matches completion_matches
+#endif
+
#include <readline/readline.h>
#ifndef HAVE_LIBEDIT
#include <readline/history.h>
@@ -249,7 +253,7 @@ PHP_FUNCTION(readline_info)
Adds a line to the history */
PHP_FUNCTION(readline_add_history)
{
- pval **arg;
+ zval **arg;
int ac = ZEND_NUM_ARGS();
if (ac != 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) {
@@ -308,7 +312,7 @@ PHP_FUNCTION(readline_list_history)
Reads the history */
PHP_FUNCTION(readline_read_history)
{
- pval **arg;
+ zval **arg;
char *filename = NULL;
int ac = ZEND_NUM_ARGS();
@@ -335,7 +339,7 @@ PHP_FUNCTION(readline_read_history)
Writes the history */
PHP_FUNCTION(readline_write_history)
{
- pval **arg;
+ zval **arg;
char *filename = NULL;
int ac = ZEND_NUM_ARGS();
@@ -421,7 +425,7 @@ static char **_readline_completion_cb(const char *text, int start, int end)
if (call_user_function(CG(function_table), NULL, _readline_completion, &_readline_array, 3, params TSRMLS_CC) == SUCCESS) {
if (Z_TYPE(_readline_array) == IS_ARRAY) {
if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
- matches = completion_matches(text,_readline_command_generator);
+ matches = rl_completion_matches(text,_readline_command_generator);
} else {
matches = malloc(sizeof(char *) * 2);
matches[0] = strdup("");