mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Update.
1997-08-20 05:30 Ulrich Drepper <drepper@cygnus.com> * catgets/catgets.c (catclose): Use __munmap instead of munmap. * catgets/gencat.c (read_input_file): Fix typo. * dirent/dirent.h: Make seekdir and telldir available for __USE_XOPEN. * elf/dl-load.c: Fix case of missing DT_RPATH in object which gets executed (e.g., when it is a static binary). * intl/bindtextdomain.c: Use strdup in glibc. Correct comment. * intl/dcgettext.c: Likewise. * intl/dgettext.c: Likewise. * intl/explodename.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettext.c: Likewise. * intl/gettext.h: Likewise. * intl/hash-string.h: Likewise. * intl/l10nflist.c: Likewise. * intl/libintl.h: Likewise. * intl/loadinfo.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/textdomain.c: Likewise. Unify libio sources with code in libg++. * libio/fcloseall.c: Update and reformat copyright. Protect use of weak_alias. Use _IO_* thread macros instead of __libc_*. * libio/feof.c: Likewise. * libio/feof_u.c: Likewise. * libio/ferror.c: Likewise. * libio/ferror_u.c: Likewise. * libio/fgetc.c: Likewise. * libio/filedoalloc.c: Likewise. * libio/fileno.c: Likewise. * libio/fileops.c: Likewise. * libio/fputc.c: Likewise. * libio/fputc_u.c: Likewise. * libio/freopen.c: Likewise. * libio/fseek.c: Likewise. * libio/genops.c: Likewise. * libio/getc.c: Likewise. * libio/getc_u.c: Likewise. * libio/getchar.c: Likewise. * libio/getchar_u.c: Likewise. * libio/iofclose.c: Likewise. * libio/iofdopen.c: Likewise. * libio/iofflush.c: Likewise. * libio/iofflush_u.c: Likewise. * libio/iofgetpos.c: Likewise. * libio/iofgets.c: Likewise. * libio/iofopen.c: Likewise. * libio/iofopncook.c: Likewise. * libio/iofprintf.c: Likewise. * libio/iofputs.c: Likewise. * libio/iofread.c: Likewise. * libio/iofsetpos.c: Likewise. * libio/ioftell.c: Likewise. * libio/iofwrite.c: Likewise. * libio/iogetdelim.c: Likewise. * libio/iogetline.c: Likewise. * libio/iogets.c: Likewise. * libio/iopadn.c: Likewise. * libio/iopopen.c: Likewise. * libio/ioputs.c: Likewise. * libio/ioseekoff.c: Likewise. * libio/ioseekpos.c: Likewise. * libio/iosetbuffer.c: Likewise. * libio/iosetvbuf.c: Likewise. * libio/iosprintf.c: Likewise. * libio/ioungetc.c: Likewise. * libio/iovdprintf.c: Likewise. * libio/iovsprintf.c: Likewise. * libio/iovsscanf.c: Likewise. * libio/libio.h: Likewise. * libio/libioP.h: Likewise. * libio/obprintf.c: Likewise. * libio/pclose.c: Likewise. * libio/peekc.c: Likewise. * libio/putc.c: Likewise. * libio/putchar.c: Likewise. * libio/rewind.c: Likewise. * libio/setbuf.c: Likewise. * libio/setlinebuf.c: Likewise. * libio/stdfiles.c: Likewise. * libio/stdio.c: Likewise. * libio/strfile.h: Likewise. * libio/strops.c: Likewise. * libio/vasprintf.c: Likewise. * libio/vscanf.c: Likewise. * libio/vsnprintf.c: Likewise. * manual/libc.texinfo: Add menu entries for chapter on message translation. * manual/locale.texi: Correct next entry in @node for new chapter. * manual/search.texi: Likewise for previous link. * manual/message.texi: New file. * manual/startup.texi: Document LC_ALL, LC_MESSAGES, NLSPATH, setenv, unsetenv, and clearenv. * manual/string.texi: Fix typos. Patch by Jim Meyering. * math/Makefile (test-longdouble-yes): Enable. We want long double tests now. Crusade against strcat. * nis/nss_nisplus/nisplus-publickey.c: Remove uses of strcat. * stdlib/canonicalize.c: Likewise. * posix/glob.h: Define __const if necessary. Use __const in all prototypes. * sysdeps/generic/stpcpy.c: Use K&R form to allow use in other GNU packages. * posix/wordexp.c: Completely reworked buffer handling for much better performance. Patch by Tim Waugh. * socket/sys/sochet.h (getpeername): Fix type of LEN parameter, it must be socklen_t. * sysdeps/libm-i387/e_remainder.S: Pretty print. * sysdeps/libm-i387/e_remainderf.S: Likewise. * sysdeps/libm-i387/e_remainderl.S: Pop extra value for FPU stack. * sysdeps/libm-i387/s_cexp.S: Little optimization. * sysdeps/libm-i387/s_cexpl.S: Likewise. * sysdep/libm-ieee754/s_csinhl.c: Include <fenv.h>. 1997-08-18 15:21 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/if_index.c (if_nameindex): Fix memory leak in cleanup code. 1997-08-17 Paul Eggert <eggert@twinsun.com> * tzset.c (__tzset_internal): Fix memory leak when the user specifies a TZ value that uses a default rule file. Do not assume US DST rules when the user specifies that there is no DST. 1997-08-10 19:17 Philip Blundell <Philip.Blundell@pobox.com> * inet/getnameinfo.c: Tidy up. * sysdeps/posix/getaddrinfo.c: Likewise. * sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0 if using stub code. (if_indextoname): Use SIOGIFNAME ioctl if the kernel supports it. (if_nameindex): Use alloca() rather than malloc(); use SIOCGIFCOUNT ioctl if the kernel supports it. 1997-08-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/sys/mount.h: Remove the IS_* macros, they operate on internal kernel structures and have no place in a user header. 1997-08-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (lib%.so): Depend on $(+preinit) and $(+postinit). (build-shlib): Filter them out of $^. 1997-08-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-error.c (_dl_signal_error): Fix error message. 1997-08-16 04:06 Ulrich Drepper <drepper@cygnus.com> * assert/assert.h [__USE_GNU]: Undefine assert_perror. Reported by Theodore C. Belding <Ted.Belding@umich.edu>. 1997-08-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makeconfig: Change object suffixes from *.[spgb]o to *.o[spgb] to avoid conflict with PO files. * Makerules: Likewise. * Rules: Likewise. * elf/Makefile: Likewise. * extra-lib.mk: Likewise. * gmon/Makefile: Likewise. * nis/Makefile: Likewise. * nss/Makefile: Likewise. * resolv/Makefile: Likewise. * rpm/Makefile: Likewise. * sunrpc/Makefile: Likewise. * sysdeps/sparc/elf/Makefile: Likewise. * sysdeps/sparc64/elf/Makefile: Likewise. * sysdeps/unix/sysv/linux/sparc/Makefile: Likewise. (ASFLAGS-.os): Renamed from as-FLAGS.os.
This commit is contained in:
parent
ca34d7a7c7
commit
40a55d2054
124 changed files with 4847 additions and 2995 deletions
189
ChangeLog
189
ChangeLog
|
@ -1,3 +1,192 @@
|
|||
1997-08-20 05:30 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* catgets/catgets.c (catclose): Use __munmap instead of munmap.
|
||||
* catgets/gencat.c (read_input_file): Fix typo.
|
||||
|
||||
* dirent/dirent.h: Make seekdir and telldir available for __USE_XOPEN.
|
||||
|
||||
* elf/dl-load.c: Fix case of missing DT_RPATH in object which gets
|
||||
executed (e.g., when it is a static binary).
|
||||
|
||||
* intl/bindtextdomain.c: Use strdup in glibc. Correct comment.
|
||||
* intl/dcgettext.c: Likewise.
|
||||
* intl/dgettext.c: Likewise.
|
||||
* intl/explodename.c: Likewise.
|
||||
* intl/finddomain.c: Likewise.
|
||||
* intl/gettext.c: Likewise.
|
||||
* intl/gettext.h: Likewise.
|
||||
* intl/hash-string.h: Likewise.
|
||||
* intl/l10nflist.c: Likewise.
|
||||
* intl/libintl.h: Likewise.
|
||||
* intl/loadinfo.h: Likewise.
|
||||
* intl/loadmsgcat.c: Likewise.
|
||||
* intl/localealias.c: Likewise.
|
||||
* intl/textdomain.c: Likewise.
|
||||
|
||||
Unify libio sources with code in libg++.
|
||||
* libio/fcloseall.c: Update and reformat copyright. Protect use
|
||||
of weak_alias. Use _IO_* thread macros instead of __libc_*.
|
||||
* libio/feof.c: Likewise.
|
||||
* libio/feof_u.c: Likewise.
|
||||
* libio/ferror.c: Likewise.
|
||||
* libio/ferror_u.c: Likewise.
|
||||
* libio/fgetc.c: Likewise.
|
||||
* libio/filedoalloc.c: Likewise.
|
||||
* libio/fileno.c: Likewise.
|
||||
* libio/fileops.c: Likewise.
|
||||
* libio/fputc.c: Likewise.
|
||||
* libio/fputc_u.c: Likewise.
|
||||
* libio/freopen.c: Likewise.
|
||||
* libio/fseek.c: Likewise.
|
||||
* libio/genops.c: Likewise.
|
||||
* libio/getc.c: Likewise.
|
||||
* libio/getc_u.c: Likewise.
|
||||
* libio/getchar.c: Likewise.
|
||||
* libio/getchar_u.c: Likewise.
|
||||
* libio/iofclose.c: Likewise.
|
||||
* libio/iofdopen.c: Likewise.
|
||||
* libio/iofflush.c: Likewise.
|
||||
* libio/iofflush_u.c: Likewise.
|
||||
* libio/iofgetpos.c: Likewise.
|
||||
* libio/iofgets.c: Likewise.
|
||||
* libio/iofopen.c: Likewise.
|
||||
* libio/iofopncook.c: Likewise.
|
||||
* libio/iofprintf.c: Likewise.
|
||||
* libio/iofputs.c: Likewise.
|
||||
* libio/iofread.c: Likewise.
|
||||
* libio/iofsetpos.c: Likewise.
|
||||
* libio/ioftell.c: Likewise.
|
||||
* libio/iofwrite.c: Likewise.
|
||||
* libio/iogetdelim.c: Likewise.
|
||||
* libio/iogetline.c: Likewise.
|
||||
* libio/iogets.c: Likewise.
|
||||
* libio/iopadn.c: Likewise.
|
||||
* libio/iopopen.c: Likewise.
|
||||
* libio/ioputs.c: Likewise.
|
||||
* libio/ioseekoff.c: Likewise.
|
||||
* libio/ioseekpos.c: Likewise.
|
||||
* libio/iosetbuffer.c: Likewise.
|
||||
* libio/iosetvbuf.c: Likewise.
|
||||
* libio/iosprintf.c: Likewise.
|
||||
* libio/ioungetc.c: Likewise.
|
||||
* libio/iovdprintf.c: Likewise.
|
||||
* libio/iovsprintf.c: Likewise.
|
||||
* libio/iovsscanf.c: Likewise.
|
||||
* libio/libio.h: Likewise.
|
||||
* libio/libioP.h: Likewise.
|
||||
* libio/obprintf.c: Likewise.
|
||||
* libio/pclose.c: Likewise.
|
||||
* libio/peekc.c: Likewise.
|
||||
* libio/putc.c: Likewise.
|
||||
* libio/putchar.c: Likewise.
|
||||
* libio/rewind.c: Likewise.
|
||||
* libio/setbuf.c: Likewise.
|
||||
* libio/setlinebuf.c: Likewise.
|
||||
* libio/stdfiles.c: Likewise.
|
||||
* libio/stdio.c: Likewise.
|
||||
* libio/strfile.h: Likewise.
|
||||
* libio/strops.c: Likewise.
|
||||
* libio/vasprintf.c: Likewise.
|
||||
* libio/vscanf.c: Likewise.
|
||||
* libio/vsnprintf.c: Likewise.
|
||||
|
||||
* manual/libc.texinfo: Add menu entries for chapter on message
|
||||
translation.
|
||||
* manual/locale.texi: Correct next entry in @node for new chapter.
|
||||
* manual/search.texi: Likewise for previous link.
|
||||
* manual/message.texi: New file.
|
||||
* manual/startup.texi: Document LC_ALL, LC_MESSAGES, NLSPATH,
|
||||
setenv, unsetenv, and clearenv.
|
||||
* manual/string.texi: Fix typos. Patch by Jim Meyering.
|
||||
|
||||
* math/Makefile (test-longdouble-yes): Enable. We want long double
|
||||
tests now.
|
||||
|
||||
Crusade against strcat.
|
||||
* nis/nss_nisplus/nisplus-publickey.c: Remove uses of strcat.
|
||||
* stdlib/canonicalize.c: Likewise.
|
||||
|
||||
* posix/glob.h: Define __const if necessary. Use __const in all
|
||||
prototypes.
|
||||
|
||||
* sysdeps/generic/stpcpy.c: Use K&R form to allow use in other
|
||||
GNU packages.
|
||||
|
||||
* posix/wordexp.c: Completely reworked buffer handling for much
|
||||
better performance. Patch by Tim Waugh.
|
||||
|
||||
* socket/sys/sochet.h (getpeername): Fix type of LEN parameter,
|
||||
it must be socklen_t.
|
||||
|
||||
* sysdeps/libm-i387/e_remainder.S: Pretty print.
|
||||
* sysdeps/libm-i387/e_remainderf.S: Likewise.
|
||||
* sysdeps/libm-i387/e_remainderl.S: Pop extra value for FPU stack.
|
||||
* sysdeps/libm-i387/s_cexp.S: Little optimization.
|
||||
* sysdeps/libm-i387/s_cexpl.S: Likewise.
|
||||
* sysdep/libm-ieee754/s_csinhl.c: Include <fenv.h>.
|
||||
|
||||
1997-08-18 15:21 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/if_index.c (if_nameindex): Fix memory leak
|
||||
in cleanup code.
|
||||
|
||||
1997-08-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* tzset.c (__tzset_internal): Fix memory leak when the user
|
||||
specifies a TZ value that uses a default rule file.
|
||||
Do not assume US DST rules when the user specifies
|
||||
that there is no DST.
|
||||
|
||||
1997-08-10 19:17 Philip Blundell <Philip.Blundell@pobox.com>
|
||||
|
||||
* inet/getnameinfo.c: Tidy up.
|
||||
* sysdeps/posix/getaddrinfo.c: Likewise.
|
||||
|
||||
* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Return 0 if
|
||||
using stub code.
|
||||
(if_indextoname): Use SIOGIFNAME ioctl if the kernel supports it.
|
||||
(if_nameindex): Use alloca() rather than malloc(); use
|
||||
SIOCGIFCOUNT ioctl if the kernel supports it.
|
||||
|
||||
1997-08-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* sysdeps/unix/sysv/linux/sys/mount.h: Remove the IS_* macros,
|
||||
they operate on internal kernel structures and have no place in a
|
||||
user header.
|
||||
|
||||
1997-08-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* Makerules (lib%.so): Depend on $(+preinit) and $(+postinit).
|
||||
(build-shlib): Filter them out of $^.
|
||||
|
||||
1997-08-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* elf/dl-error.c (_dl_signal_error): Fix error message.
|
||||
|
||||
1997-08-16 04:06 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* assert/assert.h [__USE_GNU]: Undefine assert_perror.
|
||||
Reported by Theodore C. Belding <Ted.Belding@umich.edu>.
|
||||
|
||||
1997-08-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
|
||||
* Makeconfig: Change object suffixes from *.[spgb]o to *.o[spgb]
|
||||
to avoid conflict with PO files.
|
||||
* Makerules: Likewise.
|
||||
* Rules: Likewise.
|
||||
* elf/Makefile: Likewise.
|
||||
* extra-lib.mk: Likewise.
|
||||
* gmon/Makefile: Likewise.
|
||||
* nis/Makefile: Likewise.
|
||||
* nss/Makefile: Likewise.
|
||||
* resolv/Makefile: Likewise.
|
||||
* rpm/Makefile: Likewise.
|
||||
* sunrpc/Makefile: Likewise.
|
||||
* sysdeps/sparc/elf/Makefile: Likewise.
|
||||
* sysdeps/sparc64/elf/Makefile: Likewise.
|
||||
* sysdeps/unix/sysv/linux/sparc/Makefile: Likewise.
|
||||
(ASFLAGS-.os): Renamed from as-FLAGS.os.
|
||||
|
||||
1997-08-14 03:14 Ulrich Drepper <drepper@cygnus.com>
|
||||
|
||||
* elf/dl-minimal.c: Don't use relative #include paths.
|
||||
|
|
4
INSTALL
4
INSTALL
|
@ -771,6 +771,10 @@ parts of the library were contributed or worked on by other people.
|
|||
* The port to Linux/m68k (`m68k-ANYTHING-linux') was contributed by
|
||||
Andreas Schwab.
|
||||
|
||||
* The ports to Linux/ARM (`arm-ANYTHING-linuxaout') and ARM standalone
|
||||
(`arm-ANYTHING-none'), as well as parts of the IPv6 support code, were
|
||||
contributed by Philip Blundell.
|
||||
|
||||
* Richard Henderson contributed the ELF dynamic linking code and
|
||||
other support for the Alpha processor.
|
||||
|
||||
|
|
42
Makeconfig
42
Makeconfig
|
@ -530,41 +530,41 @@ endif
|
|||
# to pass different flags for each flavor.
|
||||
libtypes = $(foreach o,$(object-suffixes),$(libtype$o))
|
||||
object-suffixes := .o
|
||||
all-object-suffixes := .o .so .po .go .bo
|
||||
all-object-suffixes := .o .os .op .og .ob
|
||||
libtype.o := lib%.a
|
||||
ifeq (yes,$(build-shared))
|
||||
# Under --enable-shared, we will build a shared library of PIC objects.
|
||||
# The PIC object files are named foo.so.
|
||||
object-suffixes += .so
|
||||
CPPFLAGS-.so = -DPIC
|
||||
CFLAGS-.so = -fPIC -fno-common
|
||||
libtype.so := lib%_pic.a
|
||||
# The PIC object files are named foo.os.
|
||||
object-suffixes += .os
|
||||
CPPFLAGS-.os = -DPIC
|
||||
CFLAGS-.os = -fPIC -fno-common
|
||||
libtype.os := lib%_pic.a
|
||||
endif
|
||||
ifeq (yes,$(build-profile))
|
||||
# Under --enable-profile, we will build a static library of profiled objects.
|
||||
# The profiled object files are named foo.po.
|
||||
object-suffixes += .po
|
||||
CPPFLAGS-.po = -DPROF
|
||||
CFLAGS-.po = -pg
|
||||
libtype.po = lib%_p.a
|
||||
# The profiled object files are named foo.op.
|
||||
object-suffixes += .op
|
||||
CPPFLAGS-.op = -DPROF
|
||||
CFLAGS-.op = -pg
|
||||
libtype.op = lib%_p.a
|
||||
endif
|
||||
ifeq (yes,$(build-omitfp))
|
||||
# Under --enable-omitfp, we build an the library optimized without
|
||||
# debugging information using -fomit-frame-pointer, and build an extra
|
||||
# library with debugging information. The debuggable objects are named foo.go.
|
||||
object-suffixes += .go
|
||||
CFLAGS-.go = -g
|
||||
# library with debugging information. The debuggable objects are named foo.og.
|
||||
object-suffixes += .og
|
||||
CFLAGS-.og = -g
|
||||
CFLAGS-.o = -g0 -O99 -fomit-frame-pointer
|
||||
CFLAGS-.so += $(CFLAGS-.o)
|
||||
libtype.go = lib%_g.a
|
||||
CFLAGS-.os += $(CFLAGS-.o)
|
||||
libtype.og = lib%_g.a
|
||||
endif
|
||||
ifeq (yes,$(build-bounded))
|
||||
# Under --enable-bounded, we build the library with `-fbounded-pointers -g'
|
||||
# to runtime bounds checking. The bounded-pointer objects are named foo.bo.
|
||||
object-suffixes += .bo
|
||||
CPPFLAGS-.bo = -DBOUNDED_POINTERS
|
||||
CFLAGS-.bo = -g -fbounded-pointers
|
||||
libtype.bo = lib%_b.a
|
||||
# to runtime bounds checking. The bounded-pointer objects are named foo.ob.
|
||||
object-suffixes += .ob
|
||||
CPPFLAGS-.ob = -DBOUNDED_POINTERS
|
||||
CFLAGS-.ob = -g -fbounded-pointers
|
||||
libtype.ob = lib%_b.a
|
||||
endif
|
||||
|
||||
|
||||
|
|
20
Makerules
20
Makerules
|
@ -344,7 +344,8 @@ endif
|
|||
# build shared libraries in place from the installed *_pic.a files.
|
||||
# $(LDLIBS-%.so) may contain -l switches to generate run-time dependencies
|
||||
# on other shared objects.
|
||||
lib%.so: lib%_pic.a; $(build-shlib)
|
||||
lib%.so: lib%_pic.a $(+preinit) $(+postinit)
|
||||
$(build-shlib)
|
||||
|
||||
ifeq ($(have-no-whole-archive),yes)
|
||||
no-whole-archive = -Wl,--no-whole-archive
|
||||
|
@ -352,10 +353,10 @@ else
|
|||
no-whole-archive =
|
||||
endif
|
||||
|
||||
interp-obj = $(common-objpfx)interp.so
|
||||
$(interp-obj): $(common-objpfx)%.so: $(..)%.c
|
||||
interp-obj = $(common-objpfx)interp.os
|
||||
$(interp-obj): $(common-objpfx)%.os: $(..)%.c
|
||||
$(compile-command.c)
|
||||
common-generated += interp.so
|
||||
common-generated += interp.os
|
||||
CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"'
|
||||
|
||||
$(common-objpfx)libc.so: $(interp-obj)
|
||||
|
@ -367,7 +368,8 @@ $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
|||
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
|
||||
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
|
||||
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
|
||||
-Wl,--whole-archive $(filter-out $($(@F:.so=)-map),$^) \
|
||||
-Wl,--whole-archive \
|
||||
$(filter-out $($(@F:.so=)-map) $(+preinit) $(+postinit),$^) \
|
||||
$(no-whole-archive) $(LDLIBS-$(@F:lib%.so=%).so)
|
||||
endef
|
||||
|
||||
|
@ -382,9 +384,9 @@ LDFLAGS-c.so += -e __libc_main
|
|||
# We have a versioning file for libc.so.
|
||||
libc-map = $(..)libc.map
|
||||
# Use our own special initializer and finalizer files for libc.so.
|
||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.os \
|
||||
$(common-objpfx)libc_pic.a \
|
||||
$(elfobjdir)/sofini.so $(elfobjdir)/ld.so \
|
||||
$(elfobjdir)/sofini.os $(elfobjdir)/ld.so \
|
||||
$(libc-map)
|
||||
$(build-shlib)
|
||||
ifdef libc.so-version
|
||||
|
@ -428,11 +430,11 @@ endif
|
|||
|
||||
ifeq ($(build-programs),yes)
|
||||
+depfiles := $(strip $(sources:.c=.d) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.so=.o))) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
|
||||
$(addsuffix .d,$(others) $(tests) $(test-srcs)))
|
||||
else
|
||||
+depfiles := $(strip $(sources:.c=.d) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.so=.o))) \
|
||||
$(patsubst %.o,%.d,$(filter %.o,$(extra-objs:.os=.o))) \
|
||||
$(addsuffix .d,$(tests) $(test-srcs)))
|
||||
endif
|
||||
+depfiles := $(addprefix $(objpfx),\
|
||||
|
|
2
Rules
2
Rules
|
@ -166,7 +166,7 @@ endif
|
|||
ifdef static-only-routines
|
||||
# These routines are to be omitted from the shared library object,
|
||||
# so we replace the PIC objects for them with the empty object file.
|
||||
$(static-only-routines:%=$(objpfx)%.so): %.so: $(common-objpfx)empty.o
|
||||
$(static-only-routines:%=$(objpfx)%.os): %.os: $(common-objpfx)empty.o
|
||||
rm -f $@
|
||||
ln $< $@
|
||||
endif
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
# undef _ASSERT_H
|
||||
# undef assert
|
||||
|
||||
# ifdef __USE_GNU
|
||||
# undef assert_perror
|
||||
# endif
|
||||
|
||||
#endif /* assert.h */
|
||||
|
||||
#define _ASSERT_H 1
|
||||
|
|
|
@ -164,7 +164,7 @@ catclose (nl_catd catalog_desc)
|
|||
catalog = (__nl_catd) catalog_desc;
|
||||
|
||||
if (catalog->status == mmapped)
|
||||
munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
__munmap ((void *) catalog->file_ptr, catalog->file_size);
|
||||
else if (catalog->status == malloced)
|
||||
free ((void *) catalog->file_ptr);
|
||||
else if (catalog->status != closed && catalog->status != nonexisting)
|
||||
|
|
|
@ -332,7 +332,7 @@ read_input_file (struct catalog *current, const char *fname)
|
|||
/* This is a comment line. Do nothing. */;
|
||||
else if (strncmp (&this_line[1], "set", 3) == 0)
|
||||
{
|
||||
int cnt = sizeof ("cnt");
|
||||
int cnt = sizeof ("set");
|
||||
int set_number;
|
||||
const char *symbol = NULL;
|
||||
while (isspace (this_line[cnt]))
|
||||
|
|
|
@ -131,6 +131,16 @@ extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
|||
/* Rewind DIRP to the beginning of the directory. */
|
||||
extern void rewinddir __P ((DIR *__dirp));
|
||||
|
||||
#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
|
||||
# include <bits/types.h>
|
||||
|
||||
/* Seek to position POS on DIRP. */
|
||||
extern void seekdir __P ((DIR *__dirp, __off_t __pos));
|
||||
|
||||
/* Return the current position of DIRP. */
|
||||
extern __off_t telldir __P ((DIR *__dirp));
|
||||
#endif
|
||||
|
||||
#if defined __USE_BSD || defined __USE_MISC
|
||||
|
||||
/* Return the file descriptor used by DIRP. */
|
||||
|
@ -152,16 +162,9 @@ extern int dirfd __P ((DIR *__dirp));
|
|||
# endif
|
||||
# endif
|
||||
|
||||
# include <bits/types.h>
|
||||
# define __need_size_t
|
||||
# include <stddef.h>
|
||||
|
||||
/* Seek to position POS on DIRP. */
|
||||
extern void seekdir __P ((DIR *__dirp, __off_t __pos));
|
||||
|
||||
/* Return the current position of DIRP. */
|
||||
extern __off_t telldir __P ((DIR *__dirp));
|
||||
|
||||
/* Scan the directory DIR, calling SELECTOR on each directory entry.
|
||||
Entries for which SELECT returns nonzero are individually malloc'd,
|
||||
sorted using qsort with CMP, and collected in a malloc'd array in
|
||||
|
|
16
elf/Makefile
16
elf/Makefile
|
@ -30,7 +30,7 @@ dl-routines = $(addprefix dl-,load cache lookup object reloc deps \
|
|||
runtime error init fini debug misc \
|
||||
version profile)
|
||||
# But they are absent from the shared libc, because that code is in ld.so.
|
||||
elide-routines.so = $(dl-routines) dl-support enbl-secure
|
||||
elide-routines.os = $(dl-routines) dl-support enbl-secure
|
||||
|
||||
# ld.so uses those routines, plus some special stuff for being the program
|
||||
# interpreter and operating independent of libc.
|
||||
|
@ -54,8 +54,8 @@ all: # Make this the default target; it will be defined in Rules.
|
|||
include ../Makeconfig
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so eval.so
|
||||
generated = librtld.so dl-allobjs.so trusted-dirs.h rtldtbl.h
|
||||
extra-objs = $(rtld-routines:=.os) soinit.os sofini.os eval.os
|
||||
generated = librtld.os dl-allobjs.os trusted-dirs.h rtldtbl.h
|
||||
install-others = $(inst_slibdir)/$(rtld-installed-name)
|
||||
install-bin = ldd
|
||||
endif
|
||||
|
@ -85,11 +85,11 @@ endif
|
|||
# Command to link into a larger single relocatable object.
|
||||
reloc-link = $(LINK.o) -nostdlib -nostartfiles -r -o $@
|
||||
|
||||
$(objpfx)dl-allobjs.so: $(rtld-routines:%=$(objpfx)%.so)
|
||||
$(objpfx)dl-allobjs.os: $(rtld-routines:%=$(objpfx)%.os)
|
||||
$(reloc-link) $^
|
||||
|
||||
# Link together the dynamic linker into a single relocatable object.
|
||||
$(objpfx)librtld.so: $(objpfx)dl-allobjs.so $(common-objpfx)libc_pic.a
|
||||
$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
|
||||
$(reloc-link) '-Wl,-(' $^ -lgcc '-Wl,-)'
|
||||
|
||||
# Do we need a linker script?
|
||||
|
@ -107,7 +107,7 @@ $(objpfx)rtld-ldscript: $(rtld-ldscript-in) $(rtld-parms)
|
|||
-e 's#@@rtld-entry@@#$(rtld-entry)#' \
|
||||
-e 's#@@rtld-base@@#$(rtld-base)#' $< >$@
|
||||
|
||||
$(objpfx)ld.so: $(objpfx)librtld.so $(objpfx)rtld-ldscript
|
||||
$(objpfx)ld.so: $(objpfx)librtld.os $(objpfx)rtld-ldscript
|
||||
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
|
||||
|
||||
define rtld-link
|
||||
|
@ -116,7 +116,7 @@ $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
|
|||
$(filter-out $(objpfx)rtld-ldscript,$^)
|
||||
endef
|
||||
else
|
||||
$(objpfx)ld.so: $(objpfx)librtld.so
|
||||
$(objpfx)ld.so: $(objpfx)librtld.os
|
||||
$(rtld-link) -Wl,-soname=$(rtld-installed-name)
|
||||
|
||||
define rtld-link
|
||||
|
@ -186,4 +186,4 @@ endif
|
|||
# muwahaha
|
||||
|
||||
LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name)
|
||||
$(objpfx)libdl.so: $(objpfx)eval.so
|
||||
$(objpfx)libdl.so: $(objpfx)eval.os
|
||||
|
|
|
@ -75,7 +75,7 @@ _dl_signal_error (int errcode,
|
|||
/* Lossage while resolving the program's own symbols is always fatal. */
|
||||
extern char **_dl_argv; /* Set in rtld.c at startup. */
|
||||
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>",
|
||||
": error in loading shared libraries",
|
||||
": error in loading shared libraries: ",
|
||||
objname ?: "", objname ? ": " : "",
|
||||
errstring, errcode ? ": " : "",
|
||||
errcode ? strerror (errcode) : "", "\n", NULL);
|
||||
|
|
|
@ -94,6 +94,11 @@ size_t _dl_pagesize;
|
|||
extern const char *_dl_platform;
|
||||
extern size_t _dl_platformlen;
|
||||
|
||||
/* This is a fake list to store the RPATH information for static
|
||||
binaries. */
|
||||
static struct r_search_path_elem **fake_path_list;
|
||||
|
||||
|
||||
/* Local version of `strdup' function. */
|
||||
static inline char *
|
||||
local_strdup (const char *s)
|
||||
|
@ -308,6 +313,12 @@ decompose_rpath (const char *rpath, size_t additional_room)
|
|||
void
|
||||
_dl_init_paths (void)
|
||||
{
|
||||
static const char *trusted_dirs[] =
|
||||
{
|
||||
#include "trusted-dirs.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
struct r_search_path_elem **pelem;
|
||||
|
||||
/* We have in `search_path' the information about the RPATH of the
|
||||
|
@ -333,27 +344,28 @@ _dl_init_paths (void)
|
|||
nllp = 0;
|
||||
|
||||
l = _dl_loaded;
|
||||
if (l && l->l_type != lt_loaded && l->l_info[DT_RPATH])
|
||||
if (l != NULL)
|
||||
{
|
||||
/* Allocate room for the search path and fill in information from
|
||||
RPATH. */
|
||||
if (l->l_type != lt_loaded && l->l_info[DT_RPATH])
|
||||
{
|
||||
/* Allocate room for the search path and fill in information
|
||||
from RPATH. */
|
||||
l->l_rpath_dirs =
|
||||
decompose_rpath ((const char *) (l->l_addr
|
||||
+ l->l_info[DT_STRTAB]->d_un.d_ptr
|
||||
decompose_rpath ((const char *)
|
||||
(l->l_addr + l->l_info[DT_STRTAB]->d_un.d_ptr
|
||||
+ l->l_info[DT_RPATH]->d_un.d_val),
|
||||
nllp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we have no LD_LIBRARY_PATH and no RPATH we must tell this
|
||||
somehow to prevent we look this up again and again. */
|
||||
/* If we have no LD_LIBRARY_PATH and no RPATH we must tell
|
||||
this somehow to prevent we look this up again and again. */
|
||||
if (nllp == 0)
|
||||
l->l_rpath_dirs = (struct r_search_path_elem **) -1l;
|
||||
else
|
||||
{
|
||||
l->l_rpath_dirs =
|
||||
(struct r_search_path_elem **) malloc ((nllp + 1)
|
||||
* sizeof (*l->l_rpath_dirs));
|
||||
l->l_rpath_dirs = (struct r_search_path_elem **)
|
||||
malloc ((nllp + 1) * sizeof (*l->l_rpath_dirs));
|
||||
if (l->l_rpath_dirs == NULL)
|
||||
_dl_signal_error (ENOMEM, NULL,
|
||||
"cannot create cache for search path");
|
||||
|
@ -361,13 +373,12 @@ _dl_init_paths (void)
|
|||
}
|
||||
}
|
||||
|
||||
/* We don't need to search the list of fake entries which is searched
|
||||
when no dynamic objects were loaded at this time. */
|
||||
fake_path_list = NULL;
|
||||
|
||||
if (nllp > 0)
|
||||
{
|
||||
static const char *trusted_dirs[] =
|
||||
{
|
||||
#include "trusted-dirs.h"
|
||||
NULL
|
||||
};
|
||||
char *copy = strdupa (llp);
|
||||
|
||||
/* Decompose the LD_LIBRARY_PATH and fill in the result.
|
||||
|
@ -376,11 +387,30 @@ _dl_init_paths (void)
|
|||
while (*result != NULL)
|
||||
++result;
|
||||
|
||||
/* We need to take care that the LD_LIBRARY_PATH environement
|
||||
/* We need to take care that the LD_LIBRARY_PATH environment
|
||||
variable can contain a semicolon. */
|
||||
(void) fillin_rpath (copy, result, ":;",
|
||||
__libc_enable_secure ? trusted_dirs : NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This is a statically linked program but we still have to
|
||||
take care for the LD_LIBRARY_PATH environment variable. We
|
||||
use a fake link_map entry. This will only contain the
|
||||
l_rpath_dirs information. */
|
||||
|
||||
if (nllp == 0)
|
||||
fake_path_list = NULL;
|
||||
else
|
||||
{
|
||||
fake_path_list = (struct r_search_path_elem **)
|
||||
malloc ((nllp + 1) * sizeof (struct r_search_path_elem *));
|
||||
|
||||
(void) fillin_rpath (local_strdup (llp), fake_path_list, ":;",
|
||||
__libc_enable_secure ? trusted_dirs : NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now set up the rest of the rtld_search_dirs. */
|
||||
for (pelem = rtld_search_dirs; *pelem != NULL; ++pelem)
|
||||
|
@ -871,7 +901,7 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
|||
|
||||
/* Look for this name among those already loaded. */
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (_dl_name_match_p (name, l) ||
|
||||
if (l->l_opencount > 0 && _dl_name_match_p (name, l) ||
|
||||
/* If the requested name matches the soname of a loaded object,
|
||||
use that object. */
|
||||
(l->l_info[DT_SONAME] &&
|
||||
|
@ -923,6 +953,11 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
|||
&& l->l_rpath_dirs != (struct r_search_path_elem **) -1l)
|
||||
fd = open_path (name, namelen, l->l_rpath_dirs, &realname);
|
||||
|
||||
/* This is used if a static binary uses dynamic loading and there
|
||||
is a LD_LIBRARY_PATH given. */
|
||||
if (fd == -1 && fake_path_list != NULL)
|
||||
fd = open_path (name, namelen, fake_path_list, &realname);
|
||||
|
||||
if (fd == -1)
|
||||
{
|
||||
/* Check the list of libraries in the file /etc/ld.so.cache,
|
||||
|
|
|
@ -36,7 +36,7 @@ endif
|
|||
|
||||
# The linked shared library is never a dependent of lib-noranlib,
|
||||
# because linking it will depend on libc.so already being built.
|
||||
ifneq (,$(filter .so,$(object-suffixes-$(lib))))
|
||||
ifneq (,$(filter .os,$(object-suffixes-$(lib))))
|
||||
others: $(objpfx)$(lib).so$($(lib).so-version)
|
||||
endif
|
||||
|
||||
|
|
|
@ -40,6 +40,6 @@ ifeq (,$(filter profil,$(unix-syscalls)))
|
|||
noprof += profil
|
||||
endif
|
||||
|
||||
$(noprof:%=$(objpfx)%.po): %.po: %.o
|
||||
$(noprof:%=$(objpfx)%.op): %.op: %.o
|
||||
rm -f $@
|
||||
ln $< $@
|
||||
|
|
|
@ -42,19 +42,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
/* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */
|
||||
|
||||
#define INET6 1
|
||||
#define LOCAL 1
|
||||
#define HOSTTABLE 0
|
||||
#define RESOLVER 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#if LOCAL
|
||||
#include <sys/un.h>
|
||||
#include <sys/utsname.h>
|
||||
#endif /* LOCAL */
|
||||
#include <netdb.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
@ -64,20 +57,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <bits/libc-lock.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#ifndef AF_LOCAL
|
||||
# define AF_LOCAL AF_UNIX
|
||||
#endif /* AF_LOCAL */
|
||||
|
||||
#if HOSTTABLE
|
||||
struct hostent *_addr2hostname_hosts (const char *, int, int);
|
||||
#endif /* HOSTTABLE */
|
||||
|
||||
#ifndef min
|
||||
# define min(x,y) (((x) > (y)) ? (y) : (x))
|
||||
#endif /* min */
|
||||
|
||||
|
||||
static const char *
|
||||
static char *
|
||||
nrl_domainname (void)
|
||||
{
|
||||
static char *domain = NULL;
|
||||
|
@ -92,7 +77,7 @@ nrl_domainname (void)
|
|||
{
|
||||
char *c;
|
||||
struct hostent *h, th;
|
||||
int tmpbuflen = 1024;
|
||||
size_t tmpbuflen = 1024;
|
||||
char *tmpbuf = alloca (tmpbuflen);
|
||||
int herror;
|
||||
|
||||
|
@ -194,27 +179,12 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
switch(sa->sa_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#if INET6
|
||||
case AF_INET6:
|
||||
#endif /* INET6 */
|
||||
if (!(flags & NI_NUMERICHOST))
|
||||
{
|
||||
struct hostent *h = NULL;
|
||||
#if HOSTTABLE
|
||||
# if INET6
|
||||
if (sa->sa_family == AF_INET6)
|
||||
h = _addr2hostname_hosts ((void *) &(((struct sockaddr_in6 *) sa)->sin6_addr),
|
||||
sizeof(struct in6_addr), AF_INET6);
|
||||
else
|
||||
# endif /* INET6 */
|
||||
h = _addr2hostname_hosts ((void *)& (((struct sockaddr_in *) sa)->sin_addr),
|
||||
sizeof(struct in_addr), AF_INET);
|
||||
#endif /* HOSTTABLE */
|
||||
|
||||
#if RESOLVER
|
||||
if (h == NULL)
|
||||
{
|
||||
#if INET6
|
||||
if (sa->sa_family == AF_INET6)
|
||||
{
|
||||
while (__gethostbyaddr_r ((void *) &(((struct sockaddr_in6 *) sa)->sin6_addr),
|
||||
|
@ -232,7 +202,8 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
else
|
||||
{
|
||||
__set_h_errno (herrno);
|
||||
goto fail;
|
||||
__set_errno (serrno);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -243,7 +214,6 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
}
|
||||
else
|
||||
{
|
||||
#endif /* INET6 */
|
||||
while (__gethostbyaddr_r ((void *) &(((struct sockaddr_in *)sa)->sin_addr),
|
||||
sizeof(struct in_addr), AF_INET,
|
||||
&th, tmpbuf, tmpbuflen,
|
||||
|
@ -261,13 +231,12 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif /* RESOLVER */
|
||||
|
||||
if (h)
|
||||
{
|
||||
if (flags & NI_NOFQDN)
|
||||
{
|
||||
const char *c;
|
||||
char *c;
|
||||
if ((c = nrl_domainname ()) && (c = strstr(h->h_name, c))
|
||||
&& (c != h->h_name) && (*(--c) == '.'))
|
||||
{
|
||||
|
@ -282,7 +251,10 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
}
|
||||
|
||||
if (flags & NI_NAMEREQD)
|
||||
goto fail;
|
||||
{
|
||||
__set_errno (serrno);
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *c;
|
||||
|
@ -297,12 +269,14 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
(void *) &(((struct sockaddr_in *) sa)->sin_addr),
|
||||
host, hostlen);
|
||||
|
||||
if (!c)
|
||||
goto fail;
|
||||
if (c == NULL)
|
||||
{
|
||||
__set_errno (serrno);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#if LOCAL
|
||||
case AF_LOCAL:
|
||||
if (!(flags & NI_NUMERICHOST))
|
||||
{
|
||||
|
@ -316,11 +290,13 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
};
|
||||
|
||||
if (flags & NI_NAMEREQD)
|
||||
goto fail;
|
||||
{
|
||||
__set_errno (serrno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
strncpy (host, "localhost", hostlen);
|
||||
break;
|
||||
#endif /* LOCAL */
|
||||
|
||||
default:
|
||||
return -1;
|
||||
|
@ -330,9 +306,7 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
switch(sa->sa_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#if INET6
|
||||
case AF_INET6:
|
||||
#endif /* INET6 */
|
||||
if (!(flags & NI_NUMERICSERV))
|
||||
{
|
||||
struct servent *s, ts;
|
||||
|
@ -348,7 +322,10 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
tmpbuf = __alloca (tmpbuflen);
|
||||
}
|
||||
else
|
||||
goto fail;
|
||||
{
|
||||
__set_errno (serrno);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -365,11 +342,9 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
ntohs (((struct sockaddr_in *) sa)->sin_port));
|
||||
break;
|
||||
|
||||
#if LOCAL
|
||||
case AF_LOCAL:
|
||||
strncpy (serv, ((struct sockaddr_un *) sa)->sun_path, servlen);
|
||||
break;
|
||||
#endif /* LOCAL */
|
||||
}
|
||||
|
||||
if (host && (hostlen > 0))
|
||||
|
@ -378,8 +353,4 @@ getnameinfo (const struct sockaddr *sa, size_t addrlen, char *host,
|
|||
serv[servlen-1] = 0;
|
||||
errno = serrno;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
errno = serrno;
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
@ -65,6 +65,7 @@ extern struct binding *_nl_domain_bindings;
|
|||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define BINDTEXTDOMAIN __bindtextdomain
|
||||
# define strdup(str) __strdup (str)
|
||||
#else
|
||||
# define BINDTEXTDOMAIN bindtextdomain__
|
||||
#endif
|
||||
|
@ -102,26 +103,37 @@ BINDTEXTDOMAIN (domainname, dirname)
|
|||
|
||||
if (binding != NULL)
|
||||
{
|
||||
/* The domain is already bound. Replace the old binding. */
|
||||
/* The domain is already bound. If the new value and the old
|
||||
one are equal we simply do nothing. Otherwise replace the
|
||||
old binding. */
|
||||
if (strcmp (dirname, binding->dirname) != 0)
|
||||
{
|
||||
char *new_dirname;
|
||||
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
new_dirname = (char *) _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_dirname = strdup (dirname);
|
||||
if (new_dirname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
size_t len = strlen (dirname) + 1;
|
||||
new_dirname = (char *) malloc (len);
|
||||
if (new_dirname == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (new_dirname, dirname, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (strcmp (binding->dirname, _nl_default_dirname) != 0)
|
||||
if (binding->dirname != _nl_default_dirname)
|
||||
free (binding->dirname);
|
||||
|
||||
binding->dirname = new_dirname;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have to create a new binding. */
|
||||
|
@ -132,21 +144,33 @@ BINDTEXTDOMAIN (domainname, dirname)
|
|||
if (new_binding == NULL)
|
||||
return NULL;
|
||||
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_binding->domainname = strdup (domainname);
|
||||
if (new_binding->domainname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
len = strlen (domainname) + 1;
|
||||
new_binding->domainname = (char *) malloc (len);
|
||||
if (new_binding->domainname == NULL)
|
||||
return NULL;
|
||||
memcpy (new_binding->domainname, domainname, len);
|
||||
#endif
|
||||
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
new_binding->dirname = (char *) _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_binding->dirname = strdup (dirname);
|
||||
if (new_binding->dirname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
len = strlen (dirname) + 1;
|
||||
new_binding->dirname = (char *) malloc (len);
|
||||
if (new_binding->dirname == NULL)
|
||||
return NULL;
|
||||
memcpy (new_binding->dirname, dirname, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Now enqueue it. */
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
@ -298,10 +298,6 @@ DCGETTEXT (domainname, msgid, category)
|
|||
return (char *) msgid;
|
||||
}
|
||||
|
||||
/* We don't want libintl.a to depend on any other library. So
|
||||
we avoid the non-standard function stpcpy. In GNU C Library
|
||||
this function is available, though. Also allow the symbol
|
||||
HAVE_STPCPY to be defined. */
|
||||
stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
|
||||
}
|
||||
|
||||
|
@ -312,10 +308,7 @@ DCGETTEXT (domainname, msgid, category)
|
|||
xdomainname = (char *) alloca (strlen (categoryname)
|
||||
+ strlen (domainname) + 5);
|
||||
ADD_BLOCK (block_list, xdomainname);
|
||||
/* We don't want libintl.a to depend on any other library. So we
|
||||
avoid the non-standard function stpcpy. In GNU C Library this
|
||||
function is available, though. Also allow the symbol HAVE_STPCPY
|
||||
to be defined. */
|
||||
|
||||
stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
|
||||
domainname),
|
||||
".mo");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
@ -146,12 +146,18 @@ _nl_find_domain (dirname, locale, domainname)
|
|||
alias_value = _nl_expand_alias (locale);
|
||||
if (alias_value != NULL)
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
locale = strdup (alias_value);
|
||||
if (locale == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
size_t len = strlen (alias_value) + 1;
|
||||
locale = (char *) malloc (len);
|
||||
if (locale == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (locale, alias_value, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Now we determine the single parts of the locale name. First
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* libintl.h -- Message catalogs for internationalization.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Message catalogs for internationalization.
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
This file is derived from the file libgettext.h in the GNU gettext package.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef PARAMS
|
||||
# if __STDC__
|
||||
# define PARAMS(args) args
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
the C library, however.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
|
@ -82,6 +82,12 @@ void free ();
|
|||
because some ANSI C functions will require linking with this object
|
||||
file and the name space must not be polluted. */
|
||||
# define strcasecmp __strcasecmp
|
||||
# define strdup __strdup
|
||||
|
||||
/* We need locking here since we can be called from different palces. */
|
||||
# include <libc-lock.h>
|
||||
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -146,8 +152,13 @@ _nl_expand_alias (name)
|
|||
{
|
||||
static const char *locale_alias_path = LOCALE_ALIAS_PATH;
|
||||
struct alias_map *retval;
|
||||
const char *result = NULL;
|
||||
size_t added;
|
||||
|
||||
#ifdef _LIBC
|
||||
__libc_lock_lock (lock);
|
||||
#endif
|
||||
|
||||
do
|
||||
{
|
||||
struct alias_map item;
|
||||
|
@ -165,7 +176,10 @@ _nl_expand_alias (name)
|
|||
|
||||
/* We really found an alias. Return the value. */
|
||||
if (retval != NULL)
|
||||
return retval->value;
|
||||
{
|
||||
result = retval->value;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Perhaps we can find another alias file. */
|
||||
added = 0;
|
||||
|
@ -186,7 +200,11 @@ _nl_expand_alias (name)
|
|||
}
|
||||
while (added != 0);
|
||||
|
||||
return NULL;
|
||||
#ifdef _LIBC
|
||||
__libc_lock_unlock (lock);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -274,7 +292,15 @@ read_alias_file (fname, fname_len)
|
|||
if (nmap >= maxmap)
|
||||
extend_alias_table ();
|
||||
|
||||
/* We cannot depend on strdup available in the libc. Sigh! */
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
map[nmap].alias = strdup (alias);
|
||||
map[nmap].value = strdup (value);
|
||||
if (map[nmap].alias == NULL || map[nmap].value == NULL)
|
||||
{
|
||||
FREE_BLOCKS (block_list);
|
||||
return added;
|
||||
}
|
||||
#else
|
||||
len = strlen (alias) + 1;
|
||||
tp = (char *) malloc (len);
|
||||
if (tp == NULL)
|
||||
|
@ -294,6 +320,7 @@ read_alias_file (fname, fname_len)
|
|||
}
|
||||
memcpy (tp, value, len);
|
||||
map[nmap].value = tp;
|
||||
#endif
|
||||
|
||||
++nmap;
|
||||
++added;
|
||||
|
|
|
@ -57,6 +57,7 @@ extern const char *_nl_current_default_domain;
|
|||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define TEXTDOMAIN __textdomain
|
||||
# define strdup(str) __strdup (str)
|
||||
#else
|
||||
# define TEXTDOMAIN textdomain__
|
||||
#endif
|
||||
|
@ -85,11 +86,15 @@ TEXTDOMAIN (domainname)
|
|||
/* If the following malloc fails `_nl_current_default_domain'
|
||||
will be NULL. This value will be returned and so signals we
|
||||
are out of core. */
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
_nl_current_default_domain = strdup (domainname);
|
||||
#else
|
||||
size_t len = strlen (domainname) + 1;
|
||||
char *cp = (char *) malloc (len);
|
||||
if (cp != NULL)
|
||||
memcpy (cp, domainname, len);
|
||||
_nl_current_default_domain = cp;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (old != _nl_default_default_domain)
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
|
@ -32,4 +33,7 @@ __fcloseall ()
|
|||
_IO_cleanup ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (__fcloseall, fcloseall)
|
||||
#endif
|
||||
|
|
37
libio/feof.c
37
libio/feof.c
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -35,4 +37,7 @@ _IO_feof (fp)
|
|||
_IO_funlockfile (fp);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_feof, feof)
|
||||
#endif
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -35,4 +37,7 @@ _IO_ferror (fp)
|
|||
_IO_funlockfile (fp);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_ferror, ferror)
|
||||
#endif
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -66,12 +67,12 @@ the executable file might be covered by the GNU General Public License. */
|
|||
*/
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_doallocate, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_file_doallocate (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
register _IO_size_t size;
|
||||
_IO_size_t size;
|
||||
int couldbetty;
|
||||
register char *p;
|
||||
char *p;
|
||||
struct stat st;
|
||||
|
||||
#ifndef _LIBC
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -38,9 +39,11 @@ fileno (fp)
|
|||
}
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
#ifdef weak_alias
|
||||
/* The fileno implementation for libio does not require locking because
|
||||
it only accesses once a single variable and this is already atomic
|
||||
(at least at thread level). */
|
||||
|
||||
weak_alias (fileno, fileno_unlocked)
|
||||
#endif
|
||||
#endif
|
||||
|
|
176
libio/fileops.c
176
libio/fileops.c
|
@ -1,28 +1,29 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
Written by Per Bothner <bothner@cygnus.com>.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
/* written by Per Bothner (bothner@cygnus.com) */
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
# define _POSIX_SOURCE
|
||||
|
@ -97,8 +98,8 @@ extern int errno;
|
|||
|
||||
|
||||
void
|
||||
DEFUN(_IO_file_init, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_file_init (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
/* POSIX.1 allows another file handle to be used to change the position
|
||||
of our file descriptor. Hence we actually don't know the actual
|
||||
|
@ -111,8 +112,8 @@ DEFUN(_IO_file_init, (fp),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_close_it, (fp),
|
||||
register _IO_FILE* fp)
|
||||
_IO_file_close_it (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
int write_status, close_status;
|
||||
if (!_IO_file_is_open (fp))
|
||||
|
@ -138,8 +139,9 @@ DEFUN(_IO_file_close_it, (fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_file_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
_IO_file_finish (fp, dummy)
|
||||
_IO_FILE *fp;
|
||||
int dummy;
|
||||
{
|
||||
if (_IO_file_is_open (fp))
|
||||
{
|
||||
|
@ -151,15 +153,18 @@ DEFUN(_IO_file_finish, (fp, dummy),
|
|||
}
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_file_fopen, (fp, filename, mode),
|
||||
register _IO_FILE *fp AND const char *filename AND const char *mode)
|
||||
_IO_file_fopen (fp, filename, mode)
|
||||
_IO_FILE *fp;
|
||||
const char *filename;
|
||||
const char *mode;
|
||||
{
|
||||
int oflags = 0, omode;
|
||||
int read_write, fdesc;
|
||||
int oprot = 0666;
|
||||
if (_IO_file_is_open (fp))
|
||||
return 0;
|
||||
switch (*mode++) {
|
||||
switch (*mode++)
|
||||
{
|
||||
case 'r':
|
||||
omode = O_RDONLY;
|
||||
read_write = _IO_NO_WRITES;
|
||||
|
@ -178,7 +183,8 @@ DEFUN(_IO_file_fopen, (fp, filename, mode),
|
|||
__set_errno (EINVAL);
|
||||
return NULL;
|
||||
}
|
||||
if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+')) {
|
||||
if (mode[0] == '+' || (mode[0] == 'b' && mode[1] == '+'))
|
||||
{
|
||||
omode = O_RDWR;
|
||||
read_write &= _IO_IS_APPENDING;
|
||||
}
|
||||
|
@ -196,8 +202,9 @@ DEFUN(_IO_file_fopen, (fp, filename, mode),
|
|||
}
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_file_attach, (fp, fd),
|
||||
_IO_FILE *fp AND int fd)
|
||||
_IO_file_attach (fp, fd)
|
||||
_IO_FILE *fp;
|
||||
int fd;
|
||||
{
|
||||
if (_IO_file_is_open (fp))
|
||||
return NULL;
|
||||
|
@ -214,8 +221,10 @@ DEFUN(_IO_file_attach, (fp, fd),
|
|||
}
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_file_setbuf, (fp, p, len),
|
||||
register _IO_FILE *fp AND char* p AND _IO_ssize_t len)
|
||||
_IO_file_setbuf (fp, p, len)
|
||||
_IO_FILE *fp;
|
||||
char *p;
|
||||
_IO_ssize_t len;
|
||||
{
|
||||
if (_IO_default_setbuf (fp, p, len) == NULL)
|
||||
return NULL;
|
||||
|
@ -231,8 +240,10 @@ DEFUN(_IO_file_setbuf, (fp, p, len),
|
|||
Then mark FP as having empty buffers. */
|
||||
|
||||
int
|
||||
DEFUN(_IO_do_write, (fp, data, to_do),
|
||||
register _IO_FILE *fp AND const char* data AND _IO_size_t to_do)
|
||||
_IO_do_write (fp, data, to_do)
|
||||
_IO_FILE *fp;
|
||||
const char *data;
|
||||
_IO_size_t to_do;
|
||||
{
|
||||
_IO_size_t count;
|
||||
if (to_do == 0)
|
||||
|
@ -257,14 +268,14 @@ DEFUN(_IO_do_write, (fp, data, to_do),
|
|||
fp->_cur_column = _IO_adjust_column (fp->_cur_column - 1, data, to_do) + 1;
|
||||
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base, fp->_IO_buf_base);
|
||||
fp->_IO_write_base = fp->_IO_write_ptr = fp->_IO_buf_base;
|
||||
fp->_IO_write_end = (fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED)) ? fp->_IO_buf_base
|
||||
: fp->_IO_buf_end;
|
||||
fp->_IO_write_end = ((fp->_flags & (_IO_LINE_BUF+_IO_UNBUFFERED))
|
||||
? fp->_IO_buf_base : fp->_IO_buf_end);
|
||||
return count != to_do ? EOF : 0;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_underflow, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_file_underflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
_IO_ssize_t count;
|
||||
#if 0
|
||||
|
@ -318,8 +329,9 @@ DEFUN(_IO_file_underflow, (fp),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_overflow, (f, ch),
|
||||
register _IO_FILE* f AND int ch)
|
||||
_IO_file_overflow (f, ch)
|
||||
_IO_FILE *f;
|
||||
int ch;
|
||||
{
|
||||
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
|
||||
{
|
||||
|
@ -368,8 +380,8 @@ DEFUN(_IO_file_overflow, (f, ch),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_sync, (fp),
|
||||
register _IO_FILE* fp)
|
||||
_IO_file_sync (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
_IO_size_t delta;
|
||||
/* char* ptr = cur_ptr(); */
|
||||
|
@ -399,8 +411,11 @@ DEFUN(_IO_file_sync, (fp),
|
|||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
|
||||
register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
|
||||
_IO_file_seekoff (fp, offset, dir, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
int mode;
|
||||
{
|
||||
_IO_pos_t result;
|
||||
_IO_off_t delta, new_offset;
|
||||
|
@ -422,7 +437,8 @@ DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
|
|||
FIXME: simulate mem-papped files. */
|
||||
|
||||
if (fp->_IO_write_ptr > fp->_IO_write_base || _IO_in_put_mode (fp))
|
||||
if (_IO_switch_to_get_mode(fp)) return EOF;
|
||||
if (_IO_switch_to_get_mode (fp))
|
||||
return EOF;
|
||||
|
||||
if (fp->_IO_buf_base == NULL)
|
||||
{
|
||||
|
@ -464,8 +480,8 @@ DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
|
|||
&& !_IO_in_backup (fp))
|
||||
{
|
||||
/* Offset relative to start of main get area. */
|
||||
_IO_pos_t rel_offset = offset - fp->_offset
|
||||
+ (fp->_IO_read_end - fp->_IO_read_base);
|
||||
_IO_pos_t rel_offset = (offset - fp->_offset
|
||||
+ (fp->_IO_read_end - fp->_IO_read_base));
|
||||
if (rel_offset >= 0)
|
||||
{
|
||||
#if 0
|
||||
|
@ -535,7 +551,8 @@ DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
|
|||
goto dumb;
|
||||
}
|
||||
}
|
||||
_IO_setg(fp, fp->_IO_buf_base, fp->_IO_buf_base+delta, fp->_IO_buf_base+count);
|
||||
_IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + delta,
|
||||
fp->_IO_buf_base + count);
|
||||
_IO_setp (fp, fp->_IO_buf_base, fp->_IO_buf_base);
|
||||
fp->_offset = result + count;
|
||||
_IO_mask_flags (fp, 0, _IO_EOF_SEEN);
|
||||
|
@ -553,8 +570,10 @@ DEFUN(_IO_file_seekoff, (fp, offset, dir, mode),
|
|||
}
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_file_read, (fp, buf, size),
|
||||
register _IO_FILE* fp AND void* buf AND _IO_ssize_t size)
|
||||
_IO_file_read (fp, buf, size)
|
||||
_IO_FILE *fp;
|
||||
void *buf;
|
||||
_IO_ssize_t size;
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
|
@ -572,29 +591,34 @@ DEFUN(_IO_file_read, (fp, buf, size),
|
|||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_file_seek, (fp, offset, dir),
|
||||
_IO_FILE *fp AND _IO_off_t offset AND int dir)
|
||||
_IO_file_seek (fp, offset, dir)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
{
|
||||
return _IO_lseek (fp->_fileno, offset, dir);
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_stat, (fp, st),
|
||||
_IO_FILE *fp AND void* st)
|
||||
_IO_file_stat (fp, st)
|
||||
_IO_FILE *fp;
|
||||
void *st;
|
||||
{
|
||||
return _IO_fstat (fp->_fileno, (struct stat *) st);
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_file_close, (fp),
|
||||
_IO_FILE* fp)
|
||||
_IO_file_close (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
return _IO_close (fp->_fileno);
|
||||
}
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_file_write, (f, data, n),
|
||||
register _IO_FILE* f AND const void* data AND _IO_ssize_t n)
|
||||
_IO_file_write (f, data, n)
|
||||
_IO_FILE *f;
|
||||
const void *data;
|
||||
_IO_ssize_t n;
|
||||
{
|
||||
_IO_ssize_t to_do = n;
|
||||
while (to_do > 0)
|
||||
|
@ -626,8 +650,10 @@ DEFUN(_IO_file_write, (f, data, n),
|
|||
}
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_file_xsputn, (f, data, n),
|
||||
_IO_FILE *f AND const void *data AND _IO_size_t n)
|
||||
_IO_file_xsputn (f, data, n)
|
||||
_IO_FILE *f;
|
||||
const void *data;
|
||||
_IO_size_t n;
|
||||
{
|
||||
register const char *s = (char *) data;
|
||||
_IO_size_t to_do = n;
|
||||
|
@ -646,10 +672,12 @@ DEFUN(_IO_file_xsputn, (f, data, n),
|
|||
{
|
||||
count = f->_IO_buf_end - f->_IO_write_ptr;
|
||||
if (count >= n)
|
||||
{ register const char *p;
|
||||
{
|
||||
register const char *p;
|
||||
for (p = s + n; p > s; )
|
||||
{
|
||||
if (*--p == '\n') {
|
||||
if (*--p == '\n')
|
||||
{
|
||||
count = p - s + 1;
|
||||
must_flush = 1;
|
||||
break;
|
||||
|
@ -662,7 +690,8 @@ DEFUN(_IO_file_xsputn, (f, data, n),
|
|||
{
|
||||
if (count > to_do)
|
||||
count = to_do;
|
||||
if (count > 20) {
|
||||
if (count > 20)
|
||||
{
|
||||
memcpy (f->_IO_write_ptr, s, count);
|
||||
s += count;
|
||||
}
|
||||
|
@ -670,13 +699,15 @@ DEFUN(_IO_file_xsputn, (f, data, n),
|
|||
{
|
||||
register char *p = f->_IO_write_ptr;
|
||||
register int i = (int) count;
|
||||
while (--i >= 0) *p++ = *s++;
|
||||
while (--i >= 0)
|
||||
*p++ = *s++;
|
||||
}
|
||||
f->_IO_write_ptr += count;
|
||||
to_do -= count;
|
||||
}
|
||||
if (to_do + must_flush > 0)
|
||||
{ _IO_size_t block_size, dont_write;
|
||||
{
|
||||
_IO_size_t block_size, dont_write;
|
||||
/* Next flush the (full) buffer. */
|
||||
if (__overflow (f, EOF) == EOF)
|
||||
return n - to_do;
|
||||
|
@ -703,14 +734,17 @@ DEFUN(_IO_file_xsputn, (f, data, n),
|
|||
#if 0
|
||||
/* Work in progress */
|
||||
_IO_size_t
|
||||
DEFUN(_IO_file_xsgetn, (fp, data, n),
|
||||
_IO_FILE *fp AND void *data AND _IO_size_t n)
|
||||
_IO_file_xsgetn (fp, data, n)
|
||||
_IO_FILE *fp;
|
||||
void *data;
|
||||
_IO_size_t n;
|
||||
{
|
||||
register _IO_size_t more = n;
|
||||
register char *s = data;
|
||||
for (;;)
|
||||
{
|
||||
_IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr; /* Data available. */
|
||||
/* Data available. */
|
||||
_IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
|
||||
if (count > 0)
|
||||
{
|
||||
if (count > more)
|
||||
|
@ -727,7 +761,8 @@ DEFUN(_IO_file_xsgetn, (fp, data, n),
|
|||
{
|
||||
register char *p = fp->_IO_read_ptr;
|
||||
register int i = (int) count;
|
||||
while (--i >= 0) *s++ = *p++;
|
||||
while (--i >= 0)
|
||||
*s++ = *p++;
|
||||
fp->_IO_read_ptr = p;
|
||||
}
|
||||
more -= count;
|
||||
|
@ -767,7 +802,8 @@ DEFUN(_IO_file_xsgetn, (fp, data, n),
|
|||
}
|
||||
#endif
|
||||
|
||||
struct _IO_jump_t _IO_file_jumps = {
|
||||
struct _IO_jump_t _IO_file_jumps =
|
||||
{
|
||||
JUMP_INIT_DUMMY,
|
||||
JUMP_INIT(finish, _IO_file_finish),
|
||||
JUMP_INIT(overflow, _IO_file_overflow),
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
365
libio/genops.c
365
libio/genops.c
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
/* Generic or default I/O operations. */
|
||||
|
||||
|
@ -31,13 +32,16 @@ the executable file might be covered by the GNU General Public License. */
|
|||
#include <string.h>
|
||||
|
||||
void
|
||||
DEFUN(_IO_un_link, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_un_link (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp->_flags & _IO_LINKED)
|
||||
{
|
||||
if (fp->_flags & _IO_LINKED) {
|
||||
_IO_FILE **f;
|
||||
for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain) {
|
||||
if (*f == fp) {
|
||||
for (f = &_IO_list_all; *f != NULL; f = &(*f)->_chain)
|
||||
{
|
||||
if (*f == fp)
|
||||
{
|
||||
*f = fp->_chain;
|
||||
break;
|
||||
}
|
||||
|
@ -47,10 +51,11 @@ DEFUN(_IO_un_link, (fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_link_in, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_link_in (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if ((fp->_flags & _IO_LINKED) == 0)
|
||||
{
|
||||
if ((fp->_flags & _IO_LINKED) == 0) {
|
||||
fp->_flags |= _IO_LINKED;
|
||||
fp->_chain = _IO_list_all;
|
||||
_IO_list_all = fp;
|
||||
|
@ -59,13 +64,14 @@ DEFUN(_IO_link_in, (fp),
|
|||
|
||||
/* Return minimum _pos markers
|
||||
Assumes the current get area is the main get area. */
|
||||
static _IO_size_t _IO_least_marker __P ((_IO_FILE *fp));
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_least_marker, (fp),
|
||||
register _IO_FILE *fp)
|
||||
static _IO_size_t
|
||||
_IO_least_marker (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
_IO_ssize_t least_so_far = fp->_IO_read_end - fp->_IO_read_base;
|
||||
register struct _IO_marker *mark;
|
||||
struct _IO_marker *mark;
|
||||
for (mark = fp->_markers; mark != NULL; mark = mark->_next)
|
||||
if (mark->_pos < least_so_far)
|
||||
least_so_far = mark->_pos;
|
||||
|
@ -75,36 +81,46 @@ DEFUN(_IO_least_marker, (fp),
|
|||
/* Switch current get area from backup buffer to (start of) main get area. */
|
||||
|
||||
void
|
||||
DEFUN(_IO_switch_to_main_get_area, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_switch_to_main_get_area (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
char *tmp;
|
||||
fp->_flags &= ~_IO_IN_BACKUP;
|
||||
/* Swap _IO_read_end and _IO_save_end. */
|
||||
tmp = fp->_IO_read_end; fp->_IO_read_end= fp->_IO_save_end; fp->_IO_save_end= tmp;
|
||||
tmp = fp->_IO_read_end;
|
||||
fp->_IO_read_end = fp->_IO_save_end;
|
||||
fp->_IO_save_end= tmp;
|
||||
/* Swap _IO_read_base and _IO_save_base. */
|
||||
tmp = fp->_IO_read_base; fp->_IO_read_base = fp->_IO_save_base; fp->_IO_save_base = tmp;
|
||||
tmp = fp->_IO_read_base;
|
||||
fp->_IO_read_base = fp->_IO_save_base;
|
||||
fp->_IO_save_base = tmp;
|
||||
|
||||
fp->_IO_read_ptr = fp->_IO_read_base;
|
||||
}
|
||||
|
||||
/* Switch current get area from main get area to (end of) backup area. */
|
||||
|
||||
void
|
||||
DEFUN(_IO_switch_to_backup_area, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_switch_to_backup_area (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
char *tmp;
|
||||
fp->_flags |= _IO_IN_BACKUP;
|
||||
/* Swap _IO_read_end and _IO_save_end. */
|
||||
tmp = fp->_IO_read_end; fp->_IO_read_end = fp->_IO_save_end; fp->_IO_save_end = tmp;
|
||||
tmp = fp->_IO_read_end;
|
||||
fp->_IO_read_end = fp->_IO_save_end;
|
||||
fp->_IO_save_end = tmp;
|
||||
/* Swap _gbase and _IO_save_base. */
|
||||
tmp = fp->_IO_read_base; fp->_IO_read_base = fp->_IO_save_base; fp->_IO_save_base = tmp;
|
||||
tmp = fp->_IO_read_base;
|
||||
fp->_IO_read_base = fp->_IO_save_base;
|
||||
fp->_IO_save_base = tmp;
|
||||
|
||||
fp->_IO_read_ptr = fp->_IO_read_end;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_switch_to_get_mode, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_switch_to_get_mode (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp->_IO_write_ptr > fp->_IO_write_base)
|
||||
if (_IO_OVERFLOW (fp, EOF) == EOF)
|
||||
|
@ -126,8 +142,8 @@ DEFUN(_IO_switch_to_get_mode, (fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_free_backup_area, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_free_backup_area (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (_IO_in_backup (fp))
|
||||
_IO_switch_to_main_get_area (fp); /* Just in case. */
|
||||
|
@ -139,13 +155,14 @@ DEFUN(_IO_free_backup_area, (fp),
|
|||
|
||||
#if 0
|
||||
int
|
||||
DEFUN(_IO_switch_to_put_mode, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_switch_to_put_mode (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
fp->_IO_write_base = fp->_IO_read_ptr;
|
||||
fp->_IO_write_ptr = fp->_IO_read_ptr;
|
||||
/* Following is wrong if line- or un-buffered? */
|
||||
fp->_IO_write_end = fp->_flags & _IO_IN_BACKUP ? fp->_IO_read_end : fp->_IO_buf_end;
|
||||
fp->_IO_write_end = (fp->_flags & _IO_IN_BACKUP
|
||||
? fp->_IO_read_end : fp->_IO_buf_end);
|
||||
|
||||
fp->_IO_read_ptr = fp->_IO_read_end;
|
||||
fp->_IO_read_base = fp->_IO_read_end;
|
||||
|
@ -156,15 +173,18 @@ DEFUN(_IO_switch_to_put_mode, (fp),
|
|||
#endif
|
||||
|
||||
int
|
||||
DEFUN(__overflow, (f, ch),
|
||||
_IO_FILE *f AND int ch)
|
||||
__overflow (f, ch)
|
||||
_IO_FILE *f;
|
||||
int ch;
|
||||
{
|
||||
return _IO_OVERFLOW (f, ch);
|
||||
}
|
||||
|
||||
static int save_for_backup __P ((_IO_FILE *fp));
|
||||
|
||||
static int
|
||||
DEFUN(save_for_backup, (fp),
|
||||
_IO_FILE *fp)
|
||||
save_for_backup (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
/* Append [_IO_read_base.._IO_read_end] to backup area. */
|
||||
int least_mark = _IO_least_marker (fp);
|
||||
|
@ -226,11 +246,12 @@ DEFUN(save_for_backup, (fp),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(__underflow, (fp),
|
||||
_IO_FILE *fp)
|
||||
__underflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (_IO_in_put_mode (fp))
|
||||
if (_IO_switch_to_get_mode(fp) == EOF) return EOF;
|
||||
if (_IO_switch_to_get_mode (fp) == EOF)
|
||||
return EOF;
|
||||
if (fp->_IO_read_ptr < fp->_IO_read_end)
|
||||
return *(unsigned char *) fp->_IO_read_ptr;
|
||||
if (_IO_in_backup (fp))
|
||||
|
@ -250,11 +271,12 @@ DEFUN(__underflow, (fp),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(__uflow, (fp),
|
||||
_IO_FILE *fp)
|
||||
__uflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (_IO_in_put_mode (fp))
|
||||
if (_IO_switch_to_get_mode(fp) == EOF) return EOF;
|
||||
if (_IO_switch_to_get_mode (fp) == EOF)
|
||||
return EOF;
|
||||
if (fp->_IO_read_ptr < fp->_IO_read_end)
|
||||
return *(unsigned char *) fp->_IO_read_ptr++;
|
||||
if (_IO_in_backup (fp))
|
||||
|
@ -274,8 +296,11 @@ DEFUN(__uflow, (fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_setb, (f, b, eb, a),
|
||||
_IO_FILE *f AND char *b AND char *eb AND int a)
|
||||
_IO_setb (f, b, eb, a)
|
||||
_IO_FILE *f;
|
||||
char *b;
|
||||
char *eb;
|
||||
int a;
|
||||
{
|
||||
if (f->_IO_buf_base && !(f->_flags & _IO_USER_BUF))
|
||||
FREE_BUF (f->_IO_buf_base, _IO_blen (f));
|
||||
|
@ -288,8 +313,8 @@ DEFUN(_IO_setb, (f, b, eb, a),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_doallocbuf, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_doallocbuf (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp->_IO_buf_base)
|
||||
return;
|
||||
|
@ -300,15 +325,15 @@ DEFUN(_IO_doallocbuf, (fp),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_underflow, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_default_underflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
return EOF;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_uflow, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_default_uflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
int ch = _IO_UNDERFLOW (fp);
|
||||
if (ch == EOF)
|
||||
|
@ -317,16 +342,19 @@ DEFUN(_IO_default_uflow, (fp),
|
|||
}
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_default_xsputn, (f, data, n),
|
||||
register _IO_FILE *f AND const void *data AND _IO_size_t n)
|
||||
_IO_default_xsputn (f, data, n)
|
||||
_IO_FILE *f;
|
||||
const void *data;
|
||||
_IO_size_t n;
|
||||
{
|
||||
register const char *s = (char*) data;
|
||||
register _IO_size_t more = n;
|
||||
const char *s = (char *) data;
|
||||
_IO_size_t more = n;
|
||||
if (more <= 0)
|
||||
return 0;
|
||||
for (;;)
|
||||
{
|
||||
_IO_ssize_t count = f->_IO_write_end - f->_IO_write_ptr; /* Space available. */
|
||||
/* Space available. */
|
||||
_IO_ssize_t count = f->_IO_write_end - f->_IO_write_ptr;
|
||||
if (count > 0)
|
||||
{
|
||||
if ((_IO_size_t) count > more)
|
||||
|
@ -341,9 +369,10 @@ DEFUN(_IO_default_xsputn, (f, data, n),
|
|||
count = 0;
|
||||
else
|
||||
{
|
||||
register char *p = f->_IO_write_ptr;
|
||||
register _IO_ssize_t i;
|
||||
for (i = count; --i >= 0; ) *p++ = *s++;
|
||||
char *p = f->_IO_write_ptr;
|
||||
_IO_ssize_t i;
|
||||
for (i = count; --i >= 0; )
|
||||
*p++ = *s++;
|
||||
f->_IO_write_ptr = p;
|
||||
}
|
||||
more -= count;
|
||||
|
@ -356,22 +385,27 @@ DEFUN(_IO_default_xsputn, (f, data, n),
|
|||
}
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_sgetn, (fp, data, n),
|
||||
_IO_FILE *fp AND void *data AND _IO_size_t n)
|
||||
_IO_sgetn (fp, data, n)
|
||||
_IO_FILE *fp;
|
||||
void *data;
|
||||
_IO_size_t n;
|
||||
{
|
||||
/* FIXME handle putback buffer here! */
|
||||
return _IO_XSGETN (fp, data, n);
|
||||
}
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_default_xsgetn, (fp, data, n),
|
||||
_IO_FILE *fp AND void *data AND _IO_size_t n)
|
||||
_IO_default_xsgetn (fp, data, n)
|
||||
_IO_FILE *fp;
|
||||
void *data;
|
||||
_IO_size_t n;
|
||||
{
|
||||
register _IO_size_t more = n;
|
||||
register char *s = (char*) data;
|
||||
_IO_size_t more = n;
|
||||
char *s = (char*) data;
|
||||
for (;;)
|
||||
{
|
||||
_IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr; /* Data available. */
|
||||
/* Data available. */
|
||||
_IO_ssize_t count = fp->_IO_read_end - fp->_IO_read_ptr;
|
||||
if (count > 0)
|
||||
{
|
||||
if ((_IO_size_t) count > more)
|
||||
|
@ -386,9 +420,10 @@ DEFUN(_IO_default_xsgetn, (fp, data, n),
|
|||
count = 0;
|
||||
else
|
||||
{
|
||||
register char *p = fp->_IO_read_ptr;
|
||||
register int i = (int)count;
|
||||
while (--i >= 0) *s++ = *p++;
|
||||
char *p = fp->_IO_read_ptr;
|
||||
int i = (int) count;
|
||||
while (--i >= 0)
|
||||
*s++ = *p++;
|
||||
fp->_IO_read_ptr = p;
|
||||
}
|
||||
more -= count;
|
||||
|
@ -399,16 +434,21 @@ DEFUN(_IO_default_xsgetn, (fp, data, n),
|
|||
return n - more;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Seems not to be needed. --drepper */
|
||||
int
|
||||
DEFUN(_IO_sync, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_sync (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_default_setbuf, (fp, p, len),
|
||||
register _IO_FILE *fp AND char* p AND _IO_ssize_t len)
|
||||
_IO_default_setbuf (fp, p, len)
|
||||
_IO_FILE *fp;
|
||||
char *p;
|
||||
_IO_ssize_t len;
|
||||
{
|
||||
if (_IO_SYNC (fp) == EOF)
|
||||
return NULL;
|
||||
|
@ -428,15 +468,17 @@ DEFUN(_IO_default_setbuf, (fp, p, len),
|
|||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_default_seekpos, (fp, pos, mode),
|
||||
_IO_FILE *fp AND _IO_pos_t pos AND int mode)
|
||||
_IO_default_seekpos (fp, pos, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_pos_t pos;
|
||||
int mode;
|
||||
{
|
||||
return _IO_SEEKOFF (fp, _IO_pos_as_off (pos), 0, mode);
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_doallocate, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_default_doallocate (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
char *buf;
|
||||
|
||||
|
@ -446,8 +488,9 @@ DEFUN(_IO_default_doallocate, (fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_init, (fp, flags),
|
||||
register _IO_FILE *fp AND int flags)
|
||||
_IO_init (fp, flags)
|
||||
_IO_FILE *fp;
|
||||
int flags;
|
||||
{
|
||||
fp->_flags = _IO_MAGIC|flags;
|
||||
fp->_IO_buf_base = NULL;
|
||||
|
@ -471,8 +514,8 @@ DEFUN(_IO_init, (fp, flags),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_sync, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_default_sync (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -481,8 +524,9 @@ DEFUN(_IO_default_sync, (fp),
|
|||
current implementation, this function can get called twice! */
|
||||
|
||||
void
|
||||
DEFUN(_IO_default_finish, (fp, dummy),
|
||||
_IO_FILE *fp AND int dummy)
|
||||
_IO_default_finish (fp, dummy)
|
||||
_IO_FILE *fp;
|
||||
int dummy;
|
||||
{
|
||||
struct _IO_marker *mark;
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
|
@ -508,15 +552,19 @@ DEFUN(_IO_default_finish, (fp, dummy),
|
|||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_default_seekoff, (fp, offset, dir, mode),
|
||||
register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
|
||||
_IO_default_seekoff (fp, offset, dir, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
int mode;
|
||||
{
|
||||
return _IO_pos_BAD;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_sputbackc, (fp, c),
|
||||
register _IO_FILE *fp AND int c)
|
||||
_IO_sputbackc (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -536,8 +584,8 @@ DEFUN(_IO_sputbackc, (fp, c),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_sungetc, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_sungetc (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -556,9 +604,12 @@ DEFUN(_IO_sungetc, (fp),
|
|||
}
|
||||
|
||||
#if 0 /* Work in progress */
|
||||
/* Seems not to be needed. */
|
||||
#if 0
|
||||
void
|
||||
DEFUN(_IO_set_column, (fp, c),
|
||||
register _IO_FILE *fp AND int c)
|
||||
_IO_set_column (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
if (c == -1)
|
||||
fp->_column = -1;
|
||||
|
@ -567,29 +618,35 @@ DEFUN(_IO_set_column, (fp, c),
|
|||
}
|
||||
#else
|
||||
int
|
||||
DEFUN(_IO_set_column, (fp, i),
|
||||
register _IO_FILE *fp AND int i)
|
||||
_IO_set_column (fp, i)
|
||||
_IO_FILE *fp;
|
||||
int i;
|
||||
{
|
||||
fp->_cur_column = i + 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
unsigned
|
||||
DEFUN(_IO_adjust_column, (start, line, count),
|
||||
unsigned start AND const char *line AND int count)
|
||||
_IO_adjust_column (start, line, count)
|
||||
unsigned start;
|
||||
const char *line;
|
||||
int count;
|
||||
{
|
||||
register const char *ptr = line + count;
|
||||
const char *ptr = line + count;
|
||||
while (ptr > line)
|
||||
if (*--ptr == '\n')
|
||||
return line + count - ptr - 1;
|
||||
return start + count;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Seems not to be needed. --drepper */
|
||||
int
|
||||
DEFUN(_IO_get_column, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_get_column (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp->_cur_column)
|
||||
return _IO_adjust_column (fp->_cur_column - 1,
|
||||
|
@ -597,9 +654,10 @@ DEFUN(_IO_get_column, (fp),
|
|||
fp->_IO_write_ptr - fp->_IO_write_base);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
DEFUN_VOID(_IO_flush_all)
|
||||
_IO_flush_all ()
|
||||
{
|
||||
int result = 0;
|
||||
_IO_FILE *fp;
|
||||
|
@ -611,7 +669,7 @@ DEFUN_VOID(_IO_flush_all)
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN_VOID(_IO_flush_all_linebuffered)
|
||||
_IO_flush_all_linebuffered ()
|
||||
{
|
||||
_IO_FILE *fp;
|
||||
for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
|
||||
|
@ -619,8 +677,10 @@ DEFUN_VOID(_IO_flush_all_linebuffered)
|
|||
_IO_OVERFLOW (fp, EOF);
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN_VOID(_IO_unbuffer_all)
|
||||
static void _IO_unbuffer_all __P ((void));
|
||||
|
||||
static void
|
||||
_IO_unbuffer_all ()
|
||||
{
|
||||
_IO_FILE *fp;
|
||||
for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
|
||||
|
@ -629,7 +689,7 @@ DEFUN_VOID(_IO_unbuffer_all)
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN_VOID(_IO_cleanup)
|
||||
_IO_cleanup ()
|
||||
{
|
||||
_IO_flush_all ();
|
||||
|
||||
|
@ -644,8 +704,9 @@ DEFUN_VOID(_IO_cleanup)
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_init_marker, (marker, fp),
|
||||
struct _IO_marker *marker AND _IO_FILE *fp)
|
||||
_IO_init_marker (marker, fp)
|
||||
struct _IO_marker *marker;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
marker->_sbuf = fp;
|
||||
if (_IO_in_put_mode (fp))
|
||||
|
@ -661,11 +722,11 @@ DEFUN(_IO_init_marker, (marker, fp),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_remove_marker, (marker),
|
||||
register struct _IO_marker *marker)
|
||||
_IO_remove_marker (marker)
|
||||
struct _IO_marker *marker;
|
||||
{
|
||||
/* Unlink from sb's chain. */
|
||||
register struct _IO_marker **ptr = &marker->_sbuf->_markers;
|
||||
struct _IO_marker **ptr = &marker->_sbuf->_markers;
|
||||
for (; ; ptr = &(*ptr)->_next)
|
||||
{
|
||||
if (*ptr == NULL)
|
||||
|
@ -685,16 +746,17 @@ DEFUN(_IO_remove_marker, (marker),
|
|||
#define BAD_DELTA EOF
|
||||
|
||||
int
|
||||
DEFUN(_IO_marker_difference, (mark1, mark2),
|
||||
struct _IO_marker *mark1 AND struct _IO_marker *mark2)
|
||||
_IO_marker_difference (mark1, mark2)
|
||||
struct _IO_marker *mark1;
|
||||
struct _IO_marker *mark2;
|
||||
{
|
||||
return mark1->_pos - mark2->_pos;
|
||||
}
|
||||
|
||||
/* Return difference between MARK and current position of MARK's stream. */
|
||||
int
|
||||
DEFUN(_IO_marker_delta, (mark),
|
||||
struct _IO_marker *mark)
|
||||
_IO_marker_delta (mark)
|
||||
struct _IO_marker *mark;
|
||||
{
|
||||
int cur_pos;
|
||||
if (mark->_sbuf == NULL)
|
||||
|
@ -707,8 +769,10 @@ DEFUN(_IO_marker_delta, (mark),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_seekmark, (fp, mark, delta),
|
||||
_IO_FILE *fp AND struct _IO_marker *mark AND int delta)
|
||||
_IO_seekmark (fp, mark, delta)
|
||||
_IO_FILE *fp;
|
||||
struct _IO_marker *mark;
|
||||
int delta;
|
||||
{
|
||||
if (mark->_sbuf != fp)
|
||||
return EOF;
|
||||
|
@ -728,10 +792,10 @@ DEFUN(_IO_seekmark, (fp, mark, delta),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_unsave_markers, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_unsave_markers (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
register struct _IO_marker *mark = fp->_markers;
|
||||
struct _IO_marker *mark = fp->_markers;
|
||||
if (mark)
|
||||
{
|
||||
#ifdef TODO
|
||||
|
@ -755,9 +819,12 @@ DEFUN(_IO_unsave_markers, (fp),
|
|||
_IO_free_backup_area (fp);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Seems not to be needed. --drepper */
|
||||
int
|
||||
DEFUN(_IO_nobackup_pbackfail, (fp, c),
|
||||
register _IO_FILE *fp AND int c)
|
||||
_IO_nobackup_pbackfail (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
if (fp->_IO_read_ptr > fp->_IO_read_base)
|
||||
fp->_IO_read_ptr--;
|
||||
|
@ -765,10 +832,12 @@ DEFUN(_IO_nobackup_pbackfail, (fp, c),
|
|||
*fp->_IO_read_ptr = c;
|
||||
return (unsigned char) c;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_pbackfail, (fp, c),
|
||||
register _IO_FILE *fp AND int c)
|
||||
_IO_default_pbackfail (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
if (fp->_IO_read_ptr <= fp->_IO_read_base)
|
||||
{
|
||||
|
@ -799,43 +868,51 @@ DEFUN(_IO_default_pbackfail, (fp, c),
|
|||
new_buf = (char *) malloc (new_size);
|
||||
if (new_buf == NULL)
|
||||
return EOF;
|
||||
memcpy(new_buf+(new_size-old_size), fp->_IO_read_base, old_size);
|
||||
memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
|
||||
old_size);
|
||||
free (fp->_IO_read_base);
|
||||
_IO_setg(fp,
|
||||
new_buf, new_buf+(new_size-old_size), new_buf+new_size);
|
||||
_IO_setg (fp, new_buf, new_buf + (new_size - old_size),
|
||||
new_buf + new_size);
|
||||
fp->_IO_backup_base = fp->_IO_read_ptr;
|
||||
}
|
||||
}
|
||||
fp->_IO_read_ptr--;
|
||||
--fp->_IO_read_ptr;
|
||||
if (c != EOF && *fp->_IO_read_ptr != c)
|
||||
*fp->_IO_read_ptr = c;
|
||||
return (unsigned char) *fp->_IO_read_ptr;
|
||||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_default_seek, (fp, offset, dir),
|
||||
_IO_FILE *fp AND _IO_off_t offset AND int dir)
|
||||
_IO_default_seek (fp, offset, dir)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
{
|
||||
return _IO_pos_BAD;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_default_stat, (fp, st),
|
||||
_IO_FILE *fp AND void* st)
|
||||
_IO_default_stat (fp, st)
|
||||
_IO_FILE *fp;
|
||||
void* st;
|
||||
{
|
||||
return EOF;
|
||||
}
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_default_read, (fp, data, n),
|
||||
register _IO_FILE* fp AND void* data AND _IO_ssize_t n)
|
||||
_IO_default_read (fp, data, n)
|
||||
_IO_FILE* fp;
|
||||
void *data;
|
||||
_IO_ssize_t n;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_default_write, (fp, data, n),
|
||||
register _IO_FILE* fp AND const void* data AND _IO_ssize_t n)
|
||||
_IO_default_write (fp, data, n)
|
||||
_IO_FILE *fp;
|
||||
const void *data;
|
||||
_IO_ssize_t n;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
39
libio/getc.c
39
libio/getc.c
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -39,5 +40,9 @@ _IO_getc (fp)
|
|||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#undef getc
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_getc, getc)
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#ifdef __STDC__
|
||||
|
@ -29,7 +30,7 @@ the executable file might be covered by the GNU General Public License. */
|
|||
|
||||
int
|
||||
_IO_fclose (fp)
|
||||
register _IO_FILE *fp;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
int status;
|
||||
|
||||
|
@ -52,4 +53,6 @@ _IO_fclose (fp)
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_fclose, fclose)
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1994 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -1,33 +1,34 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
_IO_fflush (fp)
|
||||
register _IO_FILE *fp;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp == NULL)
|
||||
return _IO_flush_all ();
|
||||
|
|
|
@ -1,33 +1,34 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
fflush_unlocked (fp)
|
||||
register _IO_FILE *fp;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp == NULL)
|
||||
return _IO_flush_all ();
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <errno.h>
|
||||
/* ANSI explicitly requires setting errno to a positive value on failure. */
|
||||
|
||||
int
|
||||
_IO_fgetpos (fp, posp)
|
||||
|
@ -39,6 +39,8 @@ _IO_fgetpos (fp, posp)
|
|||
_IO_cleanup_region_end (1);
|
||||
if (pos == _IO_pos_BAD)
|
||||
{
|
||||
/* ANSI explicitly requires setting errno to a positive value on
|
||||
failure. */
|
||||
#ifdef EIO
|
||||
if (errno == 0)
|
||||
__set_errno (EIO);
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <libioP.h>
|
||||
#include <stdio.h>
|
||||
|
@ -39,7 +40,7 @@ static int _IO_cookie_close __P ((_IO_FILE* fp));
|
|||
|
||||
static _IO_ssize_t
|
||||
_IO_cookie_read (fp, buf, size)
|
||||
register _IO_FILE* fp;
|
||||
_IO_FILE *fp;
|
||||
void *buf;
|
||||
_IO_ssize_t size;
|
||||
{
|
||||
|
@ -53,7 +54,7 @@ _IO_cookie_read (fp, buf, size)
|
|||
|
||||
static _IO_ssize_t
|
||||
_IO_cookie_write (fp, buf, size)
|
||||
register _IO_FILE* fp;
|
||||
_IO_FILE *fp;
|
||||
const void *buf;
|
||||
_IO_ssize_t size;
|
||||
{
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
@ -31,11 +32,13 @@ the executable file might be covered by the GNU General Public License. */
|
|||
#endif
|
||||
|
||||
int
|
||||
_IO_fprintf
|
||||
#ifdef __STDC__
|
||||
(_IO_FILE *fp, const char* format, ...)
|
||||
_IO_fprintf (_IO_FILE *fp, const char* format, ...)
|
||||
#else
|
||||
(fp, format, va_alist) _IO_FILE *fp; char *format; va_dcl
|
||||
_IO_fprintf (fp, format, va_alist)
|
||||
_IO_FILE *fp;
|
||||
char *format;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
int ret;
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <libioP.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
@ -41,7 +42,7 @@ _IO_fwrite (buf, size, count, fp)
|
|||
written = _IO_sputn (fp, (const char *) buf, request);
|
||||
_IO_cleanup_region_end (1);
|
||||
/* Many traditional implementations return 0 if size==0 && count > 0,
|
||||
but ANSI seems to require us to return count in this case. */
|
||||
but ANSI requires us to return count in this case. */
|
||||
if (written == request)
|
||||
return count;
|
||||
else
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1994, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stdlib.h>
|
||||
|
@ -43,7 +44,7 @@ _IO_getdelim (lineptr, n, delimiter, fp)
|
|||
_IO_FILE *fp;
|
||||
{
|
||||
int result;
|
||||
register _IO_ssize_t cur_len = 0;
|
||||
_IO_ssize_t cur_len = 0;
|
||||
_IO_ssize_t len;
|
||||
|
||||
if (lineptr == NULL || n == NULL)
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <string.h>
|
||||
|
@ -34,11 +35,14 @@ the executable file might be covered by the GNU General Public License. */
|
|||
If extract_delim > 0, insert delim in output. */
|
||||
|
||||
_IO_size_t
|
||||
DEFUN(_IO_getline, (fp, buf, n, delim, extract_delim),
|
||||
_IO_FILE *fp AND char* buf AND _IO_size_t n
|
||||
AND int delim AND int extract_delim)
|
||||
_IO_getline (fp, buf, n, delim, extract_delim)
|
||||
_IO_FILE *fp;
|
||||
char *buf;
|
||||
_IO_size_t n;
|
||||
int delim;
|
||||
int extract_delim;
|
||||
{
|
||||
register char *ptr = buf;
|
||||
char *ptr = buf;
|
||||
do
|
||||
{
|
||||
_IO_ssize_t len = fp->_IO_read_end - fp->_IO_read_ptr;
|
||||
|
@ -57,9 +61,9 @@ DEFUN(_IO_getline, (fp, buf, n, delim, extract_delim),
|
|||
len = t - fp->_IO_read_ptr;
|
||||
if (extract_delim >= 0)
|
||||
{
|
||||
t++;
|
||||
++t;
|
||||
if (extract_delim > 0)
|
||||
len++;
|
||||
++len;
|
||||
}
|
||||
memcpy ((void *) ptr, (void *) fp->_IO_read_ptr, len);
|
||||
fp->_IO_read_ptr = t;
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <limits.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
@ -31,13 +32,16 @@ static char const zeroes[PADSIZE] =
|
|||
{'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_padn, (fp, pad, count),
|
||||
_IO_FILE *fp AND int pad AND _IO_ssize_t count)
|
||||
_IO_padn (fp, pad, count)
|
||||
_IO_FILE *fp;
|
||||
int pad;
|
||||
_IO_ssize_t count;
|
||||
{
|
||||
char padbuf[PADSIZE];
|
||||
const char *padptr;
|
||||
register int i;
|
||||
_IO_size_t written = 0, w;
|
||||
int i;
|
||||
_IO_size_t written = 0;
|
||||
_IO_size_t w;
|
||||
|
||||
if (pad == ' ')
|
||||
padptr = blanks;
|
||||
|
@ -45,7 +49,8 @@ DEFUN(_IO_padn, (fp, pad, count),
|
|||
padptr = zeroes;
|
||||
else
|
||||
{
|
||||
for (i = PADSIZE; --i >= 0; ) padbuf[i] = pad;
|
||||
for (i = PADSIZE; --i >= 0; )
|
||||
padbuf[i] = pad;
|
||||
padptr = padbuf;
|
||||
}
|
||||
for (i = count; i >= PADSIZE; i -= PADSIZE)
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
Written by Per Bothner <bothner@cygnus.com>.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* written by Per Bothner (bothner@cygnus.com) */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#ifndef _POSIX_SOURCE
|
||||
# define _POSIX_SOURCE
|
||||
|
@ -80,8 +80,10 @@ typedef struct _IO_proc_file _IO_proc_file;
|
|||
static struct _IO_proc_file *proc_file_chain = NULL;
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_proc_open, (fp, command, mode),
|
||||
_IO_FILE* fp AND const char *command AND const char *mode)
|
||||
_IO_proc_open (fp, command, mode)
|
||||
_IO_FILE *fp;
|
||||
const char *command;
|
||||
const char *mode;
|
||||
{
|
||||
#if _IO_HAVE_SYS_WAIT
|
||||
volatile int read_or_write;
|
||||
|
@ -114,7 +116,7 @@ DEFUN(_IO_proc_open, (fp, command, mode),
|
|||
_IO_dup2 (child_end, child_std_end);
|
||||
_IO_close (child_end);
|
||||
}
|
||||
/* Posix.2: "popen() shall ensure that any streams from previous
|
||||
/* POSIX.2: "popen() shall ensure that any streams from previous
|
||||
popen() calls that remain open in the parent process are closed
|
||||
in the new child process." */
|
||||
while (proc_file_chain)
|
||||
|
@ -146,8 +148,9 @@ DEFUN(_IO_proc_open, (fp, command, mode),
|
|||
}
|
||||
|
||||
_IO_FILE *
|
||||
DEFUN(_IO_popen, (command, mode),
|
||||
const char *command AND const char *mode)
|
||||
_IO_popen (command, mode)
|
||||
const char *command;
|
||||
const char *mode;
|
||||
{
|
||||
struct locked_FILE
|
||||
{
|
||||
|
@ -182,8 +185,8 @@ strong_alias (_IO_popen, popen);
|
|||
#endif
|
||||
|
||||
int
|
||||
DEFUN(_IO_proc_close, (fp),
|
||||
_IO_FILE *fp)
|
||||
_IO_proc_close (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
/* This is not name-space clean. FIXME! */
|
||||
#if _IO_HAVE_SYS_WAIT
|
||||
|
@ -212,7 +215,8 @@ DEFUN(_IO_proc_close, (fp),
|
|||
do
|
||||
{
|
||||
wait_pid = _IO_waitpid (((_IO_proc_file *) fp)->pid, &wstatus, 0);
|
||||
} while (wait_pid == -1 && errno == EINTR);
|
||||
}
|
||||
while (wait_pid == -1 && errno == EINTR);
|
||||
if (wait_pid == -1)
|
||||
return -1;
|
||||
return wstatus;
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,32 +1,36 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <libioP.h>
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_seekoff, (fp, offset, dir, mode),
|
||||
_IO_FILE* fp AND _IO_off_t offset AND int dir AND int mode)
|
||||
_IO_seekoff (fp, offset, dir, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
int mode;
|
||||
{
|
||||
/* If we have a backup buffer, get rid of it, since the __seekoff
|
||||
callback may not know to do the right thing about it.
|
||||
|
|
|
@ -1,32 +1,35 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <libioP.h>
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_seekpos, (fp, pos, mode),
|
||||
_IO_FILE* fp AND _IO_pos_t pos AND int mode)
|
||||
_IO_seekpos (fp, pos, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_pos_t pos;
|
||||
int mode;
|
||||
{
|
||||
/* If we have a backup buffer, get rid of it, since the __seekoff
|
||||
callback may not know to do the right thing about it.
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
@ -31,11 +32,13 @@ the executable file might be covered by the GNU General Public License. */
|
|||
#endif
|
||||
|
||||
int
|
||||
_IO_sprintf
|
||||
#ifdef __STDC__
|
||||
(char *string, const char* format, ...)
|
||||
_IO_sprintf (char *string, const char* format, ...)
|
||||
#else
|
||||
(string, format, va_alist) char *string; char *format; va_dcl
|
||||
_IO_sprintf (string, format, va_alist)
|
||||
char *string;
|
||||
char *format;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
int ret;
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1995 Free Software Foundation
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "libio.h"
|
||||
|
@ -63,4 +64,7 @@ _IO_vdprintf (d, format, arg)
|
|||
|
||||
return done;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_vdprintf, vdprintf)
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "strfile.h"
|
||||
|
|
|
@ -1,33 +1,36 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "strfile.h"
|
||||
|
||||
int
|
||||
DEFUN(_IO_vsscanf, (string, format, args),
|
||||
const char *string AND const char *format AND _IO_va_list args)
|
||||
_IO_vsscanf (string, format, args)
|
||||
const char *string;
|
||||
const char *format;
|
||||
_IO_va_list args;
|
||||
{
|
||||
int ret;
|
||||
_IO_strfile sf;
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/*
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
Written by Per Bothner <bothner@cygnus.com>.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* This is part of the iostream library. Written by Per Bothner. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#ifndef _IO_STDIO_H
|
||||
#define _IO_STDIO_H
|
||||
|
@ -239,7 +239,8 @@ typedef struct
|
|||
} _IO_cookie_io_functions_t;
|
||||
|
||||
/* Special file type for fopencookie function. */
|
||||
struct _IO_cookie_file {
|
||||
struct _IO_cookie_file
|
||||
{
|
||||
struct _IO_FILE file;
|
||||
const void *vtable;
|
||||
void *cookie;
|
||||
|
@ -294,22 +295,7 @@ extern int _IO_ftrylockfile __P ((_IO_FILE *));
|
|||
# define _IO_cleanup_region_end(_Doit) /**/
|
||||
#endif /* !_IO_MTSAFE_IO */
|
||||
|
||||
/* XXX Should we allow a symbol to be defined which selects the efficient
|
||||
implementation when the user is really sure no threaded functions ever
|
||||
will be used? */
|
||||
#if 1
|
||||
# define _IO_getc(_fp) _IO_getc (_fp)
|
||||
#define _IO_peekc(_fp) _IO_peekc_locked (_fp)
|
||||
# define _IO_putc(_ch, _fp) _IO_putc (_ch, _fp)
|
||||
# define _IO_feof(_fp) _IO_feof (_fp)
|
||||
# define _IO_ferror(_fp) _IO_ferror (_fp)
|
||||
#else
|
||||
# define _IO_getc(_fp) _IO_getc_unlocked (_fp)
|
||||
# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp)
|
||||
# define _IO_putc(_ch, _fp) _IO_putc_unlocked (_ch, _fp)
|
||||
# define _IO_feof(_fp) _IO_feof_unlocked (_fp)
|
||||
# define _IO_ferror(_fp) _IO_ferror_unlocked (_fp)
|
||||
#endif
|
||||
|
||||
extern int _IO_vfscanf __P ((_IO_FILE *, const char *, _IO_va_list, int *));
|
||||
extern int _IO_vfprintf __P ((_IO_FILE *, const char *, _IO_va_list));
|
||||
|
|
101
libio/libioP.h
101
libio/libioP.h
|
@ -1,57 +1,34 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
#include <bits/libc-lock.h>
|
||||
|
||||
#include "iolibio.h"
|
||||
|
||||
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__cplusplus)
|
||||
/* All known AIX compilers implement these things (but don't always
|
||||
define __STDC__). The RISC/OS MIPS compiler defines these things
|
||||
in SVR4 mode, but does not define __STDC__. */
|
||||
|
||||
#define AND ,
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
|
||||
#else /* Not ANSI C. */
|
||||
|
||||
#define AND ;
|
||||
#ifndef const /* some systems define it in header files for non-ansi mode */
|
||||
#define const
|
||||
#endif
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#endif /* ANSI C. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define _IO_seek_set 0
|
||||
#define _IO_seek_cur 1
|
||||
|
@ -132,14 +109,15 @@ typedef int (*_IO_pbackfail_t) __P((_IO_FILE*, int));
|
|||
/* The 'xsputn' hook writes upto N characters from buffer DATA.
|
||||
Returns the number of character actually written.
|
||||
It matches the streambuf::xsputn virtual function. */
|
||||
typedef _IO_size_t (*_IO_xsputn_t)
|
||||
__P((_IO_FILE *FP, const void *DATA, _IO_size_t N));
|
||||
typedef _IO_size_t (*_IO_xsputn_t) __P ((_IO_FILE *FP, const void *DATA,
|
||||
_IO_size_t N));
|
||||
#define _IO_XSPUTN(FP, DATA, N) JUMP2 (__xsputn, FP, DATA, N)
|
||||
|
||||
/* The 'xsgetn' hook reads upto N characters into buffer DATA.
|
||||
Returns the number of character actually read.
|
||||
It matches the streambuf::xsgetn virtual function. */
|
||||
typedef _IO_size_t (*_IO_xsgetn_t) __P((_IO_FILE*FP, void*DATA, _IO_size_t N));
|
||||
typedef _IO_size_t (*_IO_xsgetn_t) __P ((_IO_FILE *FP, void *DATA,
|
||||
_IO_size_t N));
|
||||
#define _IO_XSGETN(FP, DATA, N) JUMP2 (__xsgetn, FP, DATA, N)
|
||||
|
||||
/* The 'seekoff' hook moves the stream position to a new position
|
||||
|
@ -147,8 +125,8 @@ typedef _IO_size_t (*_IO_xsgetn_t) __P((_IO_FILE*FP, void*DATA, _IO_size_t N));
|
|||
(MODE==1), or the end of the file (MODE==2).
|
||||
It matches the streambuf::seekoff virtual function.
|
||||
It is also used for the ANSI fseek function. */
|
||||
typedef _IO_fpos_t (*_IO_seekoff_t)
|
||||
__P((_IO_FILE* FP, _IO_off_t OFF, int DIR, int MODE));
|
||||
typedef _IO_fpos_t (*_IO_seekoff_t) __P ((_IO_FILE *FP, _IO_off_t OFF,
|
||||
int DIR, int MODE));
|
||||
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3 (__seekoff, FP, OFF, DIR, MODE)
|
||||
|
||||
/* The 'seekpos' hook also moves the stream position,
|
||||
|
@ -226,7 +204,8 @@ typedef int (*_IO_stat_t) __P((_IO_FILE*, void*));
|
|||
#define _IO_CHAR_TYPE char /* unsigned char ? */
|
||||
#define _IO_INT_TYPE int
|
||||
|
||||
struct _IO_jump_t {
|
||||
struct _IO_jump_t
|
||||
{
|
||||
JUMP_FIELD(_G_size_t, __dummy);
|
||||
#ifdef _G_USING_THUNKS
|
||||
JUMP_FIELD(_G_size_t, __dummy2);
|
||||
|
@ -260,7 +239,8 @@ struct _IO_jump_t {
|
|||
This is for compatibility with C++ streambuf; the word can
|
||||
be used to smash to a pointer to a virtual function table. */
|
||||
|
||||
struct _IO_FILE_plus {
|
||||
struct _IO_FILE_plus
|
||||
{
|
||||
_IO_FILE file;
|
||||
const struct _IO_jump_t *vtable;
|
||||
};
|
||||
|
@ -270,6 +250,8 @@ struct _IO_FILE_plus {
|
|||
extern _IO_fpos_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
|
||||
extern _IO_fpos_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
|
||||
|
||||
extern void _IO_switch_to_main_get_area __P ((_IO_FILE *));
|
||||
extern void _IO_switch_to_backup_area __P ((_IO_FILE *));
|
||||
extern int _IO_switch_to_get_mode __P ((_IO_FILE *));
|
||||
extern void _IO_init __P ((_IO_FILE *, int));
|
||||
extern int _IO_sputbackc __P ((_IO_FILE *, int));
|
||||
|
@ -286,7 +268,8 @@ extern unsigned _IO_adjust_column __P((unsigned, const char *, int));
|
|||
|
||||
extern void _IO_init_marker __P ((struct _IO_marker *, _IO_FILE *));
|
||||
extern void _IO_remove_marker __P ((struct _IO_marker *));
|
||||
extern int _IO_marker_difference __P((struct _IO_marker *, struct _IO_marker *));
|
||||
extern int _IO_marker_difference __P ((struct _IO_marker *,
|
||||
struct _IO_marker *));
|
||||
extern int _IO_marker_delta __P ((struct _IO_marker *));
|
||||
extern int _IO_seekmark __P ((_IO_FILE *, struct _IO_marker *, int));
|
||||
|
||||
|
@ -298,11 +281,13 @@ extern int _IO_default_doallocate __P((_IO_FILE*));
|
|||
extern void _IO_default_finish __P ((_IO_FILE *, int));
|
||||
extern int _IO_default_pbackfail __P ((_IO_FILE *, int));
|
||||
extern _IO_FILE* _IO_default_setbuf __P ((_IO_FILE *, char *, _IO_ssize_t));
|
||||
extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
|
||||
extern _IO_size_t _IO_default_xsputn __P ((_IO_FILE *, const void *,
|
||||
_IO_size_t));
|
||||
extern _IO_size_t _IO_default_xsgetn __P ((_IO_FILE *, void *, _IO_size_t));
|
||||
extern _IO_fpos_t _IO_default_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
|
||||
extern _IO_fpos_t _IO_default_seekpos __P ((_IO_FILE *, _IO_fpos_t, int));
|
||||
extern _IO_ssize_t _IO_default_write __P((_IO_FILE*,const void*,_IO_ssize_t));
|
||||
extern _IO_ssize_t _IO_default_write __P ((_IO_FILE *, const void *,
|
||||
_IO_ssize_t));
|
||||
extern _IO_ssize_t _IO_default_read __P ((_IO_FILE *, void *, _IO_ssize_t));
|
||||
extern int _IO_default_stat __P ((_IO_FILE *, void *));
|
||||
extern _IO_fpos_t _IO_default_seek __P ((_IO_FILE *, _IO_off_t, int));
|
||||
|
@ -347,7 +332,8 @@ extern int _IO_file_overflow __P((_IO_FILE *, int));
|
|||
extern void _IO_file_init __P ((_IO_FILE *));
|
||||
extern _IO_FILE* _IO_file_attach __P ((_IO_FILE *, int));
|
||||
extern _IO_FILE* _IO_file_fopen __P ((_IO_FILE *, const char *, const char *));
|
||||
extern _IO_ssize_t _IO_file_write __P((_IO_FILE*,const void*,_IO_ssize_t));
|
||||
extern _IO_ssize_t _IO_file_write __P ((_IO_FILE *, const void *,
|
||||
_IO_ssize_t));
|
||||
extern _IO_ssize_t _IO_file_read __P ((_IO_FILE *, void *, _IO_ssize_t));
|
||||
extern int _IO_file_sync __P ((_IO_FILE *));
|
||||
extern int _IO_file_close_it __P ((_IO_FILE *));
|
||||
|
@ -476,7 +462,7 @@ extern int _IO_vscanf __P((const char *, _IO_va_list));
|
|||
|
||||
/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
|
||||
#ifndef _IO_pos_BAD
|
||||
#define _IO_pos_BAD ((_IO_fpos_t)(-1))
|
||||
# define _IO_pos_BAD ((_IO_fpos_t) -1)
|
||||
#endif
|
||||
/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
|
||||
#ifndef _IO_pos_as_off
|
||||
|
@ -491,9 +477,7 @@ extern int _IO_vscanf __P((const char *, _IO_va_list));
|
|||
# define _IO_pos_0 ((_IO_fpos_t) 0)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
/* check following! */
|
||||
|
@ -562,6 +546,5 @@ extern struct _IO_fake_stdiobuf _IO_stdin_buf, _IO_stdout_buf, _IO_stderr_buf;
|
|||
if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
|
||||
{ MAYBE_SET_EINVAL; return RET; }}
|
||||
#else
|
||||
#define CHECK_FILE(FILE,RET) \
|
||||
COERCE_FILE(FILE)
|
||||
# define CHECK_FILE(FILE, RET) COERCE_FILE (FILE)
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Print output of stream to given obstack.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
|
@ -148,7 +148,9 @@ _IO_obstack_vprintf (struct obstack *obstack, const char *format, va_list args)
|
|||
|
||||
return result;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_obstack_vprintf, obstack_vprintf)
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
|
@ -161,4 +163,6 @@ _IO_obstack_printf (struct obstack *obstack, const char *format, ...)
|
|||
va_end (ap);
|
||||
return result;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_obstack_printf, obstack_printf)
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,28 @@
|
|||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
#include <errno.h>
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -29,13 +30,13 @@ the executable file might be covered by the GNU General Public License. */
|
|||
|
||||
int
|
||||
_IO_peekc_locked (fp)
|
||||
FILE *fp;
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
int result;
|
||||
CHECK_FILE (fp, EOF);
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_flockfile (fp);
|
||||
result = _IO_peekc_unlocked (fp);
|
||||
__libc_cleanup_region_end (1);
|
||||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -28,11 +28,15 @@ _IO_putc (c, fp)
|
|||
{
|
||||
int result;
|
||||
CHECK_FILE (fp, EOF);
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_flockfile (fp);
|
||||
result = _IO_putc_unlocked (c, fp);
|
||||
__libc_cleanup_region_end (1);
|
||||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#undef putc
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_putc, putc)
|
||||
#endif
|
||||
|
|
|
@ -26,10 +26,10 @@ putchar (c)
|
|||
int c;
|
||||
{
|
||||
int result;
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile,
|
||||
_IO_stdout);
|
||||
_IO_flockfile (_IO_stdout);
|
||||
result = _IO_putc_unlocked (c, _IO_stdout);
|
||||
__libc_cleanup_region_end (1);
|
||||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -29,8 +31,8 @@ rewind (fp)
|
|||
_IO_FILE *fp;
|
||||
{
|
||||
CHECK_FILE (fp, );
|
||||
__libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
|
||||
_IO_flockfile (fp);
|
||||
_IO_rewind (fp);
|
||||
__libc_cleanup_region_end (1);
|
||||
_IO_cleanup_region_end (1);
|
||||
}
|
||||
|
|
|
@ -1,25 +1,27 @@
|
|||
/* Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
|
||||
/* This file provides definitions of _IO_stdin, _IO_stdout, and _IO_stderr
|
||||
|
|
|
@ -1,8 +1,33 @@
|
|||
/* Copyright (C) 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
||||
/* Define non-macro versions of stdin/stdout/stderr,
|
||||
* for use by debuggers. */
|
||||
/* Define non-macro versions of stdin/stdout/stderr, for use by
|
||||
debuggers. */
|
||||
|
||||
#undef stdin
|
||||
#undef stdout
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <libio.h>
|
||||
#ifdef TODO
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "strfile.h"
|
||||
#include "libioP.h"
|
||||
|
@ -59,8 +60,11 @@ the executable file might be covered by the GNU General Public License. */
|
|||
#endif
|
||||
|
||||
void
|
||||
DEFUN(_IO_str_init_static, (fp, ptr, size, pstart),
|
||||
_IO_FILE *fp AND char *ptr AND int size AND char *pstart)
|
||||
_IO_str_init_static (fp, ptr, size, pstart)
|
||||
_IO_FILE *fp;
|
||||
char *ptr;
|
||||
int size;
|
||||
char *pstart;
|
||||
{
|
||||
if (size == 0)
|
||||
size = strlen (ptr);
|
||||
|
@ -98,20 +102,23 @@ DEFUN(_IO_str_init_static, (fp, ptr, size, pstart),
|
|||
fp->_IO_read_end = ptr+size;
|
||||
}
|
||||
/* A null _allocate_buffer function flags the strfile as being static. */
|
||||
(((_IO_strfile*)(fp))->_s._allocate_buffer) = (_IO_alloc_type)0;
|
||||
(((_IO_strfile *) fp)->_s._allocate_buffer) = (_IO_alloc_type)0;
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_str_init_readonly, (fp, ptr, size),
|
||||
_IO_FILE *fp AND const char *ptr AND int size)
|
||||
_IO_str_init_readonly (fp, ptr, size)
|
||||
_IO_FILE *fp;
|
||||
const char *ptr;
|
||||
int size;
|
||||
{
|
||||
_IO_str_init_static (fp, (char *) ptr, size, NULL);
|
||||
fp->_IO_file_flags |= _IO_NO_WRITES;
|
||||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_str_overflow, (fp, c),
|
||||
register _IO_FILE* fp AND int c)
|
||||
_IO_str_overflow (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
int flush_only = c == EOF;
|
||||
_IO_size_t pos;
|
||||
|
@ -170,8 +177,8 @@ DEFUN(_IO_str_overflow, (fp, c),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_str_underflow, (fp),
|
||||
register _IO_FILE* fp)
|
||||
_IO_str_underflow (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
if (fp->_IO_write_ptr > fp->_IO_read_end)
|
||||
fp->_IO_read_end = fp->_IO_write_ptr;
|
||||
|
@ -190,17 +197,20 @@ DEFUN(_IO_str_underflow, (fp),
|
|||
/* The size of the valid part of the buffer. */
|
||||
|
||||
_IO_ssize_t
|
||||
DEFUN(_IO_str_count, (fp),
|
||||
register _IO_FILE *fp)
|
||||
_IO_str_count (fp)
|
||||
_IO_FILE *fp;
|
||||
{
|
||||
return (fp->_IO_write_end > fp->_IO_read_end ? fp->_IO_write_end
|
||||
: fp->_IO_read_end)
|
||||
- fp->_IO_read_base;
|
||||
return ((fp->_IO_write_end > fp->_IO_read_end
|
||||
? fp->_IO_write_end : fp->_IO_read_end)
|
||||
- fp->_IO_read_base);
|
||||
}
|
||||
|
||||
_IO_pos_t
|
||||
DEFUN(_IO_str_seekoff, (fp, offset, dir, mode),
|
||||
register _IO_FILE *fp AND _IO_off_t offset AND int dir AND int mode)
|
||||
_IO_str_seekoff (fp, offset, dir, mode)
|
||||
_IO_FILE *fp;
|
||||
_IO_off_t offset;
|
||||
int dir;
|
||||
int mode;
|
||||
{
|
||||
_IO_ssize_t cur_size = _IO_str_count (fp);
|
||||
_IO_pos_t new_pos = EOF;
|
||||
|
@ -249,8 +259,9 @@ DEFUN(_IO_str_seekoff, (fp, offset, dir, mode),
|
|||
}
|
||||
|
||||
int
|
||||
DEFUN(_IO_str_pbackfail, (fp, c),
|
||||
register _IO_FILE *fp AND int c)
|
||||
_IO_str_pbackfail (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
if ((fp->_flags & _IO_NO_WRITES) && c != EOF)
|
||||
return EOF;
|
||||
|
@ -258,8 +269,9 @@ DEFUN(_IO_str_pbackfail, (fp, c),
|
|||
}
|
||||
|
||||
void
|
||||
DEFUN (_IO_str_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
_IO_str_finish (fp, dummy)
|
||||
_IO_FILE *fp;
|
||||
int dummy;
|
||||
{
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
(((_IO_strfile *) fp)->_s._free_buffer) (fp->_IO_buf_base);
|
||||
|
@ -268,7 +280,8 @@ DEFUN (_IO_str_finish, (fp, dummy),
|
|||
_IO_default_finish (fp, 0);
|
||||
}
|
||||
|
||||
struct _IO_jump_t _IO_str_jumps = {
|
||||
struct _IO_jump_t _IO_str_jumps =
|
||||
{
|
||||
JUMP_INIT_DUMMY,
|
||||
JUMP_INIT(finish, _IO_str_finish),
|
||||
JUMP_INIT(overflow, _IO_str_overflow),
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1995 Free Software Foundation
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include <malloc.h>
|
||||
#include "libioP.h"
|
||||
|
@ -42,7 +43,7 @@ _IO_vasprintf (result_ptr, format, args)
|
|||
_IO_lock_t lock;
|
||||
#endif
|
||||
int ret;
|
||||
string = malloc (init_string_size);
|
||||
string = (char *) malloc (init_string_size);
|
||||
if (string == NULL)
|
||||
return -1;
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
|
@ -65,4 +66,7 @@ _IO_vasprintf (result_ptr, format, args)
|
|||
(*result_ptr)[sf._sbf._f._IO_write_ptr-sf._sbf._f._IO_write_base] = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_vasprintf, vasprintf)
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1993 Free Software Foundation
|
||||
/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
|
@ -34,4 +35,7 @@ _IO_vscanf (format, args)
|
|||
{
|
||||
return _IO_vfscanf (_IO_stdin, format, args, NULL);
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_vscanf, vscanf)
|
||||
#endif
|
||||
|
|
|
@ -1,26 +1,27 @@
|
|||
/*
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU IO Library.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation; either version 2, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this library; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
along with this library; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA.
|
||||
|
||||
As a special exception, if you link this library with files
|
||||
compiled with a GNU compiler to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
compiled with a GNU compiler to produce an executable, this does
|
||||
not cause the resulting executable to be covered by the GNU General
|
||||
Public License. This exception does not however invalidate any
|
||||
other reasons why the executable file might be covered by the GNU
|
||||
General Public License. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "strfile.h"
|
||||
|
@ -35,8 +36,12 @@ typedef struct
|
|||
} _IO_strnfile;
|
||||
|
||||
|
||||
static int _IO_strn_overflow __P ((_IO_FILE *fp, int c));
|
||||
|
||||
static int
|
||||
_IO_strn_overflow (_IO_FILE* fp, int c)
|
||||
_IO_strn_overflow (fp, c)
|
||||
_IO_FILE *fp;
|
||||
int c;
|
||||
{
|
||||
/* When we come to here this means the user supplied buffer is
|
||||
filled. But since we must return the number of characters which
|
||||
|
@ -70,7 +75,8 @@ _IO_strn_overflow (_IO_FILE* fp, int c)
|
|||
}
|
||||
|
||||
|
||||
static struct _IO_jump_t _IO_strn_jumps = {
|
||||
static struct _IO_jump_t _IO_strn_jumps =
|
||||
{
|
||||
JUMP_INIT_DUMMY,
|
||||
JUMP_INIT(finish, _IO_str_finish),
|
||||
JUMP_INIT(overflow, _IO_strn_overflow),
|
||||
|
@ -123,5 +129,8 @@ _IO_vsnprintf (string, maxlen, format, args)
|
|||
*sf.f._sbf._f._IO_write_ptr = '\0';
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef weak_alias
|
||||
weak_alias (_IO_vsnprintf, __vsnprintf)
|
||||
weak_alias (_IO_vsnprintf, vsnprintf)
|
||||
#endif
|
||||
|
|
|
@ -122,6 +122,8 @@ of the GNU C Library.
|
|||
* Extended Characters:: Support for extended character sets.
|
||||
* Locales:: The country and language can affect
|
||||
the behavior of library functions.
|
||||
* Message Translation:: How to make the program speak the users
|
||||
language.
|
||||
* Searching and Sorting:: General searching and sorting functions.
|
||||
* Pattern Matching:: Matching wildcards and regular expressions,
|
||||
and shell-style ``word expansion''.
|
||||
|
@ -314,6 +316,11 @@ Locales and Internationalization
|
|||
* Standard Locales:: Locale names available on all systems.
|
||||
* Numeric Formatting:: How to format numbers for the chosen locale.
|
||||
|
||||
Message Translation
|
||||
|
||||
* Message catalogs a la X/Open:: The @code{catgets} family of functions.
|
||||
* The Uniforum approach:: The @code{gettext} family of functions.
|
||||
|
||||
Searching and Sorting
|
||||
|
||||
* Comparison Functions:: Defining how to compare two objects.
|
||||
|
@ -975,6 +982,7 @@ Porting the GNU C Library
|
|||
@include time.texi
|
||||
@include mbyte.texi
|
||||
@include locale.texi
|
||||
@include message.texi
|
||||
@include setjmp.texi
|
||||
@include signal.texi
|
||||
@include startup.texi
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@node Locales, Searching and Sorting, Extended Characters, Top
|
||||
@node Locales, Message Translation, Extended Characters, Top
|
||||
@chapter Locales and Internationalization
|
||||
|
||||
Different countries and cultures have varying conventions for how to
|
||||
|
|
1185
manual/message.texi
Normal file
1185
manual/message.texi
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
@node Searching and Sorting, Pattern Matching, Locales, Top
|
||||
@node Searching and Sorting, Pattern Matching, Message Translation, Top
|
||||
@chapter Searching and Sorting
|
||||
|
||||
This chapter describes functions for searching and sorting arrays of
|
||||
|
|
|
@ -290,7 +290,9 @@ character, since this is assumed to terminate the string.
|
|||
|
||||
The value of an environment variable can be accessed with the
|
||||
@code{getenv} function. This is declared in the header file
|
||||
@file{stdlib.h}.
|
||||
@file{stdlib.h}. All of the following functions can be safely used in
|
||||
multi-threaded programs. It is made sure that concurrent modifications
|
||||
to the environment do not lead to errors.
|
||||
@pindex stdlib.h
|
||||
|
||||
@comment stdlib.h
|
||||
|
@ -314,11 +316,62 @@ definition is added to the environment. Otherwise, the @var{string} is
|
|||
interpreted as the name of an environment variable, and any definition
|
||||
for this variable in the environment is removed.
|
||||
|
||||
The GNU library provides this function for compatibility with SVID; it
|
||||
may not be available in other systems.
|
||||
This function is part of the extended Unix interface. Since it was also
|
||||
available in old SVID libraries you should define either
|
||||
@var{_XOPEN_SOURCE} or @var{_SVID_SOURCE} before including any header.
|
||||
@end deftypefun
|
||||
|
||||
|
||||
@comment stdlib.h
|
||||
@comment BSD
|
||||
@deftypefun int setenv (const char *@var{name}, const char *@var{value}, int @var{replace})
|
||||
The @code{setenv} function can be used to add a new definition to the
|
||||
environment. The entry with the name @var{name} is replaced by the
|
||||
value @samp{@var{name}=@var{value}}. Please note that this is also true
|
||||
if @var{value} is the empty string. A null pointer for the @var{value}
|
||||
parameter is illegal. If the environment already contains an entry with
|
||||
key @var{name} the @var{replace} parameter controls the action. If
|
||||
replace is zero, nothing happens. otherwise the old entry is replaced
|
||||
by the new one.
|
||||
|
||||
Please note that you cannot remove an entry completely using this function.
|
||||
|
||||
This function is part of the BSD library. The GNU C Library provides
|
||||
this function for compatibility but it may not be available on other
|
||||
systems.
|
||||
@end deftypefun
|
||||
|
||||
@comment stdlib.h
|
||||
@comment BSD
|
||||
@deftypefun void unsetenv (const char *@var{name})
|
||||
Using this function one can remove an entry completely from the
|
||||
environment. If the environment contains an entry with the key
|
||||
@var{name} this whole entry is removed. A call to this function is
|
||||
equivalent to a call to @code{putenv} when the @var{value} part of the
|
||||
string is empty.
|
||||
|
||||
This function is part of the BSD library. The GNU C Library provides
|
||||
this function for compatibility but it may not be available on other
|
||||
systems.
|
||||
@end deftypefun
|
||||
|
||||
There is one more function to modify the whole environment. This
|
||||
function is said to be used in the POSIX.9 (POSIX bindings for Fortran
|
||||
77) and so one should expect it did made it into POSIX.1. But this
|
||||
never happened. But we still provide this function as a GNU extension
|
||||
to enable writing standard compliant Fortran environments.
|
||||
|
||||
@comment stdlib.h
|
||||
@comment GNU
|
||||
@deftypefun int clearenv (void)
|
||||
The @code{clearenv} function removes all entries from the environment.
|
||||
Using @code{putenv} and @code{setenv} new entries can be added again
|
||||
later.
|
||||
|
||||
If the function is successful it returns @code{0}. Otherwise the return
|
||||
value is nonzero.
|
||||
@end deftypefun
|
||||
|
||||
@c !!! BSD function setenv
|
||||
|
||||
You can deal directly with the underlying representation of environment
|
||||
objects to add more variables to the environment (for example, to
|
||||
|
@ -444,6 +497,14 @@ attribute category environment variables, or for the @code{LANG}
|
|||
environment variable.
|
||||
@end ignore
|
||||
|
||||
@item LC_ALL
|
||||
@cindex LC_ALL environment variable
|
||||
|
||||
If this environment variable is set it overrides the selection for all
|
||||
the locales done using the other @code{LC_*} environment variables. The
|
||||
value of the other @code{LC_*} environment variables is simply ignored
|
||||
in this case.
|
||||
|
||||
@item LC_COLLATE
|
||||
@cindex LC_COLLATE environment variable
|
||||
|
||||
|
@ -455,6 +516,12 @@ This specifies what locale to use for string sorting.
|
|||
This specifies what locale to use for character sets and character
|
||||
classification.
|
||||
|
||||
@item LC_MESSAGES
|
||||
@cindex LC_MESSAGES environment variable
|
||||
|
||||
This specifies what locale to use for printing messages and to parse
|
||||
reponses.
|
||||
|
||||
@item LC_MONETARY
|
||||
@cindex LC_MONETARY environment variable
|
||||
|
||||
|
@ -470,6 +537,12 @@ This specifies what locale to use for formatting numbers.
|
|||
|
||||
This specifies what locale to use for formatting date/time values.
|
||||
|
||||
@item NLSPATH
|
||||
@cindex NLSPATH environment variable
|
||||
|
||||
This specifies the directories in which the @code{catopen} function
|
||||
looks for message translation catalogs.
|
||||
|
||||
@item _POSIX_OPTION_ORDER
|
||||
@cindex _POSIX_OPTION_ORDER environment variable.
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ string has the same limitations as any block of memory allocated using
|
|||
@code{alloca}.
|
||||
|
||||
For obvious reasons @code{strdupa} is implemented only as a macro. I.e.,
|
||||
you cannot get the address of this function. Despite this limitations
|
||||
you cannot get the address of this function. Despite this limitation
|
||||
it is a useful function. The following code shows a situation where
|
||||
using @code{malloc} would be a lot more expensive.
|
||||
|
||||
|
@ -374,7 +374,7 @@ using @code{malloc} would be a lot more expensive.
|
|||
@end smallexample
|
||||
|
||||
Please note that calling @code{strtok} using @var{path} directly is
|
||||
illegal.
|
||||
invalid.
|
||||
|
||||
This function is only available if GNU CC is used.
|
||||
@end deftypefun
|
||||
|
|
|
@ -80,9 +80,7 @@ tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
|
|||
test-ifloat test-idouble test-matherr test-fenv
|
||||
# We do the `long double' tests only if this data type is available and
|
||||
# distrinct from `double'.
|
||||
#
|
||||
# XXX This test is disabled for now since the functions are too buggy.
|
||||
#test-longdouble-yes = test-ldouble test-ildoubl
|
||||
test-longdouble-yes = test-ldouble test-ildoubl
|
||||
|
||||
CFLAGS-test-float.c = -fno-inline
|
||||
CFLAGS-test-double.c = -fno-inline
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue