ifneq (,$(filter %REENTRANT, $(defines)))
routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \
- iofflush_u putc_u putchar_u
+ iofflush_u putc_u putchar_u peekc
CPPFLAGS += -D_IO_MTSAFE_IO
endif
#include "stdio.h"
int
-feof (fp)
+_IO_feof (fp)
_IO_FILE* fp;
{
int result;
_IO_funlockfile (fp);
return result;
}
+weak_alias (_IO_feof, feof)
#ifdef _IO_MTSAFE_IO
/* The feof implementation for libio does not require locking because
it only accesses once a single variable and this is already atomic
(at least at thread level). */
-weak_alias (feof, feof_locked)
+weak_alias (_IO_feof, feof_locked)
#endif
#include "stdio.h"
int
-ferror (fp)
+_IO_ferror (fp)
_IO_FILE* fp;
{
int result;
_IO_funlockfile (fp);
return result;
}
+weak_alias (_IO_ferror, ferror)
#ifdef _IO_MTSAFE_IO
#include "libioP.h"
#include "stdio.h"
-#undef getc
+#undef _IO_getc
int
-getc (fp)
+_IO_getc (fp)
FILE *fp;
{
int result;
__libc_cleanup_region_end (1);
return result;
}
+#undef getc
+weak_alias (_IO_getc, getc)
#ifdef _IO_MTSAFE_IO
# undef getc_locked
}
weak_alias (_IO_gets, gets)
+
+link_warning (gets, "the `gets' function is dangerous and should not be used.")
#ifndef _IO_STDIO_H
#define _IO_STDIO_H
+#include <features.h>
#include <_G_config.h>
#define _IO_pos_t _G_fpos_t /* obsolete */
#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
+extern int _IO_getc __P ((_IO_FILE *__fp));
+extern int _IO_putc __P ((int __c, _IO_FILE *__fp));
+extern int _IO_feof __P ((_IO_FILE *__fp));
+extern int _IO_ferror __P ((_IO_FILE *__fp));
+
+extern int _IO_peekc_locked __P ((_IO_FILE *__fp));
+
/* This one is for Emacs. */
#define _IO_PENDING_OUTPUT_COUNT(_fp) \
((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)
-extern int _IO_getc_locked __P ((_IO_FILE *));
-extern int _IO_putc_locked __P ((int, _IO_FILE *));
-
extern void _IO_flockfile __P ((_IO_FILE *));
extern void _IO_funlockfile __P ((_IO_FILE *));
+extern int _IO_ftrylockfile __P ((_IO_FILE *));
-#ifndef _IO_MTSAFE_IO
-# define _IO_flockfile(FILE) /**/
-# define _IO_funlockfile(FILE) /**/
+#ifdef _IO_MTSAFE_IO
+weak_extern (_IO_flockfile)
+weak_extern (_IO_funlockfile)
+#else
+# define _IO_flockfile(_fp) /**/
+# define _IO_funlockfile(_fp) /**/
+# define _IO_ftrylockfile(_fp) /**/
#endif /* !_IO_MTSAFE_IO */
+#ifdef __USE_REENTRANT
+# define _IO_getc(_fp) _IO_getc (_fp)
+# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
+# define _IO_putc(_ch, _fp) _IO_putc (_ch, _fp)
+# define _IO_feof(_fp) _IO_feof (_fp)
+# define _IO_ferror(_fp) _IO_ferror (_fp)
+#else
+# define _IO_getc(_fp) _IO_getc_unlocked (_fp)
+# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
+# define _IO_putc(_ch, _fp) _IO_putc_unlocked (_ch, _fp)
+# define _IO_feof(_fp) _IO_feof_unlocked (_fp)
+# define _IO_ferror(_fp) _IO_ferror_unlocked (_fp)
+#endif
extern int _IO_vfscanf __P((_IO_FILE*, const char*, _IO_va_list, int*));
extern int _IO_vfprintf __P((_IO_FILE*, const char*, _IO_va_list));
--- /dev/null
+/*
+Copyright (C) 1993, 1995, 1996 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"
+
+#undef _IO_peekc
+
+int
+_IO_peekc_locked (fp)
+ FILE *fp;
+{
+ int result;
+ CHECK_FILE (fp, EOF);
+ __libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
+ _IO_flockfile (fp);
+ result = _IO_peekc_unlocked (fp);
+ __libc_cleanup_region_end (1);
+ return result;
+}
#include "libioP.h"
#include "stdio.h"
-#undef putc
+#undef _IO_putc
int
-putc (c, fp)
+_IO_putc (c, fp)
int c;
_IO_FILE *fp;
{
__libc_cleanup_region_end (1);
return result;
}
+#undef putc
+weak_alias (_IO_putc, putc)
#ifdef _IO_MTSAFE_IO
# undef putc_locked
CHECK_FILE (fp, EOF);
return _IO_putc_unlocked (c, fp);
}
-
-#ifdef _LIBC_REENTRANT
-weak_alias (putc_unlocked, _IO_putc_unlocked)
-#endif
extern int fileno_unlocked __P ((FILE *));
extern void flockfile __P ((FILE *));
extern void funlockfile __P ((FILE *));
+extern int ftrylockfile __P ((FILE *));
extern int fclose_unlocked __P ((FILE *));
extern int fflush_locked __P ((FILE *));
extern int fflush_unlocked __P ((FILE *));
# ifndef _LIBC
# define getc_unlocked(fp) _IO_getc_unlocked (fp)
-# define getc_locked(fp) fgetc (fp)
+# define getc_locked(fp) _IO_getc (fp)
# define getchar_unlocked() _IO_getc_unlocked (stdin)
-# define getchar_locked() getc (stdin)
+# define getchar_locked() _IO_getc (stdin)
# define putchar_unlocked(c) _IO_putc_unlocked (c, stdout)
-# define putchar_locked(c) putc (c, stdout)
+# define putchar_locked(c) _IO_putc (c, stdout)
# endif
#endif /* __USE_REENTRANT */
-#define putchar(c) putc (c, stdout)
-#define getchar() getc (stdin)
+#define getc(_fp) _IO_getc (_fp)
+#define putc(_ch, _fp) _IO_putc (_ch, _fp)
+#define putchar(_ch) _IO_putc (_ch, stdout)
+#define getchar() _IO_getc (stdin)
#ifdef __cplusplus
#if STDC_HEADERS || _LIBC
#include <stdlib.h>
static VOID *fixup_null_alloc __P ((size_t n));
+VOID *xmalloc __P ((size_t n));
+VOID *xcalloc __P ((size_t n, size_t s));
+VOID *xrealloc __P ((VOID *p, size_t n));
#else
VOID *calloc ();
VOID *malloc ();
/* xstrdup.c -- copy a string with out of memory checking
- Copyright (C) 1990 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1996 Free Software Foundation, Inc.
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
#else
#include <strings.h>
#endif
-char *xmalloc ();
+void *xmalloc __P ((size_t n));
+char *xstrdup __P ((char *string));
/* Return a newly allocated copy of STRING. */
-# Messages frangais pour GNU concernant gcal.
+# Messages français pour GNU concernant libc.
# Copyright (C) 1996 Free Software Foundation, Inc.
# Michel Robitaille <robitail@IRO.UMontreal.CA>, 1996.
#
msgstr ""
"Project-Id-Version: GNU libc 1.94\n"
"POT-Creation-Date: 1996-09-08 03:45 -0400\n"
-"PO-Revision-Date: 1996-09-29 14:50 -0400\n"
+"PO-Revision-Date: 1996-10-10 19:03 -0400\n"
"Last-Translator: Michel Robitaille <robitail@IRO.UMontreal.CA>\n"
"Language-Team: French <fr@li.org>\n"
"MIME-Version: 1.0\n"
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
- int indfound;
+ int indfound = 0;
int option_index;
/* This is an option that requires an argument. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
- if (nameend - nextchar == strlen (p->name))
+ if ((unsigned int) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;
/* Lock stream. */
__libc_cleanup_region_start ((void (*) (void *)) &__funlockfile, s);
-
- if (__flockfile != NULL)
- __flockfile (s);
+ __flockfile (s);
/* Write the literal text before the first format. */
outstring ((const UCHAR_T *) format,
int
main(int argc, char *argv[])
{
- char * filename = "xbug.c";
+ char filename[] = "xbug.c";
FILE *input;
Buffer buffer;
#include <errno.h>
#include <string.h>
-link_warning (gets,
- "the `gets' function is unreliable and should not be used.")
+link_warning (gets, "the `gets' function is dangerous and should not be used.")
/* Read a newline-terminated string from stdin into S,
removing the trailing newline. Return S or NULL. */