Updated FSF street address and preparations for a release candidate.
[gnupg.git] / util / ttyio.c
index b7dd471..65d5047 100644 (file)
@@ -16,7 +16,8 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
  */
 
 #include <config.h>
@@ -165,6 +166,7 @@ init_ttyfp(void)
 #ifdef HAVE_LIBREADLINE
     rl_catch_signals = 0;
     rl_instream = rl_outstream = ttyfp;
+    rl_inhibit_completion = 1;
 #endif
 #endif
 #ifdef HAVE_TCGETATTR
@@ -173,6 +175,25 @@ init_ttyfp(void)
     initialized = 1;
 }
 
+#ifdef HAVE_LIBREADLINE
+void
+tty_enable_completion(rl_completion_func_t *completer)
+{
+  if( !initialized )
+    init_ttyfp();
+  rl_attempted_completion_function=completer;
+  rl_inhibit_completion=0;
+}
+
+void
+tty_disable_completion(void)
+{
+  if( !initialized )
+    init_ttyfp();
+  rl_inhibit_completion=1;
+}
+#endif /*HAVE_LIBREADLINE*/
+
 int
 tty_batchmode( int onoff )
 {