summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-09 23:54:10 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-09 23:54:10 +0000
commit942fa9f9bad04cc75862b72fabc8f4ff617cdafb (patch)
tree69e953e0646dfbec8015ef57a8c325db635daa03 /lib
parent25ef69613afa3d3e727203c74b7c011f87813663 (diff)
downloadgnulib-942fa9f9bad04cc75862b72fabc8f4ff617cdafb.tar.gz
Add getpass.h, so it's properly declared.
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog5
-rw-r--r--lib/getpass.c4
-rw-r--r--lib/getpass.h31
3 files changed, 39 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 194a6cc8f8..fc892c979c 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -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.
diff --git a/lib/getpass.c b/lib/getpass.c
index 8a993d3e05..9ac01f2277 100644
--- a/lib/getpass.c
+++ b/lib/getpass.c
@@ -19,6 +19,10 @@
# 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
index 0000000000..6502126497
--- /dev/null
+++ b/lib/getpass.h
@@ -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 */