From 209caedfd0ef7b7c535a26ffe84e0ea9683335da Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 26 Jan 1999 20:49:55 +0000 Subject: [PATCH] Update. * 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. --- ChangeLog | 8 ++++++++ libio/Makefile | 4 ++-- libio/Versions | 2 +- libio/fgetc.c | 41 ----------------------------------------- libio/getc.c | 3 ++- libio/getc_u.c | 7 +++++-- libio/stdio.h | 7 ++++++- 7 files changed, 24 insertions(+), 48 deletions(-) delete mode 100644 libio/fgetc.c diff --git a/ChangeLog b/ChangeLog index f1a0d41..1a0ce9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 1999-01-26 Ulrich Drepper + * 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 3a7f3b4..5f62590 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 3d6918f..61b767a 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 094c5fe..0000000 --- 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 81a4b52..6ccef99 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 f074427..5572ef6 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 edbd82b..6056652 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)); -- 2.7.4