summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shaw <dshaw@jabberwocky.com>2009-08-11 20:34:16 +0200
committerDavid Shaw <dshaw@jabberwocky.com>2009-08-11 20:34:16 +0200
commitad2f89685539232d8c98cca2843b51975e83da8b (patch)
tree7060a029aac0ca32367d6c56c323ec6e0fbc4b22 /common
parentAsk to insert the right OpenPGP card. (diff)
downloadgnupg2-ad2f89685539232d8c98cca2843b51975e83da8b.tar.xz
gnupg2-ad2f89685539232d8c98cca2843b51975e83da8b.zip
* ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs around
HAVE_LIBREADLINE to allow building when readline isn't available.
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog5
-rw-r--r--common/ttyio.c7
-rw-r--r--common/ttyio.h11
3 files changed, 19 insertions, 4 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index b9c48188e..1e2d77454 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-11 David Shaw <dshaw@jabberwocky.com>
+
+ * ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs around
+ HAVE_LIBREADLINE to allow building when readline isn't available.
+
2009-08-06 Werner Koch <wk@g10code.com>
* status.h (STATUS_INV_SGNR, STATUS_NO_SGNR): New.
diff --git a/common/ttyio.c b/common/ttyio.c
index 9882c8e30..fc274070c 100644
--- a/common/ttyio.c
+++ b/common/ttyio.c
@@ -1,6 +1,6 @@
/* ttyio.c - tty i/O functions
- * Copyright (C) 1998,1999,2000,2001,2002,2003,
- * 2004, 2006 Free Software Foundation, Inc.
+ * Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2006,2007,
+ * 2009 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -648,6 +648,7 @@ tty_private_set_rl_hooks (void (*init_stream) (FILE *),
}
+#ifdef HAVE_LIBREADLINE
void
tty_enable_completion (rl_completion_func_t *completer)
{
@@ -671,7 +672,7 @@ tty_disable_completion (void)
my_rl_inhibit_completion (1);
}
-
+#endif
void
tty_cleanup_after_signal (void)
diff --git a/common/ttyio.h b/common/ttyio.h
index d19f7fdca..eb2116a02 100644
--- a/common/ttyio.h
+++ b/common/ttyio.h
@@ -1,5 +1,6 @@
/* ttyio.h
- * Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2003, 2006,
+ * 2009 Free Software Foundation, Inc.
*
* This file is part of GNUPG.
*
@@ -45,8 +46,16 @@ void tty_kill_prompt (void);
int tty_get_answer_is_yes (const char *prompt);
int tty_no_terminal (int onoff);
+#ifdef HAVE_LIBREADLINE
void tty_enable_completion (rl_completion_func_t *completer);
void tty_disable_completion (void);
+#else
+/* Use a macro to stub out these functions since a macro has no need
+ to typedef a "rl_completion_func_t" which would be undefined
+ without readline. */
+#define tty_enable_completion(x)
+#define tty_disable_completion()
+#endif
void tty_cleanup_after_signal (void);
void tty_cleanup_rl_after_signal (void);