[svn] GnuPG - r5111 - trunk/common

svn author dshaw cvs at cvs.gnupg.org
Tue Aug 11 20:34:17 CEST 2009


Author: dshaw
Date: 2009-08-11 20:34:16 +0200 (Tue, 11 Aug 2009)
New Revision: 5111

Modified:
   trunk/common/ChangeLog
   trunk/common/ttyio.c
   trunk/common/ttyio.h
Log:
* ttyio.h, ttyio.c (tty_enable_completion): Some ifdefs around
HAVE_LIBREADLINE to allow building when readline isn't available.


Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2009-08-11 10:56:44 UTC (rev 5110)
+++ trunk/common/ChangeLog	2009-08-11 18:34:16 UTC (rev 5111)
@@ -1,3 +1,8 @@
+2009-08-11  David Shaw  <dshaw at 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 at g10code.com>
 
 	* status.h (STATUS_INV_SGNR, STATUS_NO_SGNR): New.

Modified: trunk/common/ttyio.c
===================================================================
--- trunk/common/ttyio.c	2009-08-11 10:56:44 UTC (rev 5110)
+++ trunk/common/ttyio.c	2009-08-11 18:34:16 UTC (rev 5111)
@@ -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 @@
 }
 
 
+#ifdef HAVE_LIBREADLINE
 void
 tty_enable_completion (rl_completion_func_t *completer)
 {
@@ -671,8 +672,8 @@
 
   my_rl_inhibit_completion (1);
 }
+#endif
 
-
 void
 tty_cleanup_after_signal (void)
 {

Modified: trunk/common/ttyio.h
===================================================================
--- trunk/common/ttyio.h	2009-08-11 10:56:44 UTC (rev 5110)
+++ trunk/common/ttyio.h	2009-08-11 18:34:16 UTC (rev 5111)
@@ -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 @@
 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);
 




More information about the Gnupg-commits mailing list