mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
6bc31da01b
Wed Jan 1 15:15:00 1997 Ulrich Drepper <drepper@cygnus.com> * libio/Makefile (routines): Add fcloseall. * libio/fcloseall.c: New file. * libio/stdio.h [__USE_GNU]: Add prototype for fcloseall. * libio/iofclose.c: Don't close all streams when argument is NULL. * stdio/Makefile (routines): Add fcloseall. * stdio/fcloseall.c: New file. * stdio/stdio.h [__USE_GNU]: Add prototype for fcloseall. * stdio/fclose.c: Don't close all streams when argument is NULL. * manual/stdio.texi: Document fcloseall. * sysdeps/generic/abort.c: Call __fcloseall instead of fclose with NULL argument. * socket/sys/un.h (SUN_LEN): Add cast. * sunrpc/auth_unix.c (authunix_create): Change parameter types of uid, gid, and aup_gids to uid_t and gid_t respectively. (authunix_create_default): Likewise. (authunix_refresh): Correct cast for aup_gids assignment. * sunrpc/rpc/auth.h (authunix_create): Correct types in declaration. * sunrpc/rpc/auth_unix.h (struct authunix_parms): Correct field types to uid_t and gid_t respectively. (struct short_hand_verf): Likewise. Reported by Andreas Schwab. * sysdeps/ieee754/Makefile: New file. Make sure ieee754.h gets installed. * sysdeps/ieee754/ieee754.h: Protect against multiple inclusion and use in C++ programs. * sysdeps/libm-i387/e_pow.S: New file. Optimized ix87 assembler version of pow() function. * sysdeps/libm-i387/e_powf.S: New file. Float version. * sysdeps/libm-i387/e_powl.S: New file. Long double version. * sysdeps/libm-i387/s_expm1.S: New file. Optimized ix87 assembler version of expm1() function. * sysdeps/libm-i387/s_expm1f.S: New file. Float version. * sysdeps/libm-i387/s_expm1l.S: New file. Long double version. * sysdeps/libm-i387/e_exp.S: Optimize handling of +-Inf. Better handling of computation stack from current NetBSD sources. * sysdeps/libm-i387/e_expf.S: Likewise. * sysdeps/libm-i387/e_expl.S: Likewise. * sysdeps/libm-i387/e_log.S: Use fstp instead of fincstp. * sysdeps/libm-i387/e_logf.S: Likewise. * sysdeps/libm-i387/e_logl.S: Likewise. * sysdeps/libm-i387/e_log10.S: Likewise. * sysdeps/libm-i387/e_log10f.S: Likewise. * sysdeps/libm-i387/e_log10l.S: Likewise. * sysdeps/libm-i387/s_asinh.S: Likewise. * sysdeps/libm-i387/s_asinhf.S: Likewise. * sysdeps/libm-i387/s_asinhl.S: Likewise. * sysdeps/libm-i387/s_significandl.S: Likewise. * sysdeps/libm-i387/s_ceil.S: Don't create stack frame. Modify stack pointer directly. Use 32 bit instead of 16 bit operations. * sysdeps/libm-i387/s_ceilf.S: Likewise. * sysdeps/libm-i387/s_ceill.S: Likewise. * sysdeps/libm-i387/s_floor.S: Likewise. * sysdeps/libm-i387/s_floorf.S: Likewise. * sysdeps/libm-i387/s_floorl.S: Likewise. * sysdeps/libm-ieee754/e_coshf.c (huge): Don't declare volatile. * sysdeps/libm-ieee754/e_expf.c: Likewise. * sysdeps/libm-ieee754/e_powf.c: Likewise. From current NetBSD sources. * sysdeps/libm-ieee754/e_hypot.c (__ieee754_hypot): Don't initialize `a' and `b' in definition. * sysdeps/libm-ieee754/e_hypotf.c: Likewise. * sysdeps/libm-ieee754/e_hypotl.c: New file. Long double implementation. * sysdeps/libm-ieee754/e_sinhl.c: New file. Long double implementation. * sysdeps/stub/e_hypotl.c: Removed. We have a real version now. * sysdeps/stub/e_sinhl.c: Removed. * sysdeps/posix/sigpause.c (__sigpause): Use sigdelset instead of sigaddset. Reported by Andreas Schwab. (__default_sigpause): New function. Call __sigpause as BSD version. Make this the default function by providing alias sigpause. * sysdeps/stub/sigpause.c (__default_sigpause): New funciton. Simply fail. Provide alias sigpause. Wed Jan 1 12:34:54 1997 Ulrich Drepper <drepper@cygnus.com> * po/es.po: Update for glibc-1.98. * po/fr.po: Likewise. * po/sv.po: New file. Swedish translation. Wed Jan 1 12:18:07 1997 MacGyver <macgyver@tos.net> * values.h: Fix typos: use SHRT_MAX but SHORT_MAX and SHRT_MIN but SHORT_MIN. Tue Dec 24 23:10:21 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile: Replace `stubs.h' by `gnu/stubs.h'. * features.h: Include <gnu/stubs.h> instead of <stubs.h>. Tue Dec 24 22:16:55 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile (subdirs): Move `elf' last so that librtld.so isn't relinked in the `make others' pass if an add-on adds something to libc. Mon Dec 23 21:23:16 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/abort-instr.h: New File. Mon Dec 23 21:16:38 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/Makefile ($(subdir)=elf): Define CFLAGS-rtld.c to prevent warning. Mon Dec 23 21:14:22 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * resolv/Makefile (subdirs-dirs): Define. Mon Dec 23 20:56:49 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/gnu/utmpbits.h (struct utmp): Fix padding. Mon Dec 30 11:05:11 1996 Ulrich Drepper <drepper@cygnus.com> Update from ADO tzcode1996o. * time/difftime.c: De-ANSI-declfy. Simplify computation of hibit according to ADO version. * time/zic.c: Correct typo is message. Update from ADO tzdata1996n. * time/asia: Updated. * time/australasia: Likewise. * time/europe: Likewise. * time/northamerica: Likewise. * time/southamerica: Likewise.
280 lines
9.0 KiB
C
280 lines
9.0 KiB
C
/* This is part of the iostream/stdio library, providing -*- C -*- I/O.
|
|
Define ANSI C stdio on top of C++ iostreams.
|
|
Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2 of the License, 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
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with this library; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
/*
|
|
* ISO C Standard: 4.9 INPUT/OUTPUT <stdio.h>
|
|
*/
|
|
|
|
#ifndef _STDIO_H
|
|
#define _STDIO_H
|
|
#define _STDIO_USES_IOSTREAM
|
|
|
|
#include <libio.h>
|
|
|
|
#ifndef NULL
|
|
#ifdef __cplusplus
|
|
#define NULL 0
|
|
#else
|
|
#define NULL (void*)0
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef EOF
|
|
#define EOF (-1)
|
|
#endif
|
|
#ifndef BUFSIZ
|
|
#define BUFSIZ _IO_BUFSIZ
|
|
#endif
|
|
|
|
#define _IOFBF 0 /* Fully buffered. */
|
|
#define _IOLBF 1 /* Line buffered. */
|
|
#define _IONBF 2 /* No buffering. */
|
|
|
|
#define SEEK_SET 0
|
|
#define SEEK_CUR 1
|
|
#define SEEK_END 2
|
|
|
|
/* define size_t. Crud in case <sys/types.h> has defined it. */
|
|
#if !defined(_SIZE_T) && !defined(_T_SIZE_) && !defined(_T_SIZE)
|
|
#if !defined(__SIZE_T) && !defined(_SIZE_T_) && !defined(___int_size_t_h)
|
|
#if !defined(_GCC_SIZE_T) && !defined(_SIZET_)
|
|
#define _SIZE_T
|
|
#define _T_SIZE_
|
|
#define _T_SIZE
|
|
#define __SIZE_T
|
|
#define _SIZE_T_
|
|
#define ___int_size_t_h
|
|
#define _GCC_SIZE_T
|
|
#define _SIZET_
|
|
typedef _IO_size_t size_t;
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
typedef struct _IO_FILE FILE;
|
|
typedef _IO_fpos_t fpos_t;
|
|
|
|
#include <stdio_lim.h>
|
|
|
|
#ifdef __USE_SVID
|
|
/* Default path prefix for `tempnam' and `tmpnam'. */
|
|
#define P_tmpdir "/tmp"
|
|
#endif
|
|
|
|
/* For use by debuggers. These are linked in if printf or fprintf are used. */
|
|
extern FILE *stdin, *stdout, *stderr; /* TODO */
|
|
|
|
#define stdin _IO_stdin
|
|
#define stdout _IO_stdout
|
|
#define stderr _IO_stderr
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifndef __P
|
|
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
|
|
#define __P(args) args
|
|
#else
|
|
#define __P(args) ()
|
|
#endif
|
|
#endif /*!__P*/
|
|
|
|
extern void clearerr __P ((FILE*));
|
|
extern int fclose __P ((FILE*));
|
|
extern int feof __P ((FILE*));
|
|
extern int ferror __P ((FILE*));
|
|
extern int fflush __P ((FILE*));
|
|
extern int fgetc __P ((FILE *));
|
|
extern int fgetpos __P ((FILE* fp, fpos_t *pos));
|
|
extern char* fgets __P ((char*, int, FILE*));
|
|
extern FILE* fopen __P ((__const char*, __const char*));
|
|
extern FILE* fopencookie __P ((void *cookie, __const char *mode,
|
|
_IO_cookie_io_functions_t io_functions));
|
|
extern int fprintf __P ((FILE*, __const char* format, ...));
|
|
extern int fputc __P ((int, FILE*));
|
|
extern int fputs __P ((__const char *str, FILE *fp));
|
|
extern size_t fread __P ((void*, size_t, size_t, FILE*));
|
|
extern FILE* freopen __P ((__const char*, __const char*, FILE*));
|
|
extern int fscanf __P ((FILE *fp, __const char* format, ...));
|
|
extern int fseek __P ((FILE* fp, long int offset, int whence));
|
|
extern int fsetpos __P ((FILE* fp, __const fpos_t *pos));
|
|
extern long int ftell __P ((FILE* fp));
|
|
extern size_t fwrite __P ((__const void*, size_t, size_t, FILE*));
|
|
extern int getc __P ((FILE *));
|
|
extern int getchar __P ((void));
|
|
extern char* gets __P ((char*));
|
|
extern void perror __P ((__const char *));
|
|
extern int printf __P ((__const char* format, ...));
|
|
extern int putc __P ((int, FILE *));
|
|
extern int putchar __P ((int));
|
|
extern int puts __P ((__const char *str));
|
|
extern int remove __P ((__const char*));
|
|
extern int rename __P ((__const char* _old, __const char* _new));
|
|
extern void rewind __P ((FILE*));
|
|
extern int scanf __P ((__const char* format, ...));
|
|
extern void setbuf __P ((FILE*, char*));
|
|
extern void setlinebuf __P ((FILE*));
|
|
extern void setbuffer __P ((FILE*, char*, int));
|
|
extern int setvbuf __P ((FILE*, char*, int mode, size_t size));
|
|
extern int sprintf __P ((char*, __const char* format, ...));
|
|
extern int sscanf __P ((__const char* string, __const char* format, ...));
|
|
extern FILE* tmpfile __P ((void));
|
|
extern char* tmpnam __P ((char*));
|
|
#ifdef __USE_REENTRANT
|
|
extern char* tmpnam_r __P ((char*));
|
|
#endif
|
|
#if defined(__USE_SVID) || defined(__USE_XOPEN)
|
|
extern char *tempnam __P ((__const char *__dir, __const char *__pfx));
|
|
#endif
|
|
extern char *__stdio_gen_tempname __P ((char *__buf, size_t bufsize,
|
|
__const char *dir, __const char *pfx,
|
|
int dir_search, size_t *lenptr,
|
|
FILE **streamptr));
|
|
extern int ungetc __P ((int c, FILE* fp));
|
|
extern int vfprintf __P ((FILE *fp, char __const *fmt0, _G_va_list));
|
|
extern int vprintf __P ((char __const *fmt, _G_va_list));
|
|
extern int vsprintf __P ((char* string, __const char* format, _G_va_list));
|
|
extern void __libc_fatal __P ((__const char *__message))
|
|
__attribute__ ((__noreturn__));
|
|
|
|
#ifndef __STRICT_ANSI__
|
|
extern int dprintf __P ((int, __const char *, ...));
|
|
extern int vdprintf __P ((int, __const char *, _G_va_list));
|
|
extern int vfscanf __P ((FILE*, __const char *, _G_va_list));
|
|
extern int __vfscanf __P ((FILE*, __const char *, _G_va_list));
|
|
extern int vscanf __P ((__const char *, _G_va_list));
|
|
extern int vsscanf __P ((__const char *, __const char *, _G_va_list));
|
|
extern int __vsscanf __P ((__const char *, __const char *, _G_va_list));
|
|
#endif
|
|
|
|
#ifdef __USE_GNU
|
|
extern int __fcloseall __P ((void));
|
|
extern int fcloseall __P ((void));
|
|
|
|
struct obstack;
|
|
extern int obstack_vprintf __P ((struct obstack *__obstack,
|
|
__const char *__fmt, _G_va_list));
|
|
extern int obstack_printf __P ((struct obstack *__obstack, __const char *__fmt,
|
|
...));
|
|
#endif
|
|
|
|
#if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
|
|
extern FILE *fdopen __P ((int, __const char *));
|
|
extern int fileno __P ((FILE*));
|
|
extern FILE* popen __P ((__const char*, __const char*));
|
|
extern int pclose __P ((FILE*));
|
|
|
|
#define L_ctermid 9
|
|
#define L_cuserid 9
|
|
|
|
/* Return the name of the controlling terminal. */
|
|
extern char *ctermid __P ((char *__buf));
|
|
|
|
/* Get character login name of the user. */
|
|
extern char *cuserid __P ((char * __buf));
|
|
#endif
|
|
|
|
#ifdef __USE_GNU
|
|
extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*));
|
|
extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
|
|
extern _IO_ssize_t __getline __P ((char **, size_t *, FILE *));
|
|
|
|
extern int snprintf __P ((char *, size_t, __const char *, ...));
|
|
extern int __snprintf __P ((char *, size_t, __const char *, ...));
|
|
extern int vsnprintf __P ((char *, size_t, __const char *, _G_va_list));
|
|
extern int __vsnprintf __P ((char *, size_t, __const char *, _G_va_list));
|
|
|
|
extern int asprintf __P ((char **, const char *, ...));
|
|
extern int vasprintf __P ((char **, const char *, _G_va_list));
|
|
|
|
/* Open a stream that writes into a malloc'd buffer that is expanded as
|
|
necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
|
|
and the number of characters written on fflush or fclose. */
|
|
extern FILE *open_memstream __P ((char **__bufloc, size_t *__sizeloc));
|
|
#endif
|
|
|
|
extern int __underflow __P ((struct _IO_FILE*));
|
|
extern int __overflow __P ((struct _IO_FILE*, int));
|
|
|
|
#ifdef __USE_BSD
|
|
extern int sys_nerr;
|
|
extern const char *const sys_errlist[];
|
|
#endif
|
|
#ifdef __USE_GNU
|
|
extern int _sys_nerr;
|
|
extern const char *const _sys_errlist[];
|
|
#endif
|
|
|
|
/* Handle locking of streams. */
|
|
#ifdef __USE_REENTRANT
|
|
extern void clearerr_locked __P ((FILE *));
|
|
extern void clearerr_unlocked __P ((FILE *));
|
|
extern int feof_locked __P ((FILE *));
|
|
extern int feof_unlocked __P ((FILE *));
|
|
extern int ferror_locked __P ((FILE*));
|
|
extern int ferror_unlocked __P ((FILE*));
|
|
extern int fileno_locked __P ((FILE *));
|
|
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 *));
|
|
extern size_t fread_unlocked __P ((void *, size_t, size_t, FILE *));
|
|
extern size_t fwrite_unlocked __P ((const void *, size_t, size_t, FILE *));
|
|
|
|
extern int fputc_locked __P ((int, FILE*));
|
|
extern int fputc_unlocked __P ((int, FILE*));
|
|
extern int getc_locked __P ((FILE *));
|
|
extern int getc_unlocked __P ((FILE *));
|
|
extern int getchar_locked __P ((void));
|
|
extern int getchar_unlocked __P ((void));
|
|
extern int putc_locked __P ((int, FILE *));
|
|
extern int putc_unlocked __P ((int, FILE *));
|
|
extern int putchar_locked __P ((int));
|
|
extern int putchar_unlocked __P ((int));
|
|
|
|
# ifndef _LIBC
|
|
# define getc_unlocked(fp) _IO_getc_unlocked (fp)
|
|
# define getc_locked(fp) _IO_getc (fp)
|
|
# define getchar_unlocked() _IO_getc_unlocked (stdin)
|
|
# define getchar_locked() _IO_getc (stdin)
|
|
# define putchar_unlocked(c) _IO_putc_unlocked (c, stdout)
|
|
# define putchar_locked(c) _IO_putc (c, stdout)
|
|
# endif
|
|
|
|
#endif /* __USE_REENTRANT */
|
|
|
|
#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
|
|
}
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !_STDIO_H */
|