diff options
author | Ulrich Drepper <drepper@redhat.com> | 1996-09-27 03:45:24 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1996-09-27 03:45:24 +0000 |
commit | c40298232a7ed3fb1b64eb4ffe352829deb79694 (patch) | |
tree | 6e5105602f9339c8a17b835ddc0318cd2c698b2c /stdio | |
parent | d022f6ab9f45c66478e6b3e45b3f9b3de12e090d (diff) | |
download | glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.tar.gz glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.tar.xz glibc-c40298232a7ed3fb1b64eb4ffe352829deb79694.zip |
update from main archive cvs/libc-960927
Mon Sep 23 15:31:04 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu> * hurd/Makefile ($(includedir)/rpc/netdb.h): There is no make variable `top_srcdir' in libc; use $(..) instead. * sysdeps/mach/hurd/Makefile (rtld-installed-name): Delete special definition. It was a *Mistake*. (With a capital M.) * sysdeps/mach/getsysstats.c (__get_nprocs): Renamed from __get_nproc. (__get_nprocs_conf): Renamed from __get_nproc_conf. Fri Sep 27 03:49:56 1996 Ulrich Drepper <drepper@cygnus.com> Add support for cancelable system calls. * csu/initfini.c: Make in crti.o reference to symbol __libc_force_cancel_wrapper when compiling reentrant version. * misc/Makefile (routines): Add force-wrapper. * misc/force-wrapper.c: New file. * posix/system.c: Rename function to __libc_system and make system a weak alias. * sysdeps/stub/system.c: Likewise. * posix/wait.c: Rename function to __libc_wait and make __wait a weak alias. De-ANSI-fy. * sysdeps/standalone/read.c: Rename function to __libc_read and make __read a weak alias. * sysdeps/stub/read.c: Likewise. * sysdeps/standalone/write.c: Rename function to __libc_write and make __write a weak alias. * sysdeps/stub/write.c: Likewise. * sysdeps/stub/tcdrain.c: Rename function to __libc_tcdrain and make tcdrain a weak alias. * sysdeps/unix/bsd/tcdrain.c: Likewise. * sysdeps/unix/bsd/bsd4.4/tcdrain.c: Likewise. * sysdeps/unix/sysv/tcdrain.c: Likewise. * sysdeps/unix/sysv/linux/tcdrain.c: Likewise. * sysdeps/unix/bsd/bsd4.4/wait.c: Rename function to __libc_wait and make __wait a weak alias. * sysdeps/stub/waitpid.c: Rename function to __libc_waitpid and make __waitpid a weak alias. * sysdeps/unix/bsd/bsd4.4/waitpid.c: Likewise. * sysdeps/unix/sysv/linux/waitpid.c: Likewise. * sysdeps/unix/sysv/sysv4/waitpid.c: Likewise. * sysdeps/unix/common/pause.c: Rename function to __libc_pause and make pause a weak alias. De-ANSI-fy. * sysdeps/unix/syscalls.list: Change name for close, fcntl, fsync, lseek, open, read, and write to have __libc_ prefix and make old names a weak alias. * sysdeps/unix/mman/syscalls.list: Likewise for msync. * sysdeps/unix/sysv/linux/syscalls.list: Likewise for nanosleep. * io/creat.c: De-ANSI-fy. * sysdeps/unix/sysv/linux/syscalls.list: Add pause. Thu Sep 26 19:15:55 1996 Ulrich Drepper <drepper@cygnus.com> * misc/mntent.h: Add MNTTYPE_* and MNTOPT_* macros. Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>. Thu Sep 26 14:40:10 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/posix/pathconf.c: Pass descriptor for just opened file to fpathconf. Reported by Martin von Loewis <martin@mira.isdn.cs.tu-berlin.de>. Thu Sep 26 04:02:43 1996 Ulrich Drepper <drepper@cygnus.com> * locale/programs/locfile.c (write_locale_data): Allocate room even for file name for LC_MESSAGES locale. (locafile_read): `tok_era' must be handled as a string list. * locale/programs/ld-time.c: Finish correction of handling `era'. * locale/C-time.c (_nl_C_LC_TIME): Add initializer for new fields. * locale/categories.def: Add postload function for LC_TIME. * locale/setlocale.c: Make lock global and rename to __libc_setlocale_lock. * locale/localeinfo.h (struct era_entry): New type. Used in strftime. Add prototypes for _nl_get_era_entry and _nl_get_alt_digit. * locale/lc-time.c (_nl_postload_time): New function. Initialize lazy intialization. (_nl_get_era_entry): New function. Return era entry which corresponds to given year. (_nl_get_alt_digit): New function. Return string with alternate digit representation for given number. * time/strftime.c (strftime): Use _nl_get_alt_digit to get string representing alternate digit notation. Wed Sep 25 17:31:55 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/waitstatus.h (union wait): Add w_status field. Reported by Hans Grobler <grobh@nolian.ee.sun.ac.za>. * elf/rtld.c (dl_main): Process LD_PRELOAD before loading ld.so.preload. Suggested by David Engel <david@elo.ods.com>. Wed Sep 25 13:10:57 1996 Ulrich Drepper <drepper@cygnus.com> * catgets/gencat.c (main): Change --version again because RMS wants the package name in parentheses. * db/makedb.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. Tue Sep 24 01:28:05 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makefile ($(objpfx)sysd-dirs): Depend on Subdirs files, command rewritten. ($(objpfx)version-info.h): Depend on Banner files, command rewritten. Wed Sep 25 02:44:41 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/sleep.c: New file. Based on nanosleep. Tue Sep 24 21:46:02 1996 Ulrich Drepper <drepper@cygnus.com> * shadow/lckpwdf.c (PWD_LOCKFILE): Change to /etc/lock.pwd to be on the same device as the password file. * shadow/shadow.h (struct spwd): Change type of numeric fields to `long int' since there value are days, not seconds. * shadow/putspent.c: Change casts from time_t to `long int'. * shadow/sgetspent_r.c (LINE_READER): Likewise. Mon Sep 23 23:05:24 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/errnos.h: Define __set_errno to make sure the thread specific variable is set as well as the global variable. * sysdeps/mach/hurd/errnos.awk: Define macro for source code compatibility. * sysdeps/stub/errnos.h: Likewise. * sysdeps/unix/bsd/bsd4.4/errnos.h: Likewise. * shadow/putspent.c: Don't include <errno.h>. * dirent/scandir.c (scandir): Use __set_errno to set errno variable. * elf/dl-load.c (open_path): Likewise. * inet/rcmd.c (rcmd): Likewise. (rresvport): Likewise. * intl/dcgettext.c [!__set_errno]: Define __set_errno. (DCGETTEXT): Use __set_errno to set errno variable. * io/fts.c (fts_open): Likewise. (fts_close): Likewise. (fts_read): Likewise. (fts_set): Likewise. (fts_children): Likewise. (fts_build): Likewise. (fts_stat): Likewise. * io/ftw.c (ftw_dir): Likewise. (ftw): Likewise. * io/getwd.c (getwd): Likewise. * io/lockf.c (lockf): Likewise. * libio/libioP.h [EINVAL]: Use __set_errno to define MAYBE_SET_EINVAL. * libio/iofdopen.c (_IO_fdopen): Use MAYBE_SET_EINVAL to errno. * libio/iogetdelim.c (_IO_getdelim): Likewise. * libio/fileops.c (_IO_file_open): Use __set_errno to set errno variable. * libio/iofgetpos.c (_IO_fgetpos): Likewise. * libio/iofsetpos.c (_IO_fsetpos): Likewise. * libio/ioftell.c (_IO_ftell): Likewise. * locale/loadlocale.c (_nl_load_locale): Likewise. * locale/nl_langinfo.c (nl_langinfo): Likewise. * locale/setlocale.c (ERROR_RETURN): Likewise. * login/getutid_r (__getutid_r): Likewise. * login/getutline_r (__getutline_r): Likewise. * login/login.c (tty_name): Likewise. * login/oututline_r.c (__pututline_r): Likewise. * malloc/malloc.c (morecore): Likewise. * misc/efgcvt_r.c (fcvt_r): Likewise. * misc/hsearch_r.c (hcreate_r): Likewise. (hdestroy_r): Likewise. (hsearch_r): Likewise. * nss/nsswitch.c (__nss_configure_lookup): Likewise. * nss/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Likewise. (_nss_dns_gethostbyaddr_r): Likewise. * nss/nss_files/files-XXX.c (internal_getent): Likewise. * nss/nss_files/files-parse.c (parse_list): Likewise. * posix/confstr.c (confstr): Likewise. De-ANSI-fy. * posix/execvp.c (execvp): Likewise. * posix/glob.c: Define __set_errno. (glob): Use __set_errno to set errno variable. (glob_in_dir): Likewise. * pwd/getpw.c: Likewise. De-ANSI-fy. * pwd/putpwent.c: Likewise. * resolv/inet_net_ntop.c: Likewise. * resolv/inet_net_pton.c: Likewise. * resolv/inet_neta.c: Likewise. * resolv/inet_ntop.c: Likewise. * resolv/inet_pton.c: Likewise. * resolv/res_query.c (res_search): Likewise. * resolv/res_send.c (Aerror): Likewise. (Perror): Likewise. (res_send): Likewise. * signal/sigaddset.c: Likewise. De-ANSI-fy. * signal/sigdelset.c: Likewise. * signal/sigempty.c: Likewise. * signal/sigfillset.c: Likewise. * signal/sigismem.c: Likewise. * stdio/fclose.c: Likewise. * stdio/feof.c: Likewise. * stdio/ferror.c: Likewise. * stdio/fflush.c: Likewise. * stdio/fgetc.c: Likewise. * stdio/fgetpos.c: Likewise. * stdio/fgets.c: Likewise. * stdio/fileno.c: Likewise. * stdio/fmemopen.c: Likewise. * stdio/fopen.c: Likewise. * stdio/fputc.c: Likewise. * stdio/fread.c: Likewise. * stdio/freopen.c: Likewise. * stdio/fseek.c: Likewise. * stdio/fsetpos.c: Likewise. * stdio/ftell.c: Likewise. * stdio/fwrite.c: Likewise. * stdio/getdelim.c: Likewise. * stdio/gets.c: Likewise. * stdio/glue.c: Likewise. * stdio/internals.c: Likewise. * stdio/memstream.c: Likewise. * stdio/setvbuf.c: Likewise. * stdio/ungetc.c: Likewise. * stdio/vsscanf.c: Likewise. * stdio-common/reg-printf.c: Likewise. * stdio-common/vfprintf.c: Likewise. * stdio-common/vfscanf.c: Likewise. * stdlib/canonicalize.c: Likewise. * stdlib/msort.c: Likewise. * stdlib/random_r.c: Likewise. * stdlib/strfmon.c: Likewise. * stdlib/strtod.c: Likewise. * stdlib/strtol.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * time/asctime.c: Likewise. * time/localtime.c: Likewise. * wcsmbs/mbrtowc.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wcstok.c: Likewise. * sysdeps/generic/ftime.c: Likewise. * sysdeps/generic/pty.c: Likewise. * sysdeps/generic/setenv.c: Likewise. * sysdeps/generic/speed.c: Likewise. * sysdeps/generic/sysd-stdio.c: Likewise. * sysdeps/generic/uname.c: Likewise. * sysdeps/generic/vlimit.c: Likewise. * sysdeps/libm-ieee754/k_standard.c: Likewise. * sysdeps/libm-ieee754/s_ldexp.c: Likewise. * sysdeps/libm-ieee754/s_ldexpf.c: Likewise. * sysdeps/libm-ieee754/s_ldexpl.c: Likewise. * sysdeps/libm-ieee754/w_scalb.c: Likewise. * sysdeps/libm-ieee754/w_scalbf.c: Likewise. * sysdeps/libm-ieee754/w_scalbl.c: Likewise. * sysdeps/posix/dup2.c: Likewise. * sysdeps/posix/euidaccess.c: Likewise. * sysdeps/posix/fdopen.c: Likewise. * sysdeps/posix/flock.c: Likewise. * sysdeps/posix/fpathconf.c: Likewise. * sysdeps/posix/getcwd.c: Likewise. * sysdeps/posix/gettimeofday.c: Likewise. * sysdeps/posix/isatty.c: Likewise. * sysdeps/posix/isfdtype.c: Likewise. * sysdeps/posix/killpg.c: Likewise. * sysdeps/posix/mkstemp.c: Likewise. * sysdeps/posix/mktemp.c: Likewise. * sysdeps/posix/pathconf.c: Likewise. * sysdeps/posix/pipestream.c: Likewise. * sysdeps/posix/remove.c: Likewise. * sysdeps/posix/rename.c: Likewise. * sysdeps/posix/sigintr.c: Likewise. * sysdeps/posix/signal.c: Likewise. * sysdeps/posix/sigsuspend.c: Likewise. * sysdeps/posix/sigvec.c: Likewise. * sysdeps/posix/sleep.c: Likewise. * sysdeps/posix/sysconf.c: Likewise. * sysdeps/posix/system.c: Likewise. * sysdeps/posix/tempname.c: Likewise. * sysdeps/posix/truncate.c: Likewise. * sysdeps/posix/ttyname.c: Likewise. * sysdeps/posix/ttyname_r.c: Likewise. * sysdeps/posix/wait3.c: Likewise. * sysdeps/standalone/close.c: Likewise. * sysdeps/standalone/open.c: Likewise. * sysdeps/standalone/read.c: Likewise. * sysdeps/standalone/write.c: Likewise. * sysdeps/stub/__longjmp.c: Likewise. * sysdeps/stub/accept.c: Likewise. * sysdeps/stub/access.c: Likewise. * sysdeps/stub/acct.c: Likewise. * sysdeps/stub/adjtime.c: Likewise. * sysdeps/stub/alarm.c: Likewise. * sysdeps/stub/bind.c: Likewise. * sysdeps/stub/brk.c: Likewise. * sysdeps/stub/chdir.c: Likewise. * sysdeps/stub/chflags.c: Likewise. * sysdeps/stub/chmod.c: Likewise. * sysdeps/stub/chown.c: Likewise. * sysdeps/stub/chroot.c: Likewise. * sysdeps/stub/clock.c: Likewise. * sysdeps/stub/close.c: Likewise. * sysdeps/stub/closedir.c: Likewise. * sysdeps/stub/connect.c: Likewise. * sysdeps/stub/ctermid.c: Likewise. * sysdeps/stub/cuserid.c: Likewise. * sysdeps/stub/dirfd.c: Likewise. * sysdeps/stub/dup.c: Likewise. * sysdeps/stub/dup2.c: Likewise. * sysdeps/stub/euidaccess.c: Likewise. * sysdeps/stub/execve.c: Likewise. * sysdeps/stub/fchdir.c: Likewise. * sysdeps/stub/fchflags.c: Likewise. * sysdeps/stub/fchmod.c: Likewise. * sysdeps/stub/fchown.c: Likewise. * sysdeps/stub/fcntl.c: Likewise. * sysdeps/stub/fdopen.c: Likewise. * sysdeps/stub/fexecve.c: Likewise. * sysdeps/stub/flock.c: Likewise. * sysdeps/stub/fork.c: Likewise. * sysdeps/stub/fpathconf.c: Likewise. * sysdeps/stub/fstatfs.c: Likewise. * sysdeps/stub/fsync.c: Likewise. * sysdeps/stub/ftruncate.c: Likewise. * sysdeps/stub/fxstat.c: Likewise. * sysdeps/stub/getcwd.c: Likewise. * sysdeps/stub/getdents.c: Likewise. * sysdeps/stub/getdomain.c: Likewise. * sysdeps/stub/getdtsz.c: Likewise. * sysdeps/stub/getegid.c: Likewise. * sysdeps/stub/getenv.c: Likewise. * sysdeps/stub/geteuid.c: Likewise. * sysdeps/stub/getgid.c: Likewise. * sysdeps/stub/getgroups.c: Likewise. * sysdeps/stub/gethostid.c: Likewise. * sysdeps/stub/gethostname.c: Likewise. * sysdeps/stub/getitimer.c: Likewise. * sysdeps/stub/getlogin.c: Likewise. * sysdeps/stub/getlogin_r.c: Likewise. * sysdeps/stub/getpagesize.c: Likewise. * sysdeps/stub/getpeername.c: Likewise. * sysdeps/stub/getpid.c: Likewise. * sysdeps/stub/getppid.c: Likewise. * sysdeps/stub/getpriority.c: Likewise. * sysdeps/stub/getrlimit.c: Likewise. * sysdeps/stub/getrusage.c: Likewise. * sysdeps/stub/getsid.c: Likewise. * sysdeps/stub/getsockname.c: Likewise. * sysdeps/stub/getsockopt.c: Likewise. * sysdeps/stub/getsysstats.c: Likewise. * sysdeps/stub/gettimeofday.c: Likewise. * sysdeps/stub/getuid.c: Likewise. * sysdeps/stub/gtty.c: Likewise. * sysdeps/stub/ioctl.c: Likewise. * sysdeps/stub/isatty.c: Likewise. * sysdeps/stub/isfdtype.c: Likewise. * sysdeps/stub/kill.c: Likewise. * sysdeps/stub/killpg.c: Likewise. * sysdeps/stub/link.c: Likewise. * sysdeps/stub/listen.c: Likewise. * sysdeps/stub/lseek.c: Likewise. * sysdeps/stub/lxstat.c: Likewise. * sysdeps/stub/madvice.c: Likewise. * sysdeps/stub/mkdir.c: Likewise. * sysdeps/stub/mkfifo.c: Likewise. * sysdeps/stub/mkstemp.c: Likewise. * sysdeps/stub/mktemp.c: Likewise. * sysdeps/stub/mmap.c: Likewise. * sysdeps/stub/morecore.c: Likewise. * sysdeps/stub/mprotect.c: Likewise. * sysdeps/stub/msgctl.c: Likewise. * sysdeps/stub/msgget.c: Likewise. * sysdeps/stub/msgrcv.c: Likewise. * sysdeps/stub/msgsnd.c: Likewise. * sysdeps/stub/msync.c: Likewise. * sysdeps/stub/munmap.c: Likewise. * sysdeps/stub/nanosleep.c: Likewise. * sysdeps/stub/nice.c: Likewise. * sysdeps/stub/nlist.c: Likewise. * sysdeps/stub/open.c: Likewise. * sysdeps/stub/opendir.c: Likewise. * sysdeps/stub/pathconf.c: Likewise. * sysdeps/stub/pause.c: Likewise. * sysdeps/stub/pipe.c: Likewise. * sysdeps/stub/pipestream.c: Likewise. * sysdeps/stub/poll.c: Likewise. * sysdeps/stub/profil.c: Likewise. * sysdeps/stub/ptrace.c: Likewise. * sysdeps/stub/putenv.c: Likewise. * sysdeps/stub/raise.c: Likewise. * sysdeps/stub/read.c: Likewise. * sysdeps/stub/readdir.c: Likewise. * sysdeps/stub/readlink.c: Likewise. * sysdeps/stub/readv.c: Likewise. * sysdeps/stub/reboot.c: Likewise. * sysdeps/stub/recv.c: Likewise. * sysdeps/stub/recvfrom.c: Likewise. * sysdeps/stub/recvmsg.c: Likewise. * sysdeps/stub/remove.c: Likewise. * sysdeps/stub/rename.c: Likewise. * sysdeps/stub/revoke.c: Likewise. * sysdeps/stub/rewinddir.c: Likewise. * sysdeps/stub/rmdir.c: Likewise. * sysdeps/stub/sbrk.c: Likewise. * sysdeps/stub/sched_getp.c: Likewise. * sysdeps/stub/sched_gets.c: Likewise. * sysdeps/stub/sched_primax.c: Likewise. * sysdeps/stub/sched_primin.c: Likewise. * sysdeps/stub/sched_rr_gi.c: Likewise. * sysdeps/stub/sched_setp.c: Likewise. * sysdeps/stub/sched_sets.c: Likewise. * sysdeps/stub/sched_yield.c: Likewise. * sysdeps/stub/seekdir.c: Likewise. * sysdeps/stub/select.c: Likewise. * sysdeps/stub/semctl.c: Likewise. * sysdeps/stub/semget.c: Likewise. * sysdeps/stub/semop.c: Likewise. * sysdeps/stub/send.c: Likewise. * sysdeps/stub/sendmsg.c: Likewise. * sysdeps/stub/sendto.c: Likewise. * sysdeps/stub/setdomain.c: Likewise. * sysdeps/stub/setegid.c: Likewise. * sysdeps/stub/setenv.c: Likewise. * sysdeps/stub/seteuid.c: Likewise. * sysdeps/stub/setgid.c: Likewise. * sysdeps/stub/setgroups.c: Likewise. * sysdeps/stub/sethostid.c: Likewise. * sysdeps/stub/sethostname.c: Likewise. * sysdeps/stub/setitimer.c: Likewise. * sysdeps/stub/setjmp.c: Likewise. * sysdeps/stub/setlogin.c: Likewise. * sysdeps/stub/setpgid.c: Likewise. * sysdeps/stub/setpriority.c: Likewise. * sysdeps/stub/setregid.c: Likewise. * sysdeps/stub/setreuid.c: Likewise. * sysdeps/stub/setrlimit.c: Likewise. * sysdeps/stub/setsid.c: Likewise. * sysdeps/stub/setsockopt.c: Likewise. * sysdeps/stub/settimeofday.c: Likewise. * sysdeps/stub/setuid.c: Likewise. * sysdeps/stub/shmat.c: Likewise. * sysdeps/stub/shmctl.c: Likewise. * sysdeps/stub/shmdt.c: Likewise. * sysdeps/stub/shmget.c: Likewise. * sysdeps/stub/shutdown.c: Likewise. * sysdeps/stub/sigaction.c: Likewise. * sysdeps/stub/sigaltstack.c: Likewise. * sysdeps/stub/sigblock.c: Likewise. * sysdeps/stub/sigintr.c: Likewise. * sysdeps/stub/signal.c: Likewise. * sysdeps/stub/sigpause.c: Likewise. * sysdeps/stub/sigpending.c: Likewise. * sysdeps/stub/sigprocmask.c: Likewise. * sysdeps/stub/sigreturn.c: Likewise. * sysdeps/stub/sigsetmask.c: Likewise. * sysdeps/stub/sigstack.c: Likewise. * sysdeps/stub/sigsuspend.c: Likewise. * sysdeps/stub/sigvec.c: Likewise. * sysdeps/stub/sleep.c: Likewise. * sysdeps/stub/socket.c: Likewise. * sysdeps/stub/socketpair.c: Likewise. * sysdeps/stub/sstk.c: Likewise. * sysdeps/stub/statfs.c: Likewise. * sysdeps/stub/stime.c: Likewise. * sysdeps/stub/stty.c: Likewise. * sysdeps/stub/swapoff.c: Likewise. * sysdeps/stub/swapon.c: Likewise. * sysdeps/stub/symlink.c: Likewise. * sysdeps/stub/sync.c: Likewise. * sysdeps/stub/syscall.c: Likewise. * sysdeps/stub/sysconf.c: Likewise. * sysdeps/stub/sysd-stdio.c: Likewise. * sysdeps/stub/system.c: Likewise. * sysdeps/stub/tcdrain.c: Likewise. * sysdeps/stub/tcflow.c: Likewise. * sysdeps/stub/tcflush.c: Likewise. * sysdeps/stub/tcgetattr.c: Likewise. * sysdeps/stub/tcgetpgrp.c: Likewise. * sysdeps/stub/tcsendbrk.c: Likewise. * sysdeps/stub/tcsetattr.c: Likewise. * sysdeps/stub/tcsetpgrp.c: Likewise. * sysdeps/stub/telldir.c: Likewise. * sysdeps/stub/tempname.c: Likewise. * sysdeps/stub/time.c: Likewise. * sysdeps/stub/times.c: Likewise. * sysdeps/stub/truncate.c: Likewise. * sysdeps/stub/ttyname.c: Likewise. * sysdeps/stub/ttyname_r.c: Likewise. * sysdeps/stub/ualarm.c: Likewise. * sysdeps/stub/ulimit.c: Likewise. * sysdeps/stub/umask.c: Likewise. * sysdeps/stub/unlink.c: Likewise. * sysdeps/stub/usleep.c: Likewise. * sysdeps/stub/ustat.c: Likewise. * sysdeps/stub/utime.c: Likewise. * sysdeps/stub/utimes.c: Likewise. * sysdeps/stub/vhangup.c: Likewise. * sysdeps/stub/wait.c: Likewise. * sysdeps/stub/wait3.c: Likewise. * sysdeps/stub/wait4.c: Likewise. * sysdeps/stub/waitpid.c: Likewise. * sysdeps/stub/write.c: Likewise. * sysdeps/stub/writev.c: Likewise. * sysdeps/stub/xmknod.c: Likewise. * sysdeps/stub/xstat.c: Likewise. * sysdeps/unix/closedir.c: Likewise. * sysdeps/unix/fxstat.c: Likewise. * sysdeps/unix/getlogin.c: Likewise. * sysdeps/unix/getlogin_r.c: Likewise. * sysdeps/unix/mkdir.c: Likewise. * sysdeps/unix/nice.c: Likewise. * sysdeps/unix/nlist.c: Likewise. * sysdeps/unix/opendir.c: Likewise. * sysdeps/unix/readdir.c: Likewise. * sysdeps/unix/rmdir.c: Likewise. * sysdeps/unix/stime.c: Likewise. * sysdeps/unix/xmknod.c: Likewise. * sysdeps/unix/xstat.c: Likewise. * sysdeps/unix/bsd/isatty.c: Likewise. * sysdeps/unix/bsd/setegid.c: Likewise. * sysdeps/unix/bsd/seteuid.c: Likewise. * sysdeps/unix/bsd/setsid.c: Likewise. * sysdeps/unix/bsd/sigaction.c: Likewise. * sysdeps/unix/bsd/sigprocmask.c: Likewise. * sysdeps/unix/bsd/sigsuspend.c: Likewise. * sysdeps/unix/bsd/tcflow.c: Likewise. * sysdeps/unix/bsd/tcflush.c: Likewise. * sysdeps/unix/bsd/tcgetattr.c: Likewise. * sysdeps/unix/bsd/tcsetattr.c: Likewise. * sysdeps/unix/bsd/times.c: Likewise. * sysdeps/unix/bsd/ulimit.c: Likewise. * sysdeps/unix/common/lxstat.c: Likewise. * sysdeps/unix/common/tcsendbrk.c: Likewise. * sysdeps/unix/sysv/setrlimit.c: Likewise. * sysdeps/unix/sysv/settimeofday.c: Likewise. * sysdeps/unix/sysv/sigaction.c: Likewise. * sysdeps/unix/sysv/tcflow.c: Likewise. * sysdeps/unix/sysv/tcflush.c: Likewise. * sysdeps/unix/sysv/tcgetattr.c: Likewise. * sysdeps/unix/sysv/tcsendbrk.c: Likewise. * sysdeps/unix/sysv/tcsetattr.c: Likewise. * sysdeps/unix/bsd/ultrix4/sysconf.c: Likewise. * sysdeps/unix/sysv/irix4/getpriority.c: Likewise. * sysdeps/unix/sysv/irix4/setpriority.c: Likewise. * sysdeps/unix/sysv/linux/adjtime.c: Likewise. * sysdeps/unix/sysv/linux/gethostid.c: Likewise. * sysdeps/unix/sysv/linux/gethostname.c: Likewise. * sysdeps/unix/sysv/linux/getsysstats.c: Likewise. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. * sysdeps/unix/sysv/linux/speed.c: Likewise. * sysdeps/unix/sysv/linux/ulimit.c: Likewise. * sysdeps/unix/sysv/sysv4/sigaction.c: Likewise. * sysdeps/unix/sysv/sysv4/sysconf.c: Likewise. * sysdeps/unix/bsd/sun/m68k/sigtramp.c: Likewise. * sysdeps/unix/bsd/sun/sparc/sigtramp.c: Likewise. * sysdeps/unix/bsd/sun/sunos4/speed.c: Likewise. * sysdeps/unix/bsd/sun/sunos4/tcsetattr.c: Likewise. * sysdeps/unix/sysv/linux/alpha/ioperm.c: Likewise. * sysdeps/unix/sysv/linux/i386/brk.c: Likewise. * sysdeps/unix/sysv/linux/i386/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/m68k/brk.c: Likewise. * sunrpc/clnt_tcp.c: Protect declaration of errno by #ifndef. * sunrpc/clnt_udp.c: Likewise. * sunrpc/bindrsvprt.c: Likewise. * sunrpc/pm_getmaps.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/svc.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sysdeps/generic/strtok.c: Don't check argument, just crash. * sysdeps/generic/strtok_r.c: Likewise. * sysdeps/stub/start.c: Make __errno a strong alias of errno. * sysdeps/unix/start.c: Likewise. De-ANSI-fy. * sysdeps/unix/sparc/start.c: Likewise. * sysdeps/standalone/m68k/m68020/start.S: Likewise. * sysdeps/unix/sysv/irix4/start.c: Likewise. * sysdeps/unix/bsd/ultrix4/mips/start.S: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.S: Likewise. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Likewise. Mon Sep 23 17:54:57 1996 Ulrich Drepper <drepper@cygnus.com> * catgets/gencat.c (main): Put package name in --version message in parantheses. Reported by Jim Meyering. * db/makedb.c: Likewise. * locale/programs/locale.c: Likewise. * locale/programs/localedef.c: Likewise. * sysdeps/i386/fpu/__math.h (tan): Make sure gcc knows we use two registers. Patch by John Bowman. Sat Sep 21 15:08:25 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/mach/libc-lock.h: Fix comment. * sysdeps/stubs/libc-lock.h: Likewise. Sat Sep 21 13:50:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libio/genops.c (_IO_init) [_IO_MTSAFE_IO]: Dereference pointer to lock when passing it to __libc_lock_init macro. (_IO_default_finish) [_IO_MTSAFE_IO]: Dereference pointer to lock when passing it to __libc_lock_fini macro. Sat Sep 21 14:35:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/m68k/sysdep.h (SYSCALL_ERROR_HANDLER) [_LIBC_REENTRANT]: Add missing semicolon. * sysdeps/unix/sysv/linux/m68k/sysdep.S: Move inclusion of sysdep.h to the top outside of #ifndef PIC. Don't include errnos.h. Use the ENTRY macro. Sat Sep 21 14:33:41 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * libio/Makefile: Make `all' the default target. * po/Makefile: Likewise. Mon Sep 23 15:49:47 1996 Ulrich Drepper <drepper@cygnus.com> * stdlib/test-canon.c: Correct patch from Thu Sep 12 23:01:16 1996. I applied it incorrectly. * sysdeps/m68k/fpu/s_scalbn.c: Likewise. * sysdeps/m68k/fpu/s_scalbnf.c: Likewise. * sysdeps/m68k/fpu/s_scalbnl.c: Likewise. Mon Sep 23 03:00:10 1996 Ulrich Drepper <drepper@cygnus.com> * shadow/sgetspent_r.c (LINE_PARSER): Accept empty 9th field. Patch by NIIBE Yutaka <gniibe@mri.co.jp>. * shadow/sgetspent_r.c (LINE_PARSER): Don't accept any chars after 9th field. * sysdeps/unix/sysv/linux/Makefile [$(subdir)==misc] (sysdep_headers): Add sys/debugreg.h, sys/kd.h, sys/soundcard.h, and sys/vt.h. * sysdeps/unix/sysv/linux/sys/debugreg.h: New file. * sysdeps/unix/sysv/linux/sys/kd.h: New file. * sysdeps/unix/sysv/linux/sys/soundcard.h: New file. * sysdeps/unix/sysv/linux/sys/vt.h: New file. Reported by NIIBE Yutaka <gniibe@mri.co.jp>.
Diffstat (limited to 'stdio')
-rw-r--r-- | stdio/fclose.c | 10 | ||||
-rw-r--r-- | stdio/feof.c | 14 | ||||
-rw-r--r-- | stdio/ferror.c | 14 | ||||
-rw-r--r-- | stdio/fflush.c | 16 | ||||
-rw-r--r-- | stdio/fgetc.c | 12 | ||||
-rw-r--r-- | stdio/fgetpos.c | 19 | ||||
-rw-r--r-- | stdio/fgets.c | 18 | ||||
-rw-r--r-- | stdio/fileno.c | 12 | ||||
-rw-r--r-- | stdio/fmemopen.c | 15 | ||||
-rw-r--r-- | stdio/fopen.c | 19 | ||||
-rw-r--r-- | stdio/fputc.c | 13 | ||||
-rw-r--r-- | stdio/fread.c | 26 | ||||
-rw-r--r-- | stdio/freopen.c | 15 | ||||
-rw-r--r-- | stdio/fseek.c | 17 | ||||
-rw-r--r-- | stdio/fsetpos.c | 11 | ||||
-rw-r--r-- | stdio/ftell.c | 8 | ||||
-rw-r--r-- | stdio/fwrite.c | 21 | ||||
-rw-r--r-- | stdio/getdelim.c | 16 | ||||
-rw-r--r-- | stdio/gets.c | 14 | ||||
-rw-r--r-- | stdio/glue.c | 15 | ||||
-rw-r--r-- | stdio/internals.c | 108 | ||||
-rw-r--r-- | stdio/memstream.c | 32 | ||||
-rw-r--r-- | stdio/setvbuf.c | 22 | ||||
-rw-r--r-- | stdio/ungetc.c | 11 | ||||
-rw-r--r-- | stdio/vsscanf.c | 15 |
25 files changed, 263 insertions, 230 deletions
diff --git a/stdio/fclose.c b/stdio/fclose.c index bcf4cd4163..413d8f3d7b 100644 --- a/stdio/fclose.c +++ b/stdio/fclose.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -26,7 +25,8 @@ Cambridge, MA 02139, USA. */ /* Close a stream. */ int -DEFUN(fclose, (stream), register FILE *stream) +fclose (stream) + register FILE *stream; { int status; @@ -42,10 +42,10 @@ DEFUN(fclose, (stream), register FILE *stream) if (!__validfp(stream)) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - + if (stream->__mode.__write && /* Flush the buffer. */ __flshfp (stream, EOF) == EOF) diff --git a/stdio/feof.c b/stdio/feof.c index c18300f6b5..b98220799f 100644 --- a/stdio/feof.c +++ b/stdio/feof.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -25,13 +24,14 @@ Cambridge, MA 02139, USA. */ /* Return non-zero if STREAM has its EOF indicator set. */ int -DEFUN(feof, (stream), FILE *stream) +feof (stream) + FILE *stream; { - if (!__validfp(stream)) + if (!__validfp (stream)) { - errno = EINVAL; - return(-1); + __set_errno (EINVAL); + return -1; } - return(stream->__eof); + return stream->__eof; } diff --git a/stdio/ferror.c b/stdio/ferror.c index ed8f74401a..857b250201 100644 --- a/stdio/ferror.c +++ b/stdio/ferror.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -25,13 +24,14 @@ Cambridge, MA 02139, USA. */ /* Return non-zero if STREAM has its error indicator set. */ int -DEFUN(ferror, (stream), FILE *stream) +ferror (stream) + FILE *stream; { - if (!__validfp(stream)) + if (!__validfp (stream)) { - errno = EINVAL; - return(-1); + __set_errno (EINVAL); + return -1; } - return(stream->__error); + return stream->__error; } diff --git a/stdio/fflush.c b/stdio/fflush.c index a6d52ba3e7..41e66fa540 100644 --- a/stdio/fflush.c +++ b/stdio/fflush.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -24,22 +23,23 @@ Cambridge, MA 02139, USA. */ /* Flush STREAM's buffer. If STREAM is NULL, flush the buffers of all streams that are writing. */ int -DEFUN(fflush, (stream), register FILE *stream) +fflush (stream) + register FILE *stream; { if (stream == NULL) { int lossage = 0; for (stream = __stdio_head; stream != NULL; stream = stream->__next) - if (__validfp(stream) && stream->__mode.__write) - lossage |= fflush(stream) == EOF; + if (__validfp (stream) && stream->__mode.__write) + lossage |= fflush (stream) == EOF; return lossage ? EOF : 0; } - if (!__validfp(stream) || !stream->__mode.__write) + if (!__validfp (stream) || !stream->__mode.__write) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - return __flshfp(stream, EOF); + return __flshfp (stream, EOF); } diff --git a/stdio/fgetc.c b/stdio/fgetc.c index 7f01090294..9bfff3477a 100644 --- a/stdio/fgetc.c +++ b/stdio/fgetc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,20 +16,20 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> /* Read a character from STREAM. */ int -DEFUN(fgetc, (stream), FILE *stream) +fgetc (stream) + FILE *stream; { - if (!__validfp(stream) || !stream->__mode.__read) + if (!__validfp (stream) || !stream->__mode.__read) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - return __getc(stream); + return __getc (stream); } diff --git a/stdio/fgetpos.c b/stdio/fgetpos.c index cb6a1588ba..a615081c99 100644 --- a/stdio/fgetpos.c +++ b/stdio/fgetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -25,16 +24,18 @@ Cambridge, MA 02139, USA. */ /* Put the current position of STREAM in *POS. */ int -DEFUN(fgetpos, (stream, pos), FILE *stream AND fpos_t *pos) +fgetpos (stream, pos) + FILE *stream; + fpos_t *pos; { - if (!__validfp(stream) || pos == NULL) + if (!__validfp (stream) || pos == NULL) { - errno = EINVAL; - return(-1); + __set_errno (EINVAL); + return -1; } - *pos = ftell(stream); + *pos = ftell (stream); if (*pos < 0L) - return(-1); - return(0); + return -1; + return 0; } diff --git a/stdio/fgets.c b/stdio/fgets.c index e9e53c88dd..01d4d9d095 100644 --- a/stdio/fgets.c +++ b/stdio/fgets.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> #include <string.h> @@ -28,13 +27,16 @@ Cambridge, MA 02139, USA. */ to S, the function returns NULL without appending the null character. If there is a file error, always return NULL. */ char * -DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream) +fgets (s, n, stream) + char *s; + int n; + register FILE *stream; { register char *p = s; - if (!__validfp(stream) || s == NULL || n <= 0) + if (!__validfp (stream) || s == NULL || n <= 0) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } @@ -45,7 +47,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream) { /* Unbuffered stream. Not much optimization to do. */ register int c = 0; - while (--n > 0 && (c = getc (stream)) != EOF) + while (--n > 0 && (c = getc (stream)) != EOF) if ((*p++ = c) == '\n') break; if (c == EOF && (p == s || ferror (stream))) @@ -79,7 +81,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream) size_t i; char *found; - i = stream->__get_limit - stream->__bufp; + i = stream->__get_limit - stream->__bufp; if (i == 0) { /* Refill the buffer. */ @@ -93,7 +95,7 @@ DEFUN(fgets, (s, n, stream), char *s AND int n AND register FILE *stream) *p = '\0'; return s; } - i = stream->__get_limit - stream->__bufp; + i = stream->__get_limit - stream->__bufp; } if (i > n) diff --git a/stdio/fileno.c b/stdio/fileno.c index da55300c8b..dc3dfdf6e2 100644 --- a/stdio/fileno.c +++ b/stdio/fileno.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1994, 1996 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 @@ -16,19 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> /* Return the system file descriptor associated with STREAM. */ int -DEFUN(fileno, (stream), FILE *stream) +fileno (stream) + FILE *stream; { extern void __stdio_check_funcs __P ((FILE *)); if (! __validfp (stream)) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -37,9 +37,9 @@ DEFUN(fileno, (stream), FILE *stream) if (stream->__io_funcs.__fileno == NULL) { #ifdef EOPNOTSUPP - errno = EOPNOTSUPP; + __set_errno (EOPNOTSUPP); #else - errno = ENOSYS; + __set_errno (ENOSYS); #endif return -1; } diff --git a/stdio/fmemopen.c b/stdio/fmemopen.c index 42a137a2c8..a161110703 100644 --- a/stdio/fmemopen.c +++ b/stdio/fmemopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stddef.h> #include <stdio.h> @@ -25,7 +24,7 @@ Cambridge, MA 02139, USA. */ /* Defined in fopen.c. */ -extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr)); +extern int __getmode __P ((const char *mode, __io_mode *mptr)); /* Open a new stream that will read and/or write from the buffer in S, which is of LEN bytes. If the mode indicates appending, the @@ -40,8 +39,10 @@ extern int EXFUN(__getmode, (CONST char *mode, __io_mode *mptr)); to read, attempted writes always return an output error and attempted reads always return end-of-file. */ FILE * -DEFUN(fmemopen, (s, len, mode), - PTR s AND size_t len AND CONST char *mode) +fmemopen (s, len, mode) + void *s; + size_t len; + const char *mode; { __io_mode m; register FILE *stream; @@ -77,7 +78,7 @@ DEFUN(fmemopen, (s, len, mode), { int save = errno; (void) fclose (stream); - errno = save; + __set_errno (save); return NULL; } } @@ -102,7 +103,7 @@ DEFUN(fmemopen, (s, len, mode), stream->__bufp = p; } else if (stream->__mode.__truncate) - memset ((PTR) stream->__buffer, 0, len); + memset ((void *) stream->__buffer, 0, len); return stream; } diff --git a/stdio/fopen.c b/stdio/fopen.c index fba6ac436a..fea227482f 100644 --- a/stdio/fopen.c +++ b/stdio/fopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1993, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <ctype.h> #include <errno.h> #include <stdio.h> @@ -24,18 +23,20 @@ Cambridge, MA 02139, USA. */ #include <string.h> -#define badmode() return ((errno = EINVAL), 0) +#define badmode() return ((__set_errno (EINVAL)), 0) /* Dissect the given mode string into an __io_mode. */ int -DEFUN(__getmode, (mode, mptr), CONST char *mode AND __io_mode *mptr) +__getmode (mode, mptr) + const char *mode; + __io_mode *mptr; { register unsigned char i; if (mode == NULL) badmode (); - memset ((PTR) mptr, 0, sizeof (*mptr)); + memset ((void *) mptr, 0, sizeof (*mptr)); switch (*mode) { @@ -78,14 +79,16 @@ DEFUN(__getmode, (mode, mptr), CONST char *mode AND __io_mode *mptr) /* Open a new stream on the given file. */ FILE * -DEFUN(fopen, (filename, mode), CONST char *filename AND CONST char *mode) +fopen (filename, mode) + const char *filename; + const char *mode; { FILE *stream; __io_mode m; if (filename == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } @@ -100,7 +103,7 @@ DEFUN(fopen, (filename, mode), CONST char *filename AND CONST char *mode) { int save = errno; (void) fclose (stream); - errno = save; + __set_errno (save); return NULL; } diff --git a/stdio/fputc.c b/stdio/fputc.c index 36b9501195..2cbba2a449 100644 --- a/stdio/fputc.c +++ b/stdio/fputc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,20 +16,21 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> /* Write the character C to STREAM. */ int -DEFUN(fputc, (c, stream), int c AND FILE *stream) +fputc (c, stream) + int c; + FILE *stream; { - if (!__validfp(stream) || !stream->__mode.__write) + if (!__validfp (stream) || !stream->__mode.__write) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - return __putc(c, stream); + return __putc (c, stream); } diff --git a/stdio/fread.c b/stdio/fread.c index d2766f6616..63d41d2bd0 100644 --- a/stdio/fread.c +++ b/stdio/fread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> #include <string.h> @@ -26,19 +25,22 @@ Cambridge, MA 02139, USA. */ /* Read NMEMB chunks of SIZE bytes each from STREAM into P. */ size_t -DEFUN(fread, (p, size, nmemb, stream), - PTR p AND size_t size AND size_t nmemb AND register FILE *stream) +fread (p, size, nmemb, stream) + void *p; + size_t size; + size_t nmemb; + register FILE *stream; { register char *ptr = (char *) p; register size_t to_read = size * nmemb; size_t bytes = to_read; - if (!__validfp(stream) || !stream->__mode.__read) + if (!__validfp (stream) || !stream->__mode.__read) { - errno = EINVAL; + __set_errno (EINVAL); return 0; } - if (feof(stream) || ferror(stream)) + if (feof (stream) || ferror (stream)) return 0; if (p == NULL || to_read == 0) return 0; @@ -48,7 +50,7 @@ DEFUN(fread, (p, size, nmemb, stream), /* This stream has never been seen before, or it has a character pushed back. Call __fillbf to deal with those cases. Life will be simpler after this call. */ - int c = __fillbf(stream); + int c = __fillbf (stream); if (c == EOF) return 0; *ptr++ = c; @@ -65,7 +67,7 @@ DEFUN(fread, (p, size, nmemb, stream), copy = to_read; to_read -= copy; if (copy > 20) - memcpy((PTR) ptr, (PTR) stream->__bufp, copy); + memcpy((void *) ptr, (void *) stream->__bufp, copy); else { register size_t i; @@ -90,8 +92,8 @@ DEFUN(fread, (p, size, nmemb, stream), while (to_read > 0) { register int count; - count = (*stream->__io_funcs.__read)(stream->__cookie, - ptr, to_read); + count = (*stream->__io_funcs.__read) (stream->__cookie, + ptr, to_read); if (count > 0) { to_read -= count; @@ -118,7 +120,7 @@ DEFUN(fread, (p, size, nmemb, stream), } else { - int c = __fillbf(stream); + int c = __fillbf (stream); if (c == EOF) return (bytes - to_read) / size; *ptr++ = (char) c; diff --git a/stdio/freopen.c b/stdio/freopen.c index bedddb1a63..a21d725c17 100644 --- a/stdio/freopen.c +++ b/stdio/freopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -30,16 +29,18 @@ extern int __stdio_reopen __P ((const char *filename, __io_mode mode, /* Replace STREAM, opening it on FILENAME. */ FILE * -DEFUN(freopen, (filename, mode, stream), - CONST char *filename AND CONST char *mode AND register FILE *stream) +freopen (filename, mode, stream) + const char *filename; + const char *mode; + register FILE *stream; { __io_mode m; - PTR cookie; + void *cookie; if (!__getmode (mode, &m)) { (void) fclose (stream); - errno = EINVAL; + __set_errno (EINVAL); return NULL; } @@ -56,7 +57,7 @@ DEFUN(freopen, (filename, mode, stream), { int save = errno; (void) fclose (stream); - errno = save; + __set_errno (save); return NULL; } diff --git a/stdio/fseek.c b/stdio/fseek.c index 2127c9757b..9dce18f5d3 100644 --- a/stdio/fseek.c +++ b/stdio/fseek.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -26,14 +25,16 @@ Cambridge, MA 02139, USA. */ is SEEK_SET, the end of the file is it is SEEK_END, or the current position if it is SEEK_CUR. */ int -DEFUN(fseek, (stream, offset, whence), - register FILE *stream AND long int offset AND int whence) +fseek (stream, offset, whence) + register FILE *stream; + long int offset; + int whence; { long int o; if (!__validfp (stream)) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } @@ -63,7 +64,7 @@ DEFUN(fseek, (stream, offset, whence), switch (whence) { default: - errno = EINVAL; + __set_errno (EINVAL); return EOF; case SEEK_END: @@ -72,7 +73,7 @@ DEFUN(fseek, (stream, offset, whence), for, and then look where that is. */ if (stream->__io_funcs.__seek == NULL) { - errno = ESPIPE; + __set_errno (ESPIPE); return EOF; } else @@ -144,7 +145,7 @@ DEFUN(fseek, (stream, offset, whence), if (o < 0) { /* Negative file position is meaningless. */ - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -167,7 +168,7 @@ DEFUN(fseek, (stream, offset, whence), But it makes more sense for fseek to to fail with ESPIPE than for the next reading or writing operation to fail that way. */ - errno = ESPIPE; + __set_errno (ESPIPE); return EOF; } diff --git a/stdio/fsetpos.c b/stdio/fsetpos.c index 7c8fcb78bb..6aea674066 100644 --- a/stdio/fsetpos.c +++ b/stdio/fsetpos.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> @@ -25,13 +24,15 @@ Cambridge, MA 02139, USA. */ /* Set the file position of STREAM to *POS. */ int -DEFUN(fsetpos, (stream, pos), FILE *stream AND CONST fpos_t *pos) +fsetpos (stream, pos) + FILE *stream; + const fpos_t *pos; { if (pos == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - return fseek(stream, *pos, SEEK_SET); + return fseek (stream, *pos, SEEK_SET); } diff --git a/stdio/ftell.c b/stdio/ftell.c index d27eaf7598..d715f2009f 100644 --- a/stdio/ftell.c +++ b/stdio/ftell.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1994, 1996 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 @@ -16,20 +16,20 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> /* Return the offset in bytes from the beginning of the file of the file position of STREAM. */ long int -DEFUN(ftell, (stream), FILE *stream) +ftell (stream) + FILE *stream; { long int pos; if (!__validfp (stream)) { - errno = EINVAL; + __set_errno (EINVAL); return -1L; } diff --git a/stdio/fwrite.c b/stdio/fwrite.c index 790c663aea..7cf3898127 100644 --- a/stdio/fwrite.c +++ b/stdio/fwrite.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> #include <string.h> @@ -24,11 +23,13 @@ Cambridge, MA 02139, USA. */ /* Write NMEMB chunks of SIZE bytes each from PTR onto STREAM. */ size_t -DEFUN(fwrite, (ptr, size, nmemb, stream), - CONST PTR ptr AND size_t size AND - size_t nmemb AND register FILE *stream) +fwrite (ptr, size, nmemb, stream) + const void *ptr; + size_t size; + size_t nmemb; + register FILE *stream; { - register CONST unsigned char *p = (CONST unsigned char *) ptr; + register const unsigned char *p = (const unsigned char *) ptr; register size_t to_write = size * nmemb; register size_t written = 0; int newlinep; @@ -37,7 +38,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream), if (!__validfp (stream) || !stream->__mode.__write) { - errno = EINVAL; + __set_errno (EINVAL); return 0; } @@ -71,7 +72,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream), goto done; } - errno = save; + __set_errno (save); } if (stream->__buffer == NULL && default_func && @@ -82,7 +83,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream), { int count = (stream->__io_funcs.__write == NULL ? to_write : (*stream->__io_funcs.__write) (stream->__cookie, - (CONST char *) p, + (const char *) p, to_write)); if (count > 0) { @@ -105,7 +106,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream), buffer_space = stream->__bufsize - (stream->__bufp - stream->__buffer); newlinep = (stream->__linebuf && - memchr ((CONST PTR) p, '\n', to_write) != NULL); + memchr ((const void *) p, '\n', to_write) != NULL); if (newlinep && stream->__bufp == stream->__buffer && stream->__offset == stream->__target) @@ -148,7 +149,7 @@ DEFUN(fwrite, (ptr, size, nmemb, stream), *stream->__bufp++ = *p++; else { - memcpy ((PTR) stream->__bufp, (PTR) p, n); + memcpy ((void *) stream->__bufp, (void *) p, n); stream->__bufp += n; p += n; } diff --git a/stdio/getdelim.c b/stdio/getdelim.c index 2cdb95c2a6..761c7980c1 100644 --- a/stdio/getdelim.c +++ b/stdio/getdelim.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -31,15 +30,18 @@ Cambridge, MA 02139, USA. */ null terminator), or -1 on error or EOF. */ ssize_t -DEFUN(__getdelim, (lineptr, n, terminator, stream), - char **lineptr AND size_t *n AND int terminator AND FILE *stream) +__getdelim (lineptr, n, terminator, stream) + char **lineptr; + size_t *n; + int terminator; + FILE *stream; { char *line, *p; size_t size, copy; if (!__validfp (stream) || lineptr == NULL || n == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } @@ -116,7 +118,7 @@ DEFUN(__getdelim, (lineptr, n, terminator, stream), size_t i; char *found; - i = stream->__get_limit - stream->__bufp; + i = stream->__get_limit - stream->__bufp; if (i == 0) { /* Refill the buffer. */ @@ -127,7 +129,7 @@ DEFUN(__getdelim, (lineptr, n, terminator, stream), if (c == terminator) goto win; --copy; - i = stream->__get_limit - stream->__bufp; + i = stream->__get_limit - stream->__bufp; } if (i > copy) diff --git a/stdio/gets.c b/stdio/gets.c index 37426cf4e3..7f84c92df3 100644 --- a/stdio/gets.c +++ b/stdio/gets.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <stdio.h> #include <errno.h> #include <string.h> @@ -27,22 +26,23 @@ link_warning (gets, /* Read a newline-terminated string from stdin into S, removing the trailing newline. Return S or NULL. */ char * -DEFUN(gets, (s), char *s) +gets (s) + char *s; { register char *p = s; register int c; FILE *stream = stdin; - if (!__validfp(stream) || p == NULL) + if (!__validfp (stream) || p == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } - if (feof(stream) || ferror(stream)) + if (feof (stream) || ferror (stream)) return NULL; - while ((c = getchar()) != EOF) + while ((c = getchar ()) != EOF) if (c == '\n') break; else diff --git a/stdio/glue.c b/stdio/glue.c index 6ef52a7ada..592700ff94 100644 --- a/stdio/glue.c +++ b/stdio/glue.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1996 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 @@ -27,7 +27,6 @@ Cambridge, MA 02139, USA. */ libraries) compiled with Unix header files to work with the GNU C library. */ -#include <ansidecl.h> #include <stdio.h> #include <errno.h> @@ -74,7 +73,8 @@ unix_FILE _iob[] = In a Unix stdio FILE `_cnt' is the first element. In a GNU stdio or glued FILE, the first element is the magic number. */ int -DEFUN(_filbuf, (file), unix_FILE *file) +_filbuf (file) + unix_FILE *file; { switch (++file->glue.magic) /* Compensate for Unix getc's decrement. */ { @@ -88,15 +88,16 @@ DEFUN(_filbuf, (file), unix_FILE *file) default: /* Bogus stream. */ - errno = EINVAL; + __set_errno (EINVAL); return EOF; } } /* Called by the Unix stdio `putc' macro. Much like getc, above. */ int -DEFUN(_flsbuf, (c, file), - int c AND unix_FILE *file) +_flsbuf (c, file) + int c; + unix_FILE *file; { /* Compensate for putc's decrement. */ switch (++file->glue.magic) @@ -108,7 +109,7 @@ DEFUN(_flsbuf, (c, file), return putc (c, (FILE *) file); default: - errno = EINVAL; + __set_errno (EINVAL); return EOF; } } diff --git a/stdio/internals.c b/stdio/internals.c index a1d1fa4989..8c2acc4026 100644 --- a/stdio/internals.c +++ b/stdio/internals.c @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -25,7 +24,8 @@ Cambridge, MA 02139, USA. */ /* Make sure that FP has its functions set. */ void -DEFUN(__stdio_check_funcs, (fp), register FILE *fp) +__stdio_check_funcs (fp) + register FILE *fp; { if (!fp->__seen) { @@ -34,7 +34,7 @@ DEFUN(__stdio_check_funcs, (fp), register FILE *fp) If no buffer is set (and the stream is not made explicitly unbuffered), we allocate a buffer below, using the bufsize set by this function. */ - extern void EXFUN(__stdio_init_stream, (FILE *)); + extern void __stdio_init_stream __P ((FILE *)); fp->__room_funcs = __default_room_functions; fp->__io_funcs = __default_io_functions; __stdio_init_stream (fp); @@ -51,7 +51,8 @@ DEFUN(__stdio_check_funcs, (fp), register FILE *fp) /* Figure out what kind of buffering (none, line, or full) and what buffer size to give FP. */ static void -DEFUN(init_stream, (fp), register FILE *fp) +init_stream (fp) + register FILE *fp; { __stdio_check_funcs (fp); @@ -69,13 +70,13 @@ DEFUN(init_stream, (fp), register FILE *fp) save = errno; while (fp->__bufsize >= MIN_BUFSIZE) { - fp->__buffer = (char *) malloc(fp->__bufsize); + fp->__buffer = (char *) malloc (fp->__bufsize); if (fp->__buffer == NULL) fp->__bufsize /= 2; else break; } - errno = save; + __set_errno (save); if (fp->__buffer == NULL) { @@ -96,7 +97,8 @@ DEFUN(init_stream, (fp), register FILE *fp) /* Determine the current file position of STREAM if it is unknown. */ int -DEFUN(__stdio_check_offset, (stream), FILE *stream) +__stdio_check_offset (stream) + FILE *stream; { init_stream (stream); @@ -106,15 +108,15 @@ DEFUN(__stdio_check_offset, (stream), FILE *stream) if (stream->__io_funcs.__seek == NULL) { /* Unknowable. */ - errno = ESPIPE; + __set_errno (ESPIPE); return EOF; } else { /* Unknown. Find it out. */ fpos_t pos = (fpos_t) 0; - if ((*stream->__io_funcs.__seek)(stream->__cookie, - &pos, SEEK_CUR) < 0) + if ((*stream->__io_funcs.__seek) (stream->__cookie, + &pos, SEEK_CUR) < 0) { if (errno == ESPIPE) /* Object is incapable of seeking. */ @@ -139,13 +141,14 @@ DEFUN(__stdio_check_offset, (stream), FILE *stream) seeking as necessary and updating its `offset' field. Sets ferror(FP) (and possibly errno) for errors. */ static void -DEFUN(seek_to_target, (fp), FILE *fp) +seek_to_target (fp) + FILE *fp; { int save = errno; if (__stdio_check_offset (fp) == EOF) { if (errno == ESPIPE) - errno = save; + __set_errno (save); else fp->__error = 1; } @@ -156,13 +159,13 @@ DEFUN(seek_to_target, (fp), FILE *fp) if (fp->__io_funcs.__seek == NULL) { /* We can't seek! */ - errno = ESPIPE; + __set_errno (ESPIPE); fp->__error = 1; } else { fpos_t pos = fp->__target; - if ((*fp->__io_funcs.__seek)(fp->__cookie, &pos, SEEK_SET) < 0) + if ((*fp->__io_funcs.__seek) (fp->__cookie, &pos, SEEK_SET) < 0) /* Seek failed! */ fp->__error = 1; else @@ -175,10 +178,10 @@ DEFUN(seek_to_target, (fp), FILE *fp) #ifdef EGRATUITOUS /* It happens in the Hurd when the io server doesn't obey the protocol for io_seek. */ - errno = EGRATUITOUS; + __set_errno (EGRATUITOUS); #else /* I don't think this can happen in Unix. */ - errno = ESPIPE; /* ??? */ + __set_errno (ESPIPE); /* ??? */ #endif fp->__error = 1; } @@ -194,8 +197,9 @@ DEFUN(seek_to_target, (fp), FILE *fp) flushed to avoid a system call for a single character. This is the default `output room' function. */ static void -DEFUN(flushbuf, (fp, c), - register FILE *fp AND int c) +flushbuf (fp, c) + register FILE *fp; + int c; { int flush_only = c == EOF; size_t buffer_written; @@ -223,21 +227,21 @@ DEFUN(flushbuf, (fp, c), !fp->__mode.__append) { int save = errno; - CONST int aligned = (fp->__buffer == NULL || - __stdio_check_offset(fp) == EOF || + const int aligned = (fp->__buffer == NULL || + __stdio_check_offset (fp) == EOF || fp->__target % fp->__bufsize == 0); - errno = save; + __set_errno (save); if (!aligned) { /* Move to a block (buffer size) boundary and read in a block. Then the output will be written as a whole block, too. */ - CONST size_t o = fp->__target % fp->__bufsize; + const size_t o = fp->__target % fp->__bufsize; fp->__target -= o; - if ((*fp->__room_funcs.__input)(fp) == EOF && ferror(fp)) + if ((*fp->__room_funcs.__input) (fp) == EOF && ferror (fp)) return; else - __clearerr(fp); + __clearerr (fp); if (fp->__get_limit - fp->__buffer < o) /* Oops. We didn't read enough (probably because we got EOF). @@ -322,8 +326,8 @@ DEFUN(flushbuf, (fp, c), if (!ferror(fp)) { /* Write out the buffered data. */ - wrote = (*fp->__io_funcs.__write)(fp->__cookie, fp->__buffer, - to_write); + wrote = (*fp->__io_funcs.__write) (fp->__cookie, fp->__buffer, + to_write); if (wrote > 0) { if (fp->__mode.__append) @@ -347,7 +351,7 @@ DEFUN(flushbuf, (fp, c), fp->__bufp = fp->__buffer; /* If we're not just flushing, write the last character, C. */ - if (!flush_only && !ferror(fp)) + if (!flush_only && !ferror (fp)) { if (fp->__buffer == NULL || (fp->__linebuf && (unsigned char) c == '\n')) { @@ -382,7 +386,7 @@ DEFUN(flushbuf, (fp, c), fp->__get_limit = fp->__buffer; } - if (feof(fp) || ferror(fp)) + if (feof (fp) || ferror (fp)) fp->__bufp = fp->__put_limit; } @@ -390,7 +394,8 @@ DEFUN(flushbuf, (fp, c), /* Fill the buffer for FP and return the first character read (or EOF). This is the default `input_room' function. */ static int -DEFUN(fillbuf, (fp), register FILE *fp) +fillbuf (fp) + register FILE *fp; { /* How far into the buffer we read we want to start bufp. */ size_t buffer_offset = 0; @@ -435,13 +440,13 @@ DEFUN(fillbuf, (fp), register FILE *fp) } seek_to_target (fp); } - errno = save; + __set_errno (save); } - while (!ferror(fp) && !feof(fp) && nread <= buffer_offset) + while (!ferror (fp) && !feof (fp) && nread <= buffer_offset) { /* Try to fill the buffer. */ - int count = (*fp->__io_funcs.__read)(fp->__cookie, buffer, to_read); + int count = (*fp->__io_funcs.__read) (fp->__cookie, buffer, to_read); if (count == 0) fp->__eof = 1; else if (count < 0) @@ -460,7 +465,7 @@ DEFUN(fillbuf, (fp), register FILE *fp) if (fp->__buffer == NULL) /* There is no buffer, so return the character we read without all the buffer pointer diddling. */ - return (feof(fp) || ferror(fp)) ? EOF : c; + return (feof (fp) || ferror (fp)) ? EOF : c; /* Reset the buffer pointer to the beginning of the buffer (plus whatever offset we may have set above). */ @@ -468,7 +473,7 @@ DEFUN(fillbuf, (fp), register FILE *fp) end:; - if (feof(fp) || ferror(fp)) + if (feof (fp) || ferror (fp)) { /* Set both end pointers to the beginning of the buffer so the next i/o call will force a call to __fillbf/__flshfp. */ @@ -494,12 +499,12 @@ extern __io_write_fn __stdio_write; extern __io_seek_fn __stdio_seek; extern __io_close_fn __stdio_close; extern __io_fileno_fn __stdio_fileno; -CONST __io_functions __default_io_functions = +const __io_functions __default_io_functions = { __stdio_read, __stdio_write, __stdio_seek, __stdio_close, __stdio_fileno }; -CONST __room_functions __default_room_functions = +const __room_functions __default_room_functions = { fillbuf, flushbuf }; @@ -508,18 +513,19 @@ CONST __room_functions __default_room_functions = /* Flush the buffer for FP and also write C if FLUSH_ONLY is nonzero. This is the function used by putc and fflush. */ int -DEFUN(__flshfp, (fp, c), - register FILE *fp AND int c) +__flshfp (fp, c) + register FILE *fp; + int c; { int flush_only = c == EOF; - if (!__validfp(fp) || !fp->__mode.__write) + if (!__validfp (fp) || !fp->__mode.__write) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } - if (ferror(fp)) + if (ferror (fp)) return EOF; if (fp->__pushed_back) @@ -530,7 +536,7 @@ DEFUN(__flshfp, (fp, c), } /* Make sure the stream is initialized (has functions and buffering). */ - init_stream(fp); + init_stream (fp); /* Do this early, so a `putc' on such a stream will never return success. */ if (fp->__room_funcs.__output == NULL) @@ -589,14 +595,15 @@ DEFUN(__flshfp, (fp, c), /* Fill the buffer for FP and return the first character read. This is the function used by getc. */ int -DEFUN(__fillbf, (fp), register FILE *fp) +__fillbf (fp) + register FILE *fp; { register int c; fpos_t new_target; - if (!__validfp(fp) || !fp->__mode.__read) + if (!__validfp (fp) || !fp->__mode.__read) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } @@ -609,7 +616,7 @@ DEFUN(__fillbf, (fp), register FILE *fp) } /* Make sure the stream is initialized (has functions and buffering). */ - init_stream(fp); + init_stream (fp); /* If we're trying to read the first character of a new line of input from an unbuffered or line buffered stream, @@ -648,11 +655,11 @@ DEFUN(__fillbf, (fp), register FILE *fp) fp->__target = new_target; - if (ferror(fp)) + if (ferror (fp)) c = EOF; else if (fp->__room_funcs.__input != NULL) { - c = (*fp->__room_funcs.__input)(fp); + c = (*fp->__room_funcs.__input) (fp); if (fp->__buffer == NULL) /* This is an unbuffered stream, so the target sync above won't do anything the next time around. Instead, note that @@ -673,13 +680,14 @@ DEFUN(__fillbf, (fp), register FILE *fp) /* Nuke a stream, but don't kill its link in the chain. */ void -DEFUN(__invalidate, (stream), register FILE *stream) +__invalidate (stream) + register FILE *stream; { /* Save its link. */ register FILE *next = stream->__next; /* Pulverize the fucker. */ - memset((PTR) stream, 0, sizeof(FILE)); + memset((void *) stream, 0, sizeof(FILE)); /* Restore the deceased's link. */ stream->__next = next; diff --git a/stdio/memstream.c b/stdio/memstream.c index 1a8b35081d..ab285f4624 100644 --- a/stdio/memstream.c +++ b/stdio/memstream.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1994, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 94, 95, 96 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -30,8 +29,9 @@ struct memstream_info /* Enlarge STREAM's buffer. */ static void -DEFUN(enlarge_buffer, (stream, c), - register FILE *stream AND int c) +enlarge_buffer (stream, c) + register FILE *stream; + int c; { struct memstream_info *info = (struct memstream_info *) stream->__cookie; size_t need; @@ -64,7 +64,7 @@ DEFUN(enlarge_buffer, (stream, c), newsize = need; else newsize = stream->__bufsize * 2; - newbuf = (char *) realloc ((PTR) stream->__buffer, newsize); + newbuf = (char *) realloc ((void *) stream->__buffer, newsize); if (newbuf == NULL) { stream->__error = 1; @@ -82,7 +82,7 @@ DEFUN(enlarge_buffer, (stream, c), if (need > 0) { /* We are extending the buffer after an fseek; zero-fill new space. */ - bzero (stream->__bufp, need); + memset (stream->__bufp, '\0', need); stream->__bufp += need; } @@ -96,8 +96,10 @@ DEFUN(enlarge_buffer, (stream, c), There is no external state to munge. */ static int -DEFUN(seek, (cookie, pos, whence), - PTR cookie AND fpos_t *pos AND int whence) +seek (cookie, pos, whence) + void *cookie; + fpos_t *pos; + int whence; { switch (whence) { @@ -118,7 +120,8 @@ DEFUN(seek, (cookie, pos, whence), } static int -DEFUN(free_info, (cookie), PTR cookie) +free_info (cookie) + void *cookie; { #if 0 struct memstream_info *info = (struct memstream_info *) cookie; @@ -138,15 +141,16 @@ DEFUN(free_info, (cookie), PTR cookie) necessary. *BUFLOC and *SIZELOC are updated with the buffer's location and the number of characters written on fflush or fclose. */ FILE * -DEFUN(open_memstream, (bufloc, sizeloc), - char **bufloc AND size_t *sizeloc) +open_memstream (bufloc, sizeloc) + char **bufloc; + size_t *sizeloc; { FILE *stream; struct memstream_info *info; if (bufloc == NULL || sizeloc == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return NULL; } @@ -159,14 +163,14 @@ DEFUN(open_memstream, (bufloc, sizeloc), { int save = errno; (void) fclose (stream); - errno = save; + __set_errno (save); return NULL; } stream->__room_funcs.__output = enlarge_buffer; stream->__io_funcs.__seek = seek; stream->__io_funcs.__close = free_info; - stream->__cookie = (PTR) info; + stream->__cookie = (void *) info; stream->__userbuf = 1; info->buffer = bufloc; diff --git a/stdio/setvbuf.c b/stdio/setvbuf.c index 6bfe829d1d..ba79959594 100644 --- a/stdio/setvbuf.c +++ b/stdio/setvbuf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -27,12 +26,15 @@ Cambridge, MA 02139, USA. */ If MODE indicates full or line buffering, use BUF, a buffer of SIZE bytes; if BUF is NULL, malloc a buffer. */ int -DEFUN(setvbuf, (stream, buf, mode, size), - FILE *stream AND char *buf AND int mode AND size_t size) +setvbuf (stream, buf, mode, size) + FILE *stream; + char *buf; + int mode; + size_t size; { - if (!__validfp(stream)) + if (!__validfp (stream)) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } @@ -40,7 +42,7 @@ DEFUN(setvbuf, (stream, buf, mode, size), but we allow it to replace an old buffer, flushing it first. */ if (stream->__buffer != NULL) { - (void) fflush(stream); + (void) fflush (stream); /* Free the old buffer if it was malloc'd. */ if (!stream->__userbuf) free(stream->__buffer); @@ -53,7 +55,7 @@ DEFUN(setvbuf, (stream, buf, mode, size), switch (mode) { default: - errno = EINVAL; + __set_errno (EINVAL); return EOF; case _IONBF: /* Unbuffered. */ stream->__buffer = NULL; @@ -65,13 +67,13 @@ DEFUN(setvbuf, (stream, buf, mode, size), case _IOFBF: /* Fully buffered. */ if (size == 0) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } stream->__bufsize = size; if (buf != NULL) stream->__userbuf = 1; - else if ((buf = (char *) malloc(size)) == NULL) + else if ((buf = (char *) malloc (size)) == NULL) return EOF; stream->__buffer = buf; break; diff --git a/stdio/ungetc.c b/stdio/ungetc.c index 7b22a200f6..834f5be6d4 100644 --- a/stdio/ungetc.c +++ b/stdio/ungetc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1993, 1996 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 @@ -16,18 +16,19 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdio.h> /* Push the character C back onto the input stream of STREAM. */ int -DEFUN(ungetc, (c, stream), register int c AND register FILE *stream) +ungetc (c, stream) + register int c; + register FILE *stream; { - if (!__validfp(stream) || !stream->__mode.__read) + if (!__validfp (stream) || !stream->__mode.__read) { - errno = EINVAL; + __set_errno (EINVAL); return EOF; } diff --git a/stdio/vsscanf.c b/stdio/vsscanf.c index 6f027d5065..5e538291fa 100644 --- a/stdio/vsscanf.c +++ b/stdio/vsscanf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1995, 1996 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 @@ -16,7 +16,6 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <ansidecl.h> #include <errno.h> #include <stdarg.h> #include <stdio.h> @@ -28,18 +27,20 @@ Cambridge, MA 02139, USA. */ /* Read formatted input from S according to the format string FORMAT, using the argument list in ARG. */ int -DEFUN(__vsscanf, (s, format, arg), - CONST char *s AND CONST char *format AND va_list arg) +__vsscanf (s, format, arg) + const char *s; + const char *format; + va_list arg; { FILE f; if (s == NULL) { - errno = EINVAL; + __set_errno (EINVAL); return -1; } - memset((PTR) &f, 0, sizeof(f)); + memset ((void *) &f, 0, sizeof (f)); f.__magic = _IOMAGIC; f.__mode.__read = 1; f.__bufp = f.__buffer = (char *) s; @@ -51,7 +52,7 @@ DEFUN(__vsscanf, (s, format, arg), f.__room_funcs.__input = NULL; f.__seen = 1; - return __vfscanf(&f, format, arg); + return __vfscanf (&f, format, arg); } |