From fac857e26c0833a2669dc7aacec201d2f25adbc5 Mon Sep 17 00:00:00 2001 From: cvs2svn <> Date: Sat, 29 Jul 2000 16:01:24 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'unlabeled-1.17.2'. Sprout from master 2000-07-29 16:01:23 UTC Christopher Faylor '* environ.cc (parse_thing): Make binmode a DWORD.' Delete: COPYING COPYING.LIB ChangeLog MAINTAINERS Makefile.in README README-maintainer-mode config-ml.in config.guess config.if config.sub config/ChangeLog config/acinclude.m4 config/mh-a68bsd config/mh-aix386 config/mh-apollo68 config/mh-armpic config/mh-cxux config/mh-cygwin config/mh-decstation config/mh-delta88 config/mh-dgux config/mh-dgux386 config/mh-djgpp config/mh-elfalphapic config/mh-hp300 config/mh-hpux config/mh-hpux8 config/mh-i370pic config/mh-ia64pic config/mh-interix config/mh-irix4 config/mh-irix5 config/mh-irix6 config/mh-lynxos config/mh-lynxrs6k config/mh-m68kpic config/mh-mingw32 config/mh-ncr3000 config/mh-ncrsvr43 config/mh-necv4 config/mh-openedition config/mh-papic config/mh-ppcpic config/mh-riscos config/mh-sco config/mh-solaris config/mh-sparcpic config/mh-sun3 config/mh-sysv config/mh-sysv4 config/mh-sysv5 config/mh-vaxult2 config/mh-x86pic config/mpw-mh-mpw config/mpw/ChangeLog config/mpw/MoveIfChange config/mpw/README config/mpw/forward-include config/mpw/g-mpw-make.sed config/mpw/mpw-touch config/mpw/mpw-true config/mpw/null-command config/mpw/open-brace config/mpw/tr-7to8-src config/mpw/true config/mt-aix43 config/mt-armpic config/mt-d30v config/mt-elfalphapic config/mt-i370pic config/mt-ia64pic config/mt-linux config/mt-m68kpic config/mt-netware config/mt-ospace config/mt-papic config/mt-ppcpic config/mt-sparcpic config/mt-v810 config/mt-wince config/mt-x86pic configure configure.in djunpack.bat etc/ChangeLog etc/Makefile.in etc/add-log.el etc/add-log.vi etc/configbuild.ein etc/configbuild.fig etc/configbuild.jin etc/configbuild.tin etc/configdev.ein etc/configdev.fig etc/configdev.jin etc/configdev.tin etc/configure etc/configure.in etc/configure.texi etc/make-stds.texi etc/standards.texi include/COPYING include/ChangeLog include/MAINTAINERS include/ansidecl.h include/aout/ChangeLog include/aout/adobe.h include/aout/aout64.h include/aout/ar.h include/aout/dynix3.h include/aout/encap.h include/aout/host.h include/aout/hp.h include/aout/hp300hpux.h include/aout/hppa.h include/aout/ranlib.h include/aout/reloc.h include/aout/stab.def include/aout/stab_gnu.h include/aout/sun4.h include/bfdlink.h include/bin-bugs.h include/bout.h include/callback.h include/coff/ChangeLog include/coff/a29k.h include/coff/alpha.h include/coff/apollo.h include/coff/arm.h include/coff/aux-coff.h include/coff/ecoff.h include/coff/go32exe.h include/coff/h8300.h include/coff/h8500.h include/coff/i386.h include/coff/i860.h include/coff/i960.h include/coff/ia64.h include/coff/internal.h include/coff/m68k.h include/coff/m88k.h include/coff/mcore.h include/coff/mips.h include/coff/mipspe.h include/coff/pe.h include/coff/powerpc.h include/coff/rs6000.h include/coff/rs6k64.h include/coff/sh.h include/coff/sparc.h include/coff/sym.h include/coff/symconst.h include/coff/ti.h include/coff/tic30.h include/coff/tic54x.h include/coff/tic80.h include/coff/w65.h include/coff/we32k.h include/coff/z8k.h include/demangle.h include/dis-asm.h include/dyn-string.h include/elf/ChangeLog include/elf/alpha.h include/elf/arc.h include/elf/arm.h include/elf/avr.h include/elf/common.h include/elf/cris.h include/elf/d10v.h include/elf/d30v.h include/elf/dwarf.h include/elf/dwarf2.h include/elf/external.h include/elf/fr30.h include/elf/hppa.h include/elf/i370.h include/elf/i386.h include/elf/i860.h include/elf/i960.h include/elf/ia64.h include/elf/internal.h include/elf/m32r.h include/elf/m68hc11.h include/elf/m68k.h include/elf/mcore.h include/elf/mips.h include/elf/mn10200.h include/elf/mn10300.h include/elf/pj.h include/elf/ppc.h include/elf/reloc-macros.h include/elf/sh.h include/elf/sparc.h include/elf/v850.h include/filenames.h include/floatformat.h include/fnmatch.h include/fopen-bin.h include/fopen-same.h include/fopen-vms.h include/gdbm.h include/getopt.h include/hashtab.h include/hp-symtab.h include/ieee.h include/libiberty.h include/mpw/ChangeLog include/mpw/README include/mpw/dir.h include/mpw/dirent.h include/mpw/fcntl.h include/mpw/grp.h include/mpw/mpw.h include/mpw/pwd.h include/mpw/spin.h include/mpw/stat.h include/mpw/sys/file.h include/mpw/sys/param.h include/mpw/sys/resource.h include/mpw/sys/stat.h include/mpw/sys/time.h include/mpw/sys/types.h include/mpw/utime.h include/mpw/varargs.h include/nlm/ChangeLog include/nlm/alpha-ext.h include/nlm/common.h include/nlm/external.h include/nlm/i386-ext.h include/nlm/internal.h include/nlm/ppc-ext.h include/nlm/sparc32-ext.h include/oasys.h include/objalloc.h include/obstack.h include/opcode/ChangeLog include/opcode/a29k.h include/opcode/alpha.h include/opcode/arc.h include/opcode/arm.h include/opcode/avr.h include/opcode/cgen.h include/opcode/convex.h include/opcode/cris.h include/opcode/d10v.h include/opcode/d30v.h include/opcode/h8300.h include/opcode/hppa.h include/opcode/i370.h include/opcode/i386.h include/opcode/i860.h include/opcode/i960.h include/opcode/ia64.h include/opcode/m68hc11.h include/opcode/m68k.h include/opcode/m88k.h include/opcode/mips.h include/opcode/mn10200.h include/opcode/mn10300.h include/opcode/np1.h include/opcode/ns32k.h include/opcode/pj.h include/opcode/pn.h include/opcode/ppc.h include/opcode/pyr.h include/opcode/sparc.h include/opcode/tahoe.h include/opcode/tic30.h include/opcode/tic54x.h include/opcode/tic80.h include/opcode/v850.h include/opcode/vax.h include/os9k.h include/partition.h include/progress.h include/regs/ChangeLog include/remote-sim.h include/sim-d10v.h include/sort.h include/splay-tree.h include/symcat.h install-sh libgloss/ChangeLog libgloss/Makefile.in libgloss/README libgloss/close.c libgloss/config/default.mh libgloss/config/default.mt libgloss/config/dos.mh libgloss/config/mips.mt libgloss/config/mn10200.mt libgloss/config/mn10300.mt libgloss/config/ppc.mh libgloss/configure libgloss/configure.in libgloss/d30v/Makefile.in libgloss/d30v/configure libgloss/d30v/configure.in libgloss/d30v/crt0.S libgloss/d30v/inbyte.c libgloss/d30v/outbyte.c libgloss/d30v/syscalls.c libgloss/debug.c libgloss/debug.h libgloss/doc/Makefile.in libgloss/doc/configure libgloss/doc/configure.in libgloss/doc/porting.texi libgloss/fr30/Makefile.in libgloss/fr30/configure libgloss/fr30/configure.in libgloss/fr30/crt0.s libgloss/fr30/syscalls.c libgloss/fstat.c libgloss/getpid.c libgloss/glue.h libgloss/hp74x/Makefile.in libgloss/hp74x/README libgloss/hp74x/checksum.c libgloss/hp74x/configure libgloss/hp74x/configure.in libgloss/hp74x/crt0.s libgloss/hp74x/debugger.h libgloss/hp74x/debugger.s libgloss/hp74x/diagnose.h libgloss/hp74x/hppa-defs.h libgloss/hp74x/hppa.ld libgloss/hp74x/io.c libgloss/hp74x/iva_table.h libgloss/hp74x/iva_table.s libgloss/hp74x/pa_stub.c libgloss/hp74x/test.c libgloss/i386/Makefile.in libgloss/i386/configure libgloss/i386/configure.in libgloss/i386/cygmon-crt0.S libgloss/i386/cygmon-gmon.c libgloss/i386/cygmon-gmon.h libgloss/i386/cygmon-salib.c libgloss/i386/cygmon-syscall.h libgloss/i386/cygmon.ld libgloss/i960/Makefile.in libgloss/i960/asm.h libgloss/i960/configure libgloss/i960/configure.in libgloss/i960/crt0.c libgloss/i960/mon-read.c libgloss/i960/mon-syscalls.S libgloss/i960/mon-write.c libgloss/i960/mon960.c libgloss/i960/mon960.ld libgloss/i960/syscall.h libgloss/isatty.c libgloss/kill.c libgloss/libnosys/Makefile.in libgloss/libnosys/acconfig.h libgloss/libnosys/close.c libgloss/libnosys/config.h.in libgloss/libnosys/configure libgloss/libnosys/configure.in libgloss/libnosys/environ.c libgloss/libnosys/execve.c libgloss/libnosys/fork.c libgloss/libnosys/fstat.c libgloss/libnosys/getpid.c libgloss/libnosys/gettod.c libgloss/libnosys/isatty.c libgloss/libnosys/kill.c libgloss/libnosys/link.c libgloss/libnosys/lseek.c libgloss/libnosys/open.c libgloss/libnosys/read.c libgloss/libnosys/sbrk.c libgloss/libnosys/stat.c libgloss/libnosys/times.c libgloss/libnosys/unlink.c libgloss/libnosys/wait.c libgloss/libnosys/warning.h libgloss/libnosys/write.c libgloss/lseek.c libgloss/m32r/Makefile.in libgloss/m32r/chmod.c libgloss/m32r/close.c libgloss/m32r/configure libgloss/m32r/configure.in libgloss/m32r/crt0.S libgloss/m32r/eit.h libgloss/m32r/eva-stub.ld libgloss/m32r/eva.ld libgloss/m32r/exit.c libgloss/m32r/fstat.c libgloss/m32r/getpid.c libgloss/m32r/isatty.c libgloss/m32r/kill.c libgloss/m32r/lseek.c libgloss/m32r/m32r-lib.c libgloss/m32r/mon.specs libgloss/m32r/open.c libgloss/m32r/raise.c libgloss/m32r/read.c libgloss/m32r/sbrk.c libgloss/m32r/stat.c libgloss/m32r/trap0.S libgloss/m32r/trapmon0.c libgloss/m32r/unlink.c libgloss/m32r/utime.c libgloss/m32r/write.c libgloss/m68k/Makefile.in libgloss/m68k/README libgloss/m68k/asm.h libgloss/m68k/bcc.ld libgloss/m68k/configure libgloss/m68k/configure.in libgloss/m68k/cpu32bug.S libgloss/m68k/cpu32bug.h libgloss/m68k/crt0.S libgloss/m68k/dbug-exit.S libgloss/m68k/dbug-inbyte.S libgloss/m68k/dbug-outbyte.S libgloss/m68k/dtor.C libgloss/m68k/idp-inbyte.c libgloss/m68k/idp-outbyte.c libgloss/m68k/idp.ld libgloss/m68k/leds.c libgloss/m68k/leds.h libgloss/m68k/mc68681reg.h libgloss/m68k/mc68ec.c libgloss/m68k/mvme-stub.c libgloss/m68k/mvme.S libgloss/m68k/mvme135-asm.S libgloss/m68k/mvme135.ld libgloss/m68k/mvme162.ld libgloss/m68k/mvme162lx-asm.S libgloss/m68k/sbc5204.ld libgloss/m68k/sbc5206.ld libgloss/m68k/test.c libgloss/mcore/Makefile.in libgloss/mcore/close.c libgloss/mcore/cmb-exit.c libgloss/mcore/cmb-inbyte.c libgloss/mcore/cmb-outbyte.c libgloss/mcore/configure libgloss/mcore/configure.in libgloss/mcore/crt0.S libgloss/mcore/elf-cmb.ld libgloss/mcore/elf-cmb.specs libgloss/mcore/fstat.c libgloss/mcore/getpid.c libgloss/mcore/kill.c libgloss/mcore/lseek.c libgloss/mcore/open.c libgloss/mcore/pe-cmb.ld libgloss/mcore/pe-cmb.specs libgloss/mcore/print.c libgloss/mcore/putnum.c libgloss/mcore/raise.c libgloss/mcore/read.c libgloss/mcore/sbrk.c libgloss/mcore/stat.c libgloss/mcore/syscalls.S libgloss/mcore/unlink.c libgloss/mcore/write.c libgloss/mips/Makefile.in libgloss/mips/array-io.c libgloss/mips/array.ld libgloss/mips/cma101.c libgloss/mips/configure libgloss/mips/configure.in libgloss/mips/crt0.S libgloss/mips/ddb.ld libgloss/mips/dtor.C libgloss/mips/dve.ld libgloss/mips/dvemon.c libgloss/mips/entry.S libgloss/mips/idt.ld libgloss/mips/idtecoff.ld libgloss/mips/idtmon.S libgloss/mips/jmr3904-io.c libgloss/mips/jmr3904app-java.ld libgloss/mips/jmr3904app.ld libgloss/mips/jmr3904dram-java.ld libgloss/mips/jmr3904dram.ld libgloss/mips/lsi.ld libgloss/mips/lsi33k-stub.c libgloss/mips/lsi33k-stub.h libgloss/mips/lsipmon.S libgloss/mips/nullmon.c libgloss/mips/nullmon.ld libgloss/mips/pmon.S libgloss/mips/pmon.ld libgloss/mips/regs.S libgloss/mips/syscalls.c libgloss/mips/test.c libgloss/mips/vr4300.S libgloss/mips/vr5xxx.S libgloss/mn10200/Makefile.in libgloss/mn10200/_exit.c libgloss/mn10200/access.c libgloss/mn10200/chmod.c libgloss/mn10200/chown.c libgloss/mn10200/close.c libgloss/mn10200/configure libgloss/mn10200/configure.in libgloss/mn10200/creat.c libgloss/mn10200/crt0.S libgloss/mn10200/crt1.c libgloss/mn10200/eval.ld libgloss/mn10200/execv.c libgloss/mn10200/execve.c libgloss/mn10200/fork.c libgloss/mn10200/fstat.c libgloss/mn10200/getpid.c libgloss/mn10200/gettime.c libgloss/mn10200/isatty.c libgloss/mn10200/kill.c libgloss/mn10200/lseek.c libgloss/mn10200/open.c libgloss/mn10200/pipe.c libgloss/mn10200/read.c libgloss/mn10200/sbrk.c libgloss/mn10200/sim.ld libgloss/mn10200/stat.c libgloss/mn10200/test.c libgloss/mn10200/time.c libgloss/mn10200/times.c libgloss/mn10200/trap.S libgloss/mn10200/trap.h libgloss/mn10200/unlink.c libgloss/mn10200/utime.c libgloss/mn10200/wait.c libgloss/mn10200/write.c libgloss/mn10300/Makefile.in libgloss/mn10300/_exit.c libgloss/mn10300/access.c libgloss/mn10300/chmod.c libgloss/mn10300/chown.c libgloss/mn10300/close.c libgloss/mn10300/configure libgloss/mn10300/configure.in libgloss/mn10300/creat.c libgloss/mn10300/crt0-eval.S libgloss/mn10300/crt0.S libgloss/mn10300/crt1.c libgloss/mn10300/eval.ld libgloss/mn10300/execv.c libgloss/mn10300/execve.c libgloss/mn10300/fork.c libgloss/mn10300/fstat.c libgloss/mn10300/getpid.c libgloss/mn10300/gettime.c libgloss/mn10300/isatty.c libgloss/mn10300/kill.c libgloss/mn10300/lseek.c libgloss/mn10300/open.c libgloss/mn10300/pipe.c libgloss/mn10300/read.c libgloss/mn10300/sbrk.c libgloss/mn10300/sim.ld libgloss/mn10300/stat.c libgloss/mn10300/test.c libgloss/mn10300/time.c libgloss/mn10300/times.c libgloss/mn10300/trap.S libgloss/mn10300/trap.h libgloss/mn10300/unlink.c libgloss/mn10300/utime.c libgloss/mn10300/wait.c libgloss/mn10300/write.c libgloss/open.c libgloss/pa/Makefile.in libgloss/pa/README libgloss/pa/configure libgloss/pa/configure.in libgloss/pa/crt0.S libgloss/pa/hp-milli.s libgloss/pa/op50n-io.S libgloss/pa/op50n.h libgloss/pa/op50n.ld libgloss/pa/op50nled.c libgloss/pa/setjmp.S libgloss/pa/test.c libgloss/pa/w89k-io.c libgloss/pa/w89k.h libgloss/pa/w89k.ld libgloss/print.c libgloss/putnum.c libgloss/read.c libgloss/rs6000/Makefile.in libgloss/rs6000/ads-exit.S libgloss/rs6000/ads-io.c libgloss/rs6000/ads.ld libgloss/rs6000/configure libgloss/rs6000/configure.in libgloss/rs6000/crt0.S libgloss/rs6000/mbx-exit.c libgloss/rs6000/mbx-inbyte.c libgloss/rs6000/mbx-outbyte.c libgloss/rs6000/mbx-print.c libgloss/rs6000/mbx.ld libgloss/rs6000/mbx.specs libgloss/rs6000/mcount.S libgloss/rs6000/mvme-errno.c libgloss/rs6000/mvme-exit.S libgloss/rs6000/mvme-inbyte.S libgloss/rs6000/mvme-outbyte.S libgloss/rs6000/mvme-print.c libgloss/rs6000/mvme-read.c libgloss/rs6000/sim-abort.c libgloss/rs6000/sim-crt0.S libgloss/rs6000/sim-errno.c libgloss/rs6000/sim-inbyte.c libgloss/rs6000/sim-print.c libgloss/rs6000/sim-sbrk.c libgloss/rs6000/simulator.S libgloss/rs6000/sol-cfuncs.c libgloss/rs6000/sol-syscall.S libgloss/rs6000/test.c libgloss/rs6000/yellowknife.ld libgloss/sbrk.c libgloss/sh/sh1lcevb.ld libgloss/sh/sh2lcevb.ld libgloss/sh/sh3bb.ld libgloss/sh/sh3lcevb.ld libgloss/sparc/Makefile.in libgloss/sparc/asm.h libgloss/sparc/cache.c libgloss/sparc/configure libgloss/sparc/configure.in libgloss/sparc/crt0-701.S libgloss/sparc/crt0.S libgloss/sparc/cygmon-crt0.S libgloss/sparc/cygmon-salib.c libgloss/sparc/cygmon-sparc64-ld.src libgloss/sparc/cygmon.ld.src libgloss/sparc/dtor.C libgloss/sparc/elfsim.ld libgloss/sparc/erc32-crt0.S libgloss/sparc/erc32-io.c libgloss/sparc/erc32-stub.c libgloss/sparc/erc32.ld libgloss/sparc/ex930.ld libgloss/sparc/ex931.ld libgloss/sparc/ex934.ld libgloss/sparc/fixctors.c libgloss/sparc/libsys/Makefile.in libgloss/sparc/libsys/_exit.S libgloss/sparc/libsys/cerror.S libgloss/sparc/libsys/configure libgloss/sparc/libsys/configure.in libgloss/sparc/libsys/isatty.c libgloss/sparc/libsys/libsys-crt0.S libgloss/sparc/libsys/sbrk.S libgloss/sparc/libsys/syscall.h libgloss/sparc/libsys/syscallasm.h libgloss/sparc/libsys/template.S libgloss/sparc/libsys/template_r.S libgloss/sparc/salib-701.c libgloss/sparc/salib.c libgloss/sparc/slite.h libgloss/sparc/sparc-stub.c libgloss/sparc/sparc86x.ld libgloss/sparc/sparcl-stub.c libgloss/sparc/sparclet-stub.c libgloss/sparc/sparclite.h libgloss/sparc/sysc-701.c libgloss/sparc/syscalls.c libgloss/sparc/test.c libgloss/sparc/traps.S libgloss/sparc/tsc701.ld libgloss/stat.c libgloss/syscall.h libgloss/testsuite/Makefile.in libgloss/testsuite/config/hppa.mt libgloss/testsuite/config/m68k.mt libgloss/testsuite/config/mips.mt libgloss/testsuite/config/support.c libgloss/testsuite/configure.in libgloss/testsuite/lib/libgloss.exp libgloss/testsuite/libgloss.all/.gdbinit libgloss/testsuite/libgloss.all/Makefile.in libgloss/testsuite/libgloss.all/array.c libgloss/testsuite/libgloss.all/configure.in libgloss/testsuite/libgloss.all/div.c libgloss/testsuite/libgloss.all/double.c libgloss/testsuite/libgloss.all/float.c libgloss/testsuite/libgloss.all/func.c libgloss/testsuite/libgloss.all/io.c libgloss/testsuite/libgloss.all/math.c libgloss/testsuite/libgloss.all/memory.c libgloss/testsuite/libgloss.all/misc.c libgloss/testsuite/libgloss.all/printf.c libgloss/testsuite/libgloss.all/struct.c libgloss/testsuite/libgloss.all/varargs.c libgloss/testsuite/libgloss.all/varargs2.c libgloss/unlink.c libgloss/v850/sys/syscall.h libgloss/wince/Makefile.am libgloss/wince/Makefile.in libgloss/wince/aclocal.m4 libgloss/wince/configure libgloss/wince/configure.in libgloss/write.c ltconfig ltmain.sh makefile.vms missing mkdep mkinstalldirs move-if-change mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install newlib/ChangeLog newlib/MAINTAINERS newlib/Makefile.am newlib/Makefile.in newlib/NEWS newlib/README newlib/acinclude.m4 newlib/aclocal.m4 newlib/configure newlib/configure.host newlib/configure.in newlib/doc/Makefile.am newlib/doc/Makefile.in newlib/doc/aclocal.m4 newlib/doc/ansidecl.h newlib/doc/configure newlib/doc/configure.in newlib/doc/doc.str newlib/doc/makedoc.c newlib/libc/Makefile.am newlib/libc/Makefile.in newlib/libc/aclocal.m4 newlib/libc/configure newlib/libc/configure.in newlib/libc/ctype/Makefile.am newlib/libc/ctype/Makefile.in newlib/libc/ctype/_tolower.c newlib/libc/ctype/_toupper.c newlib/libc/ctype/ctype.tex newlib/libc/ctype/ctype_.c newlib/libc/ctype/isalnum.c newlib/libc/ctype/isalpha.c newlib/libc/ctype/isascii.c newlib/libc/ctype/iscntrl.c newlib/libc/ctype/isdigit.c newlib/libc/ctype/islower.c newlib/libc/ctype/isprint.c newlib/libc/ctype/ispunct.c newlib/libc/ctype/isspace.c newlib/libc/ctype/isupper.c newlib/libc/ctype/isxdigit.c newlib/libc/ctype/toascii.c newlib/libc/ctype/tolower.c newlib/libc/ctype/toupper.c newlib/libc/errno/Makefile.am newlib/libc/errno/Makefile.in newlib/libc/errno/errno.c newlib/libc/include/_ansi.h newlib/libc/include/_syslist.h newlib/libc/include/ar.h newlib/libc/include/assert.h newlib/libc/include/ctype.h newlib/libc/include/dirent.h newlib/libc/include/errno.h newlib/libc/include/fastmath.h newlib/libc/include/fcntl.h newlib/libc/include/grp.h newlib/libc/include/ieeefp.h newlib/libc/include/locale.h newlib/libc/include/machine/fastmath.h newlib/libc/include/machine/ieeefp.h newlib/libc/include/machine/setjmp-dj.h newlib/libc/include/machine/setjmp.h newlib/libc/include/machine/time.h newlib/libc/include/machine/types.h newlib/libc/include/malloc.h newlib/libc/include/math.h newlib/libc/include/paths.h newlib/libc/include/process.h newlib/libc/include/pwd.h newlib/libc/include/reent.h newlib/libc/include/regdef.h newlib/libc/include/setjmp.h newlib/libc/include/signal.h newlib/libc/include/stdio.h newlib/libc/include/stdlib.h newlib/libc/include/string.h newlib/libc/include/sys/_types.h newlib/libc/include/sys/config.h newlib/libc/include/sys/dirent.h newlib/libc/include/sys/errno.h newlib/libc/include/sys/fcntl.h newlib/libc/include/sys/file.h newlib/libc/include/sys/param.h newlib/libc/include/sys/reent.h newlib/libc/include/sys/resource.h newlib/libc/include/sys/signal.h newlib/libc/include/sys/stat-dj.h newlib/libc/include/sys/stat.h newlib/libc/include/sys/time.h newlib/libc/include/sys/timeb.h newlib/libc/include/sys/times.h newlib/libc/include/sys/types.h newlib/libc/include/sys/unistd.h newlib/libc/include/sys/utime.h newlib/libc/include/sys/wait.h newlib/libc/include/termios.h newlib/libc/include/time.h newlib/libc/include/unctrl.h newlib/libc/include/unistd.h newlib/libc/include/utime.h newlib/libc/include/utmp.h newlib/libc/libc.texinfo newlib/libc/locale/Makefile.am newlib/libc/locale/Makefile.in newlib/libc/locale/locale.c newlib/libc/locale/locale.tex newlib/libc/machine/Makefile.am newlib/libc/machine/Makefile.in newlib/libc/machine/a29k/Makefile.am newlib/libc/machine/a29k/Makefile.in newlib/libc/machine/a29k/aclocal.m4 newlib/libc/machine/a29k/configure newlib/libc/machine/a29k/configure.in newlib/libc/machine/aclocal.m4 newlib/libc/machine/arm/Makefile.am newlib/libc/machine/arm/Makefile.in newlib/libc/machine/arm/aclocal.m4 newlib/libc/machine/arm/configure newlib/libc/machine/arm/configure.in newlib/libc/machine/configure newlib/libc/machine/configure.in newlib/libc/machine/d10v/Makefile.am newlib/libc/machine/d10v/Makefile.in newlib/libc/machine/d10v/aclocal.m4 newlib/libc/machine/d10v/configure newlib/libc/machine/d10v/configure.in newlib/libc/machine/d10v/setjmp.S newlib/libc/machine/d30v/Makefile.am newlib/libc/machine/d30v/Makefile.in newlib/libc/machine/d30v/aclocal.m4 newlib/libc/machine/d30v/configure newlib/libc/machine/d30v/configure.in newlib/libc/machine/d30v/setjmp.S newlib/libc/machine/fr30/Makefile.am newlib/libc/machine/fr30/Makefile.in newlib/libc/machine/fr30/aclocal.m4 newlib/libc/machine/fr30/configure newlib/libc/machine/fr30/configure.in newlib/libc/machine/fr30/setjmp.S newlib/libc/machine/h8300/Makefile.am newlib/libc/machine/h8300/Makefile.in newlib/libc/machine/h8300/aclocal.m4 newlib/libc/machine/h8300/configure newlib/libc/machine/h8300/configure.in newlib/libc/machine/h8300/defines.h newlib/libc/machine/h8300/memcpy.S newlib/libc/machine/h8300/memset.S newlib/libc/machine/h8300/reg_memcpy.S newlib/libc/machine/h8300/reg_memset.S newlib/libc/machine/h8300/setjmp.S newlib/libc/machine/h8300/strcmp.S newlib/libc/machine/h8500/Makefile.am newlib/libc/machine/h8500/Makefile.in newlib/libc/machine/h8500/aclocal.m4 newlib/libc/machine/h8500/cmpsi.c newlib/libc/machine/h8500/configure newlib/libc/machine/h8500/configure.in newlib/libc/machine/h8500/divhi3.S newlib/libc/machine/h8500/divsi3.c newlib/libc/machine/h8500/mulhi3.c newlib/libc/machine/h8500/mulsi3.c newlib/libc/machine/h8500/negsi2.c newlib/libc/machine/h8500/psi.S newlib/libc/machine/h8500/setjmp.S newlib/libc/machine/h8500/shifts.c newlib/libc/machine/hppa/DEFS.h newlib/libc/machine/hppa/Makefile.am newlib/libc/machine/hppa/Makefile.in newlib/libc/machine/hppa/aclocal.m4 newlib/libc/machine/hppa/configure newlib/libc/machine/hppa/configure.in newlib/libc/machine/hppa/memchr.S newlib/libc/machine/hppa/memcmp.S newlib/libc/machine/hppa/memcpy.S newlib/libc/machine/hppa/memset.S newlib/libc/machine/hppa/pcc_prefix.s newlib/libc/machine/hppa/setjmp.S newlib/libc/machine/hppa/strcat.S newlib/libc/machine/hppa/strcmp.S newlib/libc/machine/hppa/strcpy.S newlib/libc/machine/hppa/strlen.S newlib/libc/machine/hppa/strncat.S newlib/libc/machine/hppa/strncmp.S newlib/libc/machine/hppa/strncpy.S newlib/libc/machine/i386/Makefile.am newlib/libc/machine/i386/Makefile.in newlib/libc/machine/i386/aclocal.m4 newlib/libc/machine/i386/configure newlib/libc/machine/i386/configure.in newlib/libc/machine/i386/f_atan2.S newlib/libc/machine/i386/f_atan2f.S newlib/libc/machine/i386/f_exp.c newlib/libc/machine/i386/f_expf.c newlib/libc/machine/i386/f_frexp.S newlib/libc/machine/i386/f_frexpf.S newlib/libc/machine/i386/f_ldexp.S newlib/libc/machine/i386/f_ldexpf.S newlib/libc/machine/i386/f_log.S newlib/libc/machine/i386/f_log10.S newlib/libc/machine/i386/f_log10f.S newlib/libc/machine/i386/f_logf.S newlib/libc/machine/i386/f_math.h newlib/libc/machine/i386/f_pow.c newlib/libc/machine/i386/f_powf.c newlib/libc/machine/i386/f_tan.S newlib/libc/machine/i386/f_tanf.S newlib/libc/machine/i386/i386mach.h newlib/libc/machine/i386/memchr.S newlib/libc/machine/i386/memcmp.S newlib/libc/machine/i386/memcpy.S newlib/libc/machine/i386/memmove.S newlib/libc/machine/i386/memset.S newlib/libc/machine/i386/setjmp.S newlib/libc/machine/i386/strchr.S newlib/libc/machine/i386/strlen.S newlib/libc/machine/i960/Makefile.am newlib/libc/machine/i960/Makefile.in newlib/libc/machine/i960/aclocal.m4 newlib/libc/machine/i960/configure newlib/libc/machine/i960/configure.in newlib/libc/machine/i960/memccpy.S newlib/libc/machine/i960/memccpy_ca.S newlib/libc/machine/i960/memchr.S newlib/libc/machine/i960/memchr_ca.S newlib/libc/machine/i960/memcmp.S newlib/libc/machine/i960/memcmp_ca.S newlib/libc/machine/i960/memcpy.S newlib/libc/machine/i960/memcpy_ca.S newlib/libc/machine/i960/memset.S newlib/libc/machine/i960/setjmp.S newlib/libc/machine/i960/strchr.S newlib/libc/machine/i960/strchr_ca.S newlib/libc/machine/i960/strcmp.S newlib/libc/machine/i960/strcmp_ca.S newlib/libc/machine/i960/strcpy.S newlib/libc/machine/i960/strcpy_ca.S newlib/libc/machine/i960/strcspn.S newlib/libc/machine/i960/strdup.S newlib/libc/machine/i960/strlen.S newlib/libc/machine/i960/strlen_ca.S newlib/libc/machine/i960/strncat.S newlib/libc/machine/i960/strncat_ca.S newlib/libc/machine/i960/strncmp.S newlib/libc/machine/i960/strncmp_ca.S newlib/libc/machine/i960/strncpy.S newlib/libc/machine/i960/strncpy_ca.S newlib/libc/machine/i960/strpbrk.S newlib/libc/machine/i960/strrchr.S newlib/libc/machine/m32r/Makefile.am newlib/libc/machine/m32r/Makefile.in newlib/libc/machine/m32r/aclocal.m4 newlib/libc/machine/m32r/configure newlib/libc/machine/m32r/configure.in newlib/libc/machine/m32r/setjmp.S newlib/libc/machine/m68k/Makefile.am newlib/libc/machine/m68k/Makefile.in newlib/libc/machine/m68k/aclocal.m4 newlib/libc/machine/m68k/configure newlib/libc/machine/m68k/configure.in newlib/libc/machine/m68k/setjmp.S newlib/libc/machine/m68k/strcpy.c newlib/libc/machine/m68k/strlen.c newlib/libc/machine/m88k/Makefile.am newlib/libc/machine/m88k/Makefile.in newlib/libc/machine/m88k/aclocal.m4 newlib/libc/machine/m88k/configure newlib/libc/machine/m88k/configure.in newlib/libc/machine/m88k/setjmp.S newlib/libc/machine/mips/Makefile.am newlib/libc/machine/mips/Makefile.in newlib/libc/machine/mips/aclocal.m4 newlib/libc/machine/mips/configure newlib/libc/machine/mips/configure.in newlib/libc/machine/mips/machine/regdef.h newlib/libc/machine/mips/setjmp.S newlib/libc/machine/mn10200/Makefile.am newlib/libc/machine/mn10200/Makefile.in newlib/libc/machine/mn10200/aclocal.m4 newlib/libc/machine/mn10200/configure newlib/libc/machine/mn10200/configure.in newlib/libc/machine/mn10200/setjmp.S newlib/libc/machine/mn10300/Makefile.am newlib/libc/machine/mn10300/Makefile.in newlib/libc/machine/mn10300/aclocal.m4 newlib/libc/machine/mn10300/configure newlib/libc/machine/mn10300/configure.in newlib/libc/machine/mn10300/memchr.S newlib/libc/machine/mn10300/memcmp.S newlib/libc/machine/mn10300/memcpy.S newlib/libc/machine/mn10300/memset.S newlib/libc/machine/mn10300/setjmp.S newlib/libc/machine/mn10300/strchr.S newlib/libc/machine/mn10300/strcmp.S newlib/libc/machine/mn10300/strcpy.S newlib/libc/machine/mn10300/strlen.S newlib/libc/machine/necv70/Makefile.am newlib/libc/machine/necv70/Makefile.in newlib/libc/machine/necv70/aclocal.m4 newlib/libc/machine/necv70/configure newlib/libc/machine/necv70/configure.in newlib/libc/machine/necv70/fastmath.s newlib/libc/machine/necv70/machine/registers.h newlib/libc/machine/necv70/necv70.tex newlib/libc/machine/necv70/setjmp.s newlib/libc/machine/powerpc/Makefile.am newlib/libc/machine/powerpc/Makefile.in newlib/libc/machine/powerpc/aclocal.m4 newlib/libc/machine/powerpc/configure newlib/libc/machine/powerpc/configure.in newlib/libc/machine/powerpc/setjmp.S newlib/libc/machine/sh/Makefile.am newlib/libc/machine/sh/Makefile.in newlib/libc/machine/sh/aclocal.m4 newlib/libc/machine/sh/asm.h newlib/libc/machine/sh/configure newlib/libc/machine/sh/configure.in newlib/libc/machine/sh/memcpy.S newlib/libc/machine/sh/memset.S newlib/libc/machine/sh/setjmp.S newlib/libc/machine/sh/strcmp.S newlib/libc/machine/sh/strcpy.S newlib/libc/machine/sparc/Makefile.am newlib/libc/machine/sparc/Makefile.in newlib/libc/machine/sparc/aclocal.m4 newlib/libc/machine/sparc/configure newlib/libc/machine/sparc/configure.in newlib/libc/machine/sparc/machine/sparclet.h newlib/libc/machine/sparc/scan.c newlib/libc/machine/sparc/setjmp.S newlib/libc/machine/sparc/shuffle.c newlib/libc/machine/tic80/Makefile.am newlib/libc/machine/tic80/Makefile.in newlib/libc/machine/tic80/aclocal.m4 newlib/libc/machine/tic80/configure newlib/libc/machine/tic80/configure.in newlib/libc/machine/tic80/setjmp.S newlib/libc/machine/v850/Makefile.am newlib/libc/machine/v850/Makefile.in newlib/libc/machine/v850/aclocal.m4 newlib/libc/machine/v850/configure newlib/libc/machine/v850/configure.in newlib/libc/machine/v850/setjmp.S newlib/libc/machine/w65/Makefile.am newlib/libc/machine/w65/Makefile.in newlib/libc/machine/w65/aclocal.m4 newlib/libc/machine/w65/cmpsi.c newlib/libc/machine/w65/configure newlib/libc/machine/w65/configure.in newlib/libc/machine/w65/divsi3.c newlib/libc/machine/w65/lshrhi.s newlib/libc/machine/w65/mulsi3.c newlib/libc/machine/w65/sdivhi3.s newlib/libc/machine/w65/smulhi3.s newlib/libc/machine/w65/udivhi3.s newlib/libc/machine/w65/umodhi3.s newlib/libc/machine/z8k/Makefile.am newlib/libc/machine/z8k/Makefile.in newlib/libc/machine/z8k/aclocal.m4 newlib/libc/machine/z8k/args.h newlib/libc/machine/z8k/configure newlib/libc/machine/z8k/configure.in newlib/libc/machine/z8k/setjmp.S newlib/libc/misc/Makefile.am newlib/libc/misc/Makefile.in newlib/libc/misc/dprintf.c newlib/libc/misc/ffs.c newlib/libc/misc/misc.tex newlib/libc/misc/unctrl.c newlib/libc/posix/Makefile.am newlib/libc/posix/Makefile.in newlib/libc/posix/closedir.c newlib/libc/posix/creat.c newlib/libc/posix/execl.c newlib/libc/posix/execle.c newlib/libc/posix/execlp.c newlib/libc/posix/execv.c newlib/libc/posix/execve.c newlib/libc/posix/execvp.c newlib/libc/posix/isatty.c newlib/libc/posix/opendir.c newlib/libc/posix/popen.c newlib/libc/posix/readdir.c newlib/libc/posix/rewinddir.c newlib/libc/posix/scandir.c newlib/libc/posix/seekdir.c newlib/libc/posix/telldir.c newlib/libc/reent/Makefile.am newlib/libc/reent/Makefile.in newlib/libc/reent/closer.c newlib/libc/reent/execr.c newlib/libc/reent/fstatr.c newlib/libc/reent/impure.c newlib/libc/reent/linkr.c newlib/libc/reent/lseekr.c newlib/libc/reent/openr.c newlib/libc/reent/readr.c newlib/libc/reent/reent.c newlib/libc/reent/reent.tex newlib/libc/reent/sbrkr.c newlib/libc/reent/signalr.c newlib/libc/reent/statr.c newlib/libc/reent/timer.c newlib/libc/reent/unlinkr.c newlib/libc/reent/writer.c newlib/libc/saber newlib/libc/signal/Makefile.am newlib/libc/signal/Makefile.in newlib/libc/signal/raise.c newlib/libc/signal/signal.c newlib/libc/signal/signal.tex newlib/libc/stdio/Makefile.am newlib/libc/stdio/Makefile.in newlib/libc/stdio/clearerr.c newlib/libc/stdio/fclose.c newlib/libc/stdio/fdopen.c newlib/libc/stdio/feof.c newlib/libc/stdio/ferror.c newlib/libc/stdio/fflush.c newlib/libc/stdio/fgetc.c newlib/libc/stdio/fgetpos.c newlib/libc/stdio/fgets.c newlib/libc/stdio/fileno.c newlib/libc/stdio/findfp.c newlib/libc/stdio/fiprintf.c newlib/libc/stdio/flags.c newlib/libc/stdio/floatio.h newlib/libc/stdio/fopen.c newlib/libc/stdio/fprintf.c newlib/libc/stdio/fputc.c newlib/libc/stdio/fputs.c newlib/libc/stdio/fread.c newlib/libc/stdio/freopen.c newlib/libc/stdio/fscanf.c newlib/libc/stdio/fseek.c newlib/libc/stdio/fsetpos.c newlib/libc/stdio/ftell.c newlib/libc/stdio/fvwrite.c newlib/libc/stdio/fvwrite.h newlib/libc/stdio/fwalk.c newlib/libc/stdio/fwrite.c newlib/libc/stdio/getc.c newlib/libc/stdio/getchar.c newlib/libc/stdio/gets.c newlib/libc/stdio/getw.c newlib/libc/stdio/iprintf.c newlib/libc/stdio/local.h newlib/libc/stdio/makebuf.c newlib/libc/stdio/mktemp.c newlib/libc/stdio/perror.c newlib/libc/stdio/printf.c newlib/libc/stdio/putc.c newlib/libc/stdio/putchar.c newlib/libc/stdio/puts.c newlib/libc/stdio/putw.c newlib/libc/stdio/refill.c newlib/libc/stdio/remove.c newlib/libc/stdio/rename.c newlib/libc/stdio/rewind.c newlib/libc/stdio/rget.c newlib/libc/stdio/scanf.c newlib/libc/stdio/setbuf.c newlib/libc/stdio/setvbuf.c newlib/libc/stdio/siprintf.c newlib/libc/stdio/snprintf.c newlib/libc/stdio/sprintf.c newlib/libc/stdio/sscanf.c newlib/libc/stdio/stdio.c newlib/libc/stdio/stdio.tex newlib/libc/stdio/tmpfile.c newlib/libc/stdio/tmpnam.c newlib/libc/stdio/ungetc.c newlib/libc/stdio/vfieeefp.h newlib/libc/stdio/vfprintf.c newlib/libc/stdio/vfscanf.c newlib/libc/stdio/vprintf.c newlib/libc/stdio/vsnprintf.c newlib/libc/stdio/vsprintf.c newlib/libc/stdio/wbuf.c newlib/libc/stdio/wsetup.c newlib/libc/stdlib/Makefile.am newlib/libc/stdlib/Makefile.in newlib/libc/stdlib/__adjust.c newlib/libc/stdlib/__exp10.c newlib/libc/stdlib/__ten_mu.c newlib/libc/stdlib/abort.c newlib/libc/stdlib/abs.c newlib/libc/stdlib/assert.c newlib/libc/stdlib/atexit.c newlib/libc/stdlib/atexit.h newlib/libc/stdlib/atof.c newlib/libc/stdlib/atoff.c newlib/libc/stdlib/atoi.c newlib/libc/stdlib/atol.c newlib/libc/stdlib/bsearch.c newlib/libc/stdlib/calloc.c newlib/libc/stdlib/div.c newlib/libc/stdlib/dtoa.c newlib/libc/stdlib/dtoastub.c newlib/libc/stdlib/ecvtbuf.c newlib/libc/stdlib/efgcvt.c newlib/libc/stdlib/environ.c newlib/libc/stdlib/envlock.c newlib/libc/stdlib/envlock.h newlib/libc/stdlib/eprintf.c newlib/libc/stdlib/exit.c newlib/libc/stdlib/getenv.c newlib/libc/stdlib/getenv_r.c newlib/libc/stdlib/getopt.c newlib/libc/stdlib/labs.c newlib/libc/stdlib/ldiv.c newlib/libc/stdlib/local.h newlib/libc/stdlib/malign.c newlib/libc/stdlib/malloc.c newlib/libc/stdlib/mallocr.c newlib/libc/stdlib/mbctype.h newlib/libc/stdlib/mblen.c newlib/libc/stdlib/mblen_r.c newlib/libc/stdlib/mbstowcs.c newlib/libc/stdlib/mbstowcs_r.c newlib/libc/stdlib/mbtowc.c newlib/libc/stdlib/mbtowc_r.c newlib/libc/stdlib/mlock.c newlib/libc/stdlib/mprec.c newlib/libc/stdlib/mprec.h newlib/libc/stdlib/msize.c newlib/libc/stdlib/mstats.c newlib/libc/stdlib/mtrim.c newlib/libc/stdlib/putenv.c newlib/libc/stdlib/putenv_r.c newlib/libc/stdlib/qsort.c newlib/libc/stdlib/rand.c newlib/libc/stdlib/rand_r.c newlib/libc/stdlib/realloc.c newlib/libc/stdlib/setenv.c newlib/libc/stdlib/setenv_r.c newlib/libc/stdlib/std.h newlib/libc/stdlib/stdlib.tex newlib/libc/stdlib/strdup.c newlib/libc/stdlib/strdup_r.c newlib/libc/stdlib/strtod.c newlib/libc/stdlib/strtol.c newlib/libc/stdlib/strtoul.c newlib/libc/stdlib/system.c newlib/libc/stdlib/valloc.c newlib/libc/stdlib/wcstombs.c newlib/libc/stdlib/wcstombs_r.c newlib/libc/stdlib/wctomb.c newlib/libc/stdlib/wctomb_r.c newlib/libc/string/Makefile.am newlib/libc/string/Makefile.in newlib/libc/string/bcmp.c newlib/libc/string/bcopy.c newlib/libc/string/bzero.c newlib/libc/string/index.c newlib/libc/string/memchr.c newlib/libc/string/memcmp.c newlib/libc/string/memcpy.c newlib/libc/string/memmove.c newlib/libc/string/memset.c newlib/libc/string/rindex.c newlib/libc/string/strcasecmp.c newlib/libc/string/strcat.c newlib/libc/string/strchr.c newlib/libc/string/strcmp.c newlib/libc/string/strcoll.c newlib/libc/string/strcpy.c newlib/libc/string/strcspn.c newlib/libc/string/strerror.c newlib/libc/string/strings.tex newlib/libc/string/strlen.c newlib/libc/string/strlwr.c newlib/libc/string/strncasecmp.c newlib/libc/string/strncat.c newlib/libc/string/strncmp.c newlib/libc/string/strncpy.c newlib/libc/string/strpbrk.c newlib/libc/string/strrchr.c newlib/libc/string/strspn.c newlib/libc/string/strstr.c newlib/libc/string/strtok.c newlib/libc/string/strtok_r.c newlib/libc/string/strupr.c newlib/libc/string/strxfrm.c newlib/libc/string/swab.c newlib/libc/string/u_strerr.c newlib/libc/sys.tex newlib/libc/sys/Makefile.am newlib/libc/sys/Makefile.in newlib/libc/sys/a29khif/Makefile.am newlib/libc/sys/a29khif/Makefile.in newlib/libc/sys/a29khif/_alloc.s newlib/libc/sys/a29khif/_close.s newlib/libc/sys/a29khif/_cycles.s newlib/libc/sys/a29khif/_exit.s newlib/libc/sys/a29khif/_fstat.s newlib/libc/sys/a29khif/_getpsiz.s newlib/libc/sys/a29khif/_gettz.s newlib/libc/sys/a29khif/_ioctl.s newlib/libc/sys/a29khif/_iostat.s newlib/libc/sys/a29khif/_iowait.s newlib/libc/sys/a29khif/_isatty.s newlib/libc/sys/a29khif/_lseek.s newlib/libc/sys/a29khif/_open.s newlib/libc/sys/a29khif/_query.s newlib/libc/sys/a29khif/_read.s newlib/libc/sys/a29khif/_sbrk.s newlib/libc/sys/a29khif/_setim.s newlib/libc/sys/a29khif/_settrap.s newlib/libc/sys/a29khif/_setvec.s newlib/libc/sys/a29khif/_tmpnam.s newlib/libc/sys/a29khif/_write.s newlib/libc/sys/a29khif/aclocal.m4 newlib/libc/sys/a29khif/alloc.s newlib/libc/sys/a29khif/clock.s newlib/libc/sys/a29khif/configure newlib/libc/sys/a29khif/configure.in newlib/libc/sys/a29khif/crt0.s newlib/libc/sys/a29khif/getargs.s newlib/libc/sys/a29khif/getenv.s newlib/libc/sys/a29khif/getpid.c newlib/libc/sys/a29khif/kill.c newlib/libc/sys/a29khif/read.s newlib/libc/sys/a29khif/remove.s newlib/libc/sys/a29khif/rename.s newlib/libc/sys/a29khif/signal.s newlib/libc/sys/a29khif/stubs.s newlib/libc/sys/a29khif/sys/cpudef.h newlib/libc/sys/a29khif/sys/fpsymbol.h newlib/libc/sys/a29khif/sys/intrinsi.h newlib/libc/sys/a29khif/sys/macros.h newlib/libc/sys/a29khif/sys/proreg.h newlib/libc/sys/a29khif/sys/romdcl.h newlib/libc/sys/a29khif/sys/smartmac.h newlib/libc/sys/a29khif/sys/sysmac.h newlib/libc/sys/a29khif/systime.s newlib/libc/sys/a29khif/vec.s newlib/libc/sys/aclocal.m4 newlib/libc/sys/arm/Makefile.am newlib/libc/sys/arm/Makefile.in newlib/libc/sys/arm/aclocal.m4 newlib/libc/sys/arm/configure newlib/libc/sys/arm/configure.in newlib/libc/sys/arm/crt0.S newlib/libc/sys/arm/libcfunc.c newlib/libc/sys/arm/setjmp.S newlib/libc/sys/arm/swi.h newlib/libc/sys/arm/sys/param.h newlib/libc/sys/arm/syscalls.c newlib/libc/sys/arm/trap.S newlib/libc/sys/configure newlib/libc/sys/configure.in newlib/libc/sys/cygwin/Makefile.am newlib/libc/sys/cygwin/Makefile.in newlib/libc/sys/cygwin/aclocal.m4 newlib/libc/sys/cygwin/configure newlib/libc/sys/cygwin/configure.in newlib/libc/sys/cygwin/crt0.c newlib/libc/sys/cygwin/sys/dirent.h newlib/libc/sys/cygwin/sys/param.h newlib/libc/sys/cygwin/sys/utime.h newlib/libc/sys/cygwin/sys/utmp.h newlib/libc/sys/d10v/Makefile.am newlib/libc/sys/d10v/Makefile.in newlib/libc/sys/d10v/aclocal.m4 newlib/libc/sys/d10v/configure newlib/libc/sys/d10v/configure.in newlib/libc/sys/d10v/creat.c newlib/libc/sys/d10v/crt0.S newlib/libc/sys/d10v/sys/syscall.h newlib/libc/sys/d10v/syscalls.c newlib/libc/sys/d10v/trap.S newlib/libc/sys/decstation/Makefile.am newlib/libc/sys/decstation/Makefile.in newlib/libc/sys/decstation/_main.c newlib/libc/sys/decstation/aclocal.m4 newlib/libc/sys/decstation/configure newlib/libc/sys/decstation/configure.in newlib/libc/sys/decstation/sys/dirent.h newlib/libc/sys/go32/Makefile.am newlib/libc/sys/go32/Makefile.in newlib/libc/sys/go32/_exit.s newlib/libc/sys/go32/_main.c newlib/libc/sys/go32/abort.c newlib/libc/sys/go32/access.c newlib/libc/sys/go32/aclocal.m4 newlib/libc/sys/go32/bdos.c newlib/libc/sys/go32/bdosptr.c newlib/libc/sys/go32/brk.s newlib/libc/sys/go32/chdir.s newlib/libc/sys/go32/chmod.c newlib/libc/sys/go32/chown.c newlib/libc/sys/go32/clock.S newlib/libc/sys/go32/close.s newlib/libc/sys/go32/configure newlib/libc/sys/go32/configure.in newlib/libc/sys/go32/copying.dj newlib/libc/sys/go32/creat.s newlib/libc/sys/go32/crlf2nl.c newlib/libc/sys/go32/crt0.S newlib/libc/sys/go32/dir.c newlib/libc/sys/go32/dir.h newlib/libc/sys/go32/djtime.h newlib/libc/sys/go32/dos.h newlib/libc/sys/go32/dosmem.S newlib/libc/sys/go32/dpmi.c newlib/libc/sys/go32/dpmi.h newlib/libc/sys/go32/dup.s newlib/libc/sys/go32/dup2.s newlib/libc/sys/go32/exec.c newlib/libc/sys/go32/fchmod.c newlib/libc/sys/go32/findfirs.s newlib/libc/sys/go32/findnext.s newlib/libc/sys/go32/fixpath.c newlib/libc/sys/go32/fstat.s newlib/libc/sys/go32/fsync.s newlib/libc/sys/go32/ftruncat.c newlib/libc/sys/go32/gerrno.s newlib/libc/sys/go32/getcwd.c newlib/libc/sys/go32/getdate.c newlib/libc/sys/go32/getdtabl.c newlib/libc/sys/go32/getgid.c newlib/libc/sys/go32/getkey.s newlib/libc/sys/go32/getpages.c newlib/libc/sys/go32/getpid.c newlib/libc/sys/go32/getrusag.c newlib/libc/sys/go32/gettime.c newlib/libc/sys/go32/gettimeo.c newlib/libc/sys/go32/gettimeo.s newlib/libc/sys/go32/getuid.c newlib/libc/sys/go32/getwd.s newlib/libc/sys/go32/go32.h newlib/libc/sys/go32/go32func.c newlib/libc/sys/go32/infoblk.c newlib/libc/sys/go32/inportb.s newlib/libc/sys/go32/inportl.s newlib/libc/sys/go32/inportsb.s newlib/libc/sys/go32/inportsl.s newlib/libc/sys/go32/inportsw.s newlib/libc/sys/go32/inportw.s newlib/libc/sys/go32/int86x.s newlib/libc/sys/go32/intdos.c newlib/libc/sys/go32/intdosx.c newlib/libc/sys/go32/isatty.s newlib/libc/sys/go32/kbhit.s newlib/libc/sys/go32/kill.c newlib/libc/sys/go32/link.s newlib/libc/sys/go32/longjmp.S newlib/libc/sys/go32/lseek.s newlib/libc/sys/go32/lstat.s newlib/libc/sys/go32/mkdir.s newlib/libc/sys/go32/open.s newlib/libc/sys/go32/outportb.s newlib/libc/sys/go32/outportl.s newlib/libc/sys/go32/outportw.s newlib/libc/sys/go32/outprtsb.s newlib/libc/sys/go32/outprtsl.s newlib/libc/sys/go32/outprtsw.s newlib/libc/sys/go32/pc.h newlib/libc/sys/go32/read.s newlib/libc/sys/go32/readv.c newlib/libc/sys/go32/rename.s newlib/libc/sys/go32/rmdir.s newlib/libc/sys/go32/sbrk.s newlib/libc/sys/go32/screen.S newlib/libc/sys/go32/setjmp.S newlib/libc/sys/go32/setmode.s newlib/libc/sys/go32/setstack.S newlib/libc/sys/go32/settimeo.s newlib/libc/sys/go32/sleep.c newlib/libc/sys/go32/stat.c newlib/libc/sys/go32/stat.s newlib/libc/sys/go32/stat_ast.s newlib/libc/sys/go32/sys/dir.h newlib/libc/sys/go32/sys/dirent.h newlib/libc/sys/go32/sys/dos.h newlib/libc/sys/go32/sys/dpmi.h newlib/libc/sys/go32/sys/errno.h newlib/libc/sys/go32/sys/fcntl.h newlib/libc/sys/go32/sys/file.h newlib/libc/sys/go32/sys/go32.h newlib/libc/sys/go32/sys/param.h newlib/libc/sys/go32/sys/pc.h newlib/libc/sys/go32/sys/register.h newlib/libc/sys/go32/sys/resource.h newlib/libc/sys/go32/sys/setjmp.h newlib/libc/sys/go32/sys/stdc.h newlib/libc/sys/go32/sys/uio.h newlib/libc/sys/go32/syserr.c newlib/libc/sys/go32/system.s newlib/libc/sys/go32/tell.s newlib/libc/sys/go32/time.c newlib/libc/sys/go32/truncate.c newlib/libc/sys/go32/turbo.s newlib/libc/sys/go32/umask.c newlib/libc/sys/go32/unlink.s newlib/libc/sys/go32/utime.c newlib/libc/sys/go32/utimes.c newlib/libc/sys/go32/write.s newlib/libc/sys/go32/writestub.c newlib/libc/sys/go32/writev.c newlib/libc/sys/h8300hms/Makefile.am newlib/libc/sys/h8300hms/Makefile.in newlib/libc/sys/h8300hms/_exit.c newlib/libc/sys/h8300hms/aclocal.m4 newlib/libc/sys/h8300hms/configure newlib/libc/sys/h8300hms/configure.in newlib/libc/sys/h8300hms/crt0.S newlib/libc/sys/h8300hms/crt1.c newlib/libc/sys/h8300hms/misc.c newlib/libc/sys/h8300hms/sbrk.c newlib/libc/sys/h8300hms/sys/file.h newlib/libc/sys/h8300hms/syscalls.c newlib/libc/sys/h8300hms/write.c newlib/libc/sys/h8500hms/Makefile.am newlib/libc/sys/h8500hms/Makefile.in newlib/libc/sys/h8500hms/aclocal.m4 newlib/libc/sys/h8500hms/configure newlib/libc/sys/h8500hms/configure.in newlib/libc/sys/h8500hms/crt0.c newlib/libc/sys/h8500hms/misc.c newlib/libc/sys/h8500hms/syscalls.c newlib/libc/sys/m88kbug/Makefile.am newlib/libc/sys/m88kbug/Makefile.in newlib/libc/sys/m88kbug/aclocal.m4 newlib/libc/sys/m88kbug/configure newlib/libc/sys/m88kbug/configure.in newlib/libc/sys/m88kbug/crt0.c newlib/libc/sys/m88kbug/sys/systraps.h newlib/libc/sys/m88kbug/syscalls.c newlib/libc/sys/netware/Makefile.am newlib/libc/sys/netware/Makefile.in newlib/libc/sys/netware/aclocal.m4 newlib/libc/sys/netware/configure newlib/libc/sys/netware/configure.in newlib/libc/sys/netware/crt0.c newlib/libc/sys/netware/getpid.c newlib/libc/sys/netware/link.c newlib/libc/sys/rtems/Makefile.am newlib/libc/sys/rtems/Makefile.in newlib/libc/sys/rtems/aclocal.m4 newlib/libc/sys/rtems/configure newlib/libc/sys/rtems/configure.in newlib/libc/sys/rtems/crt0.c newlib/libc/sys/rtems/dummysys.c newlib/libc/sys/rtems/include/limits.h newlib/libc/sys/rtems/include/signal.h newlib/libc/sys/rtems/include/time.h newlib/libc/sys/rtems/sys/dirent.h newlib/libc/sys/rtems/sys/features.h newlib/libc/sys/rtems/sys/sched.h newlib/libc/sys/rtems/sys/siginfo.h newlib/libc/sys/rtems/sys/signal.h newlib/libc/sys/rtems/sys/time.h newlib/libc/sys/rtems/sys/times.h newlib/libc/sys/rtems/sys/types.h newlib/libc/sys/sh/Makefile.am newlib/libc/sys/sh/Makefile.in newlib/libc/sys/sh/aclocal.m4 newlib/libc/sys/sh/configure newlib/libc/sys/sh/configure.in newlib/libc/sys/sh/creat.c newlib/libc/sys/sh/crt0.S newlib/libc/sys/sh/sys/syscall.h newlib/libc/sys/sh/syscalls.c newlib/libc/sys/sh/trap.S newlib/libc/sys/sparc64/Makefile.am newlib/libc/sys/sparc64/Makefile.in newlib/libc/sys/sparc64/_exit.S newlib/libc/sys/sparc64/_main.c newlib/libc/sys/sparc64/aclocal.m4 newlib/libc/sys/sparc64/cerror.S newlib/libc/sys/sparc64/closedir.c newlib/libc/sys/sparc64/configure newlib/libc/sys/sparc64/configure.in newlib/libc/sys/sparc64/creat.c newlib/libc/sys/sparc64/crt0.S newlib/libc/sys/sparc64/dup2.S newlib/libc/sys/sparc64/execve.S newlib/libc/sys/sparc64/ieee.c newlib/libc/sys/sparc64/isatty.c newlib/libc/sys/sparc64/lstat.S newlib/libc/sys/sparc64/opendir.c newlib/libc/sys/sparc64/readdir.c newlib/libc/sys/sparc64/rewinddir.c newlib/libc/sys/sparc64/sbrk.S newlib/libc/sys/sparc64/scandir.c newlib/libc/sys/sparc64/seekdir.c newlib/libc/sys/sparc64/sigsetjmp.S newlib/libc/sys/sparc64/stat.S newlib/libc/sys/sparc64/sys/dirent.h newlib/libc/sys/sparc64/sys/fcntl.h newlib/libc/sys/sparc64/sys/file.h newlib/libc/sys/sparc64/sys/stat.h newlib/libc/sys/sparc64/sys/syscall.h newlib/libc/sys/sparc64/sys/syscallasm.h newlib/libc/sys/sparc64/sys/termios.h newlib/libc/sys/sparc64/sys/time.h newlib/libc/sys/sparc64/sys/utime.h newlib/libc/sys/sparc64/sys/utmp.h newlib/libc/sys/sparc64/sys/wait.h newlib/libc/sys/sparc64/telldir.c newlib/libc/sys/sparc64/template.S newlib/libc/sys/sparc64/template_r.S newlib/libc/sys/sparc64/utime.S newlib/libc/sys/sparc64/utime2.c newlib/libc/sys/sparc64/wait.S newlib/libc/sys/sun4/Makefile.am newlib/libc/sys/sun4/Makefile.in newlib/libc/sys/sun4/_main.c newlib/libc/sys/sun4/aclocal.m4 newlib/libc/sys/sun4/configure newlib/libc/sys/sun4/configure.in newlib/libc/sys/sun4/ieee.c newlib/libc/sys/sun4/sys/dirent.h newlib/libc/sys/sun4/sys/file.h newlib/libc/sys/sun4/sys/termios.h newlib/libc/sys/sun4/sys/utime.h newlib/libc/sys/sun4/sys/utmp.h newlib/libc/sys/sun4/sys/wait.h newlib/libc/sys/sysmec/Makefile.am newlib/libc/sys/sysmec/Makefile.in newlib/libc/sys/sysmec/_exit.c newlib/libc/sys/sysmec/access.c newlib/libc/sys/sysmec/aclocal.m4 newlib/libc/sys/sysmec/chmod.c newlib/libc/sys/sysmec/chown.c newlib/libc/sys/sysmec/close.c newlib/libc/sys/sysmec/configure newlib/libc/sys/sysmec/configure.in newlib/libc/sys/sysmec/creat.c newlib/libc/sys/sysmec/crt0.S newlib/libc/sys/sysmec/crt1.c newlib/libc/sys/sysmec/execv.c newlib/libc/sys/sysmec/execve.c newlib/libc/sys/sysmec/fork.c newlib/libc/sys/sysmec/fstat.c newlib/libc/sys/sysmec/getpid.c newlib/libc/sys/sysmec/gettime.c newlib/libc/sys/sysmec/isatty.c newlib/libc/sys/sysmec/kill.c newlib/libc/sys/sysmec/lseek.c newlib/libc/sys/sysmec/open.c newlib/libc/sys/sysmec/pipe.c newlib/libc/sys/sysmec/read.c newlib/libc/sys/sysmec/sbrk.c newlib/libc/sys/sysmec/stat.c newlib/libc/sys/sysmec/sys/syscall.h newlib/libc/sys/sysmec/time.c newlib/libc/sys/sysmec/times.c newlib/libc/sys/sysmec/trap.S newlib/libc/sys/sysmec/unlink.c newlib/libc/sys/sysmec/utime.c newlib/libc/sys/sysmec/wait.c newlib/libc/sys/sysmec/write.c newlib/libc/sys/sysnec810/Makefile.am newlib/libc/sys/sysnec810/Makefile.in newlib/libc/sys/sysnec810/aclocal.m4 newlib/libc/sys/sysnec810/configure newlib/libc/sys/sysnec810/configure.in newlib/libc/sys/sysnec810/crt0.s newlib/libc/sys/sysnec810/io.s newlib/libc/sys/sysnec810/misc.c newlib/libc/sys/sysnec810/sbrk.c newlib/libc/sys/sysnec810/write.c newlib/libc/sys/sysnecv850/Makefile.am newlib/libc/sys/sysnecv850/Makefile.in newlib/libc/sys/sysnecv850/_exit.c newlib/libc/sys/sysnecv850/access.c newlib/libc/sys/sysnecv850/aclocal.m4 newlib/libc/sys/sysnecv850/chmod.c newlib/libc/sys/sysnecv850/chown.c newlib/libc/sys/sysnecv850/close.c newlib/libc/sys/sysnecv850/configure newlib/libc/sys/sysnecv850/configure.in newlib/libc/sys/sysnecv850/creat.c newlib/libc/sys/sysnecv850/crt0.S newlib/libc/sys/sysnecv850/crt1.c newlib/libc/sys/sysnecv850/execv.c newlib/libc/sys/sysnecv850/execve.c newlib/libc/sys/sysnecv850/fork.c newlib/libc/sys/sysnecv850/fstat.c newlib/libc/sys/sysnecv850/getpid.c newlib/libc/sys/sysnecv850/gettime.c newlib/libc/sys/sysnecv850/isatty.c newlib/libc/sys/sysnecv850/kill.c newlib/libc/sys/sysnecv850/link.c newlib/libc/sys/sysnecv850/lseek.c newlib/libc/sys/sysnecv850/open.c newlib/libc/sys/sysnecv850/pipe.c newlib/libc/sys/sysnecv850/read.c newlib/libc/sys/sysnecv850/sbrk.c newlib/libc/sys/sysnecv850/stat.c newlib/libc/sys/sysnecv850/sys/syscall.h newlib/libc/sys/sysnecv850/time.c newlib/libc/sys/sysnecv850/times.c newlib/libc/sys/sysnecv850/trap.S newlib/libc/sys/sysnecv850/unlink.c newlib/libc/sys/sysnecv850/utime.c newlib/libc/sys/sysnecv850/wait.c newlib/libc/sys/sysnecv850/write.c newlib/libc/sys/sysvi386/Makefile.am newlib/libc/sys/sysvi386/Makefile.in newlib/libc/sys/sysvi386/_exit.s newlib/libc/sys/sysvi386/_longjmp.s newlib/libc/sys/sysvi386/_setjmp.s newlib/libc/sys/sysvi386/access.s newlib/libc/sys/sysvi386/aclocal.m4 newlib/libc/sys/sysvi386/alarm.s newlib/libc/sys/sysvi386/brk.s newlib/libc/sys/sysvi386/cerror.s newlib/libc/sys/sysvi386/chdir.s newlib/libc/sys/sysvi386/chmod.s newlib/libc/sys/sysvi386/close.s newlib/libc/sys/sysvi386/closedir.c newlib/libc/sys/sysvi386/configure newlib/libc/sys/sysvi386/configure.in newlib/libc/sys/sysvi386/crt0.c newlib/libc/sys/sysvi386/dup.c newlib/libc/sys/sysvi386/dup2.c newlib/libc/sys/sysvi386/exec.c newlib/libc/sys/sysvi386/execve.s newlib/libc/sys/sysvi386/fcntl.s newlib/libc/sys/sysvi386/fork.s newlib/libc/sys/sysvi386/fpathconf.s newlib/libc/sys/sysvi386/fps.s newlib/libc/sys/sysvi386/fpx.c newlib/libc/sys/sysvi386/fstat.s newlib/libc/sys/sysvi386/getdents.s newlib/libc/sys/sysvi386/getegid.s newlib/libc/sys/sysvi386/geteuid.s newlib/libc/sys/sysvi386/getgid.s newlib/libc/sys/sysvi386/getgroups.s newlib/libc/sys/sysvi386/getpid.s newlib/libc/sys/sysvi386/getuid.s newlib/libc/sys/sysvi386/ioctl.s newlib/libc/sys/sysvi386/isatty.c newlib/libc/sys/sysvi386/kill.s newlib/libc/sys/sysvi386/link.s newlib/libc/sys/sysvi386/lseek.s newlib/libc/sys/sysvi386/mkdir.s newlib/libc/sys/sysvi386/open.s newlib/libc/sys/sysvi386/opendir.c newlib/libc/sys/sysvi386/pathconf.s newlib/libc/sys/sysvi386/pause.s newlib/libc/sys/sysvi386/pipe.s newlib/libc/sys/sysvi386/read.s newlib/libc/sys/sysvi386/readdir.c newlib/libc/sys/sysvi386/rename.s newlib/libc/sys/sysvi386/rewinddir.c newlib/libc/sys/sysvi386/rmdir.s newlib/libc/sys/sysvi386/sbrk.c newlib/libc/sys/sysvi386/scandir.c newlib/libc/sys/sysvi386/seekdir.c newlib/libc/sys/sysvi386/setgid.s newlib/libc/sys/sysvi386/setuid.s newlib/libc/sys/sysvi386/sigaction.s newlib/libc/sys/sysvi386/signal.s newlib/libc/sys/sysvi386/sigprocmask.s newlib/libc/sys/sysvi386/sleep.c newlib/libc/sys/sysvi386/speed.c newlib/libc/sys/sysvi386/stat.s newlib/libc/sys/sysvi386/sys/dirent.h newlib/libc/sys/sysvi386/sys/param.h newlib/libc/sys/sysvi386/sys/setjmp.h newlib/libc/sys/sysvi386/sys/termio.h newlib/libc/sys/sysvi386/sys/termios.h newlib/libc/sys/sysvi386/sys/utime.h newlib/libc/sys/sysvi386/sys/utmp.h newlib/libc/sys/sysvi386/sys/wait.h newlib/libc/sys/sysvi386/sysconf.s newlib/libc/sys/sysvi386/tcgetattr.c newlib/libc/sys/sysvi386/tcline.c newlib/libc/sys/sysvi386/tcsetattr.c newlib/libc/sys/sysvi386/telldir.c newlib/libc/sys/sysvi386/time.s newlib/libc/sys/sysvi386/times.s newlib/libc/sys/sysvi386/unlink.s newlib/libc/sys/sysvi386/utime.s newlib/libc/sys/sysvi386/wait.s newlib/libc/sys/sysvi386/waitpid.s newlib/libc/sys/sysvi386/write.s newlib/libc/sys/sysvnecv70/Makefile.am newlib/libc/sys/sysvnecv70/Makefile.in newlib/libc/sys/sysvnecv70/aclocal.m4 newlib/libc/sys/sysvnecv70/cerror.s newlib/libc/sys/sysvnecv70/close.s newlib/libc/sys/sysvnecv70/configure newlib/libc/sys/sysvnecv70/configure.in newlib/libc/sys/sysvnecv70/crt0.s newlib/libc/sys/sysvnecv70/exit.s newlib/libc/sys/sysvnecv70/fps.s newlib/libc/sys/sysvnecv70/fpx.c newlib/libc/sys/sysvnecv70/fstat.s newlib/libc/sys/sysvnecv70/ioctl.s newlib/libc/sys/sysvnecv70/isatty.s newlib/libc/sys/sysvnecv70/lseek.s newlib/libc/sys/sysvnecv70/open.s newlib/libc/sys/sysvnecv70/read.s newlib/libc/sys/sysvnecv70/sbrk.s newlib/libc/sys/sysvnecv70/sysv60.s newlib/libc/sys/sysvnecv70/sysvnecv70.tex newlib/libc/sys/sysvnecv70/write.s newlib/libc/sys/tic80/Makefile.am newlib/libc/sys/tic80/Makefile.in newlib/libc/sys/tic80/aclocal.m4 newlib/libc/sys/tic80/configure newlib/libc/sys/tic80/configure.in newlib/libc/sys/tic80/crt0.c newlib/libc/sys/w65/Makefile.am newlib/libc/sys/w65/Makefile.in newlib/libc/sys/w65/aclocal.m4 newlib/libc/sys/w65/configure newlib/libc/sys/w65/configure.in newlib/libc/sys/w65/crt0.c newlib/libc/sys/w65/sys/syscall.h newlib/libc/sys/w65/syscalls.c newlib/libc/sys/w65/trap.c newlib/libc/sys/z8ksim/Makefile.am newlib/libc/sys/z8ksim/Makefile.in newlib/libc/sys/z8ksim/aclocal.m4 newlib/libc/sys/z8ksim/configure newlib/libc/sys/z8ksim/configure.in newlib/libc/sys/z8ksim/crt0.c newlib/libc/sys/z8ksim/glue.c newlib/libc/sys/z8ksim/sys/syscall.h newlib/libc/syscalls/Makefile.am newlib/libc/syscalls/Makefile.in newlib/libc/syscalls/sysclose.c newlib/libc/syscalls/sysexecve.c newlib/libc/syscalls/sysfcntl.c newlib/libc/syscalls/sysfork.c newlib/libc/syscalls/sysfstat.c newlib/libc/syscalls/sysgetpid.c newlib/libc/syscalls/sysgettod.c newlib/libc/syscalls/syskill.c newlib/libc/syscalls/syslink.c newlib/libc/syscalls/syslseek.c newlib/libc/syscalls/sysopen.c newlib/libc/syscalls/sysread.c newlib/libc/syscalls/syssbrk.c newlib/libc/syscalls/sysstat.c newlib/libc/syscalls/systimes.c newlib/libc/syscalls/sysunlink.c newlib/libc/syscalls/syswait.c newlib/libc/syscalls/syswrite.c newlib/libc/time/Makefile.am newlib/libc/time/Makefile.in newlib/libc/time/asctime.c newlib/libc/time/asctime_r.c newlib/libc/time/clock.c newlib/libc/time/ctime.c newlib/libc/time/ctime_r.c newlib/libc/time/difftime.c newlib/libc/time/gmtime.c newlib/libc/time/gmtime_r.c newlib/libc/time/lcltime.c newlib/libc/time/lcltime_r.c newlib/libc/time/mktime.c newlib/libc/time/strftime.c newlib/libc/time/time.c newlib/libc/time/time.tex newlib/libc/unix/Makefile.am newlib/libc/unix/Makefile.in newlib/libc/unix/getcwd.c newlib/libc/unix/getlogin.c newlib/libc/unix/getpass.c newlib/libc/unix/getpwent.c newlib/libc/unix/getut.c newlib/libc/unix/sigset.c newlib/libc/unix/ttyname.c newlib/libm/Makefile.am newlib/libm/Makefile.in newlib/libm/aclocal.m4 newlib/libm/common/Makefile.am newlib/libm/common/Makefile.in newlib/libm/common/common.tex newlib/libm/common/fdlibm.h newlib/libm/common/s_cbrt.c newlib/libm/common/s_copysign.c newlib/libm/common/s_expm1.c newlib/libm/common/s_finite.c newlib/libm/common/s_ilogb.c newlib/libm/common/s_infinity.c newlib/libm/common/s_lib_ver.c newlib/libm/common/s_log1p.c newlib/libm/common/s_logb.c newlib/libm/common/s_matherr.c newlib/libm/common/s_modf.c newlib/libm/common/s_nan.c newlib/libm/common/s_nextafter.c newlib/libm/common/s_rint.c newlib/libm/common/s_scalbn.c newlib/libm/common/sf_cbrt.c newlib/libm/common/sf_copysign.c newlib/libm/common/sf_expm1.c newlib/libm/common/sf_finite.c newlib/libm/common/sf_ilogb.c newlib/libm/common/sf_infinity.c newlib/libm/common/sf_log1p.c newlib/libm/common/sf_logb.c newlib/libm/common/sf_modf.c newlib/libm/common/sf_nan.c newlib/libm/common/sf_nextafter.c newlib/libm/common/sf_rint.c newlib/libm/common/sf_scalbn.c newlib/libm/config.h.in newlib/libm/configure newlib/libm/configure.in newlib/libm/libm.texinfo newlib/libm/math/Makefile.am newlib/libm/math/Makefile.in newlib/libm/math/e_acos.c newlib/libm/math/e_acosh.c newlib/libm/math/e_asin.c newlib/libm/math/e_atan2.c newlib/libm/math/e_atanh.c newlib/libm/math/e_cosh.c newlib/libm/math/e_exp.c newlib/libm/math/e_fmod.c newlib/libm/math/e_hypot.c newlib/libm/math/e_j0.c newlib/libm/math/e_j1.c newlib/libm/math/e_jn.c newlib/libm/math/e_log.c newlib/libm/math/e_log10.c newlib/libm/math/e_pow.c newlib/libm/math/e_rem_pio2.c newlib/libm/math/e_remainder.c newlib/libm/math/e_scalb.c newlib/libm/math/e_sinh.c newlib/libm/math/e_sqrt.c newlib/libm/math/ef_acos.c newlib/libm/math/ef_acosh.c newlib/libm/math/ef_asin.c newlib/libm/math/ef_atan2.c newlib/libm/math/ef_atanh.c newlib/libm/math/ef_cosh.c newlib/libm/math/ef_exp.c newlib/libm/math/ef_fmod.c newlib/libm/math/ef_hypot.c newlib/libm/math/ef_j0.c newlib/libm/math/ef_j1.c newlib/libm/math/ef_jn.c newlib/libm/math/ef_log.c newlib/libm/math/ef_log10.c newlib/libm/math/ef_pow.c newlib/libm/math/ef_rem_pio2.c newlib/libm/math/ef_remainder.c newlib/libm/math/ef_scalb.c newlib/libm/math/ef_sinh.c newlib/libm/math/ef_sqrt.c newlib/libm/math/er_gamma.c newlib/libm/math/er_lgamma.c newlib/libm/math/erf_gamma.c newlib/libm/math/erf_lgamma.c newlib/libm/math/k_cos.c newlib/libm/math/k_rem_pio2.c newlib/libm/math/k_sin.c newlib/libm/math/k_standard.c newlib/libm/math/k_tan.c newlib/libm/math/kf_cos.c newlib/libm/math/kf_rem_pio2.c newlib/libm/math/kf_sin.c newlib/libm/math/kf_tan.c newlib/libm/math/math.tex newlib/libm/math/s_asinh.c newlib/libm/math/s_atan.c newlib/libm/math/s_ceil.c newlib/libm/math/s_cos.c newlib/libm/math/s_erf.c newlib/libm/math/s_fabs.c newlib/libm/math/s_floor.c newlib/libm/math/s_frexp.c newlib/libm/math/s_infconst.c newlib/libm/math/s_isinf.c newlib/libm/math/s_isnan.c newlib/libm/math/s_ldexp.c newlib/libm/math/s_signif.c newlib/libm/math/s_sin.c newlib/libm/math/s_tan.c newlib/libm/math/s_tanh.c newlib/libm/math/sf_asinh.c newlib/libm/math/sf_atan.c newlib/libm/math/sf_ceil.c newlib/libm/math/sf_cos.c newlib/libm/math/sf_erf.c newlib/libm/math/sf_fabs.c newlib/libm/math/sf_floor.c newlib/libm/math/sf_frexp.c newlib/libm/math/sf_isinf.c newlib/libm/math/sf_isnan.c newlib/libm/math/sf_ldexp.c newlib/libm/math/sf_signif.c newlib/libm/math/sf_sin.c newlib/libm/math/sf_tan.c newlib/libm/math/sf_tanh.c newlib/libm/math/w_acos.c newlib/libm/math/w_acosh.c newlib/libm/math/w_asin.c newlib/libm/math/w_atan2.c newlib/libm/math/w_atanh.c newlib/libm/math/w_cabs.c newlib/libm/math/w_cosh.c newlib/libm/math/w_drem.c newlib/libm/math/w_exp.c newlib/libm/math/w_fmod.c newlib/libm/math/w_gamma.c newlib/libm/math/w_hypot.c newlib/libm/math/w_j0.c newlib/libm/math/w_j1.c newlib/libm/math/w_jn.c newlib/libm/math/w_lgamma.c newlib/libm/math/w_log.c newlib/libm/math/w_log10.c newlib/libm/math/w_pow.c newlib/libm/math/w_remainder.c newlib/libm/math/w_scalb.c newlib/libm/math/w_sinh.c newlib/libm/math/w_sqrt.c newlib/libm/math/wf_acos.c newlib/libm/math/wf_acosh.c newlib/libm/math/wf_asin.c newlib/libm/math/wf_atan2.c newlib/libm/math/wf_atanh.c newlib/libm/math/wf_cabs.c newlib/libm/math/wf_cosh.c newlib/libm/math/wf_drem.c newlib/libm/math/wf_exp.c newlib/libm/math/wf_fmod.c newlib/libm/math/wf_gamma.c newlib/libm/math/wf_hypot.c newlib/libm/math/wf_j0.c newlib/libm/math/wf_j1.c newlib/libm/math/wf_jn.c newlib/libm/math/wf_lgamma.c newlib/libm/math/wf_log.c newlib/libm/math/wf_log10.c newlib/libm/math/wf_pow.c newlib/libm/math/wf_remainder.c newlib/libm/math/wf_scalb.c newlib/libm/math/wf_sinh.c newlib/libm/math/wf_sqrt.c newlib/libm/math/wr_gamma.c newlib/libm/math/wr_lgamma.c newlib/libm/math/wrf_gamma.c newlib/libm/math/wrf_lgamma.c newlib/libm/mathfp/Makefile.am newlib/libm/mathfp/Makefile.in newlib/libm/mathfp/e_acosh.c newlib/libm/mathfp/e_atanh.c newlib/libm/mathfp/e_hypot.c newlib/libm/mathfp/e_j0.c newlib/libm/mathfp/e_j1.c newlib/libm/mathfp/e_remainder.c newlib/libm/mathfp/e_scalb.c newlib/libm/mathfp/ef_acosh.c newlib/libm/mathfp/ef_atanh.c newlib/libm/mathfp/ef_hypot.c newlib/libm/mathfp/ef_j0.c newlib/libm/mathfp/ef_j1.c newlib/libm/mathfp/ef_remainder.c newlib/libm/mathfp/ef_scalb.c newlib/libm/mathfp/er_gamma.c newlib/libm/mathfp/er_lgamma.c newlib/libm/mathfp/erf_gamma.c newlib/libm/mathfp/erf_lgamma.c newlib/libm/mathfp/mathfp.tex newlib/libm/mathfp/s_acos.c newlib/libm/mathfp/s_asin.c newlib/libm/mathfp/s_asine.c newlib/libm/mathfp/s_asinh.c newlib/libm/mathfp/s_atan.c newlib/libm/mathfp/s_atan2.c newlib/libm/mathfp/s_atangent.c newlib/libm/mathfp/s_ceil.c newlib/libm/mathfp/s_cos.c newlib/libm/mathfp/s_cosh.c newlib/libm/mathfp/s_erf.c newlib/libm/mathfp/s_exp.c newlib/libm/mathfp/s_fabs.c newlib/libm/mathfp/s_floor.c newlib/libm/mathfp/s_fmod.c newlib/libm/mathfp/s_frexp.c newlib/libm/mathfp/s_infconst.c newlib/libm/mathfp/s_isinf.c newlib/libm/mathfp/s_isnan.c newlib/libm/mathfp/s_ispos.c newlib/libm/mathfp/s_ldexp.c newlib/libm/mathfp/s_log.c newlib/libm/mathfp/s_log10.c newlib/libm/mathfp/s_logarithm.c newlib/libm/mathfp/s_mathcnst.c newlib/libm/mathfp/s_numtest.c newlib/libm/mathfp/s_pow.c newlib/libm/mathfp/s_signif.c newlib/libm/mathfp/s_sin.c newlib/libm/mathfp/s_sine.c newlib/libm/mathfp/s_sineh.c newlib/libm/mathfp/s_sinf.c newlib/libm/mathfp/s_sinh.c newlib/libm/mathfp/s_sqrt.c newlib/libm/mathfp/s_tan.c newlib/libm/mathfp/s_tanh.c newlib/libm/mathfp/sf_acos.c newlib/libm/mathfp/sf_asin.c newlib/libm/mathfp/sf_asine.c newlib/libm/mathfp/sf_asinh.c newlib/libm/mathfp/sf_atan.c newlib/libm/mathfp/sf_atan2.c newlib/libm/mathfp/sf_atangent.c newlib/libm/mathfp/sf_ceil.c newlib/libm/mathfp/sf_cos.c newlib/libm/mathfp/sf_cosh.c newlib/libm/mathfp/sf_erf.c newlib/libm/mathfp/sf_exp.c newlib/libm/mathfp/sf_fabs.c newlib/libm/mathfp/sf_floor.c newlib/libm/mathfp/sf_fmod.c newlib/libm/mathfp/sf_frexp.c newlib/libm/mathfp/sf_isinf.c newlib/libm/mathfp/sf_isnan.c newlib/libm/mathfp/sf_ispos.c newlib/libm/mathfp/sf_ldexp.c newlib/libm/mathfp/sf_log.c newlib/libm/mathfp/sf_log10.c newlib/libm/mathfp/sf_logarithm.c newlib/libm/mathfp/sf_numtest.c newlib/libm/mathfp/sf_pow.c newlib/libm/mathfp/sf_signif.c newlib/libm/mathfp/sf_sin.c newlib/libm/mathfp/sf_sine.c newlib/libm/mathfp/sf_sineh.c newlib/libm/mathfp/sf_sinh.c newlib/libm/mathfp/sf_sqrt.c newlib/libm/mathfp/sf_tan.c newlib/libm/mathfp/sf_tanh.c newlib/libm/mathfp/w_cabs.c newlib/libm/mathfp/w_drem.c newlib/libm/mathfp/w_jn.c newlib/libm/mathfp/wf_cabs.c newlib/libm/mathfp/wf_drem.c newlib/libm/mathfp/wf_jn.c newlib/libm/mathfp/zmath.h newlib/libm/test/Makefile.in newlib/libm/test/acos_vec.c newlib/libm/test/acosf_vec.c newlib/libm/test/acosh_vec.c newlib/libm/test/acoshf_vec.c newlib/libm/test/asin_vec.c newlib/libm/test/asinf_vec.c newlib/libm/test/asinh_vec.c newlib/libm/test/asinhf_vec.c newlib/libm/test/atan2_vec.c newlib/libm/test/atan2f_vec.c newlib/libm/test/atan_vec.c newlib/libm/test/atanf_vec.c newlib/libm/test/atanh_vec.c newlib/libm/test/atanhf_vec.c newlib/libm/test/ceil_vec.c newlib/libm/test/ceilf_vec.c newlib/libm/test/conv_vec.c newlib/libm/test/convert.c newlib/libm/test/cos_vec.c newlib/libm/test/cosf_vec.c newlib/libm/test/cosh_vec.c newlib/libm/test/coshf_vec.c newlib/libm/test/dcvt.c newlib/libm/test/dvec.c newlib/libm/test/erf_vec.c newlib/libm/test/erfc_vec.c newlib/libm/test/erfcf_vec.c newlib/libm/test/erff_vec.c newlib/libm/test/exp_vec.c newlib/libm/test/expf_vec.c newlib/libm/test/fabs_vec.c newlib/libm/test/fabsf_vec.c newlib/libm/test/floor_vec.c newlib/libm/test/floorf_vec.c newlib/libm/test/fmod_vec.c newlib/libm/test/fmodf_vec.c newlib/libm/test/gamma_vec.c newlib/libm/test/gammaf_vec.c newlib/libm/test/hypot_vec.c newlib/libm/test/hypotf_vec.c newlib/libm/test/iconv_vec.c newlib/libm/test/j0_vec.c newlib/libm/test/j0f_vec.c newlib/libm/test/j1_vec.c newlib/libm/test/j1f_vec.c newlib/libm/test/jn_vec.c newlib/libm/test/jnf_vec.c newlib/libm/test/log10_vec.c newlib/libm/test/log10f_vec.c newlib/libm/test/log1p_vec.c newlib/libm/test/log1pf_vec.c newlib/libm/test/log2_vec.c newlib/libm/test/log2f_vec.c newlib/libm/test/log_vec.c newlib/libm/test/logf_vec.c newlib/libm/test/math.c newlib/libm/test/math2.c newlib/libm/test/sin_vec.c newlib/libm/test/sinf_vec.c newlib/libm/test/sinh_vec.c newlib/libm/test/sinhf_vec.c newlib/libm/test/sprint_ivec.c newlib/libm/test/sprint_vec.c newlib/libm/test/sqrt_vec.c newlib/libm/test/sqrtf_vec.c newlib/libm/test/string.c newlib/libm/test/tan_vec.c newlib/libm/test/tanf_vec.c newlib/libm/test/tanh_vec.c newlib/libm/test/tanhf_vec.c newlib/libm/test/test.c newlib/libm/test/test.h newlib/libm/test/test_ieee.c newlib/libm/test/test_is.c newlib/libm/test/y0_vec.c newlib/libm/test/y0f_vec.c newlib/libm/test/y1_vec.c newlib/libm/test/y1f_vec.c newlib/libm/test/yn_vec.c newlib/libm/test/ynf_vec.c setup.com symlink-tree texinfo/texinfo.tex winsup/CYGWIN_LICENSE winsup/ChangeLog winsup/MAINTAINERS winsup/Makefile.common winsup/Makefile.in winsup/configure winsup/configure.in winsup/cygwin/CYGWIN_LICENSE winsup/cygwin/ChangeLog winsup/cygwin/ChangeLog-1995 winsup/cygwin/ChangeLog-1996 winsup/cygwin/ChangeLog-1997 winsup/cygwin/ChangeLog-1998 winsup/cygwin/ChangeLog-1999 winsup/cygwin/Makefile.in winsup/cygwin/ROADMAP winsup/cygwin/acconfig.h winsup/cygwin/ansi.sgml winsup/cygwin/assert.cc winsup/cygwin/autoload.h winsup/cygwin/binmode.c winsup/cygwin/config.h.in winsup/cygwin/config/i386/longjmp.c winsup/cygwin/config/i386/makefrag winsup/cygwin/config/i386/profile.h winsup/cygwin/config/i386/setjmp.c winsup/cygwin/configure winsup/cygwin/configure.in winsup/cygwin/cygrun.c winsup/cygwin/cygwin.din winsup/cygwin/dcrt0.cc winsup/cygwin/debug.cc winsup/cygwin/debug.h winsup/cygwin/delqueue.cc winsup/cygwin/dir.cc winsup/cygwin/dlfcn.cc winsup/cygwin/dll_init.cc winsup/cygwin/dll_init.h winsup/cygwin/dll_init.sgml winsup/cygwin/dtable.cc winsup/cygwin/dtable.sgml winsup/cygwin/errno.cc winsup/cygwin/exceptions.cc winsup/cygwin/exec.cc winsup/cygwin/external.cc winsup/cygwin/external.sgml winsup/cygwin/fcntl.cc winsup/cygwin/fhandler.cc winsup/cygwin/fhandler.h winsup/cygwin/fhandler_console.cc winsup/cygwin/fhandler_floppy.cc winsup/cygwin/fhandler_random.cc winsup/cygwin/fhandler_raw.cc winsup/cygwin/fhandler_serial.cc winsup/cygwin/fhandler_tape.cc winsup/cygwin/fhandler_termios.cc winsup/cygwin/fhandler_tty.cc winsup/cygwin/fhandler_windows.cc winsup/cygwin/fhandler_zero.cc winsup/cygwin/fork.cc winsup/cygwin/gcrt0.c winsup/cygwin/glob.c winsup/cygwin/gmon.c winsup/cygwin/gmon.h winsup/cygwin/grp.cc winsup/cygwin/heap.cc winsup/cygwin/include/a.out.h winsup/cygwin/include/arpa/ftp.h winsup/cygwin/include/arpa/inet.h winsup/cygwin/include/arpa/telnet.h winsup/cygwin/include/asm/byteorder.h winsup/cygwin/include/asm/socket.h winsup/cygwin/include/asm/types.h winsup/cygwin/include/cygwin/acl.h winsup/cygwin/include/cygwin/cygwin_dll.h winsup/cygwin/include/cygwin/icmp.h winsup/cygwin/include/cygwin/if.h winsup/cygwin/include/cygwin/in.h winsup/cygwin/include/cygwin/in_systm.h winsup/cygwin/include/cygwin/ip.h winsup/cygwin/include/cygwin/mtio.h winsup/cygwin/include/cygwin/rdevio.h winsup/cygwin/include/cygwin/socket.h winsup/cygwin/include/cygwin/sockios.h winsup/cygwin/include/cygwin/types.h winsup/cygwin/include/cygwin/uio.h winsup/cygwin/include/cygwin/version.h winsup/cygwin/include/dlfcn.h winsup/cygwin/include/exceptions.h winsup/cygwin/include/fcntl.h winsup/cygwin/include/features.h winsup/cygwin/include/getopt.h winsup/cygwin/include/glob.h winsup/cygwin/include/icmp.h winsup/cygwin/include/io.h winsup/cygwin/include/lastlog.h winsup/cygwin/include/limits.h winsup/cygwin/include/mapi.h winsup/cygwin/include/memory.h winsup/cygwin/include/mntent.h winsup/cygwin/include/net/if.h winsup/cygwin/include/netdb.h winsup/cygwin/include/netinet/in.h winsup/cygwin/include/netinet/in_systm.h winsup/cygwin/include/netinet/ip.h winsup/cygwin/include/netinet/ip_icmp.h winsup/cygwin/include/paths.h winsup/cygwin/include/poll.h winsup/cygwin/include/pthread.h winsup/cygwin/include/rapi.h winsup/cygwin/include/strings.h winsup/cygwin/include/sys/acl.h winsup/cygwin/include/sys/cdefs.h winsup/cygwin/include/sys/copying.dj winsup/cygwin/include/sys/cygwin.h winsup/cygwin/include/sys/file.h winsup/cygwin/include/sys/ioctl.h winsup/cygwin/include/sys/mman.h winsup/cygwin/include/sys/mount.h winsup/cygwin/include/sys/mtio.h winsup/cygwin/include/sys/poll.h winsup/cygwin/include/sys/resource.h winsup/cygwin/include/sys/select.h winsup/cygwin/include/sys/smallprint.h winsup/cygwin/include/sys/socket.h winsup/cygwin/include/sys/strace.h winsup/cygwin/include/sys/syslog.h winsup/cygwin/include/sys/sysmacros.h winsup/cygwin/include/sys/termio.h winsup/cygwin/include/sys/termios.h winsup/cygwin/include/sys/ttychars.h winsup/cygwin/include/sys/uio.h winsup/cygwin/include/sys/un.h winsup/cygwin/include/sys/utsname.h winsup/cygwin/include/sys/vfs.h winsup/cygwin/include/sys/wait.h winsup/cygwin/include/syslog.h winsup/cygwin/include/termio.h winsup/cygwin/include/tzfile.h winsup/cygwin/include/wchar.h winsup/cygwin/init.cc winsup/cygwin/ioctl.cc winsup/cygwin/lib/_cygwin_crt0_common.cc winsup/cygwin/lib/crt0.h winsup/cygwin/lib/cygwin_attach_dll.c winsup/cygwin/lib/cygwin_crt0.c winsup/cygwin/lib/dll_entry.c winsup/cygwin/lib/dll_main.cc winsup/cygwin/lib/getopt.c winsup/cygwin/lib/libcmain.c winsup/cygwin/lib/premain0.c winsup/cygwin/lib/premain1.c winsup/cygwin/lib/premain2.c winsup/cygwin/lib/premain3.c winsup/cygwin/localtime.c winsup/cygwin/malloc_wrapper.cc winsup/cygwin/mcount.c winsup/cygwin/misc-std.sgml winsup/cygwin/mkvers.sh winsup/cygwin/mmap.cc winsup/cygwin/net.cc winsup/cygwin/ntea.cc winsup/cygwin/passwd.cc winsup/cygwin/path.cc winsup/cygwin/path.h winsup/cygwin/path.sgml winsup/cygwin/perthread.h winsup/cygwin/pinfo.cc winsup/cygwin/pipe.cc winsup/cygwin/poll.cc winsup/cygwin/posix.sgml winsup/cygwin/profil.c winsup/cygwin/profil.h winsup/cygwin/pthread.cc winsup/cygwin/regexp/COPYRIGHT winsup/cygwin/regexp/README winsup/cygwin/regexp/regerror.c winsup/cygwin/regexp/regexp.3 winsup/cygwin/regexp/regexp.c winsup/cygwin/regexp/regexp.h winsup/cygwin/regexp/regmagic.h winsup/cygwin/regexp/regsub.c winsup/cygwin/registry.cc winsup/cygwin/resource.cc winsup/cygwin/scandir.cc winsup/cygwin/security.cc winsup/cygwin/select.cc winsup/cygwin/select.h winsup/cygwin/shared.cc winsup/cygwin/shared.h winsup/cygwin/shared.sgml winsup/cygwin/signal.cc winsup/cygwin/sigproc.cc winsup/cygwin/sigproc.h winsup/cygwin/smallprint.c winsup/cygwin/spawn.cc winsup/cygwin/strace.cc winsup/cygwin/strsep.cc winsup/cygwin/sync.cc winsup/cygwin/sync.h winsup/cygwin/syscalls.cc winsup/cygwin/sysconf.cc winsup/cygwin/syslog.cc winsup/cygwin/termios.cc winsup/cygwin/test.c winsup/cygwin/testsuite/README winsup/cygwin/testsuite/config/default.exp winsup/cygwin/testsuite/winsup.api/crlf.c winsup/cygwin/testsuite/winsup.api/devzero.c winsup/cygwin/testsuite/winsup.api/iospeed.c winsup/cygwin/testsuite/winsup.api/samples/sample-pass.c winsup/cygwin/testsuite/winsup.api/samples/xf-sample-fail.c winsup/cygwin/testsuite/winsup.api/samples/xf-sample-miscompile.c winsup/cygwin/testsuite/winsup.api/winsup.exp winsup/cygwin/textmode.c winsup/cygwin/thread.cc winsup/cygwin/thread.h winsup/cygwin/times.cc winsup/cygwin/tty.cc winsup/cygwin/tz_posixrules.h winsup/cygwin/uinfo.cc winsup/cygwin/uname.cc winsup/cygwin/wait.cc winsup/cygwin/window.cc winsup/cygwin/winsup.h winsup/cygwin/winver.rc winsup/doc/ChangeLog winsup/doc/Makefile.in winsup/doc/calls.texinfo winsup/doc/changes.texinfo winsup/doc/configure winsup/doc/configure.in winsup/doc/copy.texinfo winsup/doc/cygwin-api.in.sgml winsup/doc/cygwin-ug-net.in.sgml winsup/doc/cygwin-ug.in.sgml winsup/doc/cygwinenv.sgml winsup/doc/dll.sgml winsup/doc/doctool.c winsup/doc/doctool.txt winsup/doc/faq.texinfo winsup/doc/fhandler-tut.txt winsup/doc/filemodes.sgml winsup/doc/gcc.sgml winsup/doc/gdb.sgml winsup/doc/history.texinfo winsup/doc/how.texinfo winsup/doc/install.texinfo winsup/doc/legal.sgml winsup/doc/ntsec.sgml winsup/doc/overview.sgml winsup/doc/overview2.sgml winsup/doc/pathnames.sgml winsup/doc/programming.sgml winsup/doc/readme.texinfo winsup/doc/relnotes.texinfo winsup/doc/setup-net.sgml winsup/doc/setup.sgml winsup/doc/setup2.sgml winsup/doc/sites.texinfo winsup/doc/textbinary.sgml winsup/doc/using.sgml winsup/doc/what.texinfo winsup/doc/who.texinfo winsup/doc/windres.sgml winsup/mingw/CRT_noglob.c winsup/mingw/CRTfmode.c winsup/mingw/CRTglob.c winsup/mingw/CRTinit.c winsup/mingw/ChangeLog winsup/mingw/Makefile.in winsup/mingw/configure winsup/mingw/configure.in winsup/mingw/crt1.c winsup/mingw/crtdll.def winsup/mingw/crtmt.c winsup/mingw/crtst.c winsup/mingw/ctype_old.c winsup/mingw/dirent.c winsup/mingw/dllcrt1.c winsup/mingw/dllmain.c winsup/mingw/gccmain.c winsup/mingw/include/_mingw.h winsup/mingw/include/assert.h winsup/mingw/include/conio.h winsup/mingw/include/ctype.h winsup/mingw/include/dir.h winsup/mingw/include/direct.h winsup/mingw/include/dirent.h winsup/mingw/include/dos.h winsup/mingw/include/errno.h winsup/mingw/include/excpt.h winsup/mingw/include/fcntl.h winsup/mingw/include/float.h winsup/mingw/include/io.h winsup/mingw/include/limits.h winsup/mingw/include/locale.h winsup/mingw/include/malloc.h winsup/mingw/include/math.h winsup/mingw/include/mem.h winsup/mingw/include/memory.h winsup/mingw/include/process.h winsup/mingw/include/setjmp.h winsup/mingw/include/share.h winsup/mingw/include/signal.h winsup/mingw/include/stdarg.h winsup/mingw/include/stddef.h winsup/mingw/include/stdio.h winsup/mingw/include/stdlib.h winsup/mingw/include/string.h winsup/mingw/include/sys/fcntl.h winsup/mingw/include/sys/file.h winsup/mingw/include/sys/locking.h winsup/mingw/include/sys/stat.h winsup/mingw/include/sys/time.h winsup/mingw/include/sys/timeb.h winsup/mingw/include/sys/types.h winsup/mingw/include/sys/unistd.h winsup/mingw/include/sys/utime.h winsup/mingw/include/tchar.h winsup/mingw/include/time.h winsup/mingw/include/unistd.h winsup/mingw/include/values.h winsup/mingw/include/varargs.h winsup/mingw/include/wchar.h winsup/mingw/include/wctype.h winsup/mingw/init.c winsup/mingw/jamfile winsup/mingw/main.c winsup/mingw/moldname-crtdll.def winsup/mingw/moldname-msvcrt.def winsup/mingw/moldname.def winsup/mingw/moldname.def.in winsup/mingw/msvcrt.def winsup/mingw/msvcrt20.def winsup/mingw/msvcrt40.def winsup/mingw/mthr.c winsup/mingw/mthr_init.c winsup/mingw/mthr_stub.c winsup/mingw/profile/ChangeLog winsup/mingw/profile/Makefile.in winsup/mingw/profile/configure winsup/mingw/profile/configure.in winsup/mingw/profile/gcrt0.c winsup/mingw/profile/gmon.c winsup/mingw/profile/gmon.h winsup/mingw/profile/mcount.c winsup/mingw/profile/profil.c winsup/mingw/profile/profil.h winsup/mingw/profile/profile.h winsup/mingw/readme.txt winsup/mingw/samples/dirent/jamfile winsup/mingw/samples/dirent/test.c winsup/mingw/samples/dlltest/dll.c winsup/mingw/samples/dlltest/dll.def winsup/mingw/samples/dlltest/dll.h winsup/mingw/samples/dlltest/exe.c winsup/mingw/samples/dlltest/exe.exp winsup/mingw/samples/dlltest/expexe.c winsup/mingw/samples/dlltest/expexe.def winsup/mingw/samples/dlltest/jamfile winsup/mingw/samples/dlltest/loaddll.c winsup/mingw/samples/dlltest/loadexe.c winsup/mingw/samples/dlltest/readme.txt winsup/mingw/samples/dlltest/silly.cpp winsup/mingw/samples/dlltest/silly.def winsup/mingw/samples/dlltest/silly.exp winsup/mingw/samples/dlltest/silly.h winsup/mingw/samples/dlltest/sillydll.cpp winsup/mingw/samples/filehand/filehand.c winsup/mingw/samples/filehand/jamfile winsup/mingw/samples/filehand/junk.txt winsup/mingw/samples/fixargv/fixargv.c winsup/mingw/samples/fixargv/fixargv.h winsup/mingw/samples/fixargv/readme.txt winsup/mingw/samples/fmode/all.c winsup/mingw/samples/fmode/jamfile winsup/mingw/samples/fmode/readme.txt winsup/mingw/samples/fmode/test.c winsup/mingw/samples/globbing/glob.c winsup/mingw/samples/globbing/jamfile winsup/mingw/samples/globbing/noglob.c winsup/mingw/samples/globbing/readme.txt winsup/mingw/samples/print/jamfile winsup/mingw/samples/print/prntest.c winsup/mingw/samples/seh/eh3.c winsup/mingw/samples/seh/exutil.c winsup/mingw/samples/seh/exutil.def winsup/mingw/samples/seh/exutil.h winsup/mingw/samples/seh/jamfile winsup/mingw/samples/seh/sehfix.c winsup/mingw/samples/seh/sehsub.c winsup/mingw/samples/seh/sehtest.c winsup/mingw/samples/simpledll/dll.c winsup/mingw/samples/simpledll/dll.cpp winsup/mingw/samples/simpledll/dll.def winsup/mingw/samples/simpledll/exe.c winsup/mingw/samples/simpledll/jamfile winsup/mingw/samples/simpledll/makedll.bat winsup/mingw/samples/test/jamfile winsup/mingw/samples/test/test.c winsup/mingw/samples/wintest/jamfile winsup/mingw/samples/wintest/test.c winsup/mingw/string_old.c winsup/testsuite/README winsup/testsuite/config/default.exp winsup/testsuite/winsup.api/crlf.c winsup/testsuite/winsup.api/devzero.c winsup/testsuite/winsup.api/iospeed.c winsup/testsuite/winsup.api/samples/sample-fail.c winsup/testsuite/winsup.api/samples/sample-miscompile.c winsup/testsuite/winsup.api/samples/sample-pass.c winsup/testsuite/winsup.api/winsup.exp winsup/utils/ChangeLog winsup/utils/Makefile.in winsup/utils/aclocal.m4 winsup/utils/configure winsup/utils/configure.in winsup/utils/cygcheck.cc winsup/utils/cygpath.cc winsup/utils/getfacl.c winsup/utils/kill.cc winsup/utils/mkgroup.c winsup/utils/mkpasswd.c winsup/utils/mount.cc winsup/utils/passwd.c winsup/utils/ps.cc winsup/utils/regtool.cc winsup/utils/setfacl.c winsup/utils/strace.cc winsup/utils/umount.cc winsup/utils/utils.sgml winsup/w32api/ChangeLog winsup/w32api/Makefile.in winsup/w32api/README winsup/w32api/TODO winsup/w32api/config.guess winsup/w32api/config.sub winsup/w32api/configure winsup/w32api/configure.in winsup/w32api/include/basetyps.h winsup/w32api/include/cderr.h winsup/w32api/include/cguid.h winsup/w32api/include/commctrl.h winsup/w32api/include/commdlg.h winsup/w32api/include/cpl.h winsup/w32api/include/cplext.h winsup/w32api/include/custcntl.h winsup/w32api/include/dbt.h winsup/w32api/include/dde.h winsup/w32api/include/ddeml.h winsup/w32api/include/dlgs.h winsup/w32api/include/excpt.h winsup/w32api/include/httpext.h winsup/w32api/include/imagehlp.h winsup/w32api/include/imm.h winsup/w32api/include/initguid.h winsup/w32api/include/intshcut.h winsup/w32api/include/isguids.h winsup/w32api/include/largeint.h winsup/w32api/include/lm.h winsup/w32api/include/lmaccess.h winsup/w32api/include/lmalert.h winsup/w32api/include/lmapibuf.h winsup/w32api/include/lmat.h winsup/w32api/include/lmaudit.h winsup/w32api/include/lmbrowsr.h winsup/w32api/include/lmchdev.h winsup/w32api/include/lmconfig.h winsup/w32api/include/lmcons.h winsup/w32api/include/lmerr.h winsup/w32api/include/lmerrlog.h winsup/w32api/include/lmmsg.h winsup/w32api/include/lmremutl.h winsup/w32api/include/lmrepl.h winsup/w32api/include/lmserver.h winsup/w32api/include/lmshare.h winsup/w32api/include/lmsname.h winsup/w32api/include/lmstats.h winsup/w32api/include/lmsvc.h winsup/w32api/include/lmuse.h winsup/w32api/include/lmuseflg.h winsup/w32api/include/lmwksta.h winsup/w32api/include/lzexpand.h winsup/w32api/include/mciavi.h winsup/w32api/include/mcx.h winsup/w32api/include/mmsystem.h winsup/w32api/include/nb30.h winsup/w32api/include/nddeapi.h winsup/w32api/include/nspapi.h winsup/w32api/include/oaidl.h winsup/w32api/include/objbase.h winsup/w32api/include/objfwd.h winsup/w32api/include/objidl.h winsup/w32api/include/ocidl.h winsup/w32api/include/ole.h winsup/w32api/include/ole2.h winsup/w32api/include/ole2ver.h winsup/w32api/include/oleauto.h winsup/w32api/include/olectl.h winsup/w32api/include/olectlid.h winsup/w32api/include/oledlg.h winsup/w32api/include/oleidl.h winsup/w32api/include/pbt.h winsup/w32api/include/poppack.h winsup/w32api/include/prsht.h winsup/w32api/include/psapi.h winsup/w32api/include/pshpack1.h winsup/w32api/include/pshpack2.h winsup/w32api/include/pshpack4.h winsup/w32api/include/pshpack8.h winsup/w32api/include/rapi.h winsup/w32api/include/regstr.h winsup/w32api/include/richedit.h winsup/w32api/include/richole.h winsup/w32api/include/rpc.h winsup/w32api/include/rpcdce.h winsup/w32api/include/rpcdce2.h winsup/w32api/include/rpcdcep.h winsup/w32api/include/rpcndr.h winsup/w32api/include/rpcnsi.h winsup/w32api/include/rpcnsip.h winsup/w32api/include/rpcnterr.h winsup/w32api/include/rpcproxy.h winsup/w32api/include/scrnsave.h winsup/w32api/include/shellapi.h winsup/w32api/include/shlguid.h winsup/w32api/include/shlobj.h winsup/w32api/include/sql.h winsup/w32api/include/sqlext.h winsup/w32api/include/sqltypes.h winsup/w32api/include/tlhelp32.h winsup/w32api/include/unknwn.h winsup/w32api/include/winbase.h winsup/w32api/include/wincon.h winsup/w32api/include/wincrypt.h winsup/w32api/include/windef.h winsup/w32api/include/windows.h winsup/w32api/include/windowsx.h winsup/w32api/include/winerror.h winsup/w32api/include/wingdi.h winsup/w32api/include/wininet.h winsup/w32api/include/winioctl.h winsup/w32api/include/winnetwk.h winsup/w32api/include/winnls.h winsup/w32api/include/winnt.h winsup/w32api/include/winperf.h winsup/w32api/include/winreg.h winsup/w32api/include/winresrc.h winsup/w32api/include/winsock.h winsup/w32api/include/winsock2.h winsup/w32api/include/winspool.h winsup/w32api/include/winsvc.h winsup/w32api/include/winuser.h winsup/w32api/include/winver.h winsup/w32api/include/wtypes.h winsup/w32api/include/zmouse.h winsup/w32api/install-sh winsup/w32api/lib/Makefile.in winsup/w32api/lib/advapi32.def winsup/w32api/lib/cap.def winsup/w32api/lib/comctl32.def winsup/w32api/lib/comdlg32.def winsup/w32api/lib/ctl3d32.def winsup/w32api/lib/d3dim.def winsup/w32api/lib/d3drm.def winsup/w32api/lib/d3dxof.def winsup/w32api/lib/ddraw.def winsup/w32api/lib/dinput.c winsup/w32api/lib/dinput.def winsup/w32api/lib/dlcapi.def winsup/w32api/lib/dplayx.def winsup/w32api/lib/dsetup.def winsup/w32api/lib/dsound.def winsup/w32api/lib/dxguid.c winsup/w32api/lib/gdi32.def winsup/w32api/lib/glaux.def winsup/w32api/lib/glu32.def winsup/w32api/lib/glut.def winsup/w32api/lib/glut32.def winsup/w32api/lib/imagehlp.def winsup/w32api/lib/imm32.def winsup/w32api/lib/kernel32.def winsup/w32api/lib/largeint.c winsup/w32api/lib/lz32.def winsup/w32api/lib/mapi32.def winsup/w32api/lib/mfcuia32.def winsup/w32api/lib/mgmtapi.def winsup/w32api/lib/mpr.def winsup/w32api/lib/msacm32.def winsup/w32api/lib/mswsock.def winsup/w32api/lib/nddeapi.def winsup/w32api/lib/netapi32.def winsup/w32api/lib/odbc32.def winsup/w32api/lib/ole32.def winsup/w32api/lib/oleaut32.def winsup/w32api/lib/olecli32.def winsup/w32api/lib/oledlg.def winsup/w32api/lib/olepro32.def winsup/w32api/lib/olesvr32.def winsup/w32api/lib/opengl32.def winsup/w32api/lib/penwin32.def winsup/w32api/lib/pkpd32.def winsup/w32api/lib/psapi.def winsup/w32api/lib/rapi.def winsup/w32api/lib/rasapi32.def winsup/w32api/lib/res.rc winsup/w32api/lib/rpcdce4.def winsup/w32api/lib/rpcns4.def winsup/w32api/lib/rpcrt4.def winsup/w32api/lib/scrnsave.c winsup/w32api/lib/shell32.c winsup/w32api/lib/shell32.def winsup/w32api/lib/svrapi.def winsup/w32api/lib/tapi32.def winsup/w32api/lib/test.c winsup/w32api/lib/th32.def winsup/w32api/lib/thunk32.def winsup/w32api/lib/url.def winsup/w32api/lib/user32.def winsup/w32api/lib/uuid.c winsup/w32api/lib/vdmdbg.def winsup/w32api/lib/version.def winsup/w32api/lib/vfw32.def winsup/w32api/lib/win32spl.def winsup/w32api/lib/wininet.def winsup/w32api/lib/winmm.def winsup/w32api/lib/winspool.def winsup/w32api/lib/winstrm.def winsup/w32api/lib/wow32.def winsup/w32api/lib/ws2_32.def winsup/w32api/lib/wsock32.def winsup/w32api/lib/wst.def ylwrap --- newlib/libc/stdio/Makefile.am | 165 -------- newlib/libc/stdio/Makefile.in | 445 ------------------- newlib/libc/stdio/clearerr.c | 63 --- newlib/libc/stdio/fclose.c | 82 ---- newlib/libc/stdio/fdopen.c | 127 ------ newlib/libc/stdio/feof.c | 40 -- newlib/libc/stdio/ferror.c | 67 --- newlib/libc/stdio/fflush.c | 99 ----- newlib/libc/stdio/fgetc.c | 46 -- newlib/libc/stdio/fgetpos.c | 61 --- newlib/libc/stdio/fgets.c | 146 ------- newlib/libc/stdio/fileno.c | 40 -- newlib/libc/stdio/findfp.c | 161 ------- newlib/libc/stdio/fiprintf.c | 77 ---- newlib/libc/stdio/flags.c | 87 ---- newlib/libc/stdio/floatio.h | 27 -- newlib/libc/stdio/fopen.c | 173 -------- newlib/libc/stdio/fprintf.c | 56 --- newlib/libc/stdio/fputc.c | 51 --- newlib/libc/stdio/fputs.c | 71 ---- newlib/libc/stdio/fread.c | 155 ------- newlib/libc/stdio/freopen.c | 157 ------- newlib/libc/stdio/fscanf.c | 60 --- newlib/libc/stdio/fseek.c | 310 -------------- newlib/libc/stdio/fsetpos.c | 54 --- newlib/libc/stdio/ftell.c | 126 ------ newlib/libc/stdio/fvwrite.c | 216 ---------- newlib/libc/stdio/fvwrite.h | 38 -- newlib/libc/stdio/fwalk.c | 43 -- newlib/libc/stdio/fwrite.c | 104 ----- newlib/libc/stdio/getc.c | 80 ---- newlib/libc/stdio/getchar.c | 96 ----- newlib/libc/stdio/gets.c | 102 ----- newlib/libc/stdio/getw.c | 67 --- newlib/libc/stdio/iprintf.c | 118 ------ newlib/libc/stdio/local.h | 91 ---- newlib/libc/stdio/makebuf.c | 96 ----- newlib/libc/stdio/mktemp.c | 221 ---------- newlib/libc/stdio/perror.c | 80 ---- newlib/libc/stdio/printf.c | 83 ---- newlib/libc/stdio/putc.c | 84 ---- newlib/libc/stdio/putchar.c | 94 ----- newlib/libc/stdio/puts.c | 101 ----- newlib/libc/stdio/putw.c | 63 --- newlib/libc/stdio/refill.c | 113 ----- newlib/libc/stdio/remove.c | 69 --- newlib/libc/stdio/rename.c | 86 ---- newlib/libc/stdio/rewind.c | 60 --- newlib/libc/stdio/rget.c | 43 -- newlib/libc/stdio/scanf.c | 75 ---- newlib/libc/stdio/setbuf.c | 79 ---- newlib/libc/stdio/setvbuf.c | 190 --------- newlib/libc/stdio/siprintf.c | 70 --- newlib/libc/stdio/snprintf.c | 95 ----- newlib/libc/stdio/sprintf.c | 360 ---------------- newlib/libc/stdio/sscanf.c | 386 ----------------- newlib/libc/stdio/stdio.c | 129 ------ newlib/libc/stdio/stdio.tex | 191 --------- newlib/libc/stdio/tmpfile.c | 77 ---- newlib/libc/stdio/tmpnam.c | 208 --------- newlib/libc/stdio/ungetc.c | 145 ------- newlib/libc/stdio/vfieeefp.h | 205 --------- newlib/libc/stdio/vfprintf.c | 938 ----------------------------------------- newlib/libc/stdio/vfscanf.c | 961 ------------------------------------------ newlib/libc/stdio/vprintf.c | 35 -- newlib/libc/stdio/vsnprintf.c | 73 ---- newlib/libc/stdio/vsprintf.c | 70 --- newlib/libc/stdio/wbuf.c | 81 ---- newlib/libc/stdio/wsetup.c | 79 ---- 69 files changed, 9541 deletions(-) delete mode 100644 newlib/libc/stdio/Makefile.am delete mode 100644 newlib/libc/stdio/Makefile.in delete mode 100644 newlib/libc/stdio/clearerr.c delete mode 100644 newlib/libc/stdio/fclose.c delete mode 100644 newlib/libc/stdio/fdopen.c delete mode 100644 newlib/libc/stdio/feof.c delete mode 100644 newlib/libc/stdio/ferror.c delete mode 100644 newlib/libc/stdio/fflush.c delete mode 100644 newlib/libc/stdio/fgetc.c delete mode 100644 newlib/libc/stdio/fgetpos.c delete mode 100644 newlib/libc/stdio/fgets.c delete mode 100644 newlib/libc/stdio/fileno.c delete mode 100644 newlib/libc/stdio/findfp.c delete mode 100644 newlib/libc/stdio/fiprintf.c delete mode 100644 newlib/libc/stdio/flags.c delete mode 100644 newlib/libc/stdio/floatio.h delete mode 100644 newlib/libc/stdio/fopen.c delete mode 100644 newlib/libc/stdio/fprintf.c delete mode 100644 newlib/libc/stdio/fputc.c delete mode 100644 newlib/libc/stdio/fputs.c delete mode 100644 newlib/libc/stdio/fread.c delete mode 100644 newlib/libc/stdio/freopen.c delete mode 100644 newlib/libc/stdio/fscanf.c delete mode 100644 newlib/libc/stdio/fseek.c delete mode 100644 newlib/libc/stdio/fsetpos.c delete mode 100644 newlib/libc/stdio/ftell.c delete mode 100644 newlib/libc/stdio/fvwrite.c delete mode 100644 newlib/libc/stdio/fvwrite.h delete mode 100644 newlib/libc/stdio/fwalk.c delete mode 100644 newlib/libc/stdio/fwrite.c delete mode 100644 newlib/libc/stdio/getc.c delete mode 100644 newlib/libc/stdio/getchar.c delete mode 100644 newlib/libc/stdio/gets.c delete mode 100644 newlib/libc/stdio/getw.c delete mode 100644 newlib/libc/stdio/iprintf.c delete mode 100644 newlib/libc/stdio/local.h delete mode 100644 newlib/libc/stdio/makebuf.c delete mode 100644 newlib/libc/stdio/mktemp.c delete mode 100644 newlib/libc/stdio/perror.c delete mode 100644 newlib/libc/stdio/printf.c delete mode 100644 newlib/libc/stdio/putc.c delete mode 100644 newlib/libc/stdio/putchar.c delete mode 100644 newlib/libc/stdio/puts.c delete mode 100644 newlib/libc/stdio/putw.c delete mode 100644 newlib/libc/stdio/refill.c delete mode 100644 newlib/libc/stdio/remove.c delete mode 100644 newlib/libc/stdio/rename.c delete mode 100644 newlib/libc/stdio/rewind.c delete mode 100644 newlib/libc/stdio/rget.c delete mode 100644 newlib/libc/stdio/scanf.c delete mode 100644 newlib/libc/stdio/setbuf.c delete mode 100644 newlib/libc/stdio/setvbuf.c delete mode 100644 newlib/libc/stdio/siprintf.c delete mode 100644 newlib/libc/stdio/snprintf.c delete mode 100644 newlib/libc/stdio/sprintf.c delete mode 100644 newlib/libc/stdio/sscanf.c delete mode 100644 newlib/libc/stdio/stdio.c delete mode 100644 newlib/libc/stdio/stdio.tex delete mode 100644 newlib/libc/stdio/tmpfile.c delete mode 100644 newlib/libc/stdio/tmpnam.c delete mode 100644 newlib/libc/stdio/ungetc.c delete mode 100644 newlib/libc/stdio/vfieeefp.h delete mode 100644 newlib/libc/stdio/vfprintf.c delete mode 100644 newlib/libc/stdio/vfscanf.c delete mode 100644 newlib/libc/stdio/vprintf.c delete mode 100644 newlib/libc/stdio/vsnprintf.c delete mode 100644 newlib/libc/stdio/vsprintf.c delete mode 100644 newlib/libc/stdio/wbuf.c delete mode 100644 newlib/libc/stdio/wsetup.c (limited to 'newlib/libc/stdio') diff --git a/newlib/libc/stdio/Makefile.am b/newlib/libc/stdio/Makefile.am deleted file mode 100644 index 8461d4ace..000000000 --- a/newlib/libc/stdio/Makefile.am +++ /dev/null @@ -1,165 +0,0 @@ -## Process this file with automake to generate Makefile.in - -AUTOMAKE_OPTIONS = cygnus - -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) - -noinst_LIBRARIES = lib.a - -lib_a_SOURCES = \ - clearerr.c \ - fclose.c \ - fdopen.c \ - feof.c \ - ferror.c \ - fflush.c \ - fgetc.c \ - fgetpos.c \ - fgets.c \ - fileno.c \ - findfp.c \ - fiprintf.c \ - flags.c \ - fopen.c \ - fprintf.c \ - fputc.c \ - fputs.c \ - fread.c \ - freopen.c \ - fscanf.c \ - fseek.c \ - fsetpos.c \ - ftell.c \ - fvwrite.c \ - fwalk.c \ - fwrite.c \ - getc.c \ - getchar.c \ - gets.c \ - getw.c \ - iprintf.c \ - makebuf.c \ - mktemp.c \ - perror.c \ - printf.c \ - putc.c \ - putchar.c \ - puts.c \ - putw.c \ - refill.c \ - remove.c \ - rename.c \ - rewind.c \ - rget.c \ - scanf.c \ - setbuf.c \ - setvbuf.c \ - siprintf.c \ - snprintf.c \ - sprintf.c \ - sscanf.c \ - stdio.c \ - tmpfile.c \ - tmpnam.c \ - ungetc.c \ - vfprintf.c \ - vfscanf.c \ - vprintf.c \ - vsnprintf.c \ - vsprintf.c \ - wbuf.c \ - wsetup.c - -lib_a_LIBADD = vfiprintf.o - -vfiprintf.o: vfprintf.c - $(COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@ - -CHEWOUT_FILES = \ - clearerr.def \ - fclose.def \ - fdopen.def \ - feof.def \ - ferror.def \ - fflush.def \ - fgetc.def \ - fgetpos.def \ - fgets.def \ - fileno.def \ - fiprintf.def \ - fopen.def \ - fputc.def \ - fputs.def \ - fread.def \ - freopen.def \ - fseek.def \ - fsetpos.def \ - ftell.def \ - fwrite.def \ - getc.def \ - getchar.def \ - gets.def \ - getw.def \ - iprintf.def \ - mktemp.def \ - perror.def \ - putc.def \ - putchar.def \ - puts.def \ - putw.def \ - remove.def \ - rename.def \ - rewind.def \ - setbuf.def \ - setvbuf.def \ - siprintf.def \ - sprintf.def \ - sscanf.def \ - tmpfile.def \ - tmpnam.def \ - vfprintf.def - -SUFFIXES = .def - -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -TARGETDOC = ../tmp.texi - -doc: $(CHEWOUT_FILES) - cat $(srcdir)/stdio.tex >> $(TARGETDOC) - -CLEANFILES = $(CHEWOUT_FILES) *.ref - -fclose.o: local.h -fdopen.o: local.h -fflush.o: local.h -findfp.o: local.h -fopen.o: local.h -fputs.o: fvwrite.h -fread.o: local.h -freopen.o: local.h -fseek.o: local.h -ftell.o: local.h -fvwrite.o: local.h fvwrite.h -fwalk.o: local.h -fwrite.o: local.h fvwrite.h -makebuf.o: local.h -puts.o: fvwrite.h -refill.o: local.h -scanf.o: local.h -setbuf.o: local.h -setvbuf.o: local.h -siprintf.o: local.h -sprintf.o: local.h -sscanf.o: local.h -stdio.o: local.h -ungetc.o: local.h -vfiprintf.o: local.h -vfprintf.o: local.h -vfscanf.o: local.h floatio.h -wbuf.o: local.h fvwrite.h -wsetup.o: local.h diff --git a/newlib/libc/stdio/Makefile.in b/newlib/libc/stdio/Makefile.in deleted file mode 100644 index 2f487a19f..000000000 --- a/newlib/libc/stdio/Makefile.in +++ /dev/null @@ -1,445 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -CPP = @CPP@ -CRT0 = @CRT0@ -EXEEXT = @EXEEXT@ -LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ -LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ -LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ -LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ -LIBC_SYS_LIB = @LIBC_SYS_LIB@ -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ -machine_dir = @machine_dir@ -newlib_basedir = @newlib_basedir@ -sys_dir = @sys_dir@ - -AUTOMAKE_OPTIONS = cygnus - -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) - -noinst_LIBRARIES = lib.a - -lib_a_SOURCES = \ - clearerr.c \ - fclose.c \ - fdopen.c \ - feof.c \ - ferror.c \ - fflush.c \ - fgetc.c \ - fgetpos.c \ - fgets.c \ - fileno.c \ - findfp.c \ - fiprintf.c \ - flags.c \ - fopen.c \ - fprintf.c \ - fputc.c \ - fputs.c \ - fread.c \ - freopen.c \ - fscanf.c \ - fseek.c \ - fsetpos.c \ - ftell.c \ - fvwrite.c \ - fwalk.c \ - fwrite.c \ - getc.c \ - getchar.c \ - gets.c \ - getw.c \ - iprintf.c \ - makebuf.c \ - mktemp.c \ - perror.c \ - printf.c \ - putc.c \ - putchar.c \ - puts.c \ - putw.c \ - refill.c \ - remove.c \ - rename.c \ - rewind.c \ - rget.c \ - scanf.c \ - setbuf.c \ - setvbuf.c \ - siprintf.c \ - snprintf.c \ - sprintf.c \ - sscanf.c \ - stdio.c \ - tmpfile.c \ - tmpnam.c \ - ungetc.c \ - vfprintf.c \ - vfscanf.c \ - vprintf.c \ - vsnprintf.c \ - vsprintf.c \ - wbuf.c \ - wsetup.c - - -lib_a_LIBADD = vfiprintf.o - -CHEWOUT_FILES = \ - clearerr.def \ - fclose.def \ - fdopen.def \ - feof.def \ - ferror.def \ - fflush.def \ - fgetc.def \ - fgetpos.def \ - fgets.def \ - fileno.def \ - fiprintf.def \ - fopen.def \ - fputc.def \ - fputs.def \ - fread.def \ - freopen.def \ - fseek.def \ - fsetpos.def \ - ftell.def \ - fwrite.def \ - getc.def \ - getchar.def \ - gets.def \ - getw.def \ - iprintf.def \ - mktemp.def \ - perror.def \ - putc.def \ - putchar.def \ - puts.def \ - putw.def \ - remove.def \ - rename.def \ - rewind.def \ - setbuf.def \ - setvbuf.def \ - siprintf.def \ - sprintf.def \ - sscanf.def \ - tmpfile.def \ - tmpnam.def \ - vfprintf.def - - -SUFFIXES = .def - -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str - -TARGETDOC = ../tmp.texi - -CLEANFILES = $(CHEWOUT_FILES) *.ref -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -lib_a_DEPENDENCIES = vfiprintf.o -lib_a_OBJECTS = clearerr.o fclose.o fdopen.o feof.o ferror.o fflush.o \ -fgetc.o fgetpos.o fgets.o fileno.o findfp.o fiprintf.o flags.o fopen.o \ -fprintf.o fputc.o fputs.o fread.o freopen.o fscanf.o fseek.o fsetpos.o \ -ftell.o fvwrite.o fwalk.o fwrite.o getc.o getchar.o gets.o getw.o iprintf.o \ -makebuf.o mktemp.o perror.o printf.o putc.o putchar.o puts.o putw.o refill.o \ -remove.o rename.o rewind.o rget.o scanf.o setbuf.o setvbuf.o siprintf.o \ -snprintf.o sprintf.o sscanf.o stdio.o tmpfile.o tmpnam.o ungetc.o \ -vfprintf.o vfscanf.o vprintf.o vsnprintf.o vsprintf.o wbuf.o wsetup.o -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(lib_a_SOURCES) -OBJECTS = $(lib_a_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .def .o .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus stdio/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) - -rm -f lib.a - $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) - $(RANLIB) lib.a - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = stdio - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: -check: check-am -installcheck-am: -installcheck: installcheck-am -install-info-am: -install-info: install-info-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ - mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-generic clean-am - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-info-am install-info \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -vfiprintf.o: vfprintf.c - $(COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfprintf.c -o $@ - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -doc: $(CHEWOUT_FILES) - cat $(srcdir)/stdio.tex >> $(TARGETDOC) - -fclose.o: local.h -fdopen.o: local.h -fflush.o: local.h -findfp.o: local.h -fopen.o: local.h -fputs.o: fvwrite.h -fread.o: local.h -freopen.o: local.h -fseek.o: local.h -ftell.o: local.h -fvwrite.o: local.h fvwrite.h -fwalk.o: local.h -fwrite.o: local.h fvwrite.h -makebuf.o: local.h -puts.o: fvwrite.h -refill.o: local.h -scanf.o: local.h -setbuf.o: local.h -setvbuf.o: local.h -siprintf.o: local.h -sprintf.o: local.h -sscanf.o: local.h -stdio.o: local.h -ungetc.o: local.h -vfiprintf.o: local.h -vfprintf.o: local.h -vfscanf.o: local.h floatio.h -wbuf.o: local.h fvwrite.h -wsetup.o: local.h - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/newlib/libc/stdio/clearerr.c b/newlib/libc/stdio/clearerr.c deleted file mode 100644 index 861d9a211..000000000 --- a/newlib/libc/stdio/clearerr.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---clear file or stream error indicator - -INDEX - clearerr - -ANSI_SYNOPSIS - #include - void clearerr(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - void clearerr(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -The <> functions maintain an error indicator with each file -pointer <[fp]>, to record whether any read or write errors have -occurred on the associated file or stream. Similarly, it maintains an -end-of-file indicator to record whether there is no more data in the -file. - -Use <> to reset both of these indicators. - -See <> and <> to query the two indicators. - - -RETURNS -<> does not return a result. - -PORTABILITY -ANSI C requires <>. - -No supporting OS subroutines are required. -*/ - -#include -#undef clearerr - -_VOID -_DEFUN (clearerr, (fp), - FILE * fp) -{ - __sclearerr (fp); -} diff --git a/newlib/libc/stdio/fclose.c b/newlib/libc/stdio/fclose.c deleted file mode 100644 index 3266d8a55..000000000 --- a/newlib/libc/stdio/fclose.c +++ /dev/null @@ -1,82 +0,0 @@ -/* -FUNCTION -<>---close a file - -INDEX - fclose - -ANSI_SYNOPSIS - #include - int fclose(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fclose(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -If the file or stream identified by <[fp]> is open, <> closes -it, after first ensuring that any pending data is written (by calling -<)>>). - -RETURNS -<> returns <<0>> if successful (including when <[fp]> is -<> or not an open file); otherwise, it returns <>. - -PORTABILITY -<> is required by ANSI C. - -Required OS subroutines: <>, <>, <>, <>, -<>, <>, <>. -*/ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include "local.h" - -/* - * Close a file. - */ - -int -_DEFUN (fclose, (fp), - register FILE * fp) -{ - int r; - - if (fp == NULL) - return (0); /* on NULL */ - - CHECK_INIT (fp); - - if (fp->_flags == 0) /* not open! */ - return (0); - r = fp->_flags & __SWR ? fflush (fp) : 0; - if (fp->_close != NULL && (*fp->_close) (fp->_cookie) < 0) - r = EOF; - if (fp->_flags & __SMBF) - _free_r (fp->_data, (char *) fp->_bf._base); - if (HASUB (fp)) - FREEUB (fp); - if (HASLB (fp)) - FREELB (fp); - fp->_flags = 0; /* release this FILE for reuse */ - return (r); -} diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c deleted file mode 100644 index 410a5248a..000000000 --- a/newlib/libc/stdio/fdopen.c +++ /dev/null @@ -1,127 +0,0 @@ -/* -FUNCTION -<>---turn open file into a stream - -INDEX - fdopen -INDEX - _fdopen_r - -ANSI_SYNOPSIS - #include - FILE *fdopen(int <[fd]>, const char *<[mode]>); - FILE *_fdopen_r(void *<[reent]>, - int <[fd]>, const char *<[mode]>); - -TRAD_SYNOPSIS - #include - FILE *fdopen(<[fd]>, <[mode]>) - int <[fd]>; - char *<[mode]>; - - FILE *_fdopen_r(<[reent]>, <[fd]>, <[mode]>) - char *<[reent]>; - int <[fd]>; - char *<[mode]>); - -DESCRIPTION -<> produces a file descriptor of type <>, from a -descriptor for an already-open file (returned, for example, by the -system subroutine <> rather than by <>). -The <[mode]> argument has the same meanings as in <>. - -RETURNS -File pointer or <>, as for <>. - -PORTABILITY -<> is ANSI. -*/ - -#include -#include - -#include -#include -#include "local.h" -#include <_syslist.h> - -extern int __sflags (); - -FILE * -_DEFUN (_fdopen_r, (ptr, fd, mode), - struct _reent *ptr _AND - int fd _AND - _CONST char *mode) -{ - register FILE *fp; - int flags, oflags; -#ifdef F_GETFL - int fdflags, fdmode; -#endif - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - return 0; - - /* make sure the mode the user wants is a subset of the actual mode */ -#ifdef F_GETFL - if ((fdflags = _fcntl (fd, F_GETFL, 0)) < 0) - return 0; - fdmode = fdflags & O_ACCMODE; - if (fdmode != O_RDWR && (fdmode != (oflags & O_ACCMODE))) - { - ptr->_errno = EBADF; - return 0; - } -#endif - - if ((fp = __sfp (ptr)) == 0) - return 0; - fp->_flags = flags; - /* - * If opened for appending, but underlying descriptor - * does not have O_APPEND bit set, assert __SAPP so that - * __swrite() will lseek to end before each write. - */ - if ((oflags & O_APPEND) -#ifdef F_GETFL - && !(fdflags & O_APPEND) -#endif - ) - fp->_flags |= __SAPP; - fp->_file = fd; - fp->_cookie = (_PTR) fp; - -#undef _read -#undef _write -#undef _seek -#undef _close - - fp->_read = __sread; - fp->_write = __swrite; - fp->_seek = __sseek; - fp->_close = __sclose; - -#ifdef __SCLE - /* Explicit given mode results in explicit setting mode on fd */ - if (oflags & O_BINARY) - setmode(fp->_file, O_BINARY); - else if (oflags & O_TEXT) - setmode(fp->_file, O_TEXT); - if (__stextmode(fp->_file)) - fp->_flags |= __SCLE; -#endif - - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN (fdopen, (fd, mode), - int fd _AND - _CONST char *mode) -{ - return _fdopen_r (_REENT, fd, mode); -} - -#endif diff --git a/newlib/libc/stdio/feof.c b/newlib/libc/stdio/feof.c deleted file mode 100644 index 55f151bd4..000000000 --- a/newlib/libc/stdio/feof.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -FUNCTION -<>---test for end of file - -INDEX - feof - -ANSI_SYNOPSIS - #include - int feof(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int feof(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -<> tests whether or not the end of the file identified by <[fp]> -has been reached. - -RETURNS -<> returns <<0>> if the end of file has not yet been reached; if -at end of file, the result is nonzero. - -PORTABILITY -<> is required by ANSI C. - -No supporting OS subroutines are required. -*/ - -#include - -#undef feof - -int -_DEFUN (feof, (fp), - FILE * fp) -{ - return __sfeof (fp); -} diff --git a/newlib/libc/stdio/ferror.c b/newlib/libc/stdio/ferror.c deleted file mode 100644 index 19fa78d14..000000000 --- a/newlib/libc/stdio/ferror.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---test whether read/write error has occurred - -INDEX - ferror - -ANSI_SYNOPSIS - #include - int ferror(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int ferror(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -The <> functions maintain an error indicator with each file -pointer <[fp]>, to record whether any read or write errors have -occurred on the associated file or stream. -Use <> to query this indicator. - -See <> to reset the error indicator. - -RETURNS -<> returns <<0>> if no errors have occurred; it returns a -nonzero value otherwise. - -PORTABILITY -ANSI C requires <>. - -No supporting OS subroutines are required. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -/* A subroutine version of the macro ferror. */ - -#undef ferror - -int -_DEFUN (ferror, (fp), - FILE * fp) -{ - return __sferror (fp); -} diff --git a/newlib/libc/stdio/fflush.c b/newlib/libc/stdio/fflush.c deleted file mode 100644 index 635e5a738..000000000 --- a/newlib/libc/stdio/fflush.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---flush buffered file output - -INDEX - fflush - -ANSI_SYNOPSIS - #include - int fflush(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fflush(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -The <> output functions can buffer output before delivering it -to the host system, in order to minimize the overhead of system calls. - -Use <> to deliver any such pending output (for the file -or stream identified by <[fp]>) to the host system. - -If <[fp]> is <>, <> delivers pending output from all -open files. - -RETURNS -<> returns <<0>> unless it encounters a write error; in that -situation, it returns <>. - -PORTABILITY -ANSI C requires <>. - -No supporting OS subroutines are required. -*/ - -#include -#include "local.h" - -/* Flush a single file, or (if fp is NULL) all files. */ - -int -_DEFUN (fflush, (fp), - register FILE * fp) -{ - register unsigned char *p; - register int n, t; - - - - - if (fp == NULL) - return _fwalk (_REENT, fflush); - - CHECK_INIT (fp); - - t = fp->_flags; - if ((t & __SWR) == 0 || (p = fp->_bf._base) == NULL) - return 0; - n = fp->_p - p; /* write this much */ - - /* - * Set these immediately to avoid problems with longjmp - * and to allow exchange buffering (via setvbuf) in user - * write function. - */ - fp->_p = p; - fp->_w = t & (__SLBF | __SNBF) ? 0 : fp->_bf._size; - - while (n > 0) - { - t = (*fp->_write) (fp->_cookie, (char *) p, n); - if (t <= 0) - { - fp->_flags |= __SERR; - return EOF; - } - p += t; - n -= t; - } - return 0; -} diff --git a/newlib/libc/stdio/fgetc.c b/newlib/libc/stdio/fgetc.c deleted file mode 100644 index 3d3d2c4ed..000000000 --- a/newlib/libc/stdio/fgetc.c +++ /dev/null @@ -1,46 +0,0 @@ -/* -FUNCTION -<>---get a character from a file or stream - -INDEX - fgetc - -ANSI_SYNOPSIS - #include - int fgetc(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fgetc(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -Use <> to get the next single character from the file or stream -identified by <[fp]>. As a side effect, <> advances the file's -current position indicator. - -For a macro version of this function, see <>. - -RETURNS -The next character (read as an <>, and cast to -<>), unless there is no more data, or the host system reports a -read error; in either of these situations, <> returns <>. - -You can distinguish the two situations that cause an <> result by -using the <> and <> functions. - -PORTABILITY -ANSI C requires <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include - -int -_DEFUN (fgetc, (fp), - FILE * fp) -{ - return __sgetc (fp); -} diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c deleted file mode 100644 index 214021a84..000000000 --- a/newlib/libc/stdio/fgetpos.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -FUNCTION -<>---record position in a stream or file - -INDEX - fgetpos - -ANSI_SYNOPSIS - #include - int fgetpos(FILE *<[fp]>, fpos_t *<[pos]>); - -TRAD_SYNOPSIS - #include - int fgetpos(<[fp]>, <[pos]>) - FILE *<[fp]>; - fpos_t *<[pos]>; - -DESCRIPTION -Objects of type <> can have a ``position'' that records how much -of the file your program has already read. Many of the <> functions -depend on this position, and many change it as a side effect. - -You can use <> to report on the current position for a file -identified by <[fp]>; <> will write a value -representing that position at <<*<[pos]>>>. Later, you can -use this value with <> to return the file to this -position. - -In the current implementation, <> simply uses a character -count to represent the file position; this is the same number that -would be returned by <>. - -RETURNS -<> returns <<0>> when successful. If <> fails, the -result is <<1>>. Failure occurs on streams that do not support -positioning; the global <> indicates this condition with the -value <>. - -PORTABILITY -<> is required by the ANSI C standard, but the meaning of the -value it records is not specified beyond requiring that it be -acceptable as an argument to <>. In particular, other -conforming C implementations may return a different result from -<> than what <> writes at <<*<[pos]>>>. - -No supporting OS subroutines are required. -*/ - -#include - -int -_DEFUN (fgetpos, (fp, pos), - FILE * fp _AND - fpos_t * pos) -{ - *pos = ftell (fp); - - if (*pos != -1) - return 0; - return 1; -} diff --git a/newlib/libc/stdio/fgets.c b/newlib/libc/stdio/fgets.c deleted file mode 100644 index d395d3344..000000000 --- a/newlib/libc/stdio/fgets.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - -FUNCTION - <>---get character string from a file or stream -INDEX - fgets - -ANSI_SYNOPSIS - #include - char *fgets(char *<[buf]>, int <[n]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - char *fgets(<[buf]>,<[n]>,<[fp]>) - char *<[buf]>; - int <[n]>; - FILE *<[fp]>; - -DESCRIPTION - Reads at most <[n-1]> characters from <[fp]> until a newline - is found. The characters including to the newline are stored - in <[buf]>. The buffer is terminated with a 0. - - -RETURNS - <> returns the buffer passed to it, with the data - filled in. If end of file occurs with some data already - accumulated, the data is returned with no other indication. If - no data are read, NULL is returned instead. - -PORTABILITY - <> should replace all uses of <>. Note however - that <> returns all of the data, while <> removes - the trailing newline (with no indication that it has done so.) - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#include - -extern int __srefill (); - -/* - * Read at most n-1 characters from the given file. - * Stop when a newline has been read, or the count runs out. - * Return first argument, or NULL if no characters were read. - */ - -char * -_DEFUN (fgets, (buf, n, fp), - char *buf _AND - int n _AND - FILE * fp) -{ - size_t len; - char *s; - unsigned char *p, *t; - - if (n < 2) /* sanity check */ - return 0; - - s = buf; - -#ifdef __SCLE - if (fp->_flags & __SCLE) - { - int c; - /* Sorry, have to do it the slow way */ - while (--n > 0 && (c = __sgetc(fp)) != EOF) - { - *s++ = c; - if (c == '\n') - break; - } - if (c == EOF && s == buf) - return NULL; - *s = 0; - return buf; - } -#endif - - n--; /* leave space for NUL */ - do - { - /* - * If the buffer is empty, refill it. - */ - if ((len = fp->_r) <= 0) - { - if (__srefill (fp)) - { - /* EOF: stop with partial or no line */ - if (s == buf) - return 0; - break; - } - len = fp->_r; - } - p = fp->_p; - - /* - * Scan through at most n bytes of the current buffer, - * looking for '\n'. If found, copy up to and including - * newline, and stop. Otherwise, copy entire chunk - * and loop. - */ - if (len > n) - len = n; - t = (unsigned char *) memchr ((_PTR) p, '\n', len); - if (t != 0) - { - len = ++t - p; - fp->_r -= len; - fp->_p = t; - (void) memcpy ((_PTR) s, (_PTR) p, len); - s[len] = 0; - return (buf); - } - fp->_r -= len; - fp->_p += len; - (void) memcpy ((_PTR) s, (_PTR) p, len); - s += len; - } - while ((n -= len) != 0); - *s = 0; - return buf; -} diff --git a/newlib/libc/stdio/fileno.c b/newlib/libc/stdio/fileno.c deleted file mode 100644 index d578c3ede..000000000 --- a/newlib/libc/stdio/fileno.c +++ /dev/null @@ -1,40 +0,0 @@ -/* -FUNCTION -<>---return file descriptor associated with stream - -INDEX - fileno - -ANSI_SYNOPSIS - #include - int fileno(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fileno(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -You can use <> to return the file descriptor identified by <[fp]>. - -RETURNS -<> returns a non-negative integer when successful. -If <[fp]> is not an open stream, <> returns -1. - -PORTABILITY -<> is not part of ANSI C. -POSIX requires <>. - -Supporting OS subroutines required: none. -*/ - -#include -#include "local.h" - -int -_DEFUN (fileno, (f), - FILE * f) -{ - CHECK_INIT (f); - return __sfileno (f); -} diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c deleted file mode 100644 index 64abb1c6b..000000000 --- a/newlib/libc/stdio/findfp.c +++ /dev/null @@ -1,161 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include -#include -#include -#include "local.h" - -static void -std (ptr, flags, file, data) - FILE *ptr; - int flags; - int file; - struct _reent *data; -{ - ptr->_p = 0; - ptr->_r = 0; - ptr->_w = 0; - ptr->_flags = flags; - ptr->_file = file; - ptr->_bf._base = 0; - ptr->_bf._size = 0; - ptr->_lbfsize = 0; - ptr->_cookie = ptr; - ptr->_read = __sread; - ptr->_write = __swrite; - ptr->_seek = __sseek; - ptr->_close = __sclose; - ptr->_data = data; - -#ifdef __SCLE - if (__stextmode(ptr->_file)) - ptr->_flags |= __SCLE; -#endif -} - -struct _glue * -__sfmoreglue (d, n) - struct _reent *d; - register int n; -{ - struct _glue *g; - FILE *p; - - g = (struct _glue *) _malloc_r (d, sizeof (*g) + n * sizeof (FILE)); - if (g == NULL) - return NULL; - p = (FILE *) (g + 1); - g->_next = NULL; - g->_niobs = n; - g->_iobs = p; - memset (p, 0, n * sizeof (FILE)); - return g; -} - -/* - * Find a free FILE for fopen et al. - */ - -FILE * -__sfp (d) - struct _reent *d; -{ - FILE *fp; - int n; - struct _glue *g; - - if (!d->__sdidinit) - __sinit (d); - for (g = &d->__sglue;; g = g->_next) - { - for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) - if (fp->_flags == 0) - goto found; - if (g->_next == NULL && - (g->_next = __sfmoreglue (d, NDYNAMIC)) == NULL) - break; - } - d->_errno = ENOMEM; - return NULL; - -found: - fp->_flags = 1; /* reserve this slot; caller sets real flags */ - fp->_p = NULL; /* no current pointer */ - fp->_w = 0; /* nothing to read or write */ - fp->_r = 0; - fp->_bf._base = NULL; /* no buffer */ - fp->_bf._size = 0; - fp->_lbfsize = 0; /* not line buffered */ - fp->_file = -1; /* no file */ - /* fp->_cookie = ; */ /* caller sets cookie, _read/_write etc */ - fp->_ub._base = NULL; /* no ungetc buffer */ - fp->_ub._size = 0; - fp->_lb._base = NULL; /* no line buffer */ - fp->_lb._size = 0; - fp->_data = d; - return fp; -} - -/* - * exit() calls _cleanup() through *__cleanup, set whenever we - * open or buffer a file. This chicanery is done so that programs - * that do not use stdio need not link it all in. - * - * The name `_cleanup' is, alas, fairly well known outside stdio. - */ - -void -_cleanup_r (ptr) - struct _reent *ptr; -{ - /* (void) _fwalk(fclose); */ - (void) _fwalk (ptr, fflush); /* `cheating' */ -} - -#ifndef _REENT_ONLY -void -_cleanup () -{ - _cleanup_r (_REENT); -} -#endif - -/* - * __sinit() is called whenever stdio's internal variables must be set up. - */ - -void -__sinit (s) - struct _reent *s; -{ - /* make sure we clean up on exit */ - s->__cleanup = _cleanup_r; /* conservative */ - s->__sdidinit = 1; - - std (s->__sf + 0, __SRD, 0, s); - std (s->__sf + 1, __SWR | __SLBF, 1, s); - std (s->__sf + 2, __SWR | __SNBF, 2, s); - - s->__sglue._next = NULL; - s->__sglue._niobs = 3; - s->__sglue._iobs = &s->__sf[0]; -} diff --git a/newlib/libc/stdio/fiprintf.c b/newlib/libc/stdio/fiprintf.c deleted file mode 100644 index d490ef403..000000000 --- a/newlib/libc/stdio/fiprintf.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -FUNCTION - <>---format output to file (integer only) -INDEX - fiprintf - -ANSI_SYNOPSIS - #include - - int fiprintf(FILE *<[fd]>, const char *<[format]>, ...); - -TRAD_SYNOPSIS - #include - - int fiprintf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - char *<[format]>; - -DESCRIPTION -<> is a restricted version of <>: it has the same -arguments and behavior, save that it cannot perform any floating-point -formatting---the <>, <>, <>, <>, and <> type specifiers -are not recognized. - -RETURNS - <> returns the number of bytes in the output string, - save that the concluding <> is not counted. - <> returns when the end of the format string is - encountered. If an error occurs, <> - returns <>. - -PORTABILITY -<> is not required by ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include <_ansi.h> -#include - -#ifdef _HAVE_STDC - -#include - -int -fiprintf (FILE * fp, const char *fmt,...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - ret = vfiprintf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -fiprintf (fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - ret = vfiprintf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#endif diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c deleted file mode 100644 index e448cca80..000000000 --- a/newlib/libc/stdio/flags.c +++ /dev/null @@ -1,87 +0,0 @@ -/* No user fns here. Pesch 15apr92 */ - -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include - -#include -#include - -/* - * Return the (stdio) flags for a given mode. Store the flags - * to be passed to an open() syscall through *optr. - * Return 0 on error. - */ - -int -__sflags (ptr, mode, optr) - struct _reent *ptr; - register char *mode; - int *optr; -{ - register int ret, m, o; - - switch (mode[0]) - { - case 'r': /* open for reading */ - ret = __SRD; - m = O_RDONLY; - o = 0; - break; - - case 'w': /* open for writing */ - ret = __SWR; - m = O_WRONLY; - o = O_CREAT | O_TRUNC; - break; - - case 'a': /* open for appending */ - ret = __SWR | __SAPP; - m = O_WRONLY; - o = O_CREAT | O_APPEND; - break; - default: /* illegal mode */ - ptr->_errno = EINVAL; - return (0); - } - if (mode[1] && (mode[1] == '+' || mode[2] == '+')) - { - ret = __SRW; - m = O_RDWR; - } - if (mode[1] && (mode[1] == 'b' || mode[2] == 'b')) - { -#ifdef O_BINARY - m |= O_BINARY; -#endif - } -#ifdef __CYGWIN__ - else if (mode[1] && (mode[1] == 't' || mode[2] == 't')) -#else - else -#endif - { -#ifdef O_TEXT - m |= O_TEXT; -#endif - } - *optr = m | o; - return ret; -} diff --git a/newlib/libc/stdio/floatio.h b/newlib/libc/stdio/floatio.h deleted file mode 100644 index d9577b2b2..000000000 --- a/newlib/libc/stdio/floatio.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * %W% (Berkeley) %G% - */ - -/* - * Floating point scanf/printf (input/output) definitions. - */ - -/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ -#define MAXEXP 308 -/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ -#define MAXFRACT 39 diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c deleted file mode 100644 index e4708785d..000000000 --- a/newlib/libc/stdio/fopen.c +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---open a file - -INDEX - fopen -INDEX - _fopen_r - -ANSI_SYNOPSIS - #include - FILE *fopen(const char *<[file]>, const char *<[mode]>); - - FILE *_fopen_r(void *<[reent]>, - const char *<[file]>, const char *<[mode]>); - -TRAD_SYNOPSIS - #include - FILE *fopen(<[file]>, <[mode]>) - char *<[file]>; - char *<[mode]>; - - FILE *_fopen_r(<[reent]>, <[file]>, <[mode]>) - char *<[reent]>; - char *<[file]>; - char *<[mode]>; - -DESCRIPTION -<> initializes the data structures needed to read or write a -file. Specify the file's name as the string at <[file]>, and the kind -of access you need to the file with the string at <[mode]>. - -The alternate function <<_fopen_r>> is a reentrant version. -The extra argument <[reent]> is a pointer to a reentrancy structure. - -Three fundamental kinds of access are available: read, write, and append. -<<*<[mode]>>> must begin with one of the three characters `<>', -`<>', or `<>', to select one of these: - -o+ -o r -Open the file for reading; the operation will fail if the file does -not exist, or if the host system does not permit you to read it. - -o w -Open the file for writing @emph{from the beginning} of the file: -effectively, this always creates a new file. If the file whose name you -specified already existed, its old contents are discarded. - -o a -Open the file for appending data, that is writing from the end of -file. When you open a file this way, all data always goes to the -current end of file; you cannot change this using <>. -o- - -Some host systems distinguish between ``binary'' and ``text'' files. -Such systems may perform data transformations on data written to, or -read from, files opened as ``text''. -If your system is one of these, then you can append a `<>' to any -of the three modes above, to specify that you are opening the file as -a binary file (the default is to open the file as a text file). - -`<>', then, means ``read binary''; `<>', ``write binary''; and -`<>', ``append binary''. - -To make C programs more portable, the `<>' is accepted on all -systems, whether or not it makes a difference. - -Finally, you might need to both read and write from the same file. -You can also append a `<<+>>' to any of the three modes, to permit -this. (If you want to append both `<>' and `<<+>>', you can do it -in either order: for example, <<"rb+">> means the same thing as -<<"r+b">> when used as a mode string.) - -Use <<"r+">> (or <<"rb+">>) to permit reading and writing anywhere in -an existing file, without discarding any data; <<"w+">> (or <<"wb+">>) -to create a new file (or begin by discarding all data from an old one) -that permits reading and writing anywhere in it; and <<"a+">> (or -<<"ab+">>) to permit reading anywhere in an existing file, but writing -only at the end. - -RETURNS -<> returns a file pointer which you can use for other file -operations, unless the file you requested could not be opened; in that -situation, the result is <>. If the reason for failure was an -invalid string at <[mode]>, <> is set to <>. - -PORTABILITY -<> is required by ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include "local.h" -#ifdef __CYGWIN__ -#include -#endif - -FILE * -_DEFUN (_fopen_r, (ptr, file, mode), - struct _reent *ptr _AND - _CONST char *file _AND - _CONST char *mode) -{ - register FILE *fp; - register int f; - int flags, oflags; - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - return NULL; - if ((fp = __sfp (ptr)) == NULL) - return NULL; - - if ((f = _open_r (fp->_data, file, oflags, 0666)) < 0) - { - fp->_flags = 0; /* release */ - return NULL; - } - - fp->_file = f; - fp->_flags = flags; - fp->_cookie = (_PTR) fp; - fp->_read = __sread; - fp->_write = __swrite; - fp->_seek = __sseek; - fp->_close = __sclose; - - if (fp->_flags & __SAPP) - fseek (fp, 0, SEEK_END); - -#ifdef __SCLE - if (__stextmode (fp->_file)) - fp->_flags |= __SCLE; -#endif - - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN (fopen, (file, mode), - _CONST char *file _AND - _CONST char *mode) -{ - return _fopen_r (_REENT, file, mode); -} - -#endif diff --git a/newlib/libc/stdio/fprintf.c b/newlib/libc/stdio/fprintf.c deleted file mode 100644 index de036605f..000000000 --- a/newlib/libc/stdio/fprintf.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <_ansi.h> -#include - -#ifdef _HAVE_STDC - -#include - -int -fprintf (FILE * fp, const char *fmt,...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - ret = vfprintf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -fprintf (fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - ret = vfprintf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#endif diff --git a/newlib/libc/stdio/fputc.c b/newlib/libc/stdio/fputc.c deleted file mode 100644 index 966a0dbf7..000000000 --- a/newlib/libc/stdio/fputc.c +++ /dev/null @@ -1,51 +0,0 @@ -/* -FUNCTION -<>---write a character on a stream or file - -INDEX - fputc - -ANSI_SYNOPSIS - #include - int fputc(int <[ch]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fputc(<[ch]>, <[fp]>) - int <[ch]>; - FILE *<[fp]>; - -DESCRIPTION -<> converts the argument <[ch]> from an <> to an -<>, then writes it to the file or stream identified by -<[fp]>. - -If the file was opened with append mode (or if the stream cannot -support positioning), then the new character goes at the end of the -file or stream. Otherwise, the new character is written at the -current value of the position indicator, and the position indicator -oadvances by one. - -For a macro version of this function, see <>. - -RETURNS -If successful, <> returns its argument <[ch]>. If an error -intervenes, the result is <>. You can use `<)>>' to -query for errors. - -PORTABILITY -<> is required by ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include - -int -_DEFUN (fputc, (ch, file), - int ch _AND - FILE * file) -{ - return putc (ch, file); -} diff --git a/newlib/libc/stdio/fputs.c b/newlib/libc/stdio/fputs.c deleted file mode 100644 index 62ce98fb7..000000000 --- a/newlib/libc/stdio/fputs.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write a character string in a file or stream - -INDEX - fputs - -ANSI_SYNOPSIS - #include - int fputs(const char *<[s]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int fputs(<[s]>, <[fp]>) - char *<[s]>; - FILE *<[fp]>; - -DESCRIPTION -<> writes the string at <[s]> (but without the trailing null) -to the file or stream identified by <[fp]>. - -RETURNS -If successful, the result is <<0>>; otherwise, the result is <>. - -PORTABILITY -ANSI C requires <>, but does not specify that the result on -success must be <<0>>; any non-negative value is permitted. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#include -#include "fvwrite.h" - -/* - * Write the given string to the given file. - */ - -int -_DEFUN (fputs, (s, fp), - char _CONST * s _AND - FILE * fp) -{ - struct __suio uio; - struct __siov iov; - - iov.iov_base = s; - iov.iov_len = uio.uio_resid = strlen (s); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - return __sfvwrite (fp, &uio); -} diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c deleted file mode 100644 index c4c66b4d6..000000000 --- a/newlib/libc/stdio/fread.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---read array elements from a file - -INDEX - fread - -ANSI_SYNOPSIS - #include - size_t fread(void *<[buf]>, size_t <[size]>, size_t <[count]>, - FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - size_t fread(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - -DESCRIPTION -<> attempts to copy, from the file or stream identified by -<[fp]>, <[count]> elements (each of size <[size]>) into memory, -starting at <[buf]>. <> may copy fewer elements than -<[count]> if an error, or end of file, intervenes. - -<> also advances the file position indicator (if any) for -<[fp]> by the number of @emph{characters} actually read. - -RETURNS -The result of <> is the number of elements it succeeded in -reading. - -PORTABILITY -ANSI C requires <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#include -#include "local.h" - -#ifdef __SCLE -static size_t -_DEFUN (crlf, (fp, buf, count, eof), - FILE * fp _AND - char * buf _AND - size_t count _AND - int eof) -{ - int newcount = 0, r; - char *s, *d, *e; - - if (count == 0) - return 0; - - e = buf + count; - for (s=d=buf; s_r < 0) - fp->_r = 0; - total = resid; - p = buf; - - while (resid > (r = fp->_r)) - { - (void) memcpy ((void *) p, (void *) fp->_p, (size_t) r); - fp->_p += r; - /* fp->_r = 0 ... done in __srefill */ - p += r; - resid -= r; - if (__srefill (fp)) - { - /* no more input: return partial result */ -#ifdef __SCLE - if (fp->_flags & __SCLE) - return crlf(fp, buf, total-resid, 1) / size; -#endif - return (total - resid) / size; - } - } - (void) memcpy ((void *) p, (void *) fp->_p, resid); - fp->_r -= resid; - fp->_p += resid; -#ifdef __SCLE - if (fp->_flags & __SCLE) - return crlf(fp, buf, total, 0) / size; -#endif - return count; -} diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c deleted file mode 100644 index 63f583375..000000000 --- a/newlib/libc/stdio/freopen.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---open a file using an existing file descriptor - -INDEX - freopen - -ANSI_SYNOPSIS - #include - FILE *freopen(const char *<[file]>, const char *<[mode]>, - FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - FILE *freopen(<[file]>, <[mode]>, <[fp]>) - char *<[file]>; - char *<[mode]>; - FILE *<[fp]>; - -DESCRIPTION -Use this variant of <> if you wish to specify a particular file -descriptor <[fp]> (notably <>, <>, or <>) for -the file. - -If <[fp]> was associated with another file or stream, <> -closes that other file or stream (but ignores any errors while closing -it). - -<[file]> and <[mode]> are used just as in <>. - -RETURNS -If successful, the result is the same as the argument <[fp]>. If the -file cannot be opened as specified, the result is <>. - -PORTABILITY -ANSI C requires <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>, <>. -*/ - -#include -#include -#include -#include -#include "local.h" - -/* - * Re-direct an existing, open (probably) file to some other file. - */ - -FILE * -_DEFUN (freopen, (file, mode, fp), - _CONST char *file _AND - _CONST char *mode _AND - register FILE *fp) -{ - register int f; - int flags, oflags, e; - struct _reent *ptr; - - CHECK_INIT (fp); - ptr = fp->_data; - - if ((flags = __sflags (ptr, mode, &oflags)) == 0) - { - (void) fclose (fp); - return NULL; - } - - /* - * Remember whether the stream was open to begin with, and - * which file descriptor (if any) was associated with it. - * If it was attached to a descriptor, defer closing it, - * so that, e.g., freopen("/dev/stdin", "r", stdin) works. - * This is unnecessary if it was not a Unix file. - */ - - if (fp->_flags == 0) - fp->_flags = __SEOF; /* hold on to it */ - else - { - if (fp->_flags & __SWR) - (void) fflush (fp); - /* if close is NULL, closing is a no-op, hence pointless */ - if (fp->_close != NULL) - (void) (*fp->_close) (fp->_cookie); - } - - /* - * Now get a new descriptor to refer to the new file. - */ - - f = _open_r (ptr, (char *) file, oflags, 0666); - e = ptr->_errno; - - /* - * Finish closing fp. Even if the open succeeded above, - * we cannot keep fp->_base: it may be the wrong size. - * This loses the effect of any setbuffer calls, - * but stdio has always done this before. - */ - - if (fp->_flags & __SMBF) - _free_r (ptr, (char *) fp->_bf._base); - fp->_w = 0; - fp->_r = 0; - fp->_p = NULL; - fp->_bf._base = NULL; - fp->_bf._size = 0; - fp->_lbfsize = 0; - if (HASUB (fp)) - FREEUB (fp); - fp->_ub._size = 0; - if (HASLB (fp)) - FREELB (fp); - fp->_lb._size = 0; - - if (f < 0) - { /* did not get it after all */ - fp->_flags = 0; /* set it free */ - ptr->_errno = e; /* restore in case _close clobbered */ - return NULL; - } - - fp->_flags = flags; - fp->_file = f; - fp->_cookie = (_PTR) fp; - fp->_read = __sread; - fp->_write = __swrite; - fp->_seek = __sseek; - fp->_close = __sclose; - -#ifdef __SCLE - if (__stextmode(fp->_file)) - fp->_flags |= __SCLE; -#endif - - return fp; -} diff --git a/newlib/libc/stdio/fscanf.c b/newlib/libc/stdio/fscanf.c deleted file mode 100644 index 8980410d3..000000000 --- a/newlib/libc/stdio/fscanf.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <_ansi.h> -#include - -#ifdef _HAVE_STDC - -#include - -extern int __svfscanf (); - -int -fscanf (FILE * fp, const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - ret = __svfscanf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -extern int __svfscanf (); - -int -fscanf (fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - ret = __svfscanf (fp, fmt, ap); - va_end (ap); - return ret; -} - -#endif diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c deleted file mode 100644 index d22292e97..000000000 --- a/newlib/libc/stdio/fseek.c +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---set file position - -INDEX - fseek - -ANSI_SYNOPSIS - #include - int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>) - -TRAD_SYNOPSIS - #include - int fseek(<[fp]>, <[offset]>, <[whence]>) - FILE *<[fp]>; - long <[offset]>; - int <[whence]>; - -DESCRIPTION -Objects of type <> can have a ``position'' that records how much -of the file your program has already read. Many of the <> functions -depend on this position, and many change it as a side effect. - -You can use <> to set the position for the file identified by -<[fp]>. The value of <[offset]> determines the new position, in one -of three ways selected by the value of <[whence]> (defined as macros -in `<>'): - -<>---<[offset]> is the absolute file position (an offset -from the beginning of the file) desired. <[offset]> must be positive. - -<>---<[offset]> is relative to the current file position. -<[offset]> can meaningfully be either positive or negative. - -<>---<[offset]> is relative to the current end of file. -<[offset]> can meaningfully be either positive (to increase the size -of the file) or negative. - -See <> to determine the current file position. - -RETURNS -<> returns <<0>> when successful. If <> fails, the -result is <>. The reason for failure is indicated in <>: -either <> (the stream identified by <[fp]> doesn't support -repositioning) or <> (invalid file position). - -PORTABILITY -ANSI C requires <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#include -#include -#include -#include -#include -#include "local.h" - -#define POS_ERR (-(fpos_t)1) - -/* - * Seek the given file to the given offset. - * `Whence' must be one of the three SEEK_* macros. - */ - -int -fseek (fp, offset, whence) - register FILE *fp; - long offset; - int whence; -{ - struct _reent *ptr; - fpos_t _EXFUN ((*seekfn), (void *, fpos_t, int)); - fpos_t target, curoff; - size_t n; - struct stat st; - int havepos; - - /* Make sure stdio is set up. */ - - CHECK_INIT (fp); - ptr = fp->_data; - - /* If we've been doing some writing, and we're in append mode - then we don't really know where the filepos is. */ - - if (fp->_flags & __SAPP && fp->_flags & __SWR) - { - /* So flush the buffer and seek to the end. */ - fflush (fp); - } - - /* Have to be able to seek. */ - - if ((seekfn = fp->_seek) == NULL) - { - ptr->_errno = ESPIPE; /* ??? */ - return EOF; - } - - /* - * Change any SEEK_CUR to SEEK_SET, and check `whence' argument. - * After this, whence is either SEEK_SET or SEEK_END. - */ - - switch (whence) - { - case SEEK_CUR: - /* - * In order to seek relative to the current stream offset, - * we have to first find the current stream offset a la - * ftell (see ftell for details). - */ - fflush(fp); /* may adjust seek offset on append stream */ - if (fp->_flags & __SOFF) - curoff = fp->_offset; - else - { - curoff = (*seekfn) (fp->_cookie, (fpos_t) 0, SEEK_CUR); - if (curoff == -1L) - return EOF; - } - if (fp->_flags & __SRD) - { - curoff -= fp->_r; - if (HASUB (fp)) - curoff -= fp->_ur; - } - else if (fp->_flags & __SWR && fp->_p != NULL) - curoff += fp->_p - fp->_bf._base; - - offset += curoff; - whence = SEEK_SET; - havepos = 1; - break; - - case SEEK_SET: - case SEEK_END: - havepos = 0; - break; - - default: - ptr->_errno = EINVAL; - return (EOF); - } - - /* - * Can only optimise if: - * reading (and not reading-and-writing); - * not unbuffered; and - * this is a `regular' Unix file (and hence seekfn==__sseek). - * We must check __NBF first, because it is possible to have __NBF - * and __SOPT both set. - */ - - if (fp->_bf._base == NULL) - __smakebuf (fp); - if (fp->_flags & (__SWR | __SRW | __SNBF | __SNPT)) - goto dumb; - if ((fp->_flags & __SOPT) == 0) - { - if (seekfn != __sseek - || fp->_file < 0 - || _fstat_r (ptr, fp->_file, &st) - || (st.st_mode & S_IFMT) != S_IFREG) - { - fp->_flags |= __SNPT; - goto dumb; - } -#ifdef HAVE_BLKSIZE - fp->_blksize = st.st_blksize; -#else - fp->_blksize = 1024; -#endif - fp->_flags |= __SOPT; - } - - /* - * We are reading; we can try to optimise. - * Figure out where we are going and where we are now. - */ - - if (whence == SEEK_SET) - target = offset; - else - { - if (_fstat_r (ptr, fp->_file, &st)) - goto dumb; - target = st.st_size + offset; - } - - if (!havepos) - { - if (fp->_flags & __SOFF) - curoff = fp->_offset; - else - { - curoff = (*seekfn) (fp->_cookie, 0L, SEEK_CUR); - if (curoff == POS_ERR) - goto dumb; - } - curoff -= fp->_r; - if (HASUB (fp)) - curoff -= fp->_ur; - } - - /* - * Compute the number of bytes in the input buffer (pretending - * that any ungetc() input has been discarded). Adjust current - * offset backwards by this count so that it represents the - * file offset for the first byte in the current input buffer. - */ - - if (HASUB (fp)) - { - curoff += fp->_r; /* kill off ungetc */ - n = fp->_up - fp->_bf._base; - curoff -= n; - n += fp->_ur; - } - else - { - n = fp->_p - fp->_bf._base; - curoff -= n; - n += fp->_r; - } - - /* - * If the target offset is within the current buffer, - * simply adjust the pointers, clear EOF, undo ungetc(), - * and return. (If the buffer was modified, we have to - * skip this; see fgetline.c.) - */ - - if ((fp->_flags & __SMOD) == 0 && - target >= curoff && target < curoff + n) - { - register int o = target - curoff; - - fp->_p = fp->_bf._base + o; - fp->_r = n - o; - if (HASUB (fp)) - FREEUB (fp); - fp->_flags &= ~__SEOF; - return 0; - } - - /* - * The place we want to get to is not within the current buffer, - * but we can still be kind to the kernel copyout mechanism. - * By aligning the file offset to a block boundary, we can let - * the kernel use the VM hardware to map pages instead of - * copying bytes laboriously. Using a block boundary also - * ensures that we only read one block, rather than two. - */ - - curoff = target & ~(fp->_blksize - 1); - if ((*seekfn) (fp->_cookie, curoff, SEEK_SET) == POS_ERR) - goto dumb; - fp->_r = 0; - if (HASUB (fp)) - FREEUB (fp); - fp->_flags &= ~__SEOF; - n = target - curoff; - if (n) - { - if (__srefill (fp) || fp->_r < n) - goto dumb; - fp->_p += n; - fp->_r -= n; - } - return 0; - - /* - * We get here if we cannot optimise the seek ... just - * do it. Allow the seek function to change fp->_bf._base. - */ - -dumb: - if (fflush (fp) || (*seekfn) (fp->_cookie, offset, whence) == POS_ERR) - return EOF; - /* success: clear EOF indicator and discard ungetc() data */ - if (HASUB (fp)) - FREEUB (fp); - fp->_p = fp->_bf._base; - fp->_r = 0; - /* fp->_w = 0; *//* unnecessary (I think...) */ - fp->_flags &= ~__SEOF; - return 0; -} diff --git a/newlib/libc/stdio/fsetpos.c b/newlib/libc/stdio/fsetpos.c deleted file mode 100644 index 28cd69ead..000000000 --- a/newlib/libc/stdio/fsetpos.c +++ /dev/null @@ -1,54 +0,0 @@ -/* -FUNCTION -<>---restore position of a stream or file - -INDEX - fsetpos - -ANSI_SYNOPSIS - #include - int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>); - -TRAD_SYNOPSIS - #include - int fsetpos(<[fp]>, <[pos]>) - FILE *<[fp]>; - fpos_t *<[pos]>; - -DESCRIPTION -Objects of type <> can have a ``position'' that records how much -of the file your program has already read. Many of the <> functions -depend on this position, and many change it as a side effect. - -You can use <> to return the file identified by <[fp]> to a previous -position <<*<[pos]>>> (after first recording it with <>). - -See <> for a similar facility. - -RETURNS -<> returns <<0>> when successful. If <> fails, the -result is <<1>>. The reason for failure is indicated in <>: -either <> (the stream identified by <[fp]> doesn't support -repositioning) or <> (invalid file position). - -PORTABILITY -ANSI C requires <>, but does not specify the nature of -<<*<[pos]>>> beyond identifying it as written by <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include - -int -_DEFUN (fsetpos, (iop, pos), - FILE * iop _AND - _CONST fpos_t * pos) -{ - int x = fseek (iop, *pos, SEEK_SET); - - if (x != 0) - return 1; - return 0; -} diff --git a/newlib/libc/stdio/ftell.c b/newlib/libc/stdio/ftell.c deleted file mode 100644 index 6a8061816..000000000 --- a/newlib/libc/stdio/ftell.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---return position in a stream or file - -INDEX - ftell - -ANSI_SYNOPSIS - #include - long ftell(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - long ftell(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -Objects of type <> can have a ``position'' that records how much -of the file your program has already read. Many of the <> functions -depend on this position, and many change it as a side effect. - -The result of <> is the current position for a file -identified by <[fp]>. If you record this result, you can later -use it with <> to return the file to this -position. - -In the current implementation, <> simply uses a character -count to represent the file position; this is the same number that -would be recorded by <>. - -RETURNS -<> returns the file position, if possible. If it cannot do -this, it returns <<-1L>>. Failure occurs on streams that do not support -positioning; the global <> indicates this condition with the -value <>. - -PORTABILITY -<> is required by the ANSI C standard, but the meaning of its -result (when successful) is not specified beyond requiring that it be -acceptable as an argument to <>. In particular, other -conforming C implementations may return a different result from -<> than what <> records. - -No supporting OS subroutines are required. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -/* - * ftell: return current offset. - */ - -#include -#include - -#include "local.h" - -long -_DEFUN (ftell, (fp), - register FILE * fp) -{ - fpos_t pos; - - /* Ensure stdio is set up. */ - - CHECK_INIT (fp); - - if (fp->_seek == NULL) - { - fp->_data->_errno = ESPIPE; - return -1L; - } - - /* Find offset of underlying I/O object, then - adjust for buffered bytes. */ - fflush(fp); /* may adjust seek offset on append stream */ - if (fp->_flags & __SOFF) - pos = fp->_offset; - else - { - pos = (*fp->_seek) (fp->_cookie, (fpos_t) 0, SEEK_CUR); - if (pos == -1L) - return pos; - } - if (fp->_flags & __SRD) - { - /* - * Reading. Any unread characters (including - * those from ungetc) cause the position to be - * smaller than that in the underlying object. - */ - pos -= fp->_r; - if (HASUB (fp)) - pos -= fp->_ur; - } - else if (fp->_flags & __SWR && fp->_p != NULL) - { - /* - * Writing. Any buffered characters cause the - * position to be greater than that in the - * underlying object. - */ - pos += fp->_p - fp->_bf._base; - } - - return pos; -} diff --git a/newlib/libc/stdio/fvwrite.c b/newlib/libc/stdio/fvwrite.c deleted file mode 100644 index 8e7d316fb..000000000 --- a/newlib/libc/stdio/fvwrite.c +++ /dev/null @@ -1,216 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include "local.h" -#include "fvwrite.h" - -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define COPY(n) (void) memmove((void *) fp->_p, (void *) p, (size_t) (n)) - -#define GETIOV(extra_work) \ - while (len == 0) \ - { \ - extra_work; \ - p = iov->iov_base; \ - len = iov->iov_len; \ - iov++; \ - } - -/* - * Write some memory regions. Return zero on success, EOF on error. - * - * This routine is large and unsightly, but most of the ugliness due - * to the three different kinds of output buffering is handled here. - */ - -int -__sfvwrite (fp, uio) - register FILE *fp; - register struct __suio *uio; -{ - register size_t len; - register _CONST char *p; - register struct __siov *iov; - register int w, s; - char *nl; - int nlknown, nldist; - - if ((len = uio->uio_resid) == 0) - return 0; - - /* make sure we can write */ - if (cantwrite (fp)) - return EOF; - - iov = uio->uio_iov; - len = 0; - -#ifdef __SCLE - if (fp->_flags & __SCLE) /* text mode */ - { - do - { - GETIOV (;); - while (len > 0) - { - if (putc(*p, fp) == EOF) - return EOF; - p++; - len--; - uio->uio_resid--; - } - } - while (uio->uio_resid > 0); - return 0; - } -#endif - - if (fp->_flags & __SNBF) - { - /* - * Unbuffered: write up to BUFSIZ bytes at a time. - */ - do - { - GETIOV (;); - w = (*fp->_write) (fp->_cookie, p, MIN (len, BUFSIZ)); - if (w <= 0) - goto err; - p += w; - len -= w; - } - while ((uio->uio_resid -= w) != 0); - } - else if ((fp->_flags & __SLBF) == 0) - { - /* - * Fully buffered: fill partially full buffer, if any, - * and then flush. If there is no partial buffer, write - * one _bf._size byte chunk directly (without copying). - * - * String output is a special case: write as many bytes - * as fit, but pretend we wrote everything. This makes - * snprintf() return the number of bytes needed, rather - * than the number used, and avoids its write function - * (so that the write function can be invalid). - */ - do - { - GETIOV (;); - w = fp->_w; - if (fp->_flags & __SSTR) - { - if (len < w) - w = len; - COPY (w); /* copy MIN(fp->_w,len), */ - fp->_w -= w; - fp->_p += w; - w = len; /* but pretend copied all */ - } - else if (fp->_p > fp->_bf._base && len > w) - { - /* fill and flush */ - COPY (w); - /* fp->_w -= w; *//* unneeded */ - fp->_p += w; - if (fflush (fp)) - goto err; - } - else if (len >= (w = fp->_bf._size)) - { - /* write directly */ - w = (*fp->_write) (fp->_cookie, p, w); - if (w <= 0) - goto err; - } - else - { - /* fill and done */ - w = len; - COPY (w); - fp->_w -= w; - fp->_p += w; - } - p += w; - len -= w; - } - while ((uio->uio_resid -= w) != 0); - } - else - { - /* - * Line buffered: like fully buffered, but we - * must check for newlines. Compute the distance - * to the first newline (including the newline), - * or `infinity' if there is none, then pretend - * that the amount to write is MIN(len,nldist). - */ - nlknown = 0; - do - { - GETIOV (nlknown = 0); - if (!nlknown) - { - nl = memchr ((void *) p, '\n', len); - nldist = nl ? nl + 1 - p : len + 1; - nlknown = 1; - } - s = MIN (len, nldist); - w = fp->_w + fp->_bf._size; - if (fp->_p > fp->_bf._base && s > w) - { - COPY (w); - /* fp->_w -= w; */ - fp->_p += w; - if (fflush (fp)) - goto err; - } - else if (s >= (w = fp->_bf._size)) - { - w = (*fp->_write) (fp->_cookie, p, w); - if (w <= 0) - goto err; - } - else - { - w = s; - COPY (w); - fp->_w -= w; - fp->_p += w; - } - if ((nldist -= w) == 0) - { - /* copied the newline: flush and forget */ - if (fflush (fp)) - goto err; - nlknown = 0; - } - p += w; - len -= w; - } - while ((uio->uio_resid -= w) != 0); - } - return 0; - -err: - fp->_flags |= __SERR; - return EOF; -} diff --git a/newlib/libc/stdio/fvwrite.h b/newlib/libc/stdio/fvwrite.h deleted file mode 100644 index f27abdf81..000000000 --- a/newlib/libc/stdio/fvwrite.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* %W% (Berkeley) %G% */ -#include <_ansi.h> - -/* - * I/O descriptors for __sfvwrite(). - */ -struct __siov { - _CONST _PTR iov_base; - size_t iov_len; -}; -struct __suio { - struct __siov *uio_iov; - int uio_iovcnt; - int uio_resid; -}; - - -extern int _EXFUN(__sfvwrite,(FILE *, struct __suio *)); -extern int _EXFUN(__swsetup,(FILE *)); - - diff --git a/newlib/libc/stdio/fwalk.c b/newlib/libc/stdio/fwalk.c deleted file mode 100644 index 516283466..000000000 --- a/newlib/libc/stdio/fwalk.c +++ /dev/null @@ -1,43 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include -#include "local.h" - -int -_fwalk (ptr, function) - struct _reent *ptr; - register int (*function) (); -{ - register FILE *fp; - register int n, ret = 0; - register struct _glue *g; - - for (g = &ptr->__sglue; g != NULL; g = g->_next) - for (fp = g->_iobs, n = g->_niobs; --n >= 0; fp++) - if (fp->_flags != 0) - ret |= (*function) (fp); - return ret; -} diff --git a/newlib/libc/stdio/fwrite.c b/newlib/libc/stdio/fwrite.c deleted file mode 100644 index 642fb274f..000000000 --- a/newlib/libc/stdio/fwrite.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write array elements - -INDEX - fwrite - -ANSI_SYNOPSIS - #include - size_t fwrite(const void *<[buf]>, size_t <[size]>, - size_t <[count]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - size_t fwrite(<[buf]>, <[size]>, <[count]>, <[fp]>) - char *<[buf]>; - size_t <[size]>; - size_t <[count]>; - FILE *<[fp]>; - -DESCRIPTION -<> attempts to copy, starting from the memory location -<[buf]>, <[count]> elements (each of size <[size]>) into the file or -stream identified by <[fp]>. <> may copy fewer elements than -<[count]> if an error intervenes. - -<> also advances the file position indicator (if any) for -<[fp]> by the number of @emph{characters} actually written. - -RETURNS -If <> succeeds in writing all the elements you specify, the -result is the same as the argument <[count]>. In any event, the -result is the number of complete elements that <> copied to -the file. - -PORTABILITY -ANSI C requires <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#if 0 -#include -#endif -#include "local.h" -#if 1 -#include "fvwrite.h" -#endif - -/* - * Write `count' objects (each size `size') from memory to the given file. - * Return the number of whole objects written. - */ - -size_t -_DEFUN (fwrite, (buf, size, count, fp), - _CONST _PTR buf _AND - size_t size _AND - size_t count _AND - FILE * fp) -{ - size_t n; - struct __suio uio; - struct __siov iov; - - iov.iov_base = buf; - uio.uio_resid = iov.iov_len = n = count * size; - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - - /* - * The usual case is success (__sfvwrite returns 0); - * skip the divide if this happens, since divides are - * generally slow and since this occurs whenever size==0. - */ - - if (__sfvwrite (fp, &uio) == 0) - return count; - return (n - uio.uio_resid) / size; -} diff --git a/newlib/libc/stdio/getc.c b/newlib/libc/stdio/getc.c deleted file mode 100644 index 4b2509737..000000000 --- a/newlib/libc/stdio/getc.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---read a character (macro) - -INDEX - getc - -ANSI_SYNOPSIS - #include - int getc(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int getc(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -<> is a macro, defined in <>. You can use <> -to get the next single character from the file or stream -identified by <[fp]>. As a side effect, <> advances the file's -current position indicator. - -For a subroutine version of this macro, see <>. - -RETURNS -The next character (read as an <>, and cast to -<>), unless there is no more data, or the host system reports a -read error; in either of these situations, <> returns <>. - -You can distinguish the two situations that cause an <> result by -using the <> and <> functions. - -PORTABILITY -ANSI C requires <>; it suggests, but does not require, that -<> be implemented as a macro. The standard explicitly permits -macro implementations of <> to use the argument more than once; -therefore, in a portable program, you should not use an expression -with side effects as the <> argument. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -/* - * A subroutine version of the macro getc. - */ - -#undef getc - -int -getc (fp) - register FILE *fp; -{ - /* CHECK_INIT is called (eventually) by __srefill. */ - - return __sgetc (fp); -} diff --git a/newlib/libc/stdio/getchar.c b/newlib/libc/stdio/getchar.c deleted file mode 100644 index 475cd138b..000000000 --- a/newlib/libc/stdio/getchar.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---read a character (macro) - -INDEX - getchar -INDEX - _getchar_r - -ANSI_SYNOPSIS - #include - int getchar(void); - - int _getchar_r(void *<[reent]>); - -TRAD_SYNOPSIS - #include - int getchar(); - - int _getchar_r(<[reent]>) - char * <[reent]>; - -DESCRIPTION -<> is a macro, defined in <>. You can use <> -to get the next single character from the standard input stream. -As a side effect, <> advances the standard input's -current position indicator. - -The alternate function <<_getchar_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - - -RETURNS -The next character (read as an <>, and cast to -<>), unless there is no more data, or the host system reports a -read error; in either of these situations, <> returns <>. - -You can distinguish the two situations that cause an <> result by -using `<>' and `<>'. - -PORTABILITY -ANSI C requires <>; it suggests, but does not require, that -<> be implemented as a macro. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -/* - * A subroutine version of the macro getchar. - */ - -#include -#include - -#undef getchar - -int -_getchar_r (f) - struct _reent *f; -{ - return getc (_stdin_r (f)); -} - -#ifndef _REENT_ONLY - -int -getchar () -{ - /* CHECK_INIT is called (eventually) by __srefill. */ - - return _getchar_r (_REENT); -} - -#endif diff --git a/newlib/libc/stdio/gets.c b/newlib/libc/stdio/gets.c deleted file mode 100644 index 796100e32..000000000 --- a/newlib/libc/stdio/gets.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - - -/* - -FUNCTION - <>---get character string (obsolete, use <> instead) -INDEX - gets -INDEX - _gets_r - -ANSI_SYNOPSIS - #include - - char *gets(char *<[buf]>); - - char *_gets_r(void *<[reent]>, char *<[buf]>); - -TRAD_SYNOPSIS - #include - - char *gets(<[buf]>) - char *<[buf]>; - - char *_gets_r(<[reent]>, <[buf]>) - char *<[reent]>; - char *<[buf]>; - -DESCRIPTION - Reads characters from standard input until a newline is found. - The characters up to the newline are stored in <[buf]>. The - newline is discarded, and the buffer is terminated with a 0. - - This is a @emph{dangerous} function, as it has no way of checking - the amount of space available in <[buf]>. One of the attacks - used by the Internet Worm of 1988 used this to overrun a - buffer allocated on the stack of the finger daemon and - overwrite the return address, causing the daemon to execute - code downloaded into it over the connection. - - The alternate function <<_gets_r>> is a reentrant version. The extra - argument <[reent]> is a pointer to a reentrancy structure. - - -RETURNS - <> returns the buffer passed to it, with the data filled - in. If end of file occurs with some data already accumulated, - the data is returned with no other indication. If end of file - occurs with no data in the buffer, NULL is returned. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include - -char * -_gets_r (ptr, buf) - struct _reent *ptr; - char *buf; -{ - register int c; - register char *s = buf; - - while ((c = _getchar_r (ptr)) != '\n') - if (c == EOF) - if (s == buf) - return NULL; - else - break; - else - *s++ = c; - *s = 0; - return buf; -} - -#ifndef _REENT_ONLY - -char * -gets (buf) - char *buf; -{ - return _gets_r (_REENT, buf); -} - -#endif diff --git a/newlib/libc/stdio/getw.c b/newlib/libc/stdio/getw.c deleted file mode 100644 index b6fd87313..000000000 --- a/newlib/libc/stdio/getw.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---read a word (int) - -INDEX - getw - -ANSI_SYNOPSIS - #include - int getw(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int getw(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -<> is a function, defined in <>. You can use <> -to get the next word from the file or stream identified by <[fp]>. As -a side effect, <> advances the file's current position -indicator. - -RETURNS The next word (read as an <>), unless there is no more -data, or the host system reports a read error; in either of these -situations, <> returns <>. Since <> is a valid -<>, you must use <> or <> to distinguish these -situations. - -PORTABILITY -<> is a remnant of K&R C, it is not part of any ISO C Standard. -<> should be used instead. In fact, this implementation of -<> is based upon <>. - -Supporting OS subroutines required: <>. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -int -getw (fp) - register FILE *fp; -{ - int result; - if (fread((char*)&result, sizeof(result), 1, fp) != 1) - return EOF; - return result; -} diff --git a/newlib/libc/stdio/iprintf.c b/newlib/libc/stdio/iprintf.c deleted file mode 100644 index f05404302..000000000 --- a/newlib/libc/stdio/iprintf.c +++ /dev/null @@ -1,118 +0,0 @@ -/* -FUNCTION - <>---write formatted output (integer only) -INDEX - iprintf - -ANSI_SYNOPSIS - #include - - int iprintf(const char *<[format]>, ...); - -TRAD_SYNOPSIS - #include - - int iprintf(<[format]> [, <[arg]>, ...]) - char *<[format]>; - -DESCRIPTION -<> is a restricted version of <>: it has the same -arguments and behavior, save that it cannot perform any floating-point -formatting: the <>, <>, <>, <>, and <> type specifiers -are not recognized. - -RETURNS - <> returns the number of bytes in the output string, - save that the concluding <> is not counted. - <> returns when the end of the format string is - encountered. If an error occurs, <> - returns <>. - -PORTABILITY -<> is not required by ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include <_ansi.h> -#include - -#ifndef _REENT_ONLY - -#ifdef _HAVE_STDC - -#include - -int -iprintf (const char *fmt,...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - _stdout_r (_REENT)->_data = _REENT; - ret = vfiprintf (stdout, fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -iprintf (fmt, va_alist) - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - _stdout_r (_REENT)->_data = _REENT; - ret = vfiprintf (stdout, fmt, ap); - va_end (ap); - return ret; -} - -#endif /* ! _HAVE_STDC */ -#endif /* ! _REENT_ONLY */ - -#ifdef _HAVE_STDC - -#include - -int -_iprintf_r (struct _reent *ptr, const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - ret = vfiprintf (_stdout_r (ptr), fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -_iprintf_r (data, fmt, va_alist) - char *data; - char *fmt; - va_dcl -{ - int ret; - struct _reent *ptr = data; - va_list ap; - - va_start (ap); - ret = vfiprintf (_stdout_r (ptr), fmt, ap); - va_end (ap); - return ret; -} - -#endif diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h deleted file mode 100644 index 24e02e8e4..000000000 --- a/newlib/libc/stdio/local.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * %W% (UofMD/Berkeley) %G% - */ - -/* - * Information local to this implementation of stdio, - * in particular, macros and private variables. - */ - -#include <_ansi.h> -#include -#include -#include - -extern int _EXFUN(__svfscanf,(FILE *, _CONST char *,va_list)); -extern FILE *_EXFUN(__sfp,(struct _reent *)); -extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); -extern int _EXFUN(__srefill,(FILE *)); -extern int _EXFUN(__sread,(void *, char *, int)); -extern int _EXFUN(__swrite,(void *, char const *, int)); -extern fpos_t _EXFUN(__sseek,(void *, fpos_t, int)); -extern int _EXFUN(__sclose,(void *)); -extern int _EXFUN(__stextmode,(int)); -extern void _EXFUN(__sinit,(struct _reent *)); -extern void _EXFUN(_cleanup_r,(struct _reent *)); -extern void _EXFUN(__smakebuf,(FILE *)); -extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *))); -struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); -extern int _EXFUN(__srefill,(FILE *fp)); - -/* Called by the main entry point fns to ensure stdio has been initialized. */ - -#define CHECK_INIT(fp) \ - do \ - { \ - if ((fp)->_data == 0) \ - (fp)->_data = _REENT; \ - if (!(fp)->_data->__sdidinit) \ - __sinit ((fp)->_data); \ - } \ - while (0) - -/* Return true iff the given FILE cannot be written now. */ - -#define cantwrite(fp) \ - ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \ - __swsetup(fp)) - -/* Test whether the given stdio file has an active ungetc buffer; - release such a buffer, without restoring ordinary unread data. */ - -#define HASUB(fp) ((fp)->_ub._base != NULL) -#define FREEUB(fp) { \ - if ((fp)->_ub._base != (fp)->_ubuf) \ - _free_r(fp->_data, (char *)(fp)->_ub._base); \ - (fp)->_ub._base = NULL; \ -} - -/* Test for an fgetline() buffer. */ - -#define HASLB(fp) ((fp)->_lb._base != NULL) -#define FREELB(fp) { _free_r(fp->_data,(char *)(fp)->_lb._base); (fp)->_lb._base = NULL; } - -/* WARNING: _dcvt is defined in the stdlib directory, not here! */ - -char *_EXFUN(_dcvt,(struct _reent *, char *, double, int, int, char, int)); -char *_EXFUN(_sicvt,(char *, short, char)); -char *_EXFUN(_icvt,(char *, int, char)); -char *_EXFUN(_licvt,(char *, long, char)); -#ifdef __GNUC__ -char *_EXFUN(_llicvt,(char *, long long, char)); -#endif - -#define CVT_BUF_SIZE 128 - -#define NDYNAMIC 4 /* add four more whenever necessary */ diff --git a/newlib/libc/stdio/makebuf.c b/newlib/libc/stdio/makebuf.c deleted file mode 100644 index 4a09c4d50..000000000 --- a/newlib/libc/stdio/makebuf.c +++ /dev/null @@ -1,96 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include -#include -#include - -#include "local.h" - -/* - * Allocate a file buffer, or switch to unbuffered I/O. - * Per the ANSI C standard, ALL tty devices default to line buffered. - * - * As a side effect, we set __SOPT or __SNPT (en/dis-able fseek - * optimization) right after the _fstat() that finds the buffer size. - */ - -void -__smakebuf (fp) - register FILE *fp; -{ - register size_t size, couldbetty; - register _PTR p; - struct stat st; - - if (fp->_flags & __SNBF) - { - fp->_bf._base = fp->_p = fp->_nbuf; - fp->_bf._size = 1; - return; - } - if (fp->_file < 0 || _fstat_r (fp->_data, fp->_file, &st) < 0) - { - couldbetty = 0; - size = BUFSIZ; - /* do not try to optimise fseek() */ - fp->_flags |= __SNPT; - } - else - { - couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; -#ifdef HAVE_BLKSIZE - size = st.st_blksize <= 0 ? BUFSIZ : st.st_blksize; -#else - size = BUFSIZ; -#endif - /* - * Optimize fseek() only if it is a regular file. - * (The test for __sseek is mainly paranoia.) - */ - if ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek) - { - fp->_flags |= __SOPT; -#ifdef HAVE_BLKSIZE - fp->_blksize = st.st_blksize; -#else - fp->_blksize = 1024; -#endif - } - else - fp->_flags |= __SNPT; - } - if ((p = _malloc_r (fp->_data, size)) == NULL) - { - fp->_flags |= __SNBF; - fp->_bf._base = fp->_p = fp->_nbuf; - fp->_bf._size = 1; - } - else - { - fp->_data->__cleanup = _cleanup_r; - fp->_flags |= __SMBF; - fp->_bf._base = fp->_p = (unsigned char *) p; - fp->_bf._size = size; - if (couldbetty && isatty (fp->_file)) - fp->_flags |= __SLBF; - } -} diff --git a/newlib/libc/stdio/mktemp.c b/newlib/libc/stdio/mktemp.c deleted file mode 100644 index 54c7a9793..000000000 --- a/newlib/libc/stdio/mktemp.c +++ /dev/null @@ -1,221 +0,0 @@ -/* This is file MKTEMP.C */ -/* This file may have been modified by DJ Delorie (Jan 1991). If so, -** these modifications are Coyright (C) 1991 DJ Delorie, 24 Kirsten Ave, -** Rochester NH, 03867-2954, USA. -*/ - -/* - * Copyright (c) 1987 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that: (1) source distributions retain this entire copyright - * notice and comment, and (2) distributions including binaries display - * the following acknowledgement: ``This product includes software - * developed by the University of California, Berkeley and its contributors'' - * in the documentation or other materials provided with the distribution - * and in all advertising materials mentioning features or use of this - * software. Neither the name of the University nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>, <>---generate unused file name - -INDEX - mktemp -INDEX - mkstemp -INDEX - _mktemp_r -INDEX - _mkstemp_r - -ANSI_SYNOPSIS - #include - char *mktemp(char *<[path]>); - int mkstemp(char *<[path]>); - - char *_mktemp_r(void *<[reent]>, char *<[path]>); - int *_mkstemp_r(void *<[reent]>, char *<[path]>); - -TRAD_SYNOPSIS - #include - char *mktemp(<[path]>) - char *<[path]>; - - int mkstemp(<[path]>) - char *<[path]>; - - char *_mktemp_r(<[reent]>, <[path]>) - char *<[reent]>; - char *<[path]>; - - int _mkstemp_r(<[reent]>, <[path]>) - char *<[reent]>; - char *<[path]>; - -DESCRIPTION -<> and <> attempt to generate a file name that is not -yet in use for any existing file. <> creates the file and -opens it for reading and writing; <> simply generates the file name. - -You supply a simple pattern for the generated file name, as the string -at <[path]>. The pattern should be a valid filename (including path -information if you wish) ending with some number of `<>' -characters. The generated filename will match the leading part of the -name you supply, with the trailing `<>' characters replaced by some -combination of digits and letters. - -The alternate functions <<_mktemp_r>> and <<_mkstemp_r>> are reentrant -versions. The extra argument <[reent]> is a pointer to a reentrancy -structure. - -RETURNS -<> returns the pointer <[path]> to the modified string -representing an unused filename, unless it could not generate one, or -the pattern you provided is not suitable for a filename; in that case, -it returns <>. - -<> returns a file descriptor to the newly created file, -unless it could not generate an unused filename, or the pattern you -provided is not suitable for a filename; in that case, it returns -<<-1>>. - -PORTABILITY -ANSI C does not require either <> or <>; the System -V Interface Definition requires <> as of Issue 2. - -Supporting OS subroutines required: <>, <>, <>. -*/ - -#include -#include -#include -#include -#include -#include -#include - -static int -_DEFUN (_gettemp, (ptr, path, doopen), - struct _reent *ptr _AND - char *path _AND - register int *doopen) -{ - register char *start, *trv; - struct stat sbuf; - unsigned int pid; - - pid = _getpid_r (ptr); - for (trv = path; *trv; ++trv) /* extra X's get set to 0's */ - continue; - while (*--trv == 'X') - { - *trv = (pid % 10) + '0'; - pid /= 10; - } - - /* - * Check the target directory; if you have six X's and it - * doesn't exist this runs for a *very* long time. - */ - - for (start = trv + 1;; --trv) - { - if (trv <= path) - break; - if (*trv == '/') - { - *trv = '\0'; - if (_stat_r (ptr, path, &sbuf)) - return (0); - if (!(sbuf.st_mode & S_IFDIR)) - { - ptr->_errno = ENOTDIR; - return (0); - } - *trv = '/'; - break; - } - } - - for (;;) - { - if (doopen) - { - if ((*doopen = _open_r (ptr, path, O_CREAT | O_EXCL | O_RDWR, 0600)) - >= 0) - return 1; -#if defined(__CYGWIN32__) || defined(__CYGWIN__) - if (ptr->_errno != EEXIST && ptr->_errno != EACCES) -#else - if (ptr->_errno != EEXIST) -#endif - return 0; - } - else if (_stat_r (ptr, path, &sbuf)) - return (ptr->_errno == ENOENT ? 1 : 0); - - /* tricky little algorithm for backward compatibility */ - for (trv = start;;) - { - if (!*trv) - return 0; - if (*trv == 'z') - *trv++ = 'a'; - else - { - if (isdigit (*trv)) - *trv = 'a'; - else - ++ * trv; - break; - } - } - } - /*NOTREACHED*/ -} - -int -_DEFUN (_mkstemp_r, (ptr, path), - struct _reent *ptr _AND - char *path) -{ - int fd; - - return (_gettemp (ptr, path, &fd) ? fd : -1); -} - -char * -_DEFUN (_mktemp_r, (ptr, path), - struct _reent *ptr _AND - char *path) -{ - return (_gettemp (ptr, path, (int *) NULL) ? path : (char *) NULL); -} - -#ifndef _REENT_ONLY - -int -_DEFUN (mkstemp, (path), - char *path) -{ - int fd; - - return (_gettemp (_REENT, path, &fd) ? fd : -1); -} - -char * -_DEFUN (mktemp, (path), - char *path) -{ - return (_gettemp (_REENT, path, (int *) NULL) ? path : (char *) NULL); -} - -#endif /* ! defined (_REENT_ONLY) */ diff --git a/newlib/libc/stdio/perror.c b/newlib/libc/stdio/perror.c deleted file mode 100644 index abb595ba9..000000000 --- a/newlib/libc/stdio/perror.c +++ /dev/null @@ -1,80 +0,0 @@ -/* -FUNCTION -<>---print an error message on standard error - -INDEX - perror -INDEX - _perror_r - -ANSI_SYNOPSIS - #include - void perror(char *<[prefix]>); - - void _perror_r(void *<[reent]>, char *<[prefix]>); - -TRAD_SYNOPSIS - #include - void perror(<[prefix]>) - char *<[prefix]>; - - void _perror_r(<[reent]>, <[prefix]>) - char *<[reent]>; - char *<[prefix]>; - -DESCRIPTION -Use <> to print (on standard error) an error message -corresponding to the current value of the global variable <>. -Unless you use <> as the value of the argument <[prefix]>, the -error message will begin with the string at <[prefix]>, followed by a -colon and a space (<<: >>). The remainder of the error message is one -of the strings described for <>. - -The alternate function <<_perror_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - - -RETURNS -<> returns no result. - -PORTABILITY -ANSI C requires <>, but the strings issued vary from one -implementation to another. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#include -#include - -void -_DEFUN (_perror_r, (ptr, s), - struct _reent *ptr _AND - _CONST char *s) -{ - char *error; - - if (s != NULL && *s != '\0') - { - fputs (s, _stderr_r (ptr)); - fputs (": ", _stderr_r (ptr)); - } - - if ((error = strerror (ptr->_errno)) != NULL) - fputs (error, _stderr_r (ptr)); - - fputc ('\n', _stderr_r (ptr)); -} - -#ifndef _REENT_ONLY - -void -_DEFUN (perror, (s), - _CONST char *s) -{ - _perror_r (_REENT, s); -} - -#endif diff --git a/newlib/libc/stdio/printf.c b/newlib/libc/stdio/printf.c deleted file mode 100644 index 81fb8a2cb..000000000 --- a/newlib/libc/stdio/printf.c +++ /dev/null @@ -1,83 +0,0 @@ - -#include <_ansi.h> -#include - -#ifdef _HAVE_STDC - -#include - -int -_printf_r (struct _reent *ptr, const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - ret = _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -_printf_r (ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - ret = _vfprintf_r (ptr, _stdout_r (ptr), fmt, ap); - va_end (ap); - return ret; -} - -#endif - - -#ifndef _REENT_ONLY - -#ifdef _HAVE_STDC - -#include - -int -printf (const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start (ap, fmt); - _stdout_r (_REENT)->_data = _REENT; - ret = vfprintf (_stdout_r (_REENT), fmt, ap); - va_end (ap); - return ret; -} - -#else - -#include - -int -printf (fmt, va_alist) - char *fmt; - va_dcl -{ - int ret; - va_list ap; - - va_start (ap); - _stdout_r (_REENT)->_data = _REENT; - ret = vfprintf (_stdout_r (_REENT), fmt, ap); - va_end (ap); - return ret; -} - -#endif /* ! _HAVE_STDC */ - -#endif /* ! _REENT_ONLY */ diff --git a/newlib/libc/stdio/putc.c b/newlib/libc/stdio/putc.c deleted file mode 100644 index 27a7a4280..000000000 --- a/newlib/libc/stdio/putc.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write a character (macro) - -INDEX - putc - -ANSI_SYNOPSIS - #include - int putc(int <[ch]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int putc(<[ch]>, <[fp]>) - int <[ch]>; - FILE *<[fp]>; - -DESCRIPTION -<> is a macro, defined in <>. <> -writes the argument <[ch]> to the file or stream identified by -<[fp]>, after converting it from an <> to an <>. - -If the file was opened with append mode (or if the stream cannot -support positioning), then the new character goes at the end of the -file or stream. Otherwise, the new character is written at the -current value of the position indicator, and the position indicator -advances by one. - -For a subroutine version of this macro, see <>. - -RETURNS -If successful, <> returns its argument <[ch]>. If an error -intervenes, the result is <>. You can use `<)>>' to -query for errors. - -PORTABILITY -ANSI C requires <>; it suggests, but does not require, that -<> be implemented as a macro. The standard explicitly permits -macro implementations of <> to use the <[fp]> argument more than once; -therefore, in a portable program, you should not use an expression -with side effects as this argument. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -/* - * A subroutine version of the macro putc. - */ - -#undef putc - -int -putc (c, fp) - int c; - register FILE *fp; -{ - /* CHECK_INIT is (eventually) called by __swbuf. */ - - return __sputc (c, fp); -} diff --git a/newlib/libc/stdio/putchar.c b/newlib/libc/stdio/putchar.c deleted file mode 100644 index 462393f8a..000000000 --- a/newlib/libc/stdio/putchar.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write a character (macro) - -INDEX - putchar -INDEX - _putchar_r - -ANSI_SYNOPSIS - #include - int putchar(int <[ch]>); - - int _putchar_r(void *<[reent]>, int <[ch]>); - -TRAD_SYNOPSIS - #include - int putchar(<[ch]>) - int <[ch]>; - - int _putchar_r(<[reent]>, <[ch]>) - char *<[reent]>; - int <[ch]>; - -DESCRIPTION -<> is a macro, defined in <>. <> -writes its argument to the standard output stream, -after converting it from an <> to an <>. - -The alternate function <<_putchar_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - -RETURNS -If successful, <> returns its argument <[ch]>. If an error -intervenes, the result is <>. You can use `<>' to -query for errors. - -PORTABILITY -ANSI C requires <>; it suggests, but does not require, that -<> be implemented as a macro. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -/* - * A subroutine version of the macro putchar - */ - -#include - -#undef putchar - -int -_putchar_r (ptr, c) - struct _reent *ptr; - int c; -{ - return __sputc (c, _stdout_r (ptr)); -} - -#ifndef _REENT_ONLY - -int -putchar (c) - int c; -{ - /* CHECK_INIT is (eventually) called by __swbuf. */ - - return _putchar_r (_REENT, c); -} - -#endif diff --git a/newlib/libc/stdio/puts.c b/newlib/libc/stdio/puts.c deleted file mode 100644 index 44f17cc91..000000000 --- a/newlib/libc/stdio/puts.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write a character string - -INDEX - puts -INDEX - _puts_r - -ANSI_SYNOPSIS - #include - int puts(const char *<[s]>); - - int _puts_r(void *<[reent]>, const char *<[s]>); - -TRAD_SYNOPSIS - #include - int puts(<[s]>) - char *<[s]>; - - int _puts_r(<[reent]>, <[s]>) - char *<[reent]>; - char *<[s]>; - -DESCRIPTION -<> writes the string at <[s]> (followed by a newline, instead of -the trailing null) to the standard output stream. - -The alternate function <<_puts_r>> is a reentrant version. The extra -argument <[reent]> is a pointer to a reentrancy structure. - -RETURNS -If successful, the result is a nonnegative integer; otherwise, the -result is <>. - -PORTABILITY -ANSI C requires <>, but does not specify that the result on -success must be <<0>>; any non-negative value is permitted. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include "fvwrite.h" - -/* - * Write the given string to stdout, appending a newline. - */ - -int -_DEFUN (_puts_r, (ptr, s), - struct _reent *ptr _AND - _CONST char * s) -{ - size_t c = strlen (s); - struct __suio uio; - struct __siov iov[2]; - - iov[0].iov_base = s; - iov[0].iov_len = c; - iov[1].iov_base = "\n"; - iov[1].iov_len = 1; - uio.uio_resid = c + 1; - uio.uio_iov = &iov[0]; - uio.uio_iovcnt = 2; - - return (__sfvwrite (_stdout_r (ptr), &uio) ? EOF : '\n'); -} - -#ifndef _REENT_ONLY - -int -_DEFUN (puts, (s), - char _CONST * s) -{ - return _puts_r (_REENT, s); -} - -#endif diff --git a/newlib/libc/stdio/putw.c b/newlib/libc/stdio/putw.c deleted file mode 100644 index 19f4abc01..000000000 --- a/newlib/libc/stdio/putw.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---write a word (int) - -INDEX - putw - -ANSI_SYNOPSIS - #include - int putw(int <[w]>, FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - int putw(, <[fp]>) - int ; - FILE *<[fp]>; - -DESCRIPTION -<> is a function, defined in <>. You can use <> -to write a word to the file or stream identified by <[fp]>. As a side -effect, <> advances the file's current position indicator. - -RETURNS Zero on success, <> on failure. - -PORTABILITY -<> is a remnant of K&R C, it is not part of any ISO C Standard. -<> should be used instead. In fact, this implementation of -<> is based upon <>. - -Supporting OS subroutines required: <>. */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -int -putw (w, fp) - int w; - register FILE *fp; -{ - if (fwrite((const char*)&w, sizeof(w), 1, fp) != 1) - return EOF; - return 0; -} diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c deleted file mode 100644 index ca48a4500..000000000 --- a/newlib/libc/stdio/refill.c +++ /dev/null @@ -1,113 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include "local.h" -#include - -static int -lflush (fp) - FILE *fp; -{ - if ((fp->_flags & (__SLBF | __SWR)) == (__SLBF | __SWR)) - return fflush (fp); - return 0; -} - -/* - * Refill a stdio buffer. - * Return EOF on eof or error, 0 otherwise. - */ - -int -_DEFUN (__srefill, (fp), - register FILE * fp) -{ - /* make sure stdio is set up */ - - CHECK_INIT (fp); - - fp->_r = 0; /* largely a convenience for callers */ - - /* SysV does not make this test; take it out for compatibility */ - if (fp->_flags & __SEOF) - return EOF; - - /* if not already reading, have to be reading and writing */ - if ((fp->_flags & __SRD) == 0) - { - if ((fp->_flags & __SRW) == 0) - return EOF; - /* switch to reading */ - if (fp->_flags & __SWR) - { - if (fflush (fp)) - return EOF; - fp->_flags &= ~__SWR; - fp->_w = 0; - fp->_lbfsize = 0; - } - fp->_flags |= __SRD; - } - else - { - /* - * We were reading. If there is an ungetc buffer, - * we must have been reading from that. Drop it, - * restoring the previous buffer (if any). If there - * is anything in that buffer, return. - */ - if (HASUB (fp)) - { - FREEUB (fp); - if ((fp->_r = fp->_ur) != 0) - { - fp->_p = fp->_up; - return 0; - } - } - } - - if (fp->_bf._base == NULL) - __smakebuf (fp); - - /* - * Before reading from a line buffered or unbuffered file, - * flush all line buffered output files, per the ANSI C - * standard. - */ - - if (fp->_flags & (__SLBF | __SNBF)) - (void) _fwalk (fp->_data, lflush); - fp->_p = fp->_bf._base; - fp->_r = (*fp->_read) (fp->_cookie, (char *) fp->_p, fp->_bf._size); - fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ - if (fp->_r <= 0) - { - if (fp->_r == 0) - fp->_flags |= __SEOF; - else - { - fp->_r = 0; - fp->_flags |= __SERR; - } - return EOF; - } - return 0; -} diff --git a/newlib/libc/stdio/remove.c b/newlib/libc/stdio/remove.c deleted file mode 100644 index 074dd9ac8..000000000 --- a/newlib/libc/stdio/remove.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -FUNCTION -<>---delete a file's name - -INDEX - remove - -ANSI_SYNOPSIS - #include - int remove(char *<[filename]>); - - int _remove_r(void *<[reent]>, char *<[filename]>); - -TRAD_SYNOPSIS - #include - int remove(<[filename]>) - char *<[filename]>; - - int _remove_r(<[reent]>, <[filename]>) - char *<[reent]>; - char *<[filename]>; - -DESCRIPTION -Use <> to dissolve the association between a particular -filename (the string at <[filename]>) and the file it represents. -After calling <> with a particular filename, you will no -longer be able to open the file by that name. - -In this implementation, you may use <> on an open file without -error; existing file descriptors for the file will continue to access -the file's data until the program using them closes the file. - -The alternate function <<_remove_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - -RETURNS -<> returns <<0>> if it succeeds, <<-1>> if it fails. - -PORTABILITY -ANSI C requires <>, but only specifies that the result on -failure be nonzero. The behavior of <> when you call it on an -open file may vary among implementations. - -Supporting OS subroutine required: <>. -*/ - -#include - -int -_remove_r (ptr, filename) - struct _reent *ptr; - _CONST char *filename; -{ - if (_unlink_r (ptr, filename) == -1) - return -1; - - return 0; -} - -#ifndef _REENT_ONLY - -int -remove (filename) - _CONST char *filename; -{ - return _remove_r (_REENT, filename); -} - -#endif diff --git a/newlib/libc/stdio/rename.c b/newlib/libc/stdio/rename.c deleted file mode 100644 index 19a6afdd3..000000000 --- a/newlib/libc/stdio/rename.c +++ /dev/null @@ -1,86 +0,0 @@ -/* -FUNCTION -<>---rename a file - -INDEX - rename -INDEX - _rename_r - -ANSI_SYNOPSIS - #include - int rename(const char *<[old]>, const char *<[new]>); - - int _rename_r(void *<[reent]>, - const char *<[old]>, const char *<[new]>); - -TRAD_SYNOPSIS - #include - int rename(<[old]>, <[new]>) - char *<[old]>; - char *<[new]>; - - int _rename_r(<[reent]>, <[old]>, <[new]>) - char *<[reent]>; - char *<[old]>; - char *<[new]>; - -DESCRIPTION -Use <> to establish a new name (the string at <[new]>) for a -file now known by the string at <[old]>. After a successful -<>, the file is no longer accessible by the string at <[old]>. - -If <> fails, the file named <<*<[old]>>> is unaffected. The -conditions for failure depend on the host operating system. - -The alternate function <<_rename_r>> is a reentrant version. The -extra argument <[reent]> is a pointer to a reentrancy structure. - -RETURNS -The result is either <<0>> (when successful) or <<-1>> (when the file -could not be renamed). - -PORTABILITY -ANSI C requires <>, but only specifies that the result on -failure be nonzero. The effects of using the name of an existing file -as <<*<[new]>>> may vary from one implementation to another. - -Supporting OS subroutines required: <>, <>, or <>. -*/ - -#include -#include -#include - -int -_rename_r (ptr, old, new) - struct _reent *ptr; - _CONST char *old; - _CONST char *new; -{ -#ifdef HAVE_RENAME - return _rename (old,new); -#else - if (_link_r (ptr, old, new) == -1) - return -1; - - if (_unlink_r (ptr, old) == -1) - { - /* ??? Should we unlink new? (rhetorical question) */ - return -1; - } -#endif - return 0; -} - -#ifndef _REENT_ONLY - -int -rename (old, new) - _CONST char *old; - _CONST char *new; -{ - return _rename_r (_REENT, old, new); -} - -#endif diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c deleted file mode 100644 index 905275741..000000000 --- a/newlib/libc/stdio/rewind.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---reinitialize a file or stream - -INDEX - rewind - -ANSI_SYNOPSIS - #include - void rewind(FILE *<[fp]>); - -TRAD_SYNOPSIS - #include - void rewind(<[fp]>) - FILE *<[fp]>; - -DESCRIPTION -<> returns the file position indicator (if any) for the file -or stream identified by <[fp]> to the beginning of the file. It also -clears any error indicator and flushes any pending output. - -RETURNS -<> does not return a result. - -PORTABILITY -ANSI C requires <>. - -No supporting OS subroutines are required. -*/ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include - -void -_DEFUN (rewind, (fp), - register FILE * fp) -{ - (void) fseek(fp, 0L, SEEK_SET); - clearerr(fp); -} diff --git a/newlib/libc/stdio/rget.c b/newlib/libc/stdio/rget.c deleted file mode 100644 index ea29c2bce..000000000 --- a/newlib/libc/stdio/rget.c +++ /dev/null @@ -1,43 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include "local.h" - -/* - * Handle getc() when the buffer ran out: - * Refill, then return the first character - * in the newly-filled buffer. - */ - -int -__srget (fp) - register FILE *fp; -{ - if (__srefill (fp) == 0) - { - fp->_r--; - return *fp->_p++; - } - return EOF; -} diff --git a/newlib/libc/stdio/scanf.c b/newlib/libc/stdio/scanf.c deleted file mode 100644 index 0a4818934..000000000 --- a/newlib/libc/stdio/scanf.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <_ansi.h> -#include -#include "local.h" - -#ifdef _HAVE_STDC -#include -#else -#include -#endif - -#ifndef _REENT_ONLY - -int -#ifdef _HAVE_STDC -scanf (const char *fmt, ...) -#else -scanf (fmt, va_alist) - char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = __svfscanf (_stdin_r (_REENT), fmt, ap); - va_end (ap); - return ret; -} - -#endif - -int -#ifdef _HAVE_STDC -_scanf_r (struct _reent *ptr, const char *fmt, ...) -#else -_scanf_r (ptr, fmt, va_alist) - struct _reent *ptr; - char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = __svfscanf (_stdin_r (ptr), fmt, ap); - va_end (ap); - return (ret); -} diff --git a/newlib/libc/stdio/setbuf.c b/newlib/libc/stdio/setbuf.c deleted file mode 100644 index 15d09e0f3..000000000 --- a/newlib/libc/stdio/setbuf.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---specify full buffering for a file or stream - -INDEX - setbuf - -ANSI_SYNOPSIS - #include - void setbuf(FILE *<[fp]>, char *<[buf]>); - -TRAD_SYNOPSIS - #include - void setbuf(<[fp]>, <[buf]>) - FILE *<[fp]>; - char *<[buf]>; - -DESCRIPTION -<> specifies that output to the file or stream identified by <[fp]> -should be fully buffered. All output for this file will go to a -buffer (of size <>, specified in `<>'). Output will -be passed on to the host system only when the buffer is full, or when -an input operation intervenes. - -You may, if you wish, supply your own buffer by passing a pointer to -it as the argument <[buf]>. It must have size <>. You can -also use <> as the value of <[buf]>, to signal that the -<> function is to allocate the buffer. - -WARNINGS -You may only use <> before performing any file operation other -than opening the file. - -If you supply a non-null <[buf]>, you must ensure that the associated -storage continues to be available until you close the stream -identified by <[fp]>. - -RETURNS -<> does not return a result. - -PORTABILITY -Both ANSI C and the System V Interface Definition (Issue 2) require -<>. However, they differ on the meaning of a <> buffer -pointer: the SVID issue 2 specification says that a <> buffer -pointer requests unbuffered output. For maximum portability, avoid -<> buffer pointers. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include <_ansi.h> -#include -#include "local.h" - -void -_DEFUN (setbuf, (fp, buf), - FILE * fp _AND - char *buf) -{ - (void) setvbuf (fp, buf, buf ? _IOFBF : _IONBF, BUFSIZ); -} diff --git a/newlib/libc/stdio/setvbuf.c b/newlib/libc/stdio/setvbuf.c deleted file mode 100644 index 357ea5142..000000000 --- a/newlib/libc/stdio/setvbuf.c +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* -FUNCTION -<>---specify file or stream buffering - -INDEX - setvbuf - -ANSI_SYNOPSIS - #include - int setvbuf(FILE *<[fp]>, char *<[buf]>, - int <[mode]>, size_t <[size]>); - -TRAD_SYNOPSIS - #include - int setvbuf(<[fp]>, <[buf]>, <[mode]>, <[size]>) - FILE *<[fp]>; - char *<[buf]>; - int <[mode]>; - size_t <[size]>; - -DESCRIPTION -Use <> to specify what kind of buffering you want for the -file or stream identified by <[fp]>, by using one of the following -values (from <>) as the <[mode]> argument: - -o+ -o _IONBF -Do not use a buffer: send output directly to the host system for the -file or stream identified by <[fp]>. - -o _IOFBF -Use full output buffering: output will be passed on to the host system -only when the buffer is full, or when an input operation intervenes. - -o _IOLBF -Use line buffering: pass on output to the host system at every -newline, as well as when the buffer is full, or when an input -operation intervenes. -o- - -Use the <[size]> argument to specify how large a buffer you wish. You -can supply the buffer itself, if you wish, by passing a pointer to a -suitable area of memory as <[buf]>. Otherwise, you may pass <> -as the <[buf]> argument, and <> will allocate the buffer. - -WARNINGS -You may only use <> before performing any file operation other -than opening the file. - -If you supply a non-null <[buf]>, you must ensure that the associated -storage continues to be available until you close the stream -identified by <[fp]>. - -RETURNS -A <<0>> result indicates success, <> failure (invalid <[mode]> or -<[size]> can cause failure). - -PORTABILITY -Both ANSI C and the System V Interface Definition (Issue 2) require -<>. However, they differ on the meaning of a <> buffer -pointer: the SVID issue 2 specification says that a <> buffer -pointer requests unbuffered output. For maximum portability, avoid -<> buffer pointers. - -Both specifications describe the result on failure only as a -nonzero value. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include <_ansi.h> -#include -#include -#include "local.h" - -/* - * Set one of the three kinds of buffering, optionally including a buffer. - */ - -int -_DEFUN (setvbuf, (fp, buf, mode, size), - register FILE * fp _AND - char *buf _AND - register int mode _AND - register size_t size) -{ - int ret = 0; - CHECK_INIT (fp); - - /* - * Verify arguments. The `int' limit on `size' is due to this - * particular implementation. - */ - - if ((mode != _IOFBF && mode != _IOLBF && mode != _IONBF) || (int)(_POINTER_INT) size < 0) - return (EOF); - - /* - * Write current buffer, if any; drop read count, if any. - * Make sure putc() will not think fp is line buffered. - * Free old buffer if it was from malloc(). Clear line and - * non buffer flags, and clear malloc flag. - */ - - (void) fflush (fp); - fp->_r = 0; - fp->_lbfsize = 0; - if (fp->_flags & __SMBF) - _free_r (fp->_data, (void *) fp->_bf._base); - fp->_flags &= ~(__SLBF | __SNBF | __SMBF); - - if (mode == _IONBF) - goto nbf; - - /* - * Allocate buffer if needed. */ - if (buf == NULL) - { - /* we need this here because malloc() may return a pointer - even if size == 0 */ - if (!size) size = BUFSIZ; - if ((buf = malloc (size)) == NULL) - { - ret = EOF; - /* Try another size... */ - buf = malloc (BUFSIZ); - size = BUFSIZ; - } - if (buf == NULL) - { - /* Can't allocate it, let's try another approach */ -nbf: - fp->_flags |= __SNBF; - fp->_w = 0; - fp->_bf._base = fp->_p = fp->_nbuf; - fp->_bf._size = 1; - return (ret); - } - fp->_flags |= __SMBF; - } - /* - * Now put back whichever flag is needed, and fix _lbfsize - * if line buffered. Ensure output flush on exit if the - * stream will be buffered at all. - * If buf is NULL then make _lbfsize 0 to force the buffer - * to be flushed and hence malloced on first use - */ - - switch (mode) - { - case _IOLBF: - fp->_flags |= __SLBF; - fp->_lbfsize = buf ? -size : 0; - /* FALLTHROUGH */ - - case _IOFBF: - /* no flag */ - fp->_data->__cleanup = _cleanup_r; - fp->_bf._base = fp->_p = (unsigned char *) buf; - fp->_bf._size = size; - break; - } - - /* - * Patch up write count if necessary. - */ - - if (fp->_flags & __SWR) - fp->_w = fp->_flags & (__SLBF | __SNBF) ? 0 : size; - - return 0; -} diff --git a/newlib/libc/stdio/siprintf.c b/newlib/libc/stdio/siprintf.c deleted file mode 100644 index 40bd01696..000000000 --- a/newlib/libc/stdio/siprintf.c +++ /dev/null @@ -1,70 +0,0 @@ -/* -FUNCTION - <>---write formatted output (integer only) -INDEX - siprintf - -ANSI_SYNOPSIS - #include - - int siprintf(char *<[str]>, const char *<[format]> [, <[arg]>, ...]); - - -DESCRIPTION -<> is a restricted version of <>: it has the same -arguments and behavior, save that it cannot perform any floating-point -formatting: the <>, <>, <>, <>, and <> type specifiers -are not recognized. - -RETURNS - <> returns the number of bytes in the output string, - save that the concluding <> is not counted. - <> returns when the end of the format string is - encountered. - -PORTABILITY -<> is not required by ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif -#include -#include <_ansi.h> -#include -#include "local.h" - -int -#ifdef _HAVE_STDC -_DEFUN (siprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) -#else -siprintf (str, fmt, va_alist) - char *str; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = INT_MAX; - f._data = _REENT; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfiprintf (&f, fmt, ap); - va_end (ap); - *f._p = 0; - return (ret); -} diff --git a/newlib/libc/stdio/snprintf.c b/newlib/libc/stdio/snprintf.c deleted file mode 100644 index 333e808e4..000000000 --- a/newlib/libc/stdio/snprintf.c +++ /dev/null @@ -1,95 +0,0 @@ -/* doc in sprintf.c */ - -/* This code created by modifying sprintf.c so copyright inherited. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif -#include -#include <_ansi.h> -#include "local.h" - -int -#ifdef _HAVE_STDC -_DEFUN (_snprintf_r, (ptr, str, size, fmt), struct _reent *ptr _AND char *str _AND size_t size _AND _CONST char *fmt _DOTS) -#else -_snprintf_r (ptr, str, size, fmt, va_alist) - struct _reent *ptr; - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = size; - f._data = ptr; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfprintf (&f, fmt, ap); - va_end (ap); - *f._p = 0; - return (ret); -} - -#ifndef _REENT_ONLY - -int -#ifdef _HAVE_STDC -_DEFUN (snprintf, (str, size, fmt), char *str _AND size_t size _AND _CONST char *fmt _DOTS) -#else -snprintf (str, size, fmt, va_alist) - char *str; - size_t size; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = size; - f._data = _REENT; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfprintf (&f, fmt, ap); - va_end (ap); - *f._p = 0; - return (ret); -} - -#endif diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c deleted file mode 100644 index b5376327e..000000000 --- a/newlib/libc/stdio/sprintf.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - -FUNCTION - <>, <>, <>, <>---format output -INDEX - fprintf -INDEX - printf -INDEX - sprintf -INDEX - snprintf - -ANSI_SYNOPSIS - #include - - int printf(const char *<[format]> [, <[arg]>, ...]); - int fprintf(FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]); - int sprintf(char *<[str]>, const char *<[format]> [, <[arg]>, ...]); - int snprintf(char *<[str]>, size_t <[size]>, const char *<[format]> [, <[arg]>, ...]); - -TRAD_SYNOPSIS - #include - - int printf(<[format]> [, <[arg]>, ...]) - char *<[format]>; - - int fprintf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - char *<[format]>; - - int sprintf(<[str]>, <[format]> [, <[arg]>, ...]); - char *<[str]>; - char *<[format]>; - - int snprintf(<[str]>, size_t <[size]>, <[format]> [, <[arg]>, ...]); - char *<[str]>; - size_t <[size]>; - char *<[format]>; - -DESCRIPTION - <> accepts a series of arguments, applies to each a - format specifier from <<*<[format]>>>, and writes the - formatted data to <>, terminated with a null character. - The behavior of <> is undefined if there are not enough - arguments for the format. - <> returns when it reaches the end of the format string. - If there are more arguments than the format requires, excess - arguments are ignored. - - <>, <> and <> are identical to <>, - other than the destination of the formatted output: <> sends - the output to a specified file <[fd]>, while <> stores the - output in the specified char array <[str]> and <> limits - number of characters written to <[str]> to at most <[size]> (including - terminating <<0>>). For <> and <>, the behavior is - also undefined if the output <<*<[str]>>> overlaps with one of the - arguments. <[format]> is a pointer to a charater string containing - two types of objects: ordinary characters (other than <<%>>), which - are copied unchanged to the output, and conversion - specifications, each of which is introduced by <<%>>. - (To include <<%>> in the output, use <<%%>> in the format string.) - A conversion specification has the following form: - -. %[<[flags]>][<[width]>][.<[prec]>][<[size]>][<[type]>] - - The fields of the conversion specification have the following meanings: - - O+ - o <[flags]> - - an optional sequence of characters which control - output justification, numeric signs, decimal points, - trailing zeroes, and octal and hex prefixes. - The flag characters are minus (<<->>), plus (<<+>>), - space ( ), zero (<<0>>), and sharp (<<#>>). They can - appear in any combination. - - o+ - o - - The result of the conversion is left justified, and the right is - padded with blanks. If you do not use this flag, the result is right - justified, and padded on the left. - - o + - The result of a signed conversion (as determined by <[type]>) - will always begin with a plus or minus sign. (If you do not use - this flag, positive values do not begin with a plus sign.) - - o " " (space) - If the first character of a signed conversion specification - is not a sign, or if a signed conversion results in no - characters, the result will begin with a space. If the - space ( ) flag and the plus (<<+>>) flag both appear, - the space flag is ignored. - - o 0 - If the <[type]> character is <>, <>, <>, <>, - <>, <>, <>, <>, <>, <>, or <>: leading zeroes, - are used to pad the field width (following any indication of sign or - base); no spaces are used for padding. If the zero (<<0>>) and - minus (<<->>) flags both appear, the zero (<<0>>) flag will - be ignored. For <>, <>, <>, <>, <>, and <> - conversions, if a precision <[prec]> is specified, the zero (<<0>>) - flag is ignored. - - Note that <<0>> is interpreted as a flag, not as the beginning - of a field width. - - o # - The result is to be converted to an alternative form, according - to the next character: - - o+ - o 0 - increases precision to force the first digit - of the result to be a zero. - - o x - a non-zero result will have a <<0x>> prefix. - - o X - a non-zero result will have a <<0X>> prefix. - - o e, E or f - The result will always contain a decimal point - even if no digits follow the point. - (Normally, a decimal point appears only if a - digit follows it.) Trailing zeroes are removed. - - o g or G - same as <> or <>, but trailing zeroes - are not removed. - - o all others - undefined. - - o- - o- - - o <[width]> - - <[width]> is an optional minimum field width. You can either - specify it directly as a decimal integer, or indirectly by - using instead an asterisk (<<*>>), in which case an <> - argument is used as the field width. Negative field widths - are not supported; if you attempt to specify a negative field - width, it is interpreted as a minus (<<->>) flag followed by a - positive field width. - - o <[prec]> - - an optional field; if present, it is introduced with `<<.>>' - (a period). This field gives the maximum number of - characters to print in a conversion; the minimum number of - digits of an integer to print, for conversions with <[type]> - <>, <>, <>, <>, <>, and <>; the maximum number of - significant digits, for the <> and <> conversions; - or the number of digits to print after the decimal - point, for <>, <>, and <> conversions. You can specify - the precision either directly as a decimal integer or - indirectly by using an asterisk (<<*>>), in which case - an <> argument is used as the precision. Supplying a negative - precision is equivalent to omitting the precision. - If only a period is specified the precision is zero. - If a precision appears with any other conversion <[type]> - than those listed here, the behavior is undefined. - - o <[size]> - - <>, <>, and <> are optional size characters which - override the default way that <> interprets the - data type of the corresponding argument. <> forces - the following <>, <>, <>, <>, <> or <> conversion - <[type]> to apply to a <> or <>. <> also - forces a following <> <[type]> to apply to - a pointer to a <>. Similarily, an - <> forces the following <>, <>, <>, <>, - <> or <> conversion <[type]> to apply to a <> or - <>. <> also forces a following <> <[type]> to - apply to a pointer to a <>. If an <> - or an <> appears with another conversion - specifier, the behavior is undefined. <> forces a - following <>, <>, <>, <> or <> conversion <[type]> to - apply to a <> argument. If <> appears with - any other conversion <[type]>, the behavior is undefined. - - o <[type]> - - <[type]> specifies what kind of conversion <> performs. - Here is a table of these: - - o+ - o % - prints the percent character (<<%>>) - - o c - prints <[arg]> as single character - - o s - prints characters until precision is reached or a null terminator - is encountered; takes a string pointer - - o d - prints a signed decimal integer; takes an <> (same as <>) - - o i - prints a signed decimal integer; takes an <> (same as <>) - - o o - prints a signed octal integer; takes an <> - - o u - prints an unsigned decimal integer; takes an <> - - o x - prints an unsigned hexadecimal integer (using <> as - digits beyond <<9>>); takes an <> - - o X - prints an unsigned hexadecimal integer (using <> as - digits beyond <<9>>); takes an <> - - o f - prints a signed value of the form <<[-]9999.9999>>; takes - a floating point number - - o e - prints a signed value of the form <<[-]9.9999e[+|-]999>>; takes a - floating point number - - o E - prints the same way as <>, but using <> to introduce the - exponent; takes a floating point number - - o g - prints a signed value in either <> or <> form, based on given - value and precision---trailing zeros and the decimal point are - printed only if necessary; takes a floating point number - - o G - prints the same way as <>, but using <> for the exponent if an - exponent is needed; takes a floating point number - - o n - stores (in the same object) a count of the characters written; - takes a pointer to <> - - o p - prints a pointer in an implementation-defined format. - This implementation treats the pointer as an - <> (same as <>). - o- -O- - - -RETURNS -<> returns the number of bytes in the output string, -save that the concluding <> is not counted. -<> and <> return the number of characters transmitted. -If an error occurs, <> and <> return <>. No -error returns occur for <>. - -PORTABILITY - The ANSI C standard specifies that implementations must - support at least formatted output of up to 509 characters. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif -#include -#include <_ansi.h> -#include "local.h" - -int -#ifdef _HAVE_STDC -_DEFUN (_sprintf_r, (ptr, str, fmt), struct _reent *ptr _AND char *str _AND _CONST char *fmt _DOTS) -#else -_sprintf_r (ptr, str, fmt, va_alist) - struct _reent *ptr; - char *str; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = INT_MAX; - f._data = ptr; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfprintf (&f, fmt, ap); - va_end (ap); - *f._p = 0; - return (ret); -} - -#ifndef _REENT_ONLY - -int -#ifdef _HAVE_STDC -_DEFUN (sprintf, (str, fmt), char *str _AND _CONST char *fmt _DOTS) -#else -sprintf (str, fmt, va_alist) - char *str; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = INT_MAX; - f._data = _REENT; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfprintf (&f, fmt, ap); - va_end (ap); - *f._p = 0; - return (ret); -} - -#endif diff --git a/newlib/libc/stdio/sscanf.c b/newlib/libc/stdio/sscanf.c deleted file mode 100644 index eb344238d..000000000 --- a/newlib/libc/stdio/sscanf.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - -FUNCTION - <>, <>, <>---scan and format input - -INDEX - scanf -INDEX - fscanf -INDEX - sscanf - -ANSI_SYNOPSIS - #include - - int scanf(const char *<[format]> [, <[arg]>, ...]); - int fscanf(FILE *<[fd]>, const char *<[format]> [, <[arg]>, ...]); - int sscanf(const char *<[str]>, const char *<[format]> - [, <[arg]>, ...]); - - -TRAD_SYNOPSIS - #include - - int scanf(<[format]> [, <[arg]>, ...]) - char *<[format]>; - - int fscanf(<[fd]>, <[format]> [, <[arg]>, ...]); - FILE *<[fd]>; - char *<[format]>; - - int sscanf(<[str]>, <[format]> [, <[arg]>, ...]); - char *<[str]>; - char *<[format]>; - - -DESCRIPTION - <> scans a series of input fields from standard input, - one character at a time. Each field is interpreted according to - a format specifier passed to <> in the format string at - <<*<[format]>>>. <> stores the interpreted input from - each field at the address passed to it as the corresponding argument - following <[format]>. You must supply the same number of - format specifiers and address arguments as there are input fields. - - There must be sufficient address arguments for the given format - specifiers; if not the results are unpredictable and likely - disasterous. Excess address arguments are merely ignored. - - <> often produces unexpected results if the input diverges from - an expected pattern. Since the combination of <> or <> - followed by <> is safe and easy, that is the preferred way - to be certain that a program is synchronized with input at the end - of a line. - - <> and <> are identical to <>, other than the - source of input: <> reads from a file, and <> - from a string. - - The string at <<*<[format]>>> is a character sequence composed - of zero or more directives. Directives are composed of - one or more whitespace characters, non-whitespace characters, - and format specifications. - - Whitespace characters are blank (<< >>), tab (<<\t>>), or - newline (<<\n>>). - When <> encounters a whitespace character in the format string - it will read (but not store) all consecutive whitespace characters - up to the next non-whitespace character in the input. - - Non-whitespace characters are all other ASCII characters except the - percent sign (<<%>>). When <> encounters a non-whitespace - character in the format string it will read, but not store - a matching non-whitespace character. - - Format specifications tell <> to read and convert characters - from the input field into specific types of values, and store then - in the locations specified by the address arguments. - - Trailing whitespace is left unread unless explicitly - matched in the format string. - - The format specifiers must begin with a percent sign (<<%>>) - and have the following form: - -. %[*][<[width]>][<[size]>]<[type]> - - Each format specification begins with the percent character (<<%>>). - The other fields are: - o+ - o * - an optional marker; if present, it suppresses interpretation and - assignment of this input field. - - o <[width]> - an optional maximum field width: a decimal integer, - which controls the maximum number of characters that - will be read before converting the current input field. If the - input field has fewer than <[width]> characters, <> - reads all the characters in the field, and then - proceeds with the next field and its format specification. - - If a whitespace or a non-convertable character occurs - before <[width]> character are read, the characters up - to that character are read, converted, and stored. - Then <> proceeds to the next format specification. - - o size - <>, <>, and <> are optional size characters which - override the default way that <> interprets the - data type of the corresponding argument. - - -.Modifier Type(s) -. h d, i, o, u, x convert input to short, -. store in short object -. -. h D, I, O, U, X no effect -. e, f, c, s, n, p -. -. l d, i, o, u, x convert input to long, -. store in long object -. -. l e, f, g convert input to double -. store in a double object -. -. l D, I, O, U, X no effect -. c, s, n, p -. -. L d, i, o, u, x convert to long double, -. store in long double -. -. L all others no effect - - - o <[type]> - - A character to specify what kind of conversion - <> performs. Here is a table of the conversion - characters: - - o+ - o % - No conversion is done; the percent character (<<%>>) is stored. - - o c - Scans one character. Corresponding <[arg]>: <<(char *arg)>>. - - o s - Reads a character string into the array supplied. - Corresponding <[arg]>: <<(char arg[])>>. - - o [<[pattern]>] - Reads a non-empty character string into memory - starting at <[arg]>. This area must be large - enough to accept the sequence and a - terminating null character which will be added - automatically. (<[pattern]> is discussed in the paragraph following - this table). Corresponding <[arg]>: <<(char *arg)>>. - - o d - Reads a decimal integer into the corresponding <[arg]>: <<(int *arg)>>. - - o D - Reads a decimal integer into the corresponding - <[arg]>: <<(long *arg)>>. - - o o - Reads an octal integer into the corresponding <[arg]>: <<(int *arg)>>. - - o O - Reads an octal integer into the corresponding <[arg]>: <<(long *arg)>>. - - o u - Reads an unsigned decimal integer into the corresponding - <[arg]>: <<(unsigned int *arg)>>. - - - o U - Reads an unsigned decimal integer into the corresponding <[arg]>: - <<(unsigned long *arg)>>. - - o x,X - Read a hexadecimal integer into the corresponding <[arg]>: - <<(int *arg)>>. - - o e, f, g - Read a floating point number into the corresponding <[arg]>: - <<(float *arg)>>. - - o E, F, G - Read a floating point number into the corresponding <[arg]>: - <<(double *arg)>>. - - o i - Reads a decimal, octal or hexadecimal integer into the - corresponding <[arg]>: <<(int *arg)>>. - - o I - Reads a decimal, octal or hexadecimal integer into the - corresponding <[arg]>: <<(long *arg)>>. - - o n - Stores the number of characters read in the corresponding - <[arg]>: <<(int *arg)>>. - - o p - Stores a scanned pointer. ANSI C leaves the details - to each implementation; this implementation treats - <<%p>> exactly the same as <<%U>>. Corresponding - <[arg]>: <<(void **arg)>>. - o- - - A <[pattern]> of characters surrounded by square brackets can be used - instead of the <> type character. <[pattern]> is a set of - characters which define a search set of possible characters making up - the <> input field. If the first character in the brackets is a - caret (<<^>>), the search set is inverted to include all ASCII characters - except those between the brackets. There is also a range facility - which you can use as a shortcut. <<%[0-9] >> matches all decimal digits. - The hyphen must not be the first or last character in the set. - The character prior to the hyphen must be lexically less than the - character after it. - - Here are some <[pattern]> examples: - o+ - o %[abcd] - matches strings containing only <>, <>, <>, and <>. - - o %[^abcd] - matches strings containing any characters except <>, <>, - <>, or <> - - o %[A-DW-Z] - matches strings containing <>, <>, <>, <>, <>, - <>, <>, <> - - o %[z-a] - matches the characters <>, <<->>, and <> - o- - - Floating point numbers (for field types <>, <>, <>, <>, - <>, <>) must correspond to the following general form: - -. [+/-] ddddd[.]ddd [E|e[+|-]ddd] - - where objects inclosed in square brackets are optional, and <> - represents decimal, octal, or hexadecimal digits. - o- - -RETURNS - <> returns the number of input fields successfully - scanned, converted and stored; the return value does - not include scanned fields which were not stored. - - If <> attempts to read at end-of-file, the return - value is <>. - - If no fields were stored, the return value is <<0>>. - - <> might stop scanning a particular field before - reaching the normal field end character, or may - terminate entirely. - - <> stops scanning and storing the current field - and moves to the next input field (if any) - in any of the following situations: - - O+ - o The assignment suppressing character (<<*>>) appears - after the <<%>> in the format specification; the current - input field is scanned but not stored. - - o <[width]> characters have been read (<[width]> is a - width specification, a positive decimal integer). - - o The next character read cannot be converted - under the the current format (for example, - if a <> is read when the format is decimal). - - o The next character in the input field does not appear - in the search set (or does appear in the inverted search set). - O- - - When <> stops scanning the current input field for one of - these reasons, the next character is considered unread and - used as the first character of the following input field, or the - first character in a subsequent read operation on the input. - - <> will terminate under the following circumstances: - - O+ - o The next character in the input field conflicts - with a corresponding non-whitespace character in the - format string. - - o The next character in the input field is <>. - - o The format string has been exhausted. - O- - - When the format string contains a character sequence that is - not part of a format specification, the same character - sequence must appear in the input; <> will - scan but not store the matched characters. If a - conflict occurs, the first conflicting character remains in the input - as if it had never been read. - -PORTABILITY -<> is ANSI C. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -#include <_ansi.h> -#include -#include -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif -#include "local.h" - -/* | ARGSUSED */ -/*SUPPRESS 590*/ -static -int -eofread (cookie, buf, len) - _PTR cookie; - char *buf; - int len; -{ - return 0; -} - -#ifdef _HAVE_STDC -int -_DEFUN (sscanf, (str, fmt), _CONST char *str _AND _CONST char *fmt _DOTS) -#else -int -sscanf (str, fmt, va_alist) - _CONST char *str; - _CONST char *fmt; - va_dcl -#endif -{ - int ret; - va_list ap; - FILE f; - - f._flags = __SRD; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._r = strlen (str); - f._read = eofread; - f._ub._base = NULL; - f._lb._base = NULL; - f._data = _REENT; -#ifdef _HAVE_STDC - va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = __svfscanf (&f, fmt, ap); - va_end (ap); - return ret; -} diff --git a/newlib/libc/stdio/stdio.c b/newlib/libc/stdio/stdio.c deleted file mode 100644 index abb7c2335..000000000 --- a/newlib/libc/stdio/stdio.c +++ /dev/null @@ -1,129 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include -#include -#include "local.h" - -/* - * Small standard I/O/seek/close functions. - * These maintain the `known seek offset' for seek optimisation. - */ - -int -__sread (cookie, buf, n) - _PTR cookie; - char *buf; - int n; -{ - register FILE *fp = (FILE *) cookie; - register int ret; - -#ifdef __SCLE - int oldmode = 0; - if (fp->_flags & __SCLE) - oldmode = setmode(fp->_file, O_BINARY); -#endif - - ret = _read_r (fp->_data, fp->_file, buf, n); - -#ifdef __SCLE - if (oldmode) - setmode(fp->_file, oldmode); -#endif - - /* If the read succeeded, update the current offset. */ - - if (ret >= 0) - fp->_offset += ret; - else - fp->_flags &= ~__SOFF; /* paranoia */ - return ret; -} - -int -__swrite (cookie, buf, n) - _PTR cookie; - char _CONST *buf; - int n; -{ - register FILE *fp = (FILE *) cookie; - int w, oldmode=0; - - if (fp->_flags & __SAPP) - (void) _lseek_r (fp->_data, fp->_file, (off_t) 0, SEEK_END); - fp->_flags &= ~__SOFF; /* in case O_APPEND mode is set */ - -#ifdef __SCLE - if (fp->_flags & __SCLE) - oldmode = setmode(fp->_file, O_BINARY); -#endif - - w = _write_r (fp->_data, fp->_file, buf, n); - -#ifdef __SCLE - if (oldmode) - setmode(fp->_file, oldmode); -#endif - - return w; -} - -fpos_t -__sseek (cookie, offset, whence) - _PTR cookie; - fpos_t offset; - int whence; -{ - register FILE *fp = (FILE *) cookie; - register off_t ret; - - ret = _lseek_r (fp->_data, fp->_file, (off_t) offset, whence); - if (ret == -1L) - fp->_flags &= ~__SOFF; - else - { - fp->_flags |= __SOFF; - fp->_offset = ret; - } - return ret; -} - -int -__sclose (cookie) - _PTR cookie; -{ - FILE *fp = (FILE *) cookie; - - return _close_r (fp->_data, fp->_file); -} - -#ifdef __SCLE -int -__stextmode (int fd) -{ -#ifdef __CYGWIN__ - return _cygwin_istext_for_stdio (fd); -#else - return 0; -#endif -} -#endif diff --git a/newlib/libc/stdio/stdio.tex b/newlib/libc/stdio/stdio.tex deleted file mode 100644 index 725b2f35b..000000000 --- a/newlib/libc/stdio/stdio.tex +++ /dev/null @@ -1,191 +0,0 @@ -@node Stdio -@chapter Input and Output (@file{stdio.h}) - -This chapter comprises functions to manage files -or other input/output streams. Among these functions are subroutines -to generate or scan strings according to specifications from a format string. - -The underlying facilities for input and output depend on the host -system, but these functions provide a uniform interface. - -The corresponding declarations are in @file{stdio.h}. - -The reentrant versions of these functions use macros - -@example -_stdin_r(@var{reent}) -_stdout_r(@var{reent}) -_stderr_r(@var{reent}) -@end example - -@noindent -instead of the globals @code{stdin}, @code{stdout}, and -@code{stderr}. The argument <[reent]> is a pointer to a reentrancy -structure. - -@menu -* clearerr:: Clear file or stream error indicator -* fclose:: Close a file -* feof:: Test for end of file -* ferror:: Test whether read/write error has occurred -* fflush:: Flush buffered file output -* fgetc:: Get a character from a file or stream -* fgetpos:: Record position in a stream or file -* fgets:: Get character string from a file or stream -* fiprintf:: Write formatted output to file (integer only) -* fopen:: Open a file -* fdopen:: Turn an open file into a stream -* fputc:: Write a character on a stream or file -* fputs:: Write a character string in a file or stream -* fread:: Read array elements from a file -* freopen:: Open a file using an existing file descriptor -* fseek:: Set file position -* fsetpos:: Restore position of a stream or file -* ftell:: Return position in a stream or file -* fwrite:: Write array elements from memory to a file or stream -* getc:: Get a character from a file or stream (macro) -* getchar:: Get a character from standard input (macro) -* gets:: Get character string from standard input (obsolete) -* getw:: Get a word (int) from a file or stream -* iprintf:: Write formatted output (integer only) -* mktemp:: Generate unused file name -* perror:: Print an error message on standard error -* putc:: Write a character on a stream or file (macro) -* putchar:: Write a character on standard output (macro) -* puts:: Write a character string on standard output -* putw:: Write a word (int) to a file or stream -* remove:: Delete a file's name -* rename:: Rename a file -* rewind:: Reinitialize a file or stream -* setbuf:: Specify full buffering for a file or stream -* setvbuf:: Specify buffering for a file or stream -* siprintf:: Write formatted output (integer only) -* printf:: Write formatted output -* scanf:: Scan and format input -* tmpfile:: Create a temporary file -* tmpnam:: Generate name for a temporary file -* vprintf:: Format variable argument list -@end menu - -@page -@include stdio/clearerr.def - -@page -@include stdio/fclose.def - -@page -@include stdio/feof.def - -@page -@include stdio/ferror.def - -@page -@include stdio/fflush.def - -@page -@include stdio/fgetc.def - -@page -@include stdio/fgetpos.def - -@page -@include stdio/fgets.def - -@page -@include stdio/fiprintf.def - -@page -@include stdio/fopen.def - -@page -@include stdio/fdopen.def - -@page -@include stdio/fputc.def - -@page -@include stdio/fputs.def - -@page -@include stdio/fread.def - -@page -@include stdio/freopen.def - -@page -@include stdio/fseek.def - -@page -@include stdio/fsetpos.def - -@page -@include stdio/ftell.def - -@page -@include stdio/fwrite.def - -@page -@include stdio/getc.def - -@page -@include stdio/getchar.def - -@page -@include stdio/gets.def - -@page -@include stdio/getw.def - -@page -@include stdio/iprintf.def - -@page -@include stdio/mktemp.def - -@page -@include stdio/perror.def - -@page -@include stdio/putc.def - -@page -@include stdio/putchar.def - -@page -@include stdio/puts.def - -@page -@include stdio/putw.def - -@page -@include stdio/remove.def - -@page -@include stdio/rename.def - -@page -@include stdio/rewind.def - -@page -@include stdio/setbuf.def - -@page -@include stdio/setvbuf.def - -@page -@include stdio/siprintf.def - -@page -@include stdio/sprintf.def - -@page -@include stdio/sscanf.def - -@page -@include stdio/tmpfile.def - -@page -@include stdio/tmpnam.def - -@page -@include stdio/vfprintf.def diff --git a/newlib/libc/stdio/tmpfile.c b/newlib/libc/stdio/tmpfile.c deleted file mode 100644 index 4b31396e2..000000000 --- a/newlib/libc/stdio/tmpfile.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -FUNCTION -<>---create a temporary file - -INDEX - tmpfile -INDEX - _tmpfile_r - -ANSI_SYNOPSIS - #include - FILE *tmpfile(void); - - FILE *_tmpfile_r(void *<[reent]>); - -TRAD_SYNOPSIS - #include - FILE *tmpfile(); - - FILE *_tmpfile_r(<[reent]>) - char *<[reent]>; - -DESCRIPTION -Create a temporary file (a file which will be deleted automatically), -using a name generated by <>. The temporary file is opened with -the mode <<"wb+">>, permitting you to read and write anywhere in it -as a binary file (without any data transformations the host system may -perform for text files). - -The alternate function <<_tmpfile_r>> is a reentrant version. The -argument <[reent]> is a pointer to a reentrancy structure. - -RETURNS -<> normally returns a pointer to the temporary file. If no -temporary file could be created, the result is NULL, and <> -records the reason for failure. - -PORTABILITY -Both ANSI C and the System V Interface Definition (Issue 2) require -<>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>, <>, <>. - -<> also requires the global pointer <>. -*/ - -#include -#include - -FILE * -_DEFUN (_tmpfile_r, (ptr), - struct _reent *ptr) -{ - FILE *fp; - int e; - char *f; - char buf[L_tmpnam]; - - if ((f = _tmpnam_r (ptr, buf)) == NULL) - return NULL; - fp = fopen (f, "wb+"); - e = ptr->_errno; - _CAST_VOID remove (f); - ptr->_errno = e; - return fp; -} - -#ifndef _REENT_ONLY - -FILE * -_DEFUN_VOID (tmpfile) -{ - return _tmpfile_r (_REENT); -} - -#endif diff --git a/newlib/libc/stdio/tmpnam.c b/newlib/libc/stdio/tmpnam.c deleted file mode 100644 index 28b394f10..000000000 --- a/newlib/libc/stdio/tmpnam.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * tmpname.c - * Original Author: G. Haley - */ - -/* -FUNCTION -<>, <>---name for a temporary file - -INDEX - tmpnam -INDEX - tempnam -INDEX - _tmpnam_r -INDEX - _tempnam_r - -ANSI_SYNOPSIS - #include - char *tmpnam(char *<[s]>); - char *tempnam(char *<[dir]>, char *<[pfx]>); - char *_tmpnam_r(void *<[reent]>, char *<[s]>); - char *_tempnam_r(void *<[reent]>, char *<[dir]>, char *<[pfx]>); - -TRAD_SYNOPSIS - #include - char *tmpnam(<[s]>) - char *<[s]>; - - char *tempnam(<[dir]>, <[pfx]>) - char *<[dir]>; - char *<[pfx]>; - - char *_tmpnam_r(<[reent]>, <[s]>) - char *<[reent]>; - char *<[s]>; - - char *_tempnam_r(<[reent]>, <[dir]>, <[pfx]>) - char *<[reent]>; - char *<[dir]>; - char *<[pfx]>; - -DESCRIPTION -Use either of these functions to generate a name for a temporary file. -The generated name is guaranteed to avoid collision with other files -(for up to <> calls of either function). - -<> generates file names with the value of <> -(defined in `<>') as the leading directory component of the path. - -You can use the <> argument <[s]> to specify a suitable area -of memory for the generated filename; otherwise, you can call -<> to use an internal static buffer. - -<> allows you more control over the generated filename: you -can use the argument <[dir]> to specify the path to a directory for -temporary files, and you can use the argument <[pfx]> to specify a -prefix for the base filename. - -If <[dir]> is <>, <> will attempt to use the value of -environment variable <> instead; if there is no such value, -<> uses the value of <> (defined in `<>'). - -If you don't need any particular prefix to the basename of temporary -files, you can pass <> as the <[pfx]> argument to <>. - -<<_tmpnam_r>> and <<_tempnam_r>> are reentrant versions of <> -and <> respectively. The extra argument <[reent]> is a -pointer to a reentrancy structure. - -WARNINGS -The generated filenames are suitable for temporary files, but do not -in themselves make files temporary. Files with these names must still -be explicitly removed when you no longer want them. - -If you supply your own data area <[s]> for <>, you must ensure -that it has room for at least <> elements of type <>. - -RETURNS -Both <> and <> return a pointer to the newly -generated filename. - -PORTABILITY -ANSI C requires <>, but does not specify the use of -<>. The System V Interface Definition (Issue 2) requires -both <> and <>. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>, <>, <>. - -The global pointer <> is also required. -*/ - -#include <_ansi.h> -#include -#include -#include -#include -#include -#include - -/* Try to open the file specified, if it can't be opened then try - another one. Return nonzero if successful, otherwise zero. */ - -static int -worker (ptr, result, part1, part2, part3, part4) - struct _reent *ptr; - char *result; - _CONST char *part1; - _CONST char *part2; - int part3; - int *part4; -{ - /* Generate the filename and make sure that there isn't one called - it already. */ - - while (1) - { - int t; - _sprintf_r (ptr, result, "%s/%s%x.%x", part1, part2, part3, *part4); - (*part4)++; - t = _open_r (ptr, result, O_RDONLY, 0); - if (t == -1) - { - if (ptr->_errno == ENOSYS) - { - result[0] = '\0'; - return 0; - } - break; - } - _close_r (ptr, t); - } - return 1; -} - -char * -_DEFUN (_tmpnam_r, (p, s), - struct _reent *p _AND - char *s) -{ - char *result; - int pid; - - if (s == NULL) - { - /* ANSI states we must use an internal static buffer if s is NULL */ - result = p->_emergency; - } - else - { - result = s; - } - pid = _getpid_r (p); - - if (worker (p, result, P_tmpdir, "t", pid, &p->_inc)) - { - p->_inc++; - return result; - } - - return NULL; -} - -char * -_DEFUN (_tempnam_r, (p, dir, pfx), - struct _reent *p _AND - _CONST char *dir _AND - _CONST char *pfx) -{ - char *filename; - int length; - _CONST char *prefix = (pfx) ? pfx : ""; - if (dir == NULL && (dir = getenv ("TMPDIR")) == NULL) - dir = P_tmpdir; - - /* two 8 digit numbers + . / */ - length = strlen (dir) + strlen (prefix) + (4 * sizeof (int)) + 2 + 1; - - filename = _malloc_r (p, length); - if (filename) - { - if (! worker (p, filename, dir, prefix, - _getpid_r (p) ^ (int) (_POINTER_INT) p, &p->_inc)) - return NULL; - } - return filename; -} - -#ifndef _REENT_ONLY - -char * -_DEFUN (tempnam, (dir, pfx), - _CONST char *dir _AND - _CONST char *pfx) -{ - return _tempnam_r (_REENT, dir, pfx); -} - -char * -_DEFUN (tmpnam, (s), - char *s) -{ - return _tmpnam_r (_REENT, s); -} - -#endif diff --git a/newlib/libc/stdio/ungetc.c b/newlib/libc/stdio/ungetc.c deleted file mode 100644 index 418717e68..000000000 --- a/newlib/libc/stdio/ungetc.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include -#include "local.h" - -/* - * Expand the ungetc buffer `in place'. That is, adjust fp->_p when - * the buffer moves, so that it points the same distance from the end, - * and move the bytes in the buffer around as necessary so that they - * are all at the end (stack-style). - */ - -/*static*/ -int -__submore (fp) - register FILE *fp; -{ - register int i; - register unsigned char *p; - - if (fp->_ub._base == fp->_ubuf) - { - /* - * Get a new buffer (rather than expanding the old one). - */ - if ((p = (unsigned char *) _malloc_r (fp->_data, (size_t) BUFSIZ)) == NULL) - return EOF; - fp->_ub._base = p; - fp->_ub._size = BUFSIZ; - p += BUFSIZ - sizeof (fp->_ubuf); - for (i = sizeof (fp->_ubuf); --i >= 0;) - p[i] = fp->_ubuf[i]; - fp->_p = p; - return 0; - } - i = fp->_ub._size; - p = (unsigned char *) _realloc_r (fp->_data, (_PTR) (fp->_ub._base), i << 1); - if (p == NULL) - return EOF; - (void) memcpy ((void *) (p + i), (void *) p, (size_t) i); - fp->_p = p + i; - fp->_ub._base = p; - fp->_ub._size = i << 1; - return 0; -} - -int -ungetc (c, fp) - int c; - register FILE *fp; -{ - if (c == EOF) - return (EOF); - - /* Ensure stdio has been initialized. - ??? Might be able to remove this as some other stdio routine should - have already been called to get the char we are un-getting. */ - - CHECK_INIT (fp); - - /* After ungetc, we won't be at eof anymore */ - fp->_flags &= ~__SEOF; - - if ((fp->_flags & __SRD) == 0) - { - /* - * Not already reading: no good unless reading-and-writing. - * Otherwise, flush any current write stuff. - */ - if ((fp->_flags & __SRW) == 0) - return EOF; - if (fp->_flags & __SWR) - { - if (fflush (fp)) - return EOF; - fp->_flags &= ~__SWR; - fp->_w = 0; - fp->_lbfsize = 0; - } - fp->_flags |= __SRD; - } - c = (unsigned char) c; - - /* - * If we are in the middle of ungetc'ing, just continue. - * This may require expanding the current ungetc buffer. - */ - - if (HASUB (fp)) - { - if (fp->_r >= fp->_ub._size && __submore (fp)) - return EOF; - *--fp->_p = c; - fp->_r++; - return c; - } - - /* - * If we can handle this by simply backing up, do so, - * but never replace the original character. - * (This makes sscanf() work when scanning `const' data.) - */ - - if (fp->_bf._base != NULL && fp->_p > fp->_bf._base && fp->_p[-1] == c) - { - fp->_p--; - fp->_r++; - return c; - } - - /* - * Create an ungetc buffer. - * Initially, we will use the `reserve' buffer. - */ - - fp->_ur = fp->_r; - fp->_up = fp->_p; - fp->_ub._base = fp->_ubuf; - fp->_ub._size = sizeof (fp->_ubuf); - fp->_ubuf[sizeof (fp->_ubuf) - 1] = c; - fp->_p = &fp->_ubuf[sizeof (fp->_ubuf) - 1]; - fp->_r = 1; - return c; -} diff --git a/newlib/libc/stdio/vfieeefp.h b/newlib/libc/stdio/vfieeefp.h deleted file mode 100644 index 6843d5f47..000000000 --- a/newlib/libc/stdio/vfieeefp.h +++ /dev/null @@ -1,205 +0,0 @@ -/**************************************************************** - * - * The author of this software is David M. Gay. - * - * Copyright (c) 1991 by AT&T. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software and in all copies of the supporting - * documentation for such software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY - * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - ***************************************************************/ - -/* Please send bug reports to - David M. Gay - AT&T Bell Laboratories, Room 2C-463 - 600 Mountain Avenue - Murray Hill, NJ 07974-2070 - U.S.A. - dmg@research.att.com or research!dmg - */ - -/* This header file is a modification of mprec.h that only contains floating - point union code. */ - -#include -#include -#include -#include -#include - -#ifdef __IEEE_LITTLE_ENDIAN -#define IEEE_8087 -#endif - -#ifdef __IEEE_BIG_ENDIAN -#define IEEE_MC68k -#endif - -#ifdef __Z8000__ -#define Just_16 -#endif - -#ifdef Unsigned_Shifts -#define Sign_Extend(a,b) if (b < 0) a |= (__uint32_t)0xffff0000; -#else -#define Sign_Extend(a,b) /*no-op*/ -#endif - -#if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM) != 1 -Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. -#endif - -/* If we are going to examine or modify specific bits in a double using - the word0 and/or word1 macros, then we must wrap the double inside - a union. This is necessary to avoid undefined behavior according to - the ANSI C spec. */ -union double_union -{ - double d; - __uint32_t i[2]; -}; - -#ifdef IEEE_8087 -#define word0(x) (x.i[1]) -#define word1(x) (x.i[0]) -#else -#define word0(x) (x.i[0]) -#define word1(x) (x.i[1]) -#endif - -/* #define P DBL_MANT_DIG */ -/* Ten_pmax = floor(P*log(2)/log(5)) */ -/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ -/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ -/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ - -#if defined(IEEE_8087) + defined(IEEE_MC68k) -#if defined (_DOUBLE_IS_32BITS) -#define Exp_shift 23 -#define Exp_shift1 23 -#define Exp_msk1 ((__uint32_t)0x00800000L) -#define Exp_msk11 ((__uint32_t)0x00800000L) -#define Exp_mask ((__uint32_t)0x7f800000L) -#define P 24 -#define Bias 127 -#if 0 -#define IEEE_Arith /* it is, but the code doesn't handle IEEE singles yet */ -#endif -#define Emin (-126) -#define Exp_1 ((__uint32_t)0x3f800000L) -#define Exp_11 ((__uint32_t)0x3f800000L) -#define Ebits 8 -#define Frac_mask ((__uint32_t)0x007fffffL) -#define Frac_mask1 ((__uint32_t)0x007fffffL) -#define Ten_pmax 10 -#define Sign_bit ((__uint32_t)0x80000000L) -#define Ten_pmax 10 -#define Bletch 2 -#define Bndry_mask ((__uint32_t)0x007fffffL) -#define Bndry_mask1 ((__uint32_t)0x007fffffL) -#define LSB 1 -#define Sign_bit ((__uint32_t)0x80000000L) -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 5 -#define Int_max 6 -#define Infinite(x) (word0(x) == ((__uint32_t)0x7f800000L)) -#undef word0 -#undef word1 - -#define word0(x) (x.i[0]) -#define word1(x) 0 -#else - -#define Exp_shift 20 -#define Exp_shift1 20 -#define Exp_msk1 ((__uint32_t)0x100000L) -#define Exp_msk11 ((__uint32_t)0x100000L) -#define Exp_mask ((__uint32_t)0x7ff00000L) -#define P 53 -#define Bias 1023 -#define IEEE_Arith -#define Emin (-1022) -#define Exp_1 ((__uint32_t)0x3ff00000L) -#define Exp_11 ((__uint32_t)0x3ff00000L) -#define Ebits 11 -#define Frac_mask ((__uint32_t)0xfffffL) -#define Frac_mask1 ((__uint32_t)0xfffffL) -#define Ten_pmax 22 -#define Bletch 0x10 -#define Bndry_mask ((__uint32_t)0xfffffL) -#define Bndry_mask1 ((__uint32_t)0xfffffL) -#define LSB 1 -#define Sign_bit ((__uint32_t)0x80000000L) -#define Log2P 1 -#define Tiny0 0 -#define Tiny1 1 -#define Quick_max 14 -#define Int_max 14 -#define Infinite(x) (word0(x) == ((__uint32_t)0x7ff00000L)) /* sufficient test for here */ -#endif - -#else -#undef Sudden_Underflow -#define Sudden_Underflow -#ifdef IBM -#define Exp_shift 24 -#define Exp_shift1 24 -#define Exp_msk1 ((__uint32_t)0x1000000L) -#define Exp_msk11 ((__uint32_t)0x1000000L) -#define Exp_mask ((__uint32_t)0x7f000000L) -#define P 14 -#define Bias 65 -#define Exp_1 ((__uint32_t)0x41000000L) -#define Exp_11 ((__uint32_t)0x41000000L) -#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ -#define Frac_mask ((__uint32_t)0xffffffL) -#define Frac_mask1 ((__uint32_t)0xffffffL) -#define Bletch 4 -#define Ten_pmax 22 -#define Bndry_mask ((__uint32_t)0xefffffL) -#define Bndry_mask1 ((__uint32_t)0xffffffL) -#define LSB 1 -#define Sign_bit ((__uint32_t)0x80000000L) -#define Log2P 4 -#define Tiny0 ((__uint32_t)0x100000L) -#define Tiny1 0 -#define Quick_max 14 -#define Int_max 15 -#else /* VAX */ -#define Exp_shift 23 -#define Exp_shift1 7 -#define Exp_msk1 0x80 -#define Exp_msk11 ((__uint32_t)0x800000L) -#define Exp_mask ((__uint32_t)0x7f80L) -#define P 56 -#define Bias 129 -#define Exp_1 ((__uint32_t)0x40800000L) -#define Exp_11 ((__uint32_t)0x4080L) -#define Ebits 8 -#define Frac_mask ((__uint32_t)0x7fffffL) -#define Frac_mask1 ((__uint32_t)0xffff007fL) -#define Ten_pmax 24 -#define Bletch 2 -#define Bndry_mask ((__uint32_t)0xffff007fL) -#define Bndry_mask1 ((__uint32_t)0xffff007fL) -#define LSB ((__uint32_t)0x10000L) -#define Sign_bit ((__uint32_t)0x8000L) -#define Log2P 1 -#define Tiny0 0x80 -#define Tiny1 0 -#define Quick_max 15 -#define Int_max 15 -#endif -#endif - - diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c deleted file mode 100644 index a96ce0c7d..000000000 --- a/newlib/libc/stdio/vfprintf.c +++ /dev/null @@ -1,938 +0,0 @@ -/* -FUNCTION -<>, <>, <>---format argument list - -INDEX - vprintf -INDEX - vfprintf -INDEX - vsprintf -INDEX - vsnprintf - -ANSI_SYNOPSIS - #include - #include - int vprintf(const char *<[fmt]>, va_list <[list]>); - int vfprintf(FILE *<[fp]>, const char *<[fmt]>, va_list <[list]>); - int vsprintf(char *<[str]>, const char *<[fmt]>, va_list <[list]>); - int vsnprintf(char *<[str]>, size_t <[size]>, const char *<[fmt]>, va_list <[list]>); - - int _vprintf_r(void *<[reent]>, const char *<[fmt]>, - va_list <[list]>); - int _vfprintf_r(void *<[reent]>, FILE *<[fp]>, const char *<[fmt]>, - va_list <[list]>); - int _vsprintf_r(void *<[reent]>, char *<[str]>, const char *<[fmt]>, - va_list <[list]>); - int _vsnprintf_r(void *<[reent]>, char *<[str]>, size_t <[size]>, const char *<[fmt]>, - va_list <[list]>); - -TRAD_SYNOPSIS - #include - #include - int vprintf( <[fmt]>, <[list]>) - char *<[fmt]>; - va_list <[list]>; - - int vfprintf(<[fp]>, <[fmt]>, <[list]>) - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int vsprintf(<[str]>, <[fmt]>, <[list]>) - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int vsnprintf(<[str]>, <[size]>, <[fmt]>, <[list]>) - char *<[str]>; - size_t <[size]>; - char *<[fmt]>; - va_list <[list]>; - - int _vprintf_r(<[reent]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[fmt]>; - va_list <[list]>; - - int _vfprintf_r(<[reent]>, <[fp]>, <[fmt]>, <[list]>) - char *<[reent]>; - FILE *<[fp]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsprintf_r(<[reent]>, <[str]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[str]>; - char *<[fmt]>; - va_list <[list]>; - - int _vsnprintf_r(<[reent]>, <[str]>, <[size]>, <[fmt]>, <[list]>) - char *<[reent]>; - char *<[str]>; - size_t <[size]>; - char *<[fmt]>; - va_list <[list]>; - -DESCRIPTION -<>, <>, <> and <> are (respectively) -variants of <>, <>, <> and <>. They differ -only in allowing their caller to pass the variable argument list as a -<> object (initialized by <>) rather than directly -accepting a variable number of arguments. - -RETURNS -The return values are consistent with the corresponding functions: -<> returns the number of bytes in the output string, -save that the concluding <> is not counted. -<> and <> return the number of characters transmitted. -If an error occurs, <> and <> return <>. No -error returns occur for <>. - -PORTABILITY -ANSI C requires all three functions. - -Supporting OS subroutines required: <>, <>, <>, -<>, <>, <>, <>. -*/ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Chris Torek. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -/*static char *sccsid = "from: @(#)vfprintf.c 5.50 (Berkeley) 12/16/92";*/ -static char *rcsid = "$Id$"; -#endif /* LIBC_SCCS and not lint */ - -/* - * Actual printf innards. - * - * This code is large and complicated... - */ - -#ifdef INTEGER_ONLY -#define VFPRINTF vfiprintf -#define _VFPRINTF_R _vfiprintf_r -#else -#define VFPRINTF vfprintf -#define _VFPRINTF_R _vfprintf_r -#define FLOATING_POINT -#endif - -#define _NO_LONGLONG -#if defined WANT_PRINTF_LONG_LONG && defined __GNUC__ -# undef _NO_LONGLONG -#endif - -#include <_ansi.h> -#include -#include -#include -#include - -#ifdef _HAVE_STDC -#include -#else -#include -#endif - -#include "local.h" -#include "fvwrite.h" -#include "vfieeefp.h" - -/* - * Flush out all the vectors defined by the given uio, - * then reset it so that it can be reused. - */ -static int -__sprint(fp, uio) - FILE *fp; - register struct __suio *uio; -{ - register int err; - - if (uio->uio_resid == 0) { - uio->uio_iovcnt = 0; - return (0); - } - err = __sfvwrite(fp, uio); - uio->uio_resid = 0; - uio->uio_iovcnt = 0; - return (err); -} - -/* - * Helper function for `fprintf to unbuffered unix file': creates a - * temporary buffer. We only work on write-only files; this avoids - * worries about ungetc buffers and so forth. - */ -static int -__sbprintf(fp, fmt, ap) - register FILE *fp; - const char *fmt; - va_list ap; -{ - int ret; - FILE fake; - unsigned char buf[BUFSIZ]; - - /* copy the important variables */ - fake._data = fp->_data; - fake._flags = fp->_flags & ~__SNBF; - fake._file = fp->_file; - fake._cookie = fp->_cookie; - fake._write = fp->_write; - - /* set up the buffer */ - fake._bf._base = fake._p = buf; - fake._bf._size = fake._w = sizeof(buf); - fake._lbfsize = 0; /* not actually used, but Just In Case */ - - /* do the work, then copy any error status */ - ret = VFPRINTF(&fake, fmt, ap); - if (ret >= 0 && fflush(&fake)) - ret = EOF; - if (fake._flags & __SERR) - fp->_flags |= __SERR; - return (ret); -} - - -#ifdef FLOATING_POINT -#include -#include -#include "floatio.h" - -#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ -#define DEFPREC 6 - -static char *cvt _PARAMS((struct _reent *, double, int, int, char *, int *, int, int *)); -static int exponent _PARAMS((char *, int, int)); - -#else /* no FLOATING_POINT */ - -#define BUF 40 - -#endif /* FLOATING_POINT */ - - -/* - * Macros for converting digits to letters and vice versa - */ -#define to_digit(c) ((c) - '0') -#define is_digit(c) ((unsigned)to_digit(c) <= 9) -#define to_char(n) ((n) + '0') - -/* - * Flags used during conversion. - */ -#define ALT 0x001 /* alternate form */ -#define HEXPREFIX 0x002 /* add 0x or 0X prefix */ -#define LADJUST 0x004 /* left adjustment */ -#define LONGDBL 0x008 /* long double; unimplemented */ -#define LONGINT 0x010 /* long integer */ -#define QUADINT 0x020 /* quad integer */ -#define SHORTINT 0x040 /* short integer */ -#define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ -#define FPT 0x100 /* Floating point number */ - -int -_DEFUN (VFPRINTF, (fp, fmt0, ap), - FILE * fp _AND - _CONST char *fmt0 _AND - va_list ap) -{ - CHECK_INIT (fp); - return _VFPRINTF_R (fp->_data, fp, fmt0, ap); -} - -int -_DEFUN (_VFPRINTF_R, (data, fp, fmt0, ap), - struct _reent *data _AND - FILE * fp _AND - _CONST char *fmt0 _AND - va_list ap) -{ - register char *fmt; /* format string */ - register int ch; /* character from fmt */ - register int n, m; /* handy integers (short term usage) */ - register char *cp; /* handy char pointer (short term usage) */ - register struct __siov *iovp;/* for PRINT macro */ - register int flags; /* flags as above */ - int ret; /* return value accumulator */ - int width; /* width from format (%8d), or 0 */ - int prec; /* precision from format (%.3d), or -1 */ - char sign; /* sign prefix (' ', '+', '-', or \0) */ - wchar_t wc; -#ifdef FLOATING_POINT - char *decimal_point = localeconv()->decimal_point; - char softsign; /* temporary negative sign for floats */ - double _double; /* double precision arguments %[eEfgG] */ - int expt; /* integer value of exponent */ - int expsize; /* character count for expstr */ - int ndig; /* actual number of digits returned by cvt */ - char expstr[7]; /* buffer for exponent string */ -#endif - -#ifndef _NO_LONGLONG -#define quad_t long long -#define u_quad_t unsigned long long -#endif - -#ifndef _NO_LONGLONG - u_quad_t _uquad; /* integer arguments %[diouxX] */ -#else - u_long _uquad; -#endif - enum { OCT, DEC, HEX } base;/* base for [diouxX] conversion */ - int dprec; /* a copy of prec if [diouxX], 0 otherwise */ - int realsz; /* field size expanded by dprec */ - int size; /* size of converted field or string */ - char *xdigs; /* digits for [xX] conversion */ -#define NIOV 8 - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ - char ox[2]; /* space for 0x hex-prefix */ - int state = 0; /* mbtowc calls from library must not change state */ - - /* - * Choose PADSIZE to trade efficiency vs. size. If larger printf - * fields occur frequently, increase PADSIZE and make the initialisers - * below longer. - */ -#define PADSIZE 16 /* pad chunk size */ - static _CONST char blanks[PADSIZE] = - {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; - static _CONST char zeroes[PADSIZE] = - {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; - - /* - * BEWARE, these `goto error' on error, and PAD uses `n'. - */ -#define PRINT(ptr, len) { \ - iovp->iov_base = (ptr); \ - iovp->iov_len = (len); \ - uio.uio_resid += (len); \ - iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ - if (__sprint(fp, &uio)) \ - goto error; \ - iovp = iov; \ - } \ -} -#define PAD(howmany, with) { \ - if ((n = (howmany)) > 0) { \ - while (n > PADSIZE) { \ - PRINT(with, PADSIZE); \ - n -= PADSIZE; \ - } \ - PRINT(with, n); \ - } \ -} -#define FLUSH() { \ - if (uio.uio_resid && __sprint(fp, &uio)) \ - goto error; \ - uio.uio_iovcnt = 0; \ - iovp = iov; \ -} - - /* - * To extend shorts properly, we need both signed and unsigned - * argument extraction methods. - */ -#ifndef _NO_LONGLONG -#define SARG() \ - (flags&QUADINT ? va_arg(ap, quad_t) : \ - flags&LONGINT ? va_arg(ap, long) : \ - flags&SHORTINT ? (long)(short)va_arg(ap, int) : \ - (long)va_arg(ap, int)) -#define UARG() \ - (flags&QUADINT ? va_arg(ap, u_quad_t) : \ - flags&LONGINT ? va_arg(ap, u_long) : \ - flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \ - (u_long)va_arg(ap, u_int)) -#else -#define SARG() \ - (flags&LONGINT ? va_arg(ap, long) : \ - flags&SHORTINT ? (long)(short)va_arg(ap, int) : \ - (long)va_arg(ap, int)) -#define UARG() \ - (flags&LONGINT ? va_arg(ap, u_long) : \ - flags&SHORTINT ? (u_long)(u_short)va_arg(ap, int) : \ - (u_long)va_arg(ap, u_int)) -#endif - - /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ - if (cantwrite(fp)) - return (EOF); - - /* optimise fprintf(stderr) (and other unbuffered Unix files) */ - if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && - fp->_file >= 0) - return (__sbprintf(fp, fmt0, ap)); - - fmt = (char *)fmt0; - uio.uio_iov = iovp = iov; - uio.uio_resid = 0; - uio.uio_iovcnt = 0; - ret = 0; - - /* - * Scan the format for conversions (`%' character). - */ - for (;;) { - cp = fmt; - while ((n = _mbtowc_r(_REENT, &wc, fmt, MB_CUR_MAX, &state)) > 0) { - fmt += n; - if (wc == '%') { - fmt--; - break; - } - } - if ((m = fmt - cp) != 0) { - PRINT(cp, m); - ret += m; - } - if (n <= 0) - goto done; - fmt++; /* skip over '%' */ - - flags = 0; - dprec = 0; - width = 0; - prec = -1; - sign = '\0'; - -rflag: ch = *fmt++; -reswitch: switch (ch) { - case ' ': - /* - * ``If the space and + flags both appear, the space - * flag will be ignored.'' - * -- ANSI X3J11 - */ - if (!sign) - sign = ' '; - goto rflag; - case '#': - flags |= ALT; - goto rflag; - case '*': - /* - * ``A negative field width argument is taken as a - * - flag followed by a positive field width.'' - * -- ANSI X3J11 - * They don't exclude field widths read from args. - */ - if ((width = va_arg(ap, int)) >= 0) - goto rflag; - width = -width; - /* FALLTHROUGH */ - case '-': - flags |= LADJUST; - goto rflag; - case '+': - sign = '+'; - goto rflag; - case '.': - if ((ch = *fmt++) == '*') { - n = va_arg(ap, int); - prec = n < 0 ? -1 : n; - goto rflag; - } - n = 0; - while (is_digit(ch)) { - n = 10 * n + to_digit(ch); - ch = *fmt++; - } - prec = n < 0 ? -1 : n; - goto reswitch; - case '0': - /* - * ``Note that 0 is taken as a flag, not as the - * beginning of a field width.'' - * -- ANSI X3J11 - */ - flags |= ZEROPAD; - goto rflag; - case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - n = 0; - do { - n = 10 * n + to_digit(ch); - ch = *fmt++; - } while (is_digit(ch)); - width = n; - goto reswitch; -#ifdef FLOATING_POINT - case 'L': - flags |= LONGDBL; - goto rflag; -#endif - case 'h': - flags |= SHORTINT; - goto rflag; - case 'l': - if (*fmt == 'l') { - fmt++; - flags |= QUADINT; - } else { - flags |= LONGINT; - } - goto rflag; - case 'q': - flags |= QUADINT; - goto rflag; - case 'c': - *(cp = buf) = va_arg(ap, int); - size = 1; - sign = '\0'; - break; - case 'D': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'd': - case 'i': - _uquad = SARG(); -#ifndef _NO_LONGLONG - if ((quad_t)_uquad < 0) -#else - if ((long) _uquad < 0) -#endif - { - - _uquad = -_uquad; - sign = '-'; - } - base = DEC; - goto number; -#ifdef FLOATING_POINT - case 'e': - case 'E': - case 'f': - case 'g': - case 'G': - if (prec == -1) { - prec = DEFPREC; - } else if ((ch == 'g' || ch == 'G') && prec == 0) { - prec = 1; - } - - if (flags & LONGDBL) { - _double = (double) va_arg(ap, long double); - } else { - _double = va_arg(ap, double); - } - - /* do this before tricky precision changes */ - if (isinf(_double)) { - if (_double < 0) - sign = '-'; - cp = "Inf"; - size = 3; - break; - } - if (isnan(_double)) { - cp = "NaN"; - size = 3; - break; - } - - flags |= FPT; - cp = cvt(data, _double, prec, flags, &softsign, - &expt, ch, &ndig); - if (ch == 'g' || ch == 'G') { - if (expt <= -4 || expt > prec) - ch = (ch == 'g') ? 'e' : 'E'; - else - ch = 'g'; - } - if (ch <= 'e') { /* 'e' or 'E' fmt */ - --expt; - expsize = exponent(expstr, expt, ch); - size = expsize + ndig; - if (ndig > 1 || flags & ALT) - ++size; - } else if (ch == 'f') { /* f fmt */ - if (expt > 0) { - size = expt; - if (prec || flags & ALT) - size += prec + 1; - } else /* "0.X" */ - size = prec + 2; - } else if (expt >= ndig) { /* fixed g fmt */ - size = expt; - if (flags & ALT) - ++size; - } else - size = ndig + (expt > 0 ? - 1 : 2 - expt); - - if (softsign) - sign = '-'; - break; -#endif /* FLOATING_POINT */ - case 'n': -#ifndef _NO_LONGLONG - if (flags & QUADINT) - *va_arg(ap, quad_t *) = ret; - else -#endif - if (flags & LONGINT) - *va_arg(ap, long *) = ret; - else if (flags & SHORTINT) - *va_arg(ap, short *) = ret; - else - *va_arg(ap, int *) = ret; - continue; /* no output */ - case 'O': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'o': - _uquad = UARG(); - base = OCT; - goto nosign; - case 'p': - /* - * ``The argument shall be a pointer to void. The - * value of the pointer is converted to a sequence - * of printable characters, in an implementation- - * defined manner.'' - * -- ANSI X3J11 - */ - /* NOSTRICT */ - _uquad = (u_long)(unsigned _POINTER_INT)va_arg(ap, void *); - base = HEX; - xdigs = "0123456789abcdef"; - flags |= HEXPREFIX; - ch = 'x'; - goto nosign; - case 's': - if ((cp = va_arg(ap, char *)) == NULL) - cp = "(null)"; - if (prec >= 0) { - /* - * can't use strlen; can only look for the - * NUL in the first `prec' characters, and - * strlen() will go further. - */ - char *p = memchr(cp, 0, prec); - - if (p != NULL) { - size = p - cp; - if (size > prec) - size = prec; - } else - size = prec; - } else - size = strlen(cp); - sign = '\0'; - break; - case 'U': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'u': - _uquad = UARG(); - base = DEC; - goto nosign; - case 'X': - xdigs = "0123456789ABCDEF"; - goto hex; - case 'x': - xdigs = "0123456789abcdef"; -hex: _uquad = UARG(); - base = HEX; - /* leading 0x/X only if non-zero */ - if (flags & ALT && _uquad != 0) - flags |= HEXPREFIX; - - /* unsigned conversions */ -nosign: sign = '\0'; - /* - * ``... diouXx conversions ... if a precision is - * specified, the 0 flag will be ignored.'' - * -- ANSI X3J11 - */ -number: if ((dprec = prec) >= 0) - flags &= ~ZEROPAD; - - /* - * ``The result of converting a zero value with an - * explicit precision of zero is no characters.'' - * -- ANSI X3J11 - */ - cp = buf + BUF; - if (_uquad != 0 || prec != 0) { - /* - * Unsigned mod is hard, and unsigned mod - * by a constant is easier than that by - * a variable; hence this switch. - */ - switch (base) { - case OCT: - do { - *--cp = to_char(_uquad & 7); - _uquad >>= 3; - } while (_uquad); - /* handle octal leading 0 */ - if (flags & ALT && *cp != '0') - *--cp = '0'; - break; - - case DEC: - /* many numbers are 1 digit */ - while (_uquad >= 10) { - *--cp = to_char(_uquad % 10); - _uquad /= 10; - } - *--cp = to_char(_uquad); - break; - - case HEX: - do { - *--cp = xdigs[_uquad & 15]; - _uquad >>= 4; - } while (_uquad); - break; - - default: - cp = "bug in vfprintf: bad base"; - size = strlen(cp); - goto skipsize; - } - } - size = buf + BUF - cp; - skipsize: - break; - default: /* "%?" prints ?, unless ? is NUL */ - if (ch == '\0') - goto done; - /* pretend it was %c with argument ch */ - cp = buf; - *cp = ch; - size = 1; - sign = '\0'; - break; - } - - /* - * All reasonable formats wind up here. At this point, `cp' - * points to a string which (if not flags&LADJUST) should be - * padded out to `width' places. If flags&ZEROPAD, it should - * first be prefixed by any sign or other prefix; otherwise, - * it should be blank padded before the prefix is emitted. - * After any left-hand padding and prefixing, emit zeroes - * required by a decimal [diouxX] precision, then print the - * string proper, then emit zeroes required by any leftover - * floating precision; finally, if LADJUST, pad with blanks. - * - * Compute actual size, so we know how much to pad. - * size excludes decimal prec; realsz includes it. - */ - realsz = dprec > size ? dprec : size; - if (sign) - realsz++; - else if (flags & HEXPREFIX) - realsz+= 2; - - /* right-adjusting blank padding */ - if ((flags & (LADJUST|ZEROPAD)) == 0) - PAD(width - realsz, blanks); - - /* prefix */ - if (sign) { - PRINT(&sign, 1); - } else if (flags & HEXPREFIX) { - ox[0] = '0'; - ox[1] = ch; - PRINT(ox, 2); - } - - /* right-adjusting zero padding */ - if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) - PAD(width - realsz, zeroes); - - /* leading zeroes from decimal precision */ - PAD(dprec - size, zeroes); - - /* the string or number proper */ -#ifdef FLOATING_POINT - if ((flags & FPT) == 0) { - PRINT(cp, size); - } else { /* glue together f_p fragments */ - if (ch >= 'f') { /* 'f' or 'g' */ - if (_double == 0) { - /* kludge for __dtoa irregularity */ - PRINT("0", 1); - if (expt < ndig || (flags & ALT) != 0) { - PRINT(decimal_point, 1); - PAD(ndig - 1, zeroes); - } - } else if (expt <= 0) { - PRINT("0", 1); - PRINT(decimal_point, 1); - PAD(-expt, zeroes); - PRINT(cp, ndig); - } else if (expt >= ndig) { - PRINT(cp, ndig); - PAD(expt - ndig, zeroes); - if (flags & ALT) - PRINT(".", 1); - } else { - PRINT(cp, expt); - cp += expt; - PRINT(".", 1); - PRINT(cp, ndig-expt); - } - } else { /* 'e' or 'E' */ - if (ndig > 1 || flags & ALT) { - ox[0] = *cp++; - ox[1] = '.'; - PRINT(ox, 2); - if (_double) { - PRINT(cp, ndig-1); - } else /* 0.[0..] */ - /* __dtoa irregularity */ - PAD(ndig - 1, zeroes); - } else /* XeYYY */ - PRINT(cp, 1); - PRINT(expstr, expsize); - } - } -#else - PRINT(cp, size); -#endif - /* left-adjusting padding (always blank) */ - if (flags & LADJUST) - PAD(width - realsz, blanks); - - /* finally, adjust ret */ - ret += width > realsz ? width : realsz; - - FLUSH(); /* copy out the I/O vectors */ - } -done: - FLUSH(); -error: - return (__sferror(fp) ? EOF : ret); - /* NOTREACHED */ -} - -#ifdef FLOATING_POINT - -extern char *_dtoa_r _PARAMS((struct _reent *, double, int, - int, int *, int *, char **)); - -static char * -cvt(data, value, ndigits, flags, sign, decpt, ch, length) - struct _reent *data; - double value; - int ndigits, flags, *decpt, ch, *length; - char *sign; -{ - int mode, dsgn; - char *digits, *bp, *rve; - union double_union tmp; - - if (ch == 'f') { - mode = 3; /* ndigits after the decimal point */ - } else { - /* To obtain ndigits after the decimal point for the 'e' - * and 'E' formats, round to ndigits + 1 significant - * figures. - */ - if (ch == 'e' || ch == 'E') { - ndigits++; - } - mode = 2; /* ndigits significant digits */ - } - - tmp.d = value; - if (word0(tmp) & Sign_bit) { /* this will check for < 0 and -0.0 */ - value = -value; - *sign = '-'; - } else - *sign = '\000'; - digits = _dtoa_r(data, value, mode, ndigits, decpt, &dsgn, &rve); - if ((ch != 'g' && ch != 'G') || flags & ALT) { /* Print trailing zeros */ - bp = digits + ndigits; - if (ch == 'f') { - if (*digits == '0' && value) - *decpt = -ndigits + 1; - bp += *decpt; - } - if (value == 0) /* kludge for __dtoa irregularity */ - rve = bp; - while (rve < bp) - *rve++ = '0'; - } - *length = rve - digits; - return (digits); -} - -static int -exponent(p0, exp, fmtch) - char *p0; - int exp, fmtch; -{ - register char *p, *t; - char expbuf[MAXEXP]; - - p = p0; - *p++ = fmtch; - if (exp < 0) { - exp = -exp; - *p++ = '-'; - } - else - *p++ = '+'; - t = expbuf + MAXEXP; - if (exp > 9) { - do { - *--t = to_char(exp % 10); - } while ((exp /= 10) > 9); - *--t = to_char(exp); - for (; t < expbuf + MAXEXP; *p++ = *t++); - } - else { - *p++ = '0'; - *p++ = to_char(exp); - } - return (p - p0); -} -#endif /* FLOATING_POINT */ diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c deleted file mode 100644 index e9c67fca1..000000000 --- a/newlib/libc/stdio/vfscanf.c +++ /dev/null @@ -1,961 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <_ansi.h> -#include -#include -#include -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif -#include "local.h" - -#ifndef NO_FLOATING_POINT -#define FLOATING_POINT -#endif - -#ifdef FLOATING_POINT -#include "floatio.h" -#define BUF (MAXEXP+MAXFRACT+3) /* 3 = sign + decimal point + NUL */ -/* An upper bound for how long a long prints in decimal. 4 / 13 approximates - log (2). Add one char for roundoff compensation and one for the sign. */ -#define MAX_LONG_LEN ((CHAR_BIT * sizeof (long) - 1) * 4 / 13 + 2) -#else -#define BUF 40 -#endif - -/* - * Flags used during conversion. - */ - -#define LONG 0x01 /* l: long or double */ -#define LONGDBL 0x02 /* L: long double; unimplemented */ -#define SHORT 0x04 /* h: short */ -#define SUPPRESS 0x08 /* suppress assignment */ -#define POINTER 0x10 /* weird %p pointer (`fake hex') */ -#define NOSKIP 0x20 /* do not skip blanks */ - -/* - * The following are used in numeric conversions only: - * SIGNOK, NDIGITS, DPTOK, and EXPOK are for floating point; - * SIGNOK, NDIGITS, PFXOK, and NZDIGITS are for integral. - */ - -#define SIGNOK 0x40 /* +/- is (still) legal */ -#define NDIGITS 0x80 /* no digits detected */ - -#define DPTOK 0x100 /* (float) decimal point is still legal */ -#define EXPOK 0x200 /* (float) exponent (e+3, etc) still legal */ - -#define PFXOK 0x100 /* 0x prefix is (still) legal */ -#define NZDIGITS 0x200 /* no zero digits detected */ - -/* - * Conversion types. - */ - -#define CT_CHAR 0 /* %c conversion */ -#define CT_CCL 1 /* %[...] conversion */ -#define CT_STRING 2 /* %s conversion */ -#define CT_INT 3 /* integer, i.e., strtol or strtoul */ -#define CT_FLOAT 4 /* floating, i.e., strtod */ - -#if 0 -#define u_char unsigned char -#endif -#define u_char char -#define u_long unsigned long - -/*static*/ u_char *__sccl (); - -/* - * vfscanf - */ - -#define BufferEmpty (fp->_r <= 0 && __srefill(fp)) - -int -__svfscanf (fp, fmt0, ap) - register FILE *fp; - char _CONST *fmt0; - va_list ap; -{ - register u_char *fmt = (u_char *) fmt0; - register int c; /* character from format, or conversion */ - register size_t width; /* field width, or 0 */ - register char *p; /* points into all kinds of strings */ - register int n; /* handy integer */ - register int flags; /* flags as defined above */ - register char *p0; /* saves original value of p when necessary */ - int nassigned; /* number of fields assigned */ - int nread; /* number of characters consumed from fp */ - int base = 0; /* base argument to strtol/strtoul */ - int nbytes = 1; /* number of bytes read from fmt string */ - wchar_t wc; /* wchar to use to read format string */ - - u_long (*ccfn) () = 0; /* conversion function (strtol/strtoul) */ - char ccltab[256]; /* character class table for %[...] */ - char buf[BUF]; /* buffer for numeric conversions */ - char *lptr; /* literal pointer */ - int state = 0; /* value to keep track of multibyte state */ - - short *sp; - int *ip; - float *flp; - _LONG_DOUBLE *ldp; - double *dp; - long *lp; - - /* `basefix' is used to avoid `if' tests in the integer scanner */ - static _CONST short basefix[17] = - {10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; - - nassigned = 0; - nread = 0; - for (;;) - { -#ifndef MB_CAPABLE - wc = *fmt; -#else - nbytes = _mbtowc_r (_REENT, &wc, fmt, MB_CUR_MAX, &state); -#endif - fmt += nbytes; - if (wc == 0) - return nassigned; - if (nbytes == 1 && isspace (wc)) - { - for (;;) - { - if (BufferEmpty) - return nassigned; - if (!isspace (*fp->_p)) - break; - nread++, fp->_r--, fp->_p++; - } - continue; - } - if (wc != '%') - goto literal; - width = 0; - flags = 0; - - /* - * switch on the format. continue if done; break once format - * type is derived. - */ - - again: - c = *fmt++; - - switch (c) - { - case '%': - literal: - lptr = fmt - nbytes; - for (n = 0; n < nbytes; ++n) - { - if (BufferEmpty) - goto input_failure; - if (*fp->_p != *lptr) - goto match_failure; - fp->_r--, fp->_p++; - nread++; - ++lptr; - } - continue; - - case '*': - flags |= SUPPRESS; - goto again; - case 'l': - flags |= LONG; - goto again; - case 'L': - flags |= LONGDBL; - goto again; - case 'h': - flags |= SHORT; - goto again; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - width = width * 10 + c - '0'; - goto again; - - /* - * Conversions. Those marked `compat' are for - * 4.[123]BSD compatibility. - * - * (According to ANSI, E and X formats are supposed to - * the same as e and x. Sorry about that.) - */ - - case 'D': /* compat */ - flags |= LONG; - /* FALLTHROUGH */ - case 'd': - c = CT_INT; - ccfn = (u_long (*)())strtol; - base = 10; - break; - - case 'i': - c = CT_INT; - ccfn = (u_long (*)())strtol; - base = 0; - break; - - case 'O': /* compat */ - flags |= LONG; - /* FALLTHROUGH */ - case 'o': - c = CT_INT; - ccfn = strtoul; - base = 8; - break; - - case 'u': - c = CT_INT; - ccfn = strtoul; - base = 10; - break; - - case 'X': /* compat XXX */ - case 'x': - flags |= PFXOK; /* enable 0x prefixing */ - c = CT_INT; - ccfn = strtoul; - base = 16; - break; - -#ifdef FLOATING_POINT - case 'E': /* compat XXX */ - case 'G': /* compat XXX */ -/* ANSI says that E,G and X behave the same way as e,g,x */ - /* FALLTHROUGH */ - case 'e': - case 'f': - case 'g': - c = CT_FLOAT; - break; -#endif - - case 's': - c = CT_STRING; - break; - - case '[': - fmt = __sccl (ccltab, fmt); - flags |= NOSKIP; - c = CT_CCL; - break; - - case 'c': - flags |= NOSKIP; - c = CT_CHAR; - break; - - case 'p': /* pointer format is like hex */ - flags |= POINTER | PFXOK; - c = CT_INT; - ccfn = strtoul; - base = 16; - break; - - case 'n': - if (flags & SUPPRESS) /* ??? */ - continue; - if (flags & SHORT) - { - sp = va_arg (ap, short *); - *sp = nread; - } - else if (flags & LONG) - { - lp = va_arg (ap, long *); - *lp = nread; - } - else - { - ip = va_arg (ap, int *); - *ip = nread; - } - continue; - - /* - * Disgusting backwards compatibility hacks. XXX - */ - case '\0': /* compat */ - return EOF; - - default: /* compat */ - if (isupper (c)) - flags |= LONG; - c = CT_INT; - ccfn = (u_long (*)())strtol; - base = 10; - break; - } - - /* - * We have a conversion that requires input. - */ - if (BufferEmpty) - goto input_failure; - - /* - * Consume leading white space, except for formats that - * suppress this. - */ - if ((flags & NOSKIP) == 0) - { - while (isspace (*fp->_p)) - { - nread++; - if (--fp->_r > 0) - fp->_p++; - else -#ifndef CYGNUS_NEC - if (__srefill (fp)) -#endif - goto input_failure; - } - /* - * Note that there is at least one character in the - * buffer, so conversions that do not set NOSKIP ca - * no longer result in an input failure. - */ - } - - /* - * Do the conversion. - */ - switch (c) - { - - case CT_CHAR: - /* scan arbitrary characters (sets NOSKIP) */ - if (width == 0) - width = 1; - if (flags & SUPPRESS) - { - size_t sum = 0; - - for (;;) - { - if ((n = fp->_r) < width) - { - sum += n; - width -= n; - fp->_p += n; -#ifndef CYGNUS_NEC - if (__srefill (fp)) - { -#endif - if (sum == 0) - goto input_failure; - break; -#ifndef CYGNUS_NEC - } -#endif - } - else - { - sum += width; - fp->_r -= width; - fp->_p += width; - break; - } - } - nread += sum; - } - else - { -#ifdef CYGNUS_NEC - /* Kludge city for the moment */ - char *dest = va_arg (ap, char *); - int n = width; - if (fp->_r == 0) - goto input_failure; - - while (n && fp->_r) - { - *dest++ = *(fp->_p++); - n--; - fp->_r--; - nread++; - } -#else - size_t r = fread ((_PTR) va_arg (ap, char *), 1, width, fp); - - if (r == 0) - goto input_failure; - nread += r; -#endif - nassigned++; - } - break; - - case CT_CCL: - /* scan a (nonempty) character class (sets NOSKIP) */ - if (width == 0) - width = ~0; /* `infinity' */ - /* take only those things in the class */ - if (flags & SUPPRESS) - { - n = 0; - while (ccltab[*fp->_p]) - { - n++, fp->_r--, fp->_p++; - if (--width == 0) - break; - if (BufferEmpty) - { - if (n == 0) - goto input_failure; - break; - } - } - if (n == 0) - goto match_failure; - } - else - { - p0 = p = va_arg (ap, char *); - while (ccltab[*fp->_p]) - { - fp->_r--; - *p++ = *fp->_p++; - if (--width == 0) - break; - if (BufferEmpty) - { - if (p == p0) - goto input_failure; - break; - } - } - n = p - p0; - if (n == 0) - goto match_failure; - *p = 0; - nassigned++; - } - nread += n; - break; - - case CT_STRING: - /* like CCL, but zero-length string OK, & no NOSKIP */ - if (width == 0) - width = ~0; - if (flags & SUPPRESS) - { - n = 0; - while (!isspace (*fp->_p)) - { - n++, fp->_r--, fp->_p++; - if (--width == 0) - break; - if (BufferEmpty) - break; - } - nread += n; - } - else - { - p0 = p = va_arg (ap, char *); - while (!isspace (*fp->_p)) - { - fp->_r--; - *p++ = *fp->_p++; - if (--width == 0) - break; - if (BufferEmpty) - break; - } - *p = 0; - nread += p - p0; - nassigned++; - } - continue; - - case CT_INT: - /* scan an integer as if by strtol/strtoul */ -#ifdef hardway - if (width == 0 || width > sizeof (buf) - 1) - width = sizeof (buf) - 1; -#else - /* size_t is unsigned, hence this optimisation */ - if (--width > sizeof (buf) - 2) - width = sizeof (buf) - 2; - width++; -#endif - flags |= SIGNOK | NDIGITS | NZDIGITS; - for (p = buf; width; width--) - { - c = *fp->_p; - /* - * Switch on the character; `goto ok' if we - * accept it as a part of number. - */ - switch (c) - { - /* - * The digit 0 is always legal, but is special. - * For %i conversions, if no digits (zero or nonzero) - * have been scanned (only signs), we will have base==0. - * In that case, we should set it to 8 and enable 0x - * prefixing. Also, if we have not scanned zero digits - * before this, do not turn off prefixing (someone else - * will turn it off if we have scanned any nonzero digits). - */ - case '0': - if (base == 0) - { - base = 8; - flags |= PFXOK; - } - if (flags & NZDIGITS) - flags &= ~(SIGNOK | NZDIGITS | NDIGITS); - else - flags &= ~(SIGNOK | PFXOK | NDIGITS); - goto ok; - - /* 1 through 7 always legal */ - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - base = basefix[base]; - flags &= ~(SIGNOK | PFXOK | NDIGITS); - goto ok; - - /* digits 8 and 9 ok iff decimal or hex */ - case '8': - case '9': - base = basefix[base]; - if (base <= 8) - break; /* not legal here */ - flags &= ~(SIGNOK | PFXOK | NDIGITS); - goto ok; - - /* letters ok iff hex */ - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - /* no need to fix base here */ - if (base <= 10) - break; /* not legal here */ - flags &= ~(SIGNOK | PFXOK | NDIGITS); - goto ok; - - /* sign ok only as first character */ - case '+': - case '-': - if (flags & SIGNOK) - { - flags &= ~SIGNOK; - goto ok; - } - break; - - /* x ok iff flag still set & 2nd char */ - case 'x': - case 'X': - if (flags & PFXOK && p == buf + 1) - { - base = 16;/* if %i */ - flags &= ~PFXOK; - goto ok; - } - break; - } - - /* - * If we got here, c is not a legal character - * for a number. Stop accumulating digits. - */ - break; - ok: - /* - * c is legal: store it and look at the next. - */ - *p++ = c; - if (--fp->_r > 0) - fp->_p++; - else -#ifndef CYGNUS_NEC - if (__srefill (fp)) -#endif - break; /* EOF */ - } - /* - * If we had only a sign, it is no good; push back the sign. - * If the number ends in `x', it was [sign] '0' 'x', so push back - * the x and treat it as [sign] '0'. - */ - if (flags & NDIGITS) - { - if (p > buf) - _CAST_VOID ungetc (*(u_char *)-- p, fp); - goto match_failure; - } - c = ((u_char *) p)[-1]; - if (c == 'x' || c == 'X') - { - --p; - /*(void)*/ ungetc (c, fp); - } - if ((flags & SUPPRESS) == 0) - { - u_long res; - - *p = 0; - res = (*ccfn) (buf, (char **) NULL, base); - if (flags & POINTER) - *(va_arg (ap, _PTR *)) = (_PTR) (unsigned _POINTER_INT) res; - else if (flags & SHORT) - { - sp = va_arg (ap, short *); - *sp = res; - } - else if (flags & LONG) - { - lp = va_arg (ap, long *); - *lp = res; - } - else - { - ip = va_arg (ap, int *); - *ip = res; - } - nassigned++; - } - nread += p - buf; - break; - -#ifdef FLOATING_POINT - case CT_FLOAT: - { - /* scan a floating point number as if by strtod */ - /* This code used to assume that the number of digits is reasonable. - However, ANSI / ISO C makes no such stipulation; we have to get - exact results even when there is an unreasonable amount of - leading zeroes. */ - long leading_zeroes, zeroes, exp_adjust; - char *exp_start; -#ifdef hardway - if (width == 0 || width > sizeof (buf) - 1) - width = sizeof (buf) - 1; -#else - /* size_t is unsigned, hence this optimisation */ - if (--width > sizeof (buf) - 2) - width = sizeof (buf) - 2; - width++; -#endif - flags |= SIGNOK | NDIGITS | DPTOK | EXPOK; - zeroes = 0; - exp_adjust = 0; - for (p = buf; width; ) - { - c = *fp->_p; - /* - * This code mimicks the integer conversion - * code, but is much simpler. - */ - switch (c) - { - - case '0': - if (flags & NDIGITS) - { - flags &= ~SIGNOK; - zeroes++; - goto fskip; - } - /* Fall through. */ - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - flags &= ~(SIGNOK | NDIGITS); - goto fok; - - case '+': - case '-': - if (flags & SIGNOK) - { - flags &= ~SIGNOK; - goto fok; - } - break; - case '.': - if (flags & DPTOK) - { - flags &= ~(SIGNOK | DPTOK); - leading_zeroes = zeroes; - goto fok; - } - break; - case 'e': - case 'E': - /* no exponent without some digits */ - if ((flags & (NDIGITS | EXPOK)) == EXPOK - || ((flags & EXPOK) && zeroes)) - { - if (! (flags & DPTOK)) - { - exp_adjust = zeroes - leading_zeroes; - exp_start = p; - } - flags = - (flags & ~(EXPOK | DPTOK)) | - SIGNOK | NDIGITS; - zeroes = 0; - goto fok; - } - break; - } - break; - fok: - *p++ = c; - width--; - fskip: - ++nread; - if (--fp->_r > 0) - fp->_p++; - else -#ifndef CYGNUS_NEC - if (__srefill (fp)) -#endif - break; /* EOF */ - } - if (zeroes) - flags &= ~NDIGITS; - /* - * If no digits, might be missing exponent digits - * (just give back the exponent) or might be missing - * regular digits, but had sign and/or decimal point. - */ - if (flags & NDIGITS) - { - if (flags & EXPOK) - { - /* no digits at all */ - while (p > buf) - { - ungetc (*(u_char *)-- p, fp); - --nread; - } - goto match_failure; - } - /* just a bad exponent (e and maybe sign) */ - c = *(u_char *)-- p; - --nread; - if (c != 'e' && c != 'E') - { - _CAST_VOID ungetc (c, fp); /* sign */ - c = *(u_char *)-- p; - --nread; - } - _CAST_VOID ungetc (c, fp); - } - if ((flags & SUPPRESS) == 0) - { - double res; - long new_exp; - - *p = 0; - if ((flags & (DPTOK | EXPOK)) == EXPOK) - { - exp_adjust = zeroes - leading_zeroes; - new_exp = -exp_adjust; - exp_start = p; - } - else if (exp_adjust) - new_exp = atol (exp_start + 1) - exp_adjust; - if (exp_adjust) - { - - /* If there might not be enough space for the new exponent, - truncate some trailing digits to make room. */ - if (exp_start >= buf + sizeof (buf) - MAX_LONG_LEN) - exp_start = buf + sizeof (buf) - MAX_LONG_LEN - 1; - sprintf (exp_start, "e%ld", new_exp); - } - res = atof (buf); - if (flags & LONG) - { - dp = va_arg (ap, double *); - *dp = res; - } - else if (flags & LONGDBL) - { - ldp = va_arg (ap, _LONG_DOUBLE *); - *ldp = res; - } - else - { - flp = va_arg (ap, float *); - *flp = res; - } - nassigned++; - } - break; - } -#endif /* FLOATING_POINT */ - } - } -input_failure: - return nassigned ? nassigned : -1; -match_failure: - return nassigned; -} - -/* - * Fill in the given table from the scanset at the given format - * (just after `['). Return a pointer to the character past the - * closing `]'. The table has a 1 wherever characters should be - * considered part of the scanset. - */ - -/*static*/ -u_char * -__sccl (tab, fmt) - register char *tab; - register u_char *fmt; -{ - register int c, n, v; - - /* first `clear' the whole table */ - c = *fmt++; /* first char hat => negated scanset */ - if (c == '^') - { - v = 1; /* default => accept */ - c = *fmt++; /* get new first char */ - } - else - v = 0; /* default => reject */ - /* should probably use memset here */ - for (n = 0; n < 256; n++) - tab[n] = v; - if (c == 0) - return fmt - 1; /* format ended before closing ] */ - - /* - * Now set the entries corresponding to the actual scanset to the - * opposite of the above. - * - * The first character may be ']' (or '-') without being special; the - * last character may be '-'. - */ - - v = 1 - v; - for (;;) - { - tab[c] = v; /* take character c */ - doswitch: - n = *fmt++; /* and examine the next */ - switch (n) - { - - case 0: /* format ended too soon */ - return fmt - 1; - - case '-': - /* - * A scanset of the form [01+-] is defined as `the digit 0, the - * digit 1, the character +, the character -', but the effect of a - * scanset such as [a-zA-Z0-9] is implementation defined. The V7 - * Unix scanf treats `a-z' as `the letters a through z', but treats - * `a-a' as `the letter a, the character -, and the letter a'. - * - * For compatibility, the `-' is not considerd to define a range if - * the character following it is either a close bracket (required by - * ANSI) or is not numerically greater than the character we just - * stored in the table (c). - */ - n = *fmt; - if (n == ']' || n < c) - { - c = '-'; - break; /* resume the for(;;) */ - } - fmt++; - do - { /* fill in the range */ - tab[++c] = v; - } - while (c < n); -#if 1 /* XXX another disgusting compatibility hack */ - /* - * Alas, the V7 Unix scanf also treats formats such - * as [a-c-e] as `the letters a through e'. This too - * is permitted by the standard.... - */ - goto doswitch; -#else - c = *fmt++; - if (c == 0) - return fmt - 1; - if (c == ']') - return fmt; -#endif - - break; - - - case ']': /* end of scanset */ - return fmt; - - default: /* just another character */ - c = n; - break; - } - } - /* NOTREACHED */ -} diff --git a/newlib/libc/stdio/vprintf.c b/newlib/libc/stdio/vprintf.c deleted file mode 100644 index c270141f0..000000000 --- a/newlib/libc/stdio/vprintf.c +++ /dev/null @@ -1,35 +0,0 @@ -/* doc in vfprintf.c */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include <_ansi.h> -#include - -#ifdef _HAVE_STDC -#include -#else -#include -#endif - -int -vprintf (fmt, ap) - char _CONST *fmt; - va_list ap; -{ - return vfprintf (stdout, fmt, ap); -} diff --git a/newlib/libc/stdio/vsnprintf.c b/newlib/libc/stdio/vsnprintf.c deleted file mode 100644 index 18df5864a..000000000 --- a/newlib/libc/stdio/vsnprintf.c +++ /dev/null @@ -1,73 +0,0 @@ -/* doc in vfprintf.c */ - -/* This code created by modifying vsprintf.c so copyright inherited. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include <_ansi.h> -#include -#include -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif - -int -vsnprintf (str, size, fmt, ap) - char *str; - size_t size; - char _CONST *fmt; - va_list ap; -{ - int ret; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = size; - f._data = _REENT; - ret = vfprintf (&f, fmt, ap); - *f._p = 0; - return ret; -} - -int -vsnprintf_r (ptr, str, size, fmt, ap) - struct _reent *ptr; - char *str; - size_t size; - char _CONST *fmt; - va_list ap; -{ - int ret; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = size; - f._data = ptr; - ret = vfprintf (&f, fmt, ap); - *f._p = 0; - return ret; -} diff --git a/newlib/libc/stdio/vsprintf.c b/newlib/libc/stdio/vsprintf.c deleted file mode 100644 index 416c184e8..000000000 --- a/newlib/libc/stdio/vsprintf.c +++ /dev/null @@ -1,70 +0,0 @@ -/* doc in vfprintf.c */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include <_ansi.h> -#include -#include -#include -#ifdef _HAVE_STDC -#include -#else -#include -#endif - -int -vsprintf (str, fmt, ap) - char *str; - char _CONST *fmt; - va_list ap; -{ - int ret; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = INT_MAX; - f._data = _REENT; - ret = vfprintf (&f, fmt, ap); - *f._p = 0; - return ret; -} - -int -vsprintf_r (ptr, str, fmt, ap) - struct _reent *ptr; - char *str; - char _CONST *fmt; - va_list ap; -{ - int ret; - FILE f; - - f._flags = __SWR | __SSTR; - f._bf._base = f._p = (unsigned char *) str; - f._bf._size = f._w = INT_MAX; - f._data = ptr; - ret = vfprintf (&f, fmt, ap); - *f._p = 0; - return ret; -} - diff --git a/newlib/libc/stdio/wbuf.c b/newlib/libc/stdio/wbuf.c deleted file mode 100644 index 110682971..000000000 --- a/newlib/libc/stdio/wbuf.c +++ /dev/null @@ -1,81 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "%W% (Berkeley) %G%"; -#endif /* LIBC_SCCS and not lint */ - -#include -#include "local.h" -#include "fvwrite.h" - -/* - * Write the given character into the (probably full) buffer for - * the given file. Flush the buffer out if it is or becomes full, - * or if c=='\n' and the file is line buffered. - */ - -int -__swbuf (c, fp) - register int c; - register FILE *fp; -{ - register int n; - - /* Ensure stdio has been initialized. */ - - CHECK_INIT (fp); - - /* - * In case we cannot write, or longjmp takes us out early, - * make sure _w is 0 (if fully- or un-buffered) or -_bf._size - * (if line buffered) so that we will get called again. - * If we did not do this, a sufficient number of putc() - * calls might wrap _w from negative to positive. - */ - - fp->_w = fp->_lbfsize; - if (cantwrite (fp)) - return EOF; - c = (unsigned char) c; - - /* - * If it is completely full, flush it out. Then, in any case, - * stuff c into the buffer. If this causes the buffer to fill - * completely, or if c is '\n' and the file is line buffered, - * flush it (perhaps a second time). The second flush will always - * happen on unbuffered streams, where _bf._size==1; fflush() - * guarantees that putc() will always call wbuf() by setting _w - * to 0, so we need not do anything else. - */ - - n = fp->_p - fp->_bf._base; - if (n >= fp->_bf._size) - { - if (fflush (fp)) - return EOF; - n = 0; - } - fp->_w--; - *fp->_p++ = c; - if (++n == fp->_bf._size || (fp->_flags & __SLBF && c == '\n')) - if (fflush (fp)) - return EOF; - return c; -} diff --git a/newlib/libc/stdio/wsetup.c b/newlib/libc/stdio/wsetup.c deleted file mode 100644 index 23b032efe..000000000 --- a/newlib/libc/stdio/wsetup.c +++ /dev/null @@ -1,79 +0,0 @@ -/* No user fns here. Pesch 15apr92. */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include -#include -#include "local.h" - -/* - * Various output routines call wsetup to be sure it is safe to write, - * because either _flags does not include __SWR, or _buf is NULL. - * _wsetup returns 0 if OK to write, nonzero otherwise. - */ - -int -_DEFUN (__swsetup, (fp), - register FILE * fp) -{ - /* Make sure stdio is set up. */ - - CHECK_INIT (fp); - - /* - * If we are not writing, we had better be reading and writing. - */ - - if ((fp->_flags & __SWR) == 0) - { - if ((fp->_flags & __SRW) == 0) - return EOF; - if (fp->_flags & __SRD) - { - /* clobber any ungetc data */ - if (HASUB (fp)) - FREEUB (fp); - fp->_flags &= ~(__SRD | __SEOF); - fp->_r = 0; - fp->_p = fp->_bf._base; - } - fp->_flags |= __SWR; - } - - /* - * Make a buffer if necessary, then set _w. - */ - /* NOT NEEDED FOR CYGNUS SPRINTF ONLY jpg */ - if (fp->_bf._base == NULL) - __smakebuf (fp); - - if (fp->_flags & __SLBF) - { - /* - * It is line buffered, so make _lbfsize be -_bufsize - * for the putc() macro. We will change _lbfsize back - * to 0 whenever we turn off __SWR. - */ - fp->_w = 0; - fp->_lbfsize = -fp->_bf._size; - } - else - fp->_w = fp->_flags & __SNBF ? 0 : fp->_bf._size; - - return 0; -} -- cgit v1.2.3