Add getpass.h, so it's properly declared.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 9 Aug 2004 23:54:10 +0000 (23:54 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 9 Aug 2004 23:54:10 +0000 (23:54 +0000)
ChangeLog
lib/ChangeLog
lib/getpass.c
lib/getpass.h [new file with mode: 0644]
m4/ChangeLog
m4/getpass.m4
modules/getpass
modules/getpass-gnu

index 8bb8bc14a68f0d399fe97521bcff63473b2eb3ed..735d385ceef2e6be2aac1b4dd571449b09c6986d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * modules/xgethostname (Depends-on): Remove exit and error (not
        used).
 
+       * modules/getpass-gnu: Add getpass.h.
+       (Depends-on): Add stdbool.
+       * modules/getpass: Add getpass.h.
+
 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        More merge from coreutils.
index 194a6cc8f8cfaba2e240c96f2a18464b01f8de71..fc892c979caaf4cab4f1fdc820726dd7b1471ed4 100644 (file)
@@ -1,7 +1,10 @@
 2004-08-08  Simon Josefsson  <jas@extundo.com>
-
+       
        * xgethostname.c: Don't include error.h (not used).
 
+       * getpass.h: Add.
+       * getpass.c: Include getpass.h first.
+
 2004-08-08  Paul Eggert  <eggert@cs.ucla.edu>
 
        * xalloc-die.c: New files.
index 8a993d3e059b5633974f10f011a83d1e5fd1a10a..9ac01f22776749ffa4ab77f862d850a7d1ebceb8 100644 (file)
 # include <config.h>
 #endif
 
+#if !_LIBC
+# include "getpass.h"
+#endif
+
 #if _LIBC
 # define HAVE_STDIO_EXT_H 1
 #endif
diff --git a/lib/getpass.h b/lib/getpass.h
new file mode 100644 (file)
index 0000000..6502126
--- /dev/null
@@ -0,0 +1,31 @@
+/* getpass.h -- Read a password of arbitrary length from /dev/tty or stdin.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   Contributed by Simon Josefsson <jas@extundo.com>, 2004.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   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.  */
+
+#ifndef GETPASS_H
+#define GETPASS_H
+
+/* Get getpass declaration, if available.  */
+#include <unistd.h>
+
+#if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS
+/* Read a password of arbitrary length from /dev/tty or stdin.  */
+char *getpass (const char *prompt);
+
+#endif
+
+#endif /* GETPASS_H */
index d85088454e612ded3603d5c1b2381542607fd312..5b5b3470b8e2683c6ff141d45ce11af43f0352ed 100644 (file)
@@ -4,6 +4,11 @@
        * sha1.m4: Renamed from sha.m4.
        (gl_SHA1): Renamed from gl_SHA.  All uses changed.
 
+2004-08-08  Simon Josefsson  <jas@extundo.com>
+
+       * getpass.m4 (gl_FUNC_GETPASS, gl_FUNC_GETPASS_GNU):
+       Check getpass declaration.
+
 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
 
        More merge from coreutils.
index 4449bc5fb68dfbc77e60535b3274eb5b38262c29..0c4d8050f239479605fdaa30c86ac97f16c2e729 100644 (file)
@@ -1,4 +1,4 @@
-# getpass.m4 serial 3
+# getpass.m4 serial 4
 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -10,6 +10,7 @@ dnl the same distribution terms as the rest of that program.
 AC_DEFUN([gl_FUNC_GETPASS],
 [
   AC_REPLACE_FUNCS(getpass)
+  AC_CHECK_DECLS_ONCE(getpass)
   if test $ac_cv_func_getpass = no; then
     gl_PREREQ_GETPASS
   fi
@@ -19,6 +20,7 @@ AC_DEFUN([gl_FUNC_GETPASS],
 # arbitrary length (not just 8 bytes as on HP-UX).
 AC_DEFUN([gl_FUNC_GETPASS_GNU],
 [
+  AC_CHECK_DECLS_ONCE(getpass)
   dnl TODO: Detect when GNU getpass() is already found in glibc.
   AC_LIBOBJ(getpass)
   gl_PREREQ_GETPASS
index f7d00f31c6033db76bc80566f7b3d6230ecdb872..1d4b3addfeb2f7c4dc431925b68da9b68746042d 100644 (file)
@@ -2,6 +2,7 @@ Description:
 getpass() function: read a password from /dev/tty.
 
 Files:
+lib/getpass.h
 lib/getpass.c
 m4/getpass.m4
 
@@ -14,8 +15,10 @@ configure.ac:
 gl_FUNC_GETPASS
 
 Makefile.am:
+lib_SOURCES += getpass.h
 
 Include:
+"getpass.h"
 
 Maintainer:
 Jim Meyering, glibc
index 01c26869e79c85f3d957f1ed0d303777b0c085cc..945731fdb596e727a469b7b99be3801fdd9984e4 100644 (file)
@@ -2,19 +2,23 @@ Description:
 getpass() function: read a password of arbitrary length from /dev/tty.
 
 Files:
+lib/getpass.h
 lib/getpass.c
 m4/getpass.m4
 
 Depends-on:
 unlocked-io
 getline
+stdbool
 
 configure.ac:
 gl_FUNC_GETPASS_GNU
 
 Makefile.am:
+lib_SOURCES += getpass.h
 
 Include:
+"getpass.h"
 
 Maintainer:
 Jim Meyering, glibc