aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--libio/Makefile4
-rw-r--r--libio/Versions2
-rw-r--r--libio/fgetc.c41
-rw-r--r--libio/getc.c3
-rw-r--r--libio/getc_u.c7
-rw-r--r--libio/stdio.h7
7 files changed, 24 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index f1a0d41f2a..1a0ce9a5db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
1999-01-26 Ulrich Drepper <drepper@cygnus.com>
+ * libio/Makefile (routines): Remove fgetc.
+ * libio/fgetc.c: Removed.
+ * libio/getc.c: Add fgetc alias.
+ * libio/Versions [GLIBC_2.1]: Add fgetc_unlocked.
+ * libio/getc_u.c: Rename functio to __getc_unlocked and make
+ getc_unlocked and fgetc_unlocked weak aliases.
+ * libio/stdio.h: Add prototype for fgetc_unlocked.
+
* sysdeps/gnu/bits/utmp.h: Don't prepend exit_status elements with
__ since utmp.h is not mentioned in any standard.
diff --git a/libio/Makefile b/libio/Makefile
index 3a7f3b473c..5f6259038a 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -31,7 +31,7 @@ routines := \
iovsprintf iovsscanf \
iofgetpos64 iofopen64 iofsetpos64 \
\
- clearerr feof ferror fgetc fileno fputc freopen fseek getc getchar \
+ clearerr feof ferror fileno fputc freopen fseek getc getchar \
memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
iovdprintf vscanf vsnprintf obprintf fcloseall fseeko ftello \
freopen64 fseeko64 ftello64 \
diff --git a/libio/Versions b/libio/Versions
index 3d6918f2b8..61b767a2d3 100644
--- a/libio/Versions
+++ b/libio/Versions
@@ -95,7 +95,7 @@ libc {
# f*
fgetpos64; fopen64; freopen64; fseeko; fseeko64; fsetpos64; ftello;
ftello64; fopen; fclose; fdopen; fread_unlocked; fwrite_unlocked;
- fgets_unlocked; fputs_unlocked;
+ fgets_unlocked; fputs_unlocked; fgetc_unlocked;
# p*
pclose; popen;
diff --git a/libio/fgetc.c b/libio/fgetc.c
deleted file mode 100644
index 094c5fe62f..0000000000
--- a/libio/fgetc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library 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 library 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 library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-#include "stdio.h"
-
-int
-fgetc (fp)
- FILE *fp;
-{
- int result;
- CHECK_FILE (fp, EOF);
- _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
- _IO_flockfile (fp);
- result = _IO_getc_unlocked (fp);
- _IO_funlockfile (fp);
- _IO_cleanup_region_end (0);
- return result;
-}
diff --git a/libio/getc.c b/libio/getc.c
index 81a4b52c83..6ccef9960d 100644
--- a/libio/getc.c
+++ b/libio/getc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -46,4 +46,5 @@ _IO_getc (fp)
#ifdef weak_alias
weak_alias (_IO_getc, getc)
+weak_alias (_IO_getc, fgetc)
#endif
diff --git a/libio/getc_u.c b/libio/getc_u.c
index f074427446..5572ef6b3e 100644
--- a/libio/getc_u.c
+++ b/libio/getc_u.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU IO Library.
This library is free software; you can redistribute it and/or
@@ -29,9 +29,12 @@
#undef getc_unlocked
int
-getc_unlocked (fp)
+__getc_unlocked (fp)
FILE *fp;
{
CHECK_FILE (fp, EOF);
return _IO_getc_unlocked (fp);
}
+
+weak_alias (__getc_unlocked, getc_unlocked)
+weak_alias (__getc_unlocked, fgetc_unlocked)
diff --git a/libio/stdio.h b/libio/stdio.h
index edbd82b3dc..6056652bf9 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -1,5 +1,5 @@
/* Define ISO C stdio on top of C++ iostreams.
- Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+ Copyright (C) 1991, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -347,6 +347,11 @@ extern int getc_unlocked __P ((FILE *__stream));
extern int getchar_unlocked __P ((void));
#endif /* Use POSIX or MISC. */
+#ifdef __USE_MISC
+/* Faster version when locking is not necessary. */
+extern int fgetc_unlocked __P ((FILE *__stream));
+#endif /* Use MISC. */
+
/* Write a character to STREAM. */
extern int fputc __P ((int __c, FILE *__stream));