summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorPeter Eisentraut2002-04-10 22:47:09 +0000
committerPeter Eisentraut2002-04-10 22:47:09 +0000
commit5c1f31d2d47110f49d16bd56295125d656401855 (patch)
tree8e3cd0ad3576df4af07ede841db0f68b3908a2b7 /src/bin
parent563673e15db995b6f531b44be7bb162330ac157a (diff)
Readline and Zlib now required by default. Add options --without-readline
and --without-zlib to turn them off.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/psql/input.c14
-rw-r--r--src/bin/psql/input.h32
-rw-r--r--src/bin/psql/startup.c13
3 files changed, 21 insertions, 38 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 32872e9d71..6e083506f3 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.18 2001/10/25 05:49:54 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.19 2002/04/10 22:46:58 petere Exp $
*/
#include "postgres_fe.h"
#include "input.h"
@@ -19,8 +19,6 @@
/* (of course there is no runtime command for doing that :) */
#ifdef USE_READLINE
static bool useReadline;
-#endif
-#ifdef USE_HISTORY
static bool useHistory;
#endif
@@ -44,7 +42,7 @@ gets_interactive(char *prompt)
{
char *s;
-#ifdef USE_HISTORY
+#ifdef USE_READLINE
const char *var;
static char *prev_hist = NULL;
#endif
@@ -62,7 +60,7 @@ gets_interactive(char *prompt)
}
#endif
-#ifdef USE_HISTORY
+#ifdef USE_READLINE
if (useHistory && s && s[0] != '\0')
{
var = GetVariable(pset.vars, "HISTCONTROL");
@@ -133,7 +131,7 @@ initializeInput(int flags)
}
#endif
-#ifdef USE_HISTORY
+#ifdef USE_READLINE
if (flags == 1)
{
const char *home;
@@ -168,7 +166,7 @@ initializeInput(int flags)
bool
saveHistory(char *fname)
{
-#ifdef USE_HISTORY
+#ifdef USE_READLINE
if (useHistory && fname)
{
if (write_history(fname) != 0)
@@ -194,7 +192,7 @@ finishInput(void)
finishInput(int exitstatus, void *arg)
#endif
{
-#ifdef USE_HISTORY
+#ifdef USE_READLINE
if (useHistory)
{
char *home;
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 8c6def33a3..e893b8c539 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.15 2001/11/05 17:46:31 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.16 2002/04/10 22:47:03 petere Exp $
*/
#ifndef INPUT_H
#define INPUT_H
@@ -12,26 +12,20 @@
* If some other file needs to have access to readline/history, include this
* file and save yourself all this work.
*
- * USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not.
+ * USE_READLINE is the definite pointers regarding existence or not.
*/
#ifdef HAVE_LIBREADLINE
-#if defined(HAVE_READLINE_READLINE_H)
-#include <readline/readline.h>
-#define USE_READLINE 1
-#elif defined(HAVE_READLINE_H)
-#include <readline.h>
-#define USE_READLINE 1
-#endif
-#endif
-
-#if defined(HAVE_HISTORY_FUNCTIONS)
-#if defined(HAVE_READLINE_HISTORY_H)
-#include <readline/history.h>
-#define USE_HISTORY 1
-#elif defined(HAVE_HISTORY_H)
-#include <history.h>
-#define USE_HISTORY 1
-#endif
+# define USE_READLINE 1
+# if defined(HAVE_READLINE_READLINE_H)
+# include <readline/readline.h>
+# elif defined(HAVE_READLINE_H)
+# include <readline.h>
+# endif
+# if defined(HAVE_READLINE_HISTORY_H)
+# include <readline/history.h>
+# elif defined(HAVE_HISTORY_H)
+# include <history.h>
+# endif
#endif
char *gets_interactive(char *prompt);
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 3a7b7a0f93..765f6db901 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.55 2002/03/27 19:16:13 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.56 2002/04/10 22:47:04 petere Exp $
*/
#include "postgres_fe.h"
@@ -636,7 +636,7 @@ showVersion(void)
{
puts("psql (PostgreSQL) " PG_VERSION);
-#if defined(USE_READLINE) || defined (USE_HISTORY) || defined(MULTIBYTE)
+#if defined(USE_READLINE) || defined(MULTIBYTE)
fputs(gettext("contains support for: "), stdout);
#ifdef USE_READLINE
@@ -644,15 +644,6 @@ showVersion(void)
#define _Feature
#endif
-#ifdef USE_HISTORY
-#ifdef _Feature
- fputs(", ", stdout);
-#else
-#define _Feature
-#endif
- fputs(gettext("history"), stdout);
-#endif
-
#ifdef MULTIBYTE
#ifdef _Feature
fputs(", ", stdout);