Commit eb1b1643 authored by Peter Eisentraut's avatar Peter Eisentraut

Work with Readline 4.2.

parent 25efda22
This diff is collapsed.
...@@ -879,35 +879,18 @@ AC_CHECK_FUNC(rint, ...@@ -879,35 +879,18 @@ AC_CHECK_FUNC(rint,
# Readline versions < 2.1 don't have rl_completion_append_character # Readline versions < 2.1 don't have rl_completion_append_character
AC_MSG_CHECKING([for rl_completion_append_character]) AC_MSG_CHECKING([for rl_completion_append_character])
AC_TRY_LINK([#include <stdio.h> AC_TRY_LINK([#include <stdio.h>
#ifdef HAVE_READLINE_H
# include <readline.h>
#endif
#ifdef HAVE_READLINE_READLINE_H #ifdef HAVE_READLINE_READLINE_H
# include <readline/readline.h> # include <readline/readline.h>
#endif], #elif defined(HAVE_READLINE_H)
# include <readline.h>
#endif
],
[rl_completion_append_character = 'x';], [rl_completion_append_character = 'x';],
[AC_MSG_RESULT(yes) [AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)], AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
AC_CHECK_FUNCS([rl_completion_matches])
# Check whether readline's filename_completion_function is declared.
# Some prehistoric versions of readline, in particular those shipped
# with earlier Cygwins don't have this declared, although it's in the
# library.
AC_MSG_CHECKING([whether filename_completion_function is declared])
if test "$ac_cv_header_readline_h" = yes; then
_readline_header='readline.h'
elif test "$ac_cv_header_readline_readline_h" = yes; then
_readline_header='readline/readline.h'
else
_readline_header='xxx'
fi
AC_EGREP_HEADER([filename_completion_function], [$_readline_header],
[AC_DEFINE(HAVE_FILENAME_COMPLETION_FUNCTION_DECL)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
dnl Cannot use AC_CHECK_FUNC because finite may be a macro dnl Cannot use AC_CHECK_FUNC because finite may be a macro
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2000 by PostgreSQL Global Development Group * Copyright 2000 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.29 2001/03/30 04:50:47 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.30 2001/04/14 22:55:02 petere Exp $
*/ */
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -60,9 +60,10 @@ ...@@ -60,9 +60,10 @@
#include "common.h" #include "common.h"
#include "settings.h" #include "settings.h"
#ifndef HAVE_FILENAME_COMPLETION_FUNCTION_DECL extern char *filename_completion_function();
char *filename_completion_function(char *, int);
#ifdef HAVE_RL_COMPLETION_MATCHES
#define completion_matches(x, y) rl_completion_matches((x), ((rl_compentry_func_t *)(y)))
#endif #endif
#define BUF_SIZE 2048 #define BUF_SIZE 2048
...@@ -100,7 +101,7 @@ void ...@@ -100,7 +101,7 @@ void
initialize_readline(void) initialize_readline(void)
{ {
rl_readline_name = pset.progname; rl_readline_name = pset.progname;
rl_attempted_completion_function = psql_completion; rl_attempted_completion_function = (void *)psql_completion;
rl_basic_word_break_characters = "\t\n@$><=;|&{( "; rl_basic_word_break_characters = "\t\n@$><=;|&{( ";
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your * or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure. * changes will be overwritten the next time you run configure.
* *
* $Id: config.h.in,v 1.161 2001/03/23 18:42:12 tgl Exp $ * $Id: config.h.in,v 1.162 2001/04/14 22:55:02 petere Exp $
*/ */
#ifndef CONFIG_H #ifndef CONFIG_H
...@@ -573,8 +573,8 @@ extern int fdatasync(int fildes); ...@@ -573,8 +573,8 @@ extern int fdatasync(int fildes);
/* Set to 1 if your libreadline defines rl_completion_append_character */ /* Set to 1 if your libreadline defines rl_completion_append_character */
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER #undef HAVE_RL_COMPLETION_APPEND_CHARACTER
/* Set to 1 if filename_completion_function is declared in the readline header */ /* Set to 1 if you have rl_completion_matches */
#undef HAVE_FILENAME_COMPLETION_FUNCTION_DECL #undef HAVE_RL_COMPLETION_MATCHES
/* Set to 1 if you have getopt_long() (GNU long options) */ /* Set to 1 if you have getopt_long() (GNU long options) */
#undef HAVE_GETOPT_LONG #undef HAVE_GETOPT_LONG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment