Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
e693cc28
Commit
e693cc28
authored
Sep 16, 1997
by
Ulrich Drepper
Committed by
Jeff Law
Sep 16, 1997
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uli's libio/libstdc++ patches.
From-SVN: r15486
parent
610ce97e
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
1132 additions
and
619 deletions
+1132
-619
ChangeLog
+9
-0
configure
+36
-37
configure.in
+1
-0
gcc/ChangeLog
+3
-2
libio/ChangeLog
+62
-0
libio/cleanup.c
+1
-1
libio/config.shared
+3
-2
libio/config/linux.mt
+20
-16
libio/configure.in
+25
-2
libio/depend
+71
-71
libio/fileops.c
+22
-34
libio/include/empty.h
+36
-0
libio/ioignore.c
+3
-2
libio/iolibio.h
+5
-0
libio/ioperror.c
+2
-2
libio/iopopen.c
+4
-0
libio/ioprims.c
+17
-10
libio/ioseekoff.c
+8
-1
libio/ioseekpos.c
+7
-1
libio/iostream.cc
+193
-44
libio/iostream.h
+13
-3
libio/iostrerror.c
+2
-2
libio/iovfprintf.c
+11
-6
libio/iovfscanf.c
+8
-5
libio/libio.h
+79
-84
libio/libioP.h
+228
-234
libio/osform.cc
+13
-1
libio/outfloat.c
+11
-4
libio/stdio-lock.h
+0
-1
libio/stdio/ChangeLog
+1
-2
libio/stdio/feof.c
+31
-22
libio/stdio/ferror.c
+37
-4
libio/stdio/getc.c
+41
-4
libio/stdio/putc.c
+34
-4
libio/stdio/putchar.c
+1
-1
libio/stdio/stdio.h
+40
-2
libio/stdstrbufs.cc
+18
-7
libio/streambuf.cc
+11
-2
libio/strops.c
+2
-2
libio/tests/tFile.cc
+12
-4
libstdc++/ChangeLog
+6
-0
libstdc++/configure.in
+5
-0
No files found.
ChangeLog
View file @
e693cc28
1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
* config/mt-linux: Define CXXFLAGS to make sure -fvtable-thunks is
used.
* configure.in: Name Linux target fragment.
* configure: Rewrite so that project Makefile fragment is inserted
first and appears last in the resulting Makefile.
Thu Sep 11 16:40:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
Thu Sep 11 16:40:46 1997 H.J. Lu (hjl@gnu.ai.mit.edu)
* Makefile.in (local-distclean): Also remove mh-frag mt-frag.
* Makefile.in (local-distclean): Also remove mh-frag mt-frag.
...
...
configure
View file @
e693cc28
...
@@ -81,7 +81,7 @@ subdirs=
...
@@ -81,7 +81,7 @@ subdirs=
target_alias
=
NOTARGET
target_alias
=
NOTARGET
target_makefile_frag
=
target_makefile_frag
=
undefs
=
NOUNDEFS
undefs
=
NOUNDEFS
version
=
"
$Revision
: 1.
244
$"
version
=
"
$Revision
: 1.
1.1.1
$"
x11
=
default
x11
=
default
### we might need to use some other shell than /bin/sh for running subshells
### we might need to use some other shell than /bin/sh for running subshells
...
@@ -1045,78 +1045,77 @@ EOF
...
@@ -1045,78 +1045,77 @@ EOF
if
[
-f
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
]
;
then
if
[
-f
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
]
;
then
# Conditionalize
for this site from "Makefile.in" (or whatever it's called) into Makefile.tem
# Conditionalize
the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem.
rm
-f
${
subdir
}
/
Makefile
.tem
rm
-f
${
subdir
}
/
${
Makefile
}
.tem
case
"
${
site
}
"
in
case
"
${
package_makefile_frag
}
"
in
""
)
cp
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
${
subdir
}
/Makefile.tem
;;
""
)
cp
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
${
subdir
}
/Makefile.tem
;;
*
)
*
)
if
[
!
-f
${
package_makefile_frag
}
]
;
then
package_makefile_frag
=
${
srcdir
}
/
${
package_makefile_frag
}
fi
if
[
-f
${
package_makefile_frag
}
]
;
then
sed
-e
"/^####/ r
${
package_makefile_frag
}
"
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
>
${
Makefile
}
.tem
else
echo
'***'
Expected package makefile fragment
\"
${
package_makefile_frag
}
\"
1>&2
echo
'***'
is missing
in
${
PWD
=
`
pwd
`
}
.
1>&2
cp
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
${
subdir
}
/Makefile.tem
fi
esac
# working copy now in ${Makefile}.tem
# Conditionalize for this site.
rm
-f
${
Makefile
}
case
"
${
site
}
"
in
""
)
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
;;
*
)
site_makefile_frag
=
${
srcdir
}
/config/ms-
${
site
}
site_makefile_frag
=
${
srcdir
}
/config/ms-
${
site
}
if
[
-f
${
site_makefile_frag
}
]
;
then
if
[
-f
${
site_makefile_frag
}
]
;
then
sed
-e
"/^####/ r
${
site_makefile_frag
}
"
${
s
rcdir
}
/
${
subdir
}
/
${
Makefile_in
}
\
sed
-e
"/^####/ r
${
site_makefile_frag
}
"
${
s
ubdir
}
/Makefile.tem
\
>
${
subdir
}
/Makefile.tem
>
${
Makefile
}
else
else
cp
${
srcdir
}
/
${
subdir
}
/
${
Makefile_in
}
${
subdir
}
/Makefile.tem
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
site_makefile_frag
=
site_makefile_frag
=
fi
fi
;;
;;
esac
esac
# working copy now in ${
subdir}/Makefile.tem
# working copy now in ${
Makefile}
# Conditionalize the makefile for this host.
# Conditionalize the makefile for this host.
rm
-f
${
Makefile
}
rm
-f
${
subdir
}
/Makefile.tem
case
"
${
host_makefile_frag
}
"
in
case
"
${
host_makefile_frag
}
"
in
""
)
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
;;
""
)
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
;;
*
)
*
)
if
[
!
-f
${
host_makefile_frag
}
]
;
then
if
[
!
-f
${
host_makefile_frag
}
]
;
then
host_makefile_frag
=
${
srcdir
}
/
${
host_makefile_frag
}
host_makefile_frag
=
${
srcdir
}
/
${
host_makefile_frag
}
fi
fi
if
[
-f
${
host_makefile_frag
}
]
;
then
if
[
-f
${
host_makefile_frag
}
]
;
then
sed
-e
"/^####/ r
${
host_makefile_frag
}
"
${
subdir
}
/Makefile.tem
>
${
Makefile
}
sed
-e
"/^####/ r
${
host_makefile_frag
}
"
${
Makefile
}
>
${
subdir
}
/Makefile.tem
else
else
echo
'***'
Expected host makefile fragment
\"
${
host_makefile_frag
}
\"
1>&2
echo
'***'
Expected host makefile fragment
\"
${
host_makefile_frag
}
\"
1>&2
echo
'***'
is missing
in
${
PWD
=
`
pwd
`
}
.
1>&2
echo
'***'
is missing
in
${
PWD
=
`
pwd
`
}
.
1>&2
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
fi
fi
esac
esac
# working copy now in ${
Makefile}
# working copy now in ${
subdir)/Makefile.tem
# Conditionalize the makefile for this target.
# Conditionalize the makefile for this target.
rm
-f
${
subdir
}
/Makefile.tem
rm
-f
${
Makefile
}
case
"
${
target_makefile_frag
}
"
in
case
"
${
target_makefile_frag
}
"
in
""
)
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
;;
""
)
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
;;
*
)
*
)
if
[
!
-f
${
target_makefile_frag
}
]
;
then
if
[
!
-f
${
target_makefile_frag
}
]
;
then
target_makefile_frag
=
${
srcdir
}
/
${
target_makefile_frag
}
target_makefile_frag
=
${
srcdir
}
/
${
target_makefile_frag
}
fi
fi
if
[
-f
${
target_makefile_frag
}
]
;
then
if
[
-f
${
target_makefile_frag
}
]
;
then
sed
-e
"/^####/ r
${
target_makefile_frag
}
"
${
Makefile
}
>
${
subdir
}
/Makefile.tem
sed
-e
"/^####/ r
${
target_makefile_frag
}
"
${
subdir
}
/Makefile.tem
>
${
Makefile
}
else
else
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
target_makefile_frag
=
target_makefile_frag
=
fi
fi
;;
;;
esac
esac
# real copy now in ${subdir}/Makefile.tem
# real copy now in ${Makefile}
# Conditionalize the makefile for this package.
rm
-f
${
Makefile
}
case
"
${
package_makefile_frag
}
"
in
""
)
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
;;
*
)
if
[
!
-f
${
package_makefile_frag
}
]
;
then
package_makefile_frag
=
${
srcdir
}
/
${
package_makefile_frag
}
fi
if
[
-f
${
package_makefile_frag
}
]
;
then
sed
-e
"/^####/ r
${
package_makefile_frag
}
"
${
subdir
}
/Makefile.tem
>
${
Makefile
}
rm
-f
${
subdir
}
/Makefile.tem
else
echo
'***'
Expected package makefile fragment
\"
${
package_makefile_frag
}
\"
1>&2
echo
'***'
is missing
in
${
PWD
=
`
pwd
`
}
.
1>&2
mv
${
subdir
}
/Makefile.tem
${
Makefile
}
fi
esac
# working copy now in ${Makefile}
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
mv
${
Makefile
}
${
subdir
}
/Makefile.tem
...
...
configure.in
View file @
e693cc28
...
@@ -212,6 +212,7 @@ case "${target}" in
...
@@ -212,6 +212,7 @@ case "${target}" in
v810
*
)
target_makefile_frag
=
config/mt-v810
;;
v810
*
)
target_makefile_frag
=
config/mt-v810
;;
i[3456]86-
*
-netware
*
)
target_makefile_frag
=
config/mt-netware
;;
i[3456]86-
*
-netware
*
)
target_makefile_frag
=
config/mt-netware
;;
powerpc-
*
-netware
*
)
target_makefile_frag
=
config/mt-netware
;;
powerpc-
*
-netware
*
)
target_makefile_frag
=
config/mt-netware
;;
*
-
*
-linux-gnu
)
target_makefile_frag
=
config/mt-linux
;;
esac
esac
skipdirs
=
skipdirs
=
...
...
gcc/ChangeLog
View file @
e693cc28
Tue Sep 16 0
0:40:23 1997 Jeffrey A Law (law
@cygnus.com)
Tue Sep 16 0
9:18:52 1997 Jason Merrill (jason
@cygnus.com)
* version.c: Bump for snapshot.
* expr.c (expand_expr, case TARGET_EXPR): Call mark_addressable
again for the slot after we give it RTL.
Tue Sep 16 00:13:20 1997 Nick Clifton <nickc@cygnus.com>
Tue Sep 16 00:13:20 1997 Nick Clifton <nickc@cygnus.com>
...
...
libio/ChangeLog
View file @
e693cc28
1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
* config/linux.mt: Rewrite for use with glibc 2.
* config/linuxlibc1.mt: Old content of linux.mt, fir libc4 and
libc5.
* config.shared (COMPILE.c): Allow new flags in MT_CFLAGS be
passed.
(COMPILE.cc): Likewise.
* configure.in (*-linux*): Remove goal. We now have...
(*-linux-gnulibc1): For libc4 and libc5. Emit warning.
(*-linux-gnu)): For glibc 2.
Create links to find headers for multi-threading if necessary.
* fileops.c: Make thread-safe by using _IO_cleanup_region_start
etc to handle cancelation. Acquire locks in functions which are
called directly.
(_IO_file_read, _IO_file_write): Remove dead code.
* include/empty.h: Define stub macros for locking.
* iolibio.h: Add prototypes for obstack printing functions.
* ioseekoff.c (_IO_seekoff): Lock stream before working.
* ioseekpos.c (_IO_seekpos): Likewise.
* iostream.cc: Add support for long double I/O.
Use __printf_fp from glibc is available.
Use _IO_cleanup_region_start to handle cancelation correctly.
* iostream.h (class ostream): Change opfx and osfx to lock/unlock
stream
(class istream): Likewise for ipfx, ipfx0, ipfx1, and isfx.
Declare new function lock and unlock for ostream and istream.
* osform.cc: Use _IO_cleanup_region_start to handle cancelation
correctly.
* libio.h: Update from glibc version. Pretty printing.
* libioP.h: Likewise.
* outfloat.c: Only compile if _IO_USE_DTOA is defined.
* stdio/feof.c: Make thread safe.
* stdio/ferror.c: Likewise.
* stdio/getc.c : Likewise.
* stdio/putc.c : Likewise.
* stdio/stdio.h: Declare function of thread-safe API.
* stdio/obprintf.c: New file.
* stdio/vasprintf.c: New file.
* stdio-lock.h: Removed.
* stdstrbufs.c: Add definitions for thread-safe streams.
* streambuf.cc: Initialize lock.
* strops.c (_IO_str_count): Undo last change.
* tests/tFile.cc: Support parallel builds by avoiding fixed
name for test file.
Thu Sep 11 18:43:56 1997 Jason Merrill <jason@yorick.cygnus.com>
Thu Sep 11 18:43:56 1997 Jason Merrill <jason@yorick.cygnus.com>
* Makefile.in (iostream.list): Remove STDIO_WRAP_OBJECTS.
* Makefile.in (iostream.list): Remove STDIO_WRAP_OBJECTS.
...
...
libio/cleanup.c
View file @
e693cc28
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
typedef
void
(
*
voidfunc
)
__P
((
void
));
typedef
void
(
*
voidfunc
)
__P
((
void
));
static
void
static
void
DEFUN_VOID
(
_IO_register_cleanup
)
_IO_register_cleanup
(
)
{
{
atexit
((
voidfunc
)
_IO_cleanup
);
atexit
((
voidfunc
)
_IO_cleanup
);
_IO_cleanup_registration_needed
=
0
;
_IO_cleanup_registration_needed
=
0
;
...
...
libio/config.shared
View file @
e693cc28
...
@@ -254,7 +254,7 @@ else
...
@@ -254,7 +254,7 @@ else
fi
fi
echo '.SUFFIXES: .o .C .cc .c'
echo '.SUFFIXES: .o .C .cc .c'
echo 'COMPILE.c = $(CC) -c $(XCFLAGS) $(CINCLUDES)'
echo 'COMPILE.c = $(CC) -c $(XCFLAGS) $(CINCLUDES)
$(MT_CFLAGS)
'
echo '.c.o:'
echo '.c.o:'
if [ "${LIBDIR}" = "yes" ]; then
if [ "${LIBDIR}" = "yes" ]; then
echo ' test -z "$(PICFLAG)" ||\'
echo ' test -z "$(PICFLAG)" ||\'
...
@@ -262,7 +262,7 @@ echo ' $(COMPILE.c) $(PICFLAG) $< -o pic/$@'
...
@@ -262,7 +262,7 @@ echo ' $(COMPILE.c) $(PICFLAG) $< -o pic/$@'
fi
fi
echo ' $(COMPILE.c) $<'
echo ' $(COMPILE.c) $<'
[ "${TOUCH_ON_COMPILE}" = "yes" ] && echo ' @touch stamp'
[ "${TOUCH_ON_COMPILE}" = "yes" ] && echo ' @touch stamp'
echo 'COMPILE.cc = $(CXX) -c $(XCXXFLAGS) $(CXXINCLUDES)'
echo 'COMPILE.cc = $(CXX) -c $(XCXXFLAGS) $(CXXINCLUDES)
$(MT_CFLAGS)
'
echo '.C.o:'
echo '.C.o:'
if [ "${LIBDIR}" = "yes" ]; then
if [ "${LIBDIR}" = "yes" ]; then
echo ' test -z "$(PICFLAG)" ||\'
echo ' test -z "$(PICFLAG)" ||\'
...
@@ -466,6 +466,7 @@ depend.new:
...
@@ -466,6 +466,7 @@ depend.new:
>depend.new
>depend.new
$(CXX) -M $(CXXINCLUDES) $(DEPEND_SOURCES) \
$(CXX) -M $(CXXINCLUDES) $(DEPEND_SOURCES) \
| sed -e 's|$(srcdir)/|$$(srcdir)/|g' \
| sed -e 's|$(srcdir)/|$$(srcdir)/|g' \
-e 's| [^ ]_G_config.h| $$(_G_CONFIG_H)|g \
-e 's| /[^ ]*||g' \
-e 's| /[^ ]*||g' \
-e '/^[ ]*\\$$/d' -e 's/^[ ]*$$//' \
-e '/^[ ]*\\$$/d' -e 's/^[ ]*$$//' \
| sed -e 's|$$(srcdir)/[.][.]|$$(srcdir)/$$(MULTISRCTOP)..|g' \
| sed -e 's|$$(srcdir)/[.][.]|$$(srcdir)/$$(MULTISRCTOP)..|g' \
...
...
libio/config/linux.mt
View file @
e693cc28
#
Since the Linux C library has libio, we have to be very careful
.
#
Use the libio which comes with the local libc
.
# By default, we build libio and use it. If someone wants to not
# That is where we keep the g++ header files.
# build it, let them go to extra work. The reason is that the user
gxx_includedir =$(prefix)/include/g++
# may want a newer, bug fixed libio, also on a linux 1.0.8 system
# things just won't build with the bottom section uncommented.
# Comment this out to avoid including the stdio functions in libiostream.a:
# Comment this out to avoid including the stdio functions in libiostream.a:
LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS)
#
LIBIOSTREAM_OBJECTS = $(IO_OBJECTS) $(IOSTREAM_OBJECTS) $(STDIO_WRAP_OBJECTS) $(OSPRIM_OBJECTS)
LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS) stmp-stdio
# LIBIOSTREAM_DEP = $(LIBIOSTREAM_OBJECTS) stdio.list
LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS) `cat stdio.list`
#
LIBIOSTREAM_USE = $(LIBIOSTREAM_OBJECTS) `cat stdio.list`
# Comment the above and uncomment the below to use the code in the Linux libc:
# Comment the above and uncomment the below to use the code in the Linux libc:
# We have _G_config.h in /usr/include.
# We have _G_config.h in /usr/include.
# _G_CONFIG_H=
_G_CONFIG_H=
# We must not see the libio.h file from this library.
LIBIO_INCLUDE=
# We have those in libc.a.
# We have those in libc.a.
#
IO_OBJECTS=
IO_OBJECTS=
#
STDIO_WRAP_OBJECTS=
STDIO_WRAP_OBJECTS=
#
OSPRIM_OBJECTS=
OSPRIM_OBJECTS=
# We have the rest in /usr/include.
# We have the rest in /usr/include.
# USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \
USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \
# indstream.h iomanip.h iostream.h istream.h ostream.h \
indstream.h iomanip.h iostream.h istream.h ostream.h \
# parsestream.h pfstream.h procbuf.h stdiostream.h stream.h \
parsestream.h pfstream.h procbuf.h stdiostream.h stream.h \
# streambuf.h strfile.h strstream.h
streambuf.h strfile.h strstream.h
# tell we want the mt-safe version
MT_CFLAGS = -D_IO_MTSAFE_IO
libio/configure.in
View file @
e693cc28
...
@@ -16,12 +16,13 @@ frags=
...
@@ -16,12 +16,13 @@ frags=
case "${target}" in
case "${target}" in
*-hpux*) frags=hpux.mt ;;
*-hpux*) frags=hpux.mt ;;
*-linux
*)
*-linux
-gnulibc1)
echo "WARNING: The I/O implementation in FSF libg++ 2.8.x is not"
echo "WARNING: The I/O implementation in FSF libg++ 2.8.x is not"
echo " compatible with Linux libc through 5.2.x."
echo " compatible with Linux libc through 5.2.x."
echo " See libg++/README for more information."
echo " See libg++/README for more information."
echo " YOU ARE ON YOUR OWN!"
echo " YOU ARE ON YOUR OWN!"
frags=linux.mt ;;
frags=linuxlibc1.mt ;;
*-linux-gnu) frags=linux.mt ;;
*-sco3.2v[45]*) frags=sco4.mt ;;
*-sco3.2v[45]*) frags=sco4.mt ;;
*-isc*) frags=isc.mt ;;
*-isc*) frags=isc.mt ;;
*-netware*) frags=netware.mt ;;
*-netware*) frags=netware.mt ;;
...
@@ -43,6 +44,28 @@ if [ "${shared}" = "yes" ]; then
...
@@ -43,6 +44,28 @@ if [ "${shared}" = "yes" ]; then
esac
esac
fi
fi
# Make a link for the correct stdio-lock.h file.
case "${target}" in
*-linux-gnu)
# We have a correct file in glibc but the libioP.h file is written
# with glibc 2.1 in mind which has the internals headers in special
# directory while glibc 2.0 has them in /usr/include. Create a wrapper
# if necessary.
(echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
{
rm -fr bits
mkdir bits
echo "#include <libc-lock.h>" > bits/libc-lock.h
echo "#include <stdio-lock.h>" > bits/stdio-lock.h
}
;;
*)
rm -fr bits
mkdir bits
ln -s ${srcdir}/include/empty.h bits/stdio-lock.h
;;
esac
for frag in ${frags}; do
for frag in ${frags}; do
frag=${srcdir}/config/$frag
frag=${srcdir}/config/$frag
if [ -f ${frag} ]; then
if [ -f ${frag} ]; then
...
...
libio/depend
View file @
e693cc28
...
@@ -5,24 +5,24 @@ PlotFile.o: PlotFile.cc \
...
@@ -5,24 +5,24 @@ PlotFile.o: PlotFile.cc \
$(srcdir)/fstream.h \
$(srcdir)/fstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
SFile.o: SFile.cc \
SFile.o: SFile.cc \
$(srcdir)/SFile.h \
$(srcdir)/SFile.h \
$(srcdir)/fstream.h \
$(srcdir)/fstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
builtinbuf.o: builtinbuf.cc \
builtinbuf.o: builtinbuf.cc \
$(srcdir)/builtinbuf.h \
$(srcdir)/builtinbuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/iostreamP.h \
$(srcdir)/iostreamP.h \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h
$(srcdir)/iolibio.h
editbuf.o: editbuf.cc \
editbuf.o: editbuf.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/editbuf.h \
$(srcdir)/editbuf.h \
$(srcdir)/fstream.h \
$(srcdir)/fstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
...
@@ -30,14 +30,14 @@ editbuf.o: editbuf.cc \
...
@@ -30,14 +30,14 @@ editbuf.o: editbuf.cc \
filebuf.o: filebuf.cc \
filebuf.o: filebuf.cc \
$(srcdir)/iostreamP.h \
$(srcdir)/iostreamP.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/builtinbuf.h
$(srcdir)/builtinbuf.h
fstream.o: fstream.cc \
fstream.o: fstream.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/fstream.h \
$(srcdir)/fstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
...
@@ -45,63 +45,63 @@ indstream.o: indstream.cc \
...
@@ -45,63 +45,63 @@ indstream.o: indstream.cc \
$(srcdir)/indstream.h \
$(srcdir)/indstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioassign.o: ioassign.cc \
ioassign.o: ioassign.cc \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h
$(srcdir)/iolibio.h
ioextend.o: ioextend.cc \
ioextend.o: ioextend.cc \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iomanip.o: iomanip.cc \
iomanip.o: iomanip.cc \
$(srcdir)/iomanip.h \
$(srcdir)/iomanip.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iostream.o: iostream.cc \
iostream.o: iostream.cc \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/floatio.h
$(srcdir)/floatio.h
isgetline.o: isgetline.cc \
isgetline.o: isgetline.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
isgetsb.o: isgetsb.cc \
isgetsb.o: isgetsb.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
isscan.o: isscan.cc \
isscan.o: isscan.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
osform.o: osform.cc \
osform.o: osform.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
parsestream.o: parsestream.cc \
parsestream.o: parsestream.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/parsestream.h \
$(srcdir)/parsestream.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
pfstream.o: pfstream.cc \
pfstream.o: pfstream.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/pfstream.h \
$(srcdir)/pfstream.h \
$(srcdir)/fstream.h \
$(srcdir)/fstream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
...
@@ -110,45 +110,45 @@ pfstream.o: pfstream.cc \
...
@@ -110,45 +110,45 @@ pfstream.o: pfstream.cc \
procbuf.o: procbuf.cc \
procbuf.o: procbuf.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/procbuf.h \
$(srcdir)/procbuf.h \
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
sbform.o: sbform.cc \
sbform.o: sbform.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
sbgetline.o: sbgetline.cc \
sbgetline.o: sbgetline.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
sbscan.o: sbscan.cc \
sbscan.o: sbscan.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/streambuf.h
$(srcdir)/streambuf.h
stdiostream.o: stdiostream.cc \
stdiostream.o: stdiostream.cc \
$(srcdir)/stdiostream.h \
$(srcdir)/stdiostream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h
$(srcdir)/iolibio.h
stdstrbufs.o: stdstrbufs.cc \
stdstrbufs.o: stdstrbufs.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
stdstreams.o: stdstreams.cc \
stdstreams.o: stdstreams.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/iostream.h
$(srcdir)/iostream.h
stream.o: stream.cc \
stream.o: stream.cc \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/stream.h \
$(srcdir)/stream.h \
$(srcdir)/iostream.h \
$(srcdir)/iostream.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
...
@@ -157,13 +157,13 @@ stream.o: stream.cc \
...
@@ -157,13 +157,13 @@ stream.o: stream.cc \
streambuf.o: streambuf.cc \
streambuf.o: streambuf.cc \
$(srcdir)/iostreamP.h \
$(srcdir)/iostreamP.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h
$(srcdir)/iolibio.h
strstream.o: strstream.cc \
strstream.o: strstream.cc \
$(srcdir)/iostreamP.h \
$(srcdir)/iostreamP.h \
$(srcdir)/streambuf.h \
$(srcdir)/streambuf.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/strstream.h \
$(srcdir)/strstream.h \
...
@@ -172,181 +172,181 @@ strstream.o: strstream.cc \
...
@@ -172,181 +172,181 @@ strstream.o: strstream.cc \
cleanup.o: cleanup.c \
cleanup.o: cleanup.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
filedoalloc.o: filedoalloc.c \
filedoalloc.o: filedoalloc.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
fileops.o: fileops.c \
fileops.o: fileops.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
floatconv.o: floatconv.c \
floatconv.o: floatconv.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
genops.o: genops.c \
genops.o: genops.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofclose.o: iofclose.c \
iofclose.o: iofclose.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofdopen.o: iofdopen.c \
iofdopen.o: iofdopen.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofflush.o: iofflush.c \
iofflush.o: iofflush.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofgetpos.o: iofgetpos.c \
iofgetpos.o: iofgetpos.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofgets.o: iofgets.c \
iofgets.o: iofgets.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofopen.o: iofopen.c \
iofopen.o: iofopen.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofprintf.o: iofprintf.c \
iofprintf.o: iofprintf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofputs.o: iofputs.c \
iofputs.o: iofputs.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofread.o: iofread.c \
iofread.o: iofread.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofscanf.o: iofscanf.c \
iofscanf.o: iofscanf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofsetpos.o: iofsetpos.c \
iofsetpos.o: iofsetpos.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioftell.o: ioftell.c \
ioftell.o: ioftell.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iofwrite.o: iofwrite.c \
iofwrite.o: iofwrite.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iogetdelim.o: iogetdelim.c \
iogetdelim.o: iogetdelim.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iogetline.o: iogetline.c \
iogetline.o: iogetline.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iogets.o: iogets.c \
iogets.o: iogets.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioignore.o: ioignore.c \
ioignore.o: ioignore.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iopadn.o: iopadn.c \
iopadn.o: iopadn.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioperror.o: ioperror.c \
ioperror.o: ioperror.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iopopen.o: iopopen.c \
iopopen.o: iopopen.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioprims.o: ioprims.c \
ioprims.o: ioprims.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioprintf.o: ioprintf.c \
ioprintf.o: ioprintf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioputs.o: ioputs.c \
ioputs.o: ioputs.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioscanf.o: ioscanf.c \
ioscanf.o: ioscanf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioseekoff.o: ioseekoff.c \
ioseekoff.o: ioseekoff.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioseekpos.o: ioseekpos.c \
ioseekpos.o: ioseekpos.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iosetbuffer.o: iosetbuffer.c \
iosetbuffer.o: iosetbuffer.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iosetvbuf.o: iosetvbuf.c \
iosetvbuf.o: iosetvbuf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iosprintf.o: iosprintf.c \
iosprintf.o: iosprintf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iosscanf.o: iosscanf.c \
iosscanf.o: iosscanf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iostrerror.o: iostrerror.c \
iostrerror.o: iostrerror.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
ioungetc.o: ioungetc.c \
ioungetc.o: ioungetc.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
iovfprintf.o: iovfprintf.c \
iovfprintf.o: iovfprintf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/floatio.h
$(srcdir)/floatio.h
iovfscanf.o: iovfscanf.c \
iovfscanf.o: iovfscanf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/floatio.h
$(srcdir)/floatio.h
iovsprintf.o: iovsprintf.c \
iovsprintf.o: iovsprintf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/strfile.h
$(srcdir)/strfile.h
iovsscanf.o: iovsscanf.c \
iovsscanf.o: iovsscanf.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/strfile.h
$(srcdir)/strfile.h
outfloat.o: outfloat.c \
outfloat.o: outfloat.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
stdfiles.o: stdfiles.c \
stdfiles.o: stdfiles.c \
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h \
$(srcdir)/iolibio.h \
$(srcdir)/libio.h
_G_config.h
$(srcdir)/libio.h
$(_G_CONFIG_H)
strops.o: strops.c \
strops.o: strops.c \
$(srcdir)/strfile.h \
$(srcdir)/strfile.h \
$(srcdir)/libio.h
_G_config.h
\
$(srcdir)/libio.h
$(_G_CONFIG_H)
\
$(srcdir)/libioP.h \
$(srcdir)/libioP.h \
$(srcdir)/iolibio.h
$(srcdir)/iolibio.h
libio/fileops.c
View file @
e693cc28
...
@@ -40,7 +40,12 @@ extern int errno;
...
@@ -40,7 +40,12 @@ extern int errno;
#ifdef _LIBC
#ifdef _LIBC
# define open(Name, Flags, Prot) __open ((Name), (Flags), (Prot))
# define open(Name, Flags, Prot) __open (Name, Flags, Prot)
# define close(FD) __close (FD)
# define fstat(FD, Statbuf) __fstat (FD, Statbuf)
# define lseek(FD, Offset, Whence) __lseek (FD, Offset, Whence)
# define read(FD, Buf, NBytes) __read (FD, Buf, NBytes)
# define write(FD, Buf, NBytes) __write (FD, Buf, NBytes)
#endif
#endif
/* An fstream can be in at most one of put mode, get mode, or putback mode.
/* An fstream can be in at most one of put mode, get mode, or putback mode.
...
@@ -384,6 +389,10 @@ _IO_file_sync (fp)
...
@@ -384,6 +389,10 @@ _IO_file_sync (fp)
_IO_FILE
*
fp
;
_IO_FILE
*
fp
;
{
{
_IO_size_t
delta
;
_IO_size_t
delta
;
int
retval
=
0
;
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
fp
);
_IO_flockfile
(
fp
);
/* char* ptr = cur_ptr(); */
/* char* ptr = cur_ptr(); */
if
(
fp
->
_IO_write_ptr
>
fp
->
_IO_write_base
)
if
(
fp
->
_IO_write_ptr
>
fp
->
_IO_write_base
)
if
(
_IO_do_flush
(
fp
))
return
EOF
;
if
(
_IO_do_flush
(
fp
))
return
EOF
;
...
@@ -402,12 +411,14 @@ _IO_file_sync (fp)
...
@@ -402,12 +411,14 @@ _IO_file_sync (fp)
;
/* Ignore error from unseekable devices. */
;
/* Ignore error from unseekable devices. */
#endif
#endif
else
else
ret
urn
EOF
;
ret
val
=
EOF
;
}
}
fp
->
_offset
=
_IO_pos_BAD
;
if
(
retval
!=
EOF
)
fp
->
_offset
=
_IO_pos_BAD
;
/* FIXME: Cleanup - can this be shared? */
/* FIXME: Cleanup - can this be shared? */
/* setg(base(), ptr, ptr); */
/* setg(base(), ptr, ptr); */
return
0
;
_IO_cleanup_region_end
(
1
);
return
retval
;
}
}
_IO_pos_t
_IO_pos_t
...
@@ -575,19 +586,7 @@ _IO_file_read (fp, buf, size)
...
@@ -575,19 +586,7 @@ _IO_file_read (fp, buf, size)
void
*
buf
;
void
*
buf
;
_IO_ssize_t
size
;
_IO_ssize_t
size
;
{
{
for
(;;)
return
read
(
fp
->
_fileno
,
buf
,
size
);
{
_IO_ssize_t
count
=
_IO_read
(
fp
->
_fileno
,
buf
,
size
);
#if 0 && defined EINTR
/* We must not do this optimization since POSIX.1 explicitly
requests that the stream operations must return with the
error EINTR if this happens. There must be the possibility
that stream operations time out. --drepper */
if (count == -1 && errno == EINTR)
continue;
#endif
return
count
;
}
}
}
_IO_pos_t
_IO_pos_t
...
@@ -596,7 +595,7 @@ _IO_file_seek (fp, offset, dir)
...
@@ -596,7 +595,7 @@ _IO_file_seek (fp, offset, dir)
_IO_off_t
offset
;
_IO_off_t
offset
;
int
dir
;
int
dir
;
{
{
return
_IO_
lseek
(
fp
->
_fileno
,
offset
,
dir
);
return
lseek
(
fp
->
_fileno
,
offset
,
dir
);
}
}
int
int
...
@@ -604,14 +603,14 @@ _IO_file_stat (fp, st)
...
@@ -604,14 +603,14 @@ _IO_file_stat (fp, st)
_IO_FILE
*
fp
;
_IO_FILE
*
fp
;
void
*
st
;
void
*
st
;
{
{
return
_IO_
fstat
(
fp
->
_fileno
,
(
struct
stat
*
)
st
);
return
fstat
(
fp
->
_fileno
,
(
struct
stat
*
)
st
);
}
}
int
int
_IO_file_close
(
fp
)
_IO_file_close
(
fp
)
_IO_FILE
*
fp
;
_IO_FILE
*
fp
;
{
{
return
_IO_
close
(
fp
->
_fileno
);
return
close
(
fp
->
_fileno
);
}
}
_IO_ssize_t
_IO_ssize_t
...
@@ -623,22 +622,11 @@ _IO_file_write (f, data, n)
...
@@ -623,22 +622,11 @@ _IO_file_write (f, data, n)
_IO_ssize_t
to_do
=
n
;
_IO_ssize_t
to_do
=
n
;
while
(
to_do
>
0
)
while
(
to_do
>
0
)
{
{
_IO_ssize_t
count
=
_IO_
write
(
f
->
_fileno
,
data
,
to_do
);
_IO_ssize_t
count
=
write
(
f
->
_fileno
,
data
,
to_do
);
if
(
count
==
EOF
)
if
(
count
==
EOF
)
{
{
#if 0 && defined EINTR
f
->
_flags
|=
_IO_ERR_SEEN
;
/* We must not do this optimization since POSIX.1 explicitly
break
;
requests that the stream operations must return with the
error EINTR if this happens. There must be the
possibility that stream operations time out. --drepper */
if (errno == EINTR)
continue;
else
#endif
{
f
->
_flags
|=
_IO_ERR_SEEN
;
break
;
}
}
}
to_do
-=
count
;
to_do
-=
count
;
data
=
(
void
*
)
((
char
*
)
data
+
count
);
data
=
(
void
*
)
((
char
*
)
data
+
count
);
...
...
libio/include/empty.h
View file @
e693cc28
/* Thread package specific definitions of stream lock type.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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 _LIBIO_LOCK_H
#define _LIBIO_LOCK_H 1
typedef
void
*
_IO_lock_t
;
/* We need recursive (counting) mutexes. */
#define _IO_lock_initializer NULL
#define _IO_cleanup_region_start(_fct, _fp)
#define _IO_cleanup_region_end(_doit)
#define _IO_lock_init(_name)
#define _IO_lock_fini(_name)
#define _IO_lock_lock(_name)
#define _IO_lock_unlock(_name)
#endif
/* libio-lock.h */
/* this will be used later*/
/* this will be used later*/
libio/ioignore.c
View file @
e693cc28
...
@@ -25,8 +25,9 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -25,8 +25,9 @@ the executable file might be covered by the GNU General Public License. */
#include "libioP.h"
#include "libioP.h"
int
int
DEFUN
(
_IO_ignore
,
(
fp
,
n
),
_IO_ignore
(
fp
,
n
)
register
_IO_FILE
*
fp
AND
_IO_size_t
n
)
_IO_FILE
*
fp
;
_IO_size_t
n
;
{
{
register
_IO_size_t
more
=
n
;
register
_IO_size_t
more
=
n
;
for
(;;)
for
(;;)
...
...
libio/iolibio.h
View file @
e693cc28
...
@@ -32,6 +32,11 @@ extern int _IO_sprintf __P((char *, const char*, ...));
...
@@ -32,6 +32,11 @@ extern int _IO_sprintf __P((char *, const char*, ...));
extern
int
_IO_ungetc
__P
((
int
,
_IO_FILE
*
));
extern
int
_IO_ungetc
__P
((
int
,
_IO_FILE
*
));
extern
int
_IO_vsscanf
__P
((
const
char
*
,
const
char
*
,
_IO_va_list
));
extern
int
_IO_vsscanf
__P
((
const
char
*
,
const
char
*
,
_IO_va_list
));
extern
int
_IO_vsprintf
__P
((
char
*
,
const
char
*
,
_IO_va_list
));
extern
int
_IO_vsprintf
__P
((
char
*
,
const
char
*
,
_IO_va_list
));
struct
obstack
;
extern
int
_IO_obstack_vprintf
__P
((
struct
obstack
*
,
const
char
*
,
_IO_va_list
));
extern
int
_IO_obstack_printf
__P
((
struct
obstack
*
,
const
char
*
,
...));
#ifndef _IO_pos_BAD
#ifndef _IO_pos_BAD
#define _IO_pos_BAD ((_IO_fpos_t)(-1))
#define _IO_pos_BAD ((_IO_fpos_t)(-1))
#endif
#endif
...
...
libio/ioperror.c
View file @
e693cc28
...
@@ -10,8 +10,8 @@ extern char* _IO_strerror __P((int));
...
@@ -10,8 +10,8 @@ extern char* _IO_strerror __P((int));
#endif
#endif
void
void
DEFUN
(
_IO_perror
,
(
s
),
_IO_perror
(
s
)
const
char
*
s
)
const
char
*
s
;
{
{
char
*
error
=
_IO_strerror
(
errno
);
char
*
error
=
_IO_strerror
(
errno
);
...
...
libio/iopopen.c
View file @
e693cc28
...
@@ -68,6 +68,10 @@ extern int _IO_dup2 __P ((int fd, int fd2));
...
@@ -68,6 +68,10 @@ extern int _IO_dup2 __P ((int fd, int fd2));
#define _IO__exit _exit
#define _IO__exit _exit
#endif
#endif
#ifndef _IO_close
#define _IO_close close
#endif
struct
_IO_proc_file
struct
_IO_proc_file
{
{
struct
_IO_FILE_plus
file
;
struct
_IO_FILE_plus
file
;
...
...
libio/ioprims.c
View file @
e693cc28
...
@@ -37,36 +37,43 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -37,36 +37,43 @@ the executable file might be covered by the GNU General Public License. */
#endif
#endif
_IO_ssize_t
_IO_ssize_t
DEFUN
(
_IO_read
,
(
fildes
,
buf
,
nbyte
),
_IO_read
(
fildes
,
buf
,
nbyte
)
int
fildes
AND
void
*
buf
AND
_IO_size_t
nbyte
)
int
fildes
;
void
*
buf
;
_IO_size_t
nbyte
;
{
{
return
read
(
fildes
,
buf
,
nbyte
);
return
read
(
fildes
,
buf
,
nbyte
);
}
}
_IO_ssize_t
_IO_ssize_t
DEFUN
(
_IO_write
,
(
fildes
,
buf
,
nbyte
),
_IO_write
(
fildes
,
buf
,
nbyte
)
int
fildes
AND
const
void
*
buf
AND
_IO_size_t
nbyte
)
int
fildes
;
const
void
*
buf
;
_IO_size_t
nbyte
;
{
{
return
write
(
fildes
,
buf
,
nbyte
);
return
write
(
fildes
,
buf
,
nbyte
);
}
}
_IO_off_t
_IO_off_t
DEFUN
(
_IO_lseek
,
(
fildes
,
offset
,
whence
),
_IO_lseek
(
fildes
,
offset
,
whence
)
int
fildes
AND
_IO_off_t
offset
AND
int
whence
)
int
fildes
;
_IO_off_t
offset
;
int
whence
;
{
{
return
lseek
(
fildes
,
offset
,
whence
);
return
lseek
(
fildes
,
offset
,
whence
);
}
}
int
int
DEFUN
(
_IO_close
,
(
fildes
),
_IO_close
(
fildes
)
int
fildes
)
int
fildes
;
{
{
return
close
(
fildes
);
return
close
(
fildes
);
}
}
int
int
DEFUN
(
_IO_fstat
,
(
fildes
,
buf
),
_IO_fstat
(
fildes
,
buf
)
int
fildes
AND
struct
stat
*
buf
)
int
fildes
;
struct
stat
*
buf
;
{
{
return
fstat
(
fildes
,
buf
);
return
fstat
(
fildes
,
buf
);
}
}
libio/ioseekoff.c
View file @
e693cc28
...
@@ -32,9 +32,14 @@ _IO_seekoff (fp, offset, dir, mode)
...
@@ -32,9 +32,14 @@ _IO_seekoff (fp, offset, dir, mode)
int
dir
;
int
dir
;
int
mode
;
int
mode
;
{
{
_IO_pos_t
retval
;
/* If we have a backup buffer, get rid of it, since the __seekoff
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
callback may not know to do the right thing about it.
This may be over-kill, but it'll do for now. TODO */
This may be over-kill, but it'll do for now. TODO */
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
fp
);
_IO_flockfile
(
fp
);
if
(
_IO_have_backup
(
fp
))
if
(
_IO_have_backup
(
fp
))
{
{
...
@@ -42,6 +47,8 @@ _IO_seekoff (fp, offset, dir, mode)
...
@@ -42,6 +47,8 @@ _IO_seekoff (fp, offset, dir, mode)
offset
-=
fp
->
_IO_read_end
-
fp
->
_IO_read_ptr
;
offset
-=
fp
->
_IO_read_end
-
fp
->
_IO_read_ptr
;
_IO_free_backup_area
(
fp
);
_IO_free_backup_area
(
fp
);
}
}
retval
=
_IO_SEEKOFF
(
fp
,
offset
,
dir
,
mode
);
return
_IO_SEEKOFF
(
fp
,
offset
,
dir
,
mode
);
_IO_cleanup_region_end
(
1
);
return
retval
;
}
}
libio/ioseekpos.c
View file @
e693cc28
...
@@ -31,12 +31,18 @@ _IO_seekpos (fp, pos, mode)
...
@@ -31,12 +31,18 @@ _IO_seekpos (fp, pos, mode)
_IO_pos_t
pos
;
_IO_pos_t
pos
;
int
mode
;
int
mode
;
{
{
_IO_pos_t
retval
;
/* If we have a backup buffer, get rid of it, since the __seekoff
/* If we have a backup buffer, get rid of it, since the __seekoff
callback may not know to do the right thing about it.
callback may not know to do the right thing about it.
This may be over-kill, but it'll do for now. TODO */
This may be over-kill, but it'll do for now. TODO */
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
fp
);
_IO_flockfile
(
fp
);
if
(
_IO_have_backup
(
fp
))
if
(
_IO_have_backup
(
fp
))
_IO_free_backup_area
(
fp
);
_IO_free_backup_area
(
fp
);
retval
=
_IO_SEEKPOS
(
fp
,
pos
,
mode
);
return
_IO_SEEKPOS
(
fp
,
pos
,
mode
);
_IO_cleanup_region_end
(
1
);
return
retval
;
}
}
libio/iostream.cc
View file @
e693cc28
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
/* This is part of libio/iostream, providing -*- C++ -*- input/output.
Copyright (C) 1993 Free Software Foundation
Copyright (C) 1993, 1997 Free Software Foundation, Inc.
This file is part of the GNU IO Library. This library is free
This file is part of the GNU IO Library. This library is free
software; you can redistribute it and/or modify it under the
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
Free Software Foundation; either version 2, or (at your option)
any later version.
any later version.
This library is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
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
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.
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
As a special exception, if you link this library with files
the resulting executable to be covered by the GNU General Public License.
compiled with a GNU compiler to produce an executable, this does not cause
This exception does not however invalidate any other reasons why
the resulting executable to be covered by the GNU General Public License.
the executable file might 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). */
/* Written by Per Bothner (bothner@cygnus.com). */
...
@@ -34,7 +35,14 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -34,7 +35,14 @@ the executable file might be covered by the GNU General Public License. */
#include <ctype.h>
#include <ctype.h>
#include <string.h>
#include <string.h>
#include <limits.h>
#include <limits.h>
#if _G_HAVE_PRINTF_FP
#include <printf.h>
extern
"C"
int
__printf_fp
(
_IO_FILE
*
,
const
struct
printf_info
*
,
const
void
*
const
*
);
#else
#include "floatio.h"
#include "floatio.h"
#endif
#define BUF (MAXEXP+MAXFRACT+1)
/* + decimal point */
#define BUF (MAXEXP+MAXFRACT+1)
/* + decimal point */
...
@@ -133,7 +141,7 @@ istream::sync ()
...
@@ -133,7 +141,7 @@ istream::sync ()
if
(
sb
==
NULL
)
if
(
sb
==
NULL
)
return
EOF
;
return
EOF
;
if
(
sb
->
sync
())
// Later: pubsync
if
(
sb
->
sync
())
// Later: pubsync
{
{
setstate
(
ios
::
badbit
);
setstate
(
ios
::
badbit
);
return
EOF
;
return
EOF
;
}
}
...
@@ -321,7 +329,11 @@ READ_INT(bool)
...
@@ -321,7 +329,11 @@ READ_INT(bool)
istream
&
istream
::
operator
>>
(
long
double
&
x
)
istream
&
istream
::
operator
>>
(
long
double
&
x
)
{
{
if
(
ipfx0
())
if
(
ipfx0
())
#if _G_HAVE_LONG_DOUBLE_IO
scan
(
"%Lg"
,
&
x
);
#else
scan
(
"%lg"
,
&
x
);
scan
(
"%lg"
,
&
x
);
#endif
return
*
this
;
return
*
this
;
}
}
...
@@ -362,10 +374,14 @@ istream& istream::operator>>(register streambuf* sbuf)
...
@@ -362,10 +374,14 @@ istream& istream::operator>>(register streambuf* sbuf)
ostream
&
ostream
::
operator
<<
(
char
c
)
ostream
&
ostream
::
operator
<<
(
char
c
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
#if 1
#if 1
// This is what the cfront implementation does.
// This is what the cfront implementation does.
if
(
_strbuf
->
sputc
(
c
)
==
EOF
)
if
(
_strbuf
->
sputc
(
c
)
==
EOF
)
{
goto
failed
;
set
(
ios
::
badbit
);
goto
failed
;
}
#else
#else
// This is what cfront documentation and current ANSI drafts say.
// This is what cfront documentation and current ANSI drafts say.
int
w
=
width
(
0
);
int
w
=
width
(
0
);
...
@@ -373,21 +389,23 @@ ostream& ostream::operator<<(char c)
...
@@ -373,21 +389,23 @@ ostream& ostream::operator<<(char c)
register
int
padding
=
w
>
0
?
w
-
1
:
0
;
register
int
padding
=
w
>
0
?
w
-
1
:
0
;
register
streambuf
*
sb
=
_strbuf
;
register
streambuf
*
sb
=
_strbuf
;
if
(
!
(
flags
()
&
ios
::
left
)
&&
padding
)
// Default adjustment.
if
(
!
(
flags
()
&
ios
::
left
)
&&
padding
)
// Default adjustment.
if
(
_IO_padn
(
sb
,
fill_char
,
padding
)
<
padding
)
if
(
_IO_padn
(
sb
,
fill_char
,
padding
)
<
padding
)
{
set
(
ios
::
badbit
);
goto
failed
;
goto
failed
;
if
(
sb
->
sputc
(
c
)
==
EOF
)
}
if
(
sb
->
sputc
(
c
)
==
EOF
)
{
set
(
ios
::
badbit
);
goto
failed
;
goto
failed
;
}
if
(
flags
()
&
ios
::
left
&&
padding
)
// Left adjustment.
if
(
flags
()
&
ios
::
left
&&
padding
)
// Left adjustment.
if
(
_IO_padn
(
sb
,
fill_char
,
padding
)
<
padding
)
if
(
_IO_padn
(
sb
,
fill_char
,
padding
)
<
padding
)
goto
failed
;
set
(
ios
::
badbit
)
;
#endif
#endif
failed
:
osfx
();
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
failed
:
set
(
ios
::
badbit
);
osfx
();
return
*
this
;
}
}
/* Write VAL on STREAM.
/* Write VAL on STREAM.
...
@@ -493,19 +511,26 @@ static void write_int(ostream& stream, unsigned LONGEST val, int sign)
...
@@ -493,19 +511,26 @@ static void write_int(ostream& stream, unsigned LONGEST val, int sign)
ostream
&
ostream
::
operator
<<
(
int
n
)
ostream
&
ostream
::
operator
<<
(
int
n
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
int
sign
=
1
;
int
sign
=
1
;
unsigned
int
abs_n
=
(
unsigned
)
n
;
unsigned
int
abs_n
=
(
unsigned
)
n
;
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
abs_n
=
-
((
unsigned
)
n
),
sign
=
-
1
;
abs_n
=
-
((
unsigned
)
n
),
sign
=
-
1
;
write_int
(
*
this
,
abs_n
,
sign
);
write_int
(
*
this
,
abs_n
,
sign
);
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
ostream
&
ostream
::
operator
<<
(
unsigned
int
n
)
ostream
&
ostream
::
operator
<<
(
unsigned
int
n
)
{
{
if
(
opfx
())
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
write_int
(
*
this
,
n
,
0
);
write_int
(
*
this
,
n
,
0
);
_IO_cleanup_region_end
(
0
);
}
return
*
this
;
return
*
this
;
}
}
...
@@ -513,19 +538,26 @@ ostream& ostream::operator<<(unsigned int n)
...
@@ -513,19 +538,26 @@ ostream& ostream::operator<<(unsigned int n)
ostream
&
ostream
::
operator
<<
(
long
n
)
ostream
&
ostream
::
operator
<<
(
long
n
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
int
sign
=
1
;
int
sign
=
1
;
unsigned
long
abs_n
=
(
unsigned
long
)
n
;
unsigned
long
abs_n
=
(
unsigned
long
)
n
;
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
abs_n
=
-
((
unsigned
long
)
n
),
sign
=
-
1
;
abs_n
=
-
((
unsigned
long
)
n
),
sign
=
-
1
;
write_int
(
*
this
,
abs_n
,
sign
);
write_int
(
*
this
,
abs_n
,
sign
);
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
ostream
&
ostream
::
operator
<<
(
unsigned
long
n
)
ostream
&
ostream
::
operator
<<
(
unsigned
long
n
)
{
{
if
(
opfx
())
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
write_int
(
*
this
,
n
,
0
);
write_int
(
*
this
,
n
,
0
);
_IO_cleanup_region_end
(
0
);
}
return
*
this
;
return
*
this
;
}
}
...
@@ -533,11 +565,14 @@ ostream& ostream::operator<<(unsigned long n)
...
@@ -533,11 +565,14 @@ ostream& ostream::operator<<(unsigned long n)
ostream
&
ostream
::
operator
<<
(
long
long
n
)
ostream
&
ostream
::
operator
<<
(
long
long
n
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
int
sign
=
1
;
int
sign
=
1
;
unsigned
long
long
abs_n
=
(
unsigned
long
long
)
n
;
unsigned
long
long
abs_n
=
(
unsigned
long
long
)
n
;
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
if
(
n
<
0
&&
(
flags
()
&
(
ios
::
oct
|
ios
::
hex
))
==
0
)
abs_n
=
-
((
unsigned
long
long
)
n
),
sign
=
-
1
;
abs_n
=
-
((
unsigned
long
long
)
n
),
sign
=
-
1
;
write_int
(
*
this
,
abs_n
,
sign
);
write_int
(
*
this
,
abs_n
,
sign
);
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -545,8 +580,12 @@ ostream& ostream::operator<<(long long n)
...
@@ -545,8 +580,12 @@ ostream& ostream::operator<<(long long n)
ostream
&
ostream
::
operator
<<
(
unsigned
long
long
n
)
ostream
&
ostream
::
operator
<<
(
unsigned
long
long
n
)
{
{
if
(
opfx
())
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
write_int
(
*
this
,
n
,
0
);
write_int
(
*
this
,
n
,
0
);
_IO_cleanup_region_end
(
0
);
}
return
*
this
;
return
*
this
;
}
}
#endif
/*__GNUC__*/
#endif
/*__GNUC__*/
...
@@ -554,6 +593,8 @@ ostream& ostream::operator<<(unsigned long long n)
...
@@ -554,6 +593,8 @@ ostream& ostream::operator<<(unsigned long long n)
ostream
&
ostream
::
operator
<<
(
double
n
)
ostream
&
ostream
::
operator
<<
(
double
n
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
// Uses __cvt_double (renamed from static cvt), in Chris Torek's
// Uses __cvt_double (renamed from static cvt), in Chris Torek's
// stdio implementation. The setup code uses the same logic
// stdio implementation. The setup code uses the same logic
// as in __vsbprintf.C (also based on Torek's code).
// as in __vsbprintf.C (also based on Torek's code).
...
@@ -570,7 +611,26 @@ ostream& ostream::operator<<(double n)
...
@@ -570,7 +611,26 @@ ostream& ostream::operator<<(double n)
prec
=
6
;
/* default */
prec
=
6
;
/* default */
// Do actual conversion.
// Do actual conversion.
#ifdef _IO_USE_DTOA
#ifdef _G_HAVE_PRINTF_FP
{
struct
printf_info
info
=
{
prec
:
prec
,
width
:
width
(
0
),
spec
:
format_char
,
is_long_double
:
0
,
is_short
:
0
,
is_long
:
0
,
alt
:
flags
()
&
ios
::
showpoint
,
space
:
0
,
left
:
ios
::
left
,
showsign
:
flags
()
&
ios
::
showpos
,
group
:
0
,
pad
:
fill
(),
extra
:
0
};
const
void
*
ptr
=
&
n
;
if
(
__printf_fp
(
rdbuf
(),
&
info
,
&
ptr
)
<
0
)
set
(
ios
::
badbit
|
ios
::
failbit
);
}
#elif defined _IO_USE_DTOA
if
(
_IO_outfloat
(
n
,
rdbuf
(),
format_char
,
width
(
0
),
if
(
_IO_outfloat
(
n
,
rdbuf
(),
format_char
,
width
(
0
),
prec
,
flags
(),
prec
,
flags
(),
flags
()
&
ios
::
showpos
?
'+'
:
0
,
flags
()
&
ios
::
showpos
?
'+'
:
0
,
...
@@ -618,7 +678,7 @@ ostream& ostream::operator<<(double n)
...
@@ -618,7 +678,7 @@ ostream& ostream::operator<<(double n)
sbuf
->
sputc
(
sign
);
sbuf
->
sputc
(
sign
);
if
(
pad_kind
==
(
ios
::
fmtflags
)
ios
::
internal
)
if
(
pad_kind
==
(
ios
::
fmtflags
)
ios
::
internal
)
for
(
i
=
padding
;
--
i
>=
0
;
)
sbuf
->
sputc
(
fill_char
);
for
(
i
=
padding
;
--
i
>=
0
;
)
sbuf
->
sputc
(
fill_char
);
// Emit the actual concented field, followed by extra zeros.
// Emit the actual concented field, followed by extra zeros.
_IO_sputn
(
sbuf
,
cp
,
size
);
_IO_sputn
(
sbuf
,
cp
,
size
);
for
(
i
=
fpprec
;
--
i
>=
0
;
)
sbuf
->
sputc
(
'0'
);
for
(
i
=
fpprec
;
--
i
>=
0
;
)
sbuf
->
sputc
(
'0'
);
...
@@ -627,14 +687,66 @@ ostream& ostream::operator<<(double n)
...
@@ -627,14 +687,66 @@ ostream& ostream::operator<<(double n)
for
(
i
=
padding
;
--
i
>=
0
;
)
sbuf
->
sputc
(
fill_char
);
for
(
i
=
padding
;
--
i
>=
0
;
)
sbuf
->
sputc
(
fill_char
);
#endif
#endif
osfx
();
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
#if _G_HAVE_LONG_DOUBLE_IO
ostream
&
ostream
::
operator
<<
(
long
double
n
)
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
int
format_char
;
if
((
flags
()
&
ios
::
floatfield
)
==
ios
::
fixed
)
format_char
=
'f'
;
else
if
((
flags
()
&
ios
::
floatfield
)
==
ios
::
scientific
)
format_char
=
flags
()
&
ios
::
uppercase
?
'E'
:
'e'
;
else
format_char
=
flags
()
&
ios
::
uppercase
?
'G'
:
'g'
;
int
prec
=
precision
();
if
(
prec
<=
0
&&
!
(
flags
()
&
ios
::
fixed
))
prec
=
6
;
/* default */
#ifdef _G_HAVE_PRINTF_FP
// Do actual conversion.
struct
printf_info
info
=
{
prec
:
prec
,
width
:
width
(
0
),
spec
:
format_char
,
is_long_double
:
1
,
is_short
:
0
,
is_long
:
0
,
alt
:
flags
()
&
ios
::
showpoint
,
space
:
0
,
left
:
ios
::
left
,
showsign
:
flags
()
&
ios
::
showpos
,
group
:
0
,
pad
:
fill
(),
extra
:
0
};
const
void
*
ptr
=
&
n
;
if
(
__printf_fp
(
rdbuf
(),
&
info
,
&
ptr
)
<
0
)
set
(
ios
::
badbit
|
ios
::
failbit
);
#else
# error "long double I/O using dtoa or cvt_double is not implemented"
#endif
osfx
();
_IO_cleanup_region_end
(
0
);
}
return
*
this
;
}
#endif
ostream
&
ostream
::
operator
<<
(
const
char
*
s
)
ostream
&
ostream
::
operator
<<
(
const
char
*
s
)
{
{
if
(
opfx
())
if
(
opfx
())
{
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
if
(
s
==
NULL
)
if
(
s
==
NULL
)
s
=
"(null)"
;
s
=
"(null)"
;
int
len
=
strlen
(
s
);
int
len
=
strlen
(
s
);
...
@@ -645,19 +757,23 @@ ostream& ostream::operator<<(const char *s)
...
@@ -645,19 +757,23 @@ ostream& ostream::operator<<(const char *s)
register
int
padding
=
w
>
len
?
w
-
len
:
0
;
register
int
padding
=
w
>
len
?
w
-
len
:
0
;
if
(
!
(
flags
()
&
ios
::
left
)
&&
padding
>
0
)
// Default adjustment.
if
(
!
(
flags
()
&
ios
::
left
)
&&
padding
>
0
)
// Default adjustment.
if
(
_IO_padn
(
sbuf
,
fill_char
,
padding
)
!=
padding
)
if
(
_IO_padn
(
sbuf
,
fill_char
,
padding
)
!=
padding
)
goto
failed
;
{
set
(
ios
::
badbit
);
goto
failed
;
}
if
(
_IO_sputn
(
sbuf
,
s
,
len
)
!=
len
)
if
(
_IO_sputn
(
sbuf
,
s
,
len
)
!=
len
)
goto
failed
;
{
set
(
ios
::
badbit
);
goto
failed
;
}
if
(
flags
()
&
ios
::
left
&&
padding
>
0
)
// Left adjustment.
if
(
flags
()
&
ios
::
left
&&
padding
>
0
)
// Left adjustment.
if
(
_IO_padn
(
sbuf
,
fill_char
,
padding
)
!=
padding
)
if
(
_IO_padn
(
sbuf
,
fill_char
,
padding
)
!=
padding
)
goto
failed
;
set
(
ios
::
badbit
)
;
osfx
();
osfx
();
failed
:
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
failed
:
set
(
ios
::
badbit
);
osfx
();
return
*
this
;
}
}
#if 0
#if 0
...
@@ -669,6 +785,8 @@ ostream& ostream::operator<<(register streambuf* sbuf)
...
@@ -669,6 +785,8 @@ ostream& ostream::operator<<(register streambuf* sbuf)
{
{
if
(
opfx
())
if
(
opfx
())
{
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
char
buffer
[
_IO_BUFSIZ
];
char
buffer
[
_IO_BUFSIZ
];
register
streambuf
*
outbuf
=
_strbuf
;
register
streambuf
*
outbuf
=
_strbuf
;
for
(;;)
for
(;;)
...
@@ -683,6 +801,7 @@ ostream& ostream::operator<<(register streambuf* sbuf)
...
@@ -683,6 +801,7 @@ ostream& ostream::operator<<(register streambuf* sbuf)
}
}
}
}
osfx
();
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
...
@@ -735,11 +854,15 @@ ostream& flush(ostream& outs)
...
@@ -735,11 +854,15 @@ ostream& flush(ostream& outs)
istream
&
ws
(
istream
&
ins
)
istream
&
ws
(
istream
&
ins
)
{
{
if
(
ins
.
ipfx1
())
{
if
(
ins
.
ipfx1
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
ins
.
_strbuf
);
int
ch
=
skip_ws
(
ins
.
_strbuf
);
int
ch
=
skip_ws
(
ins
.
_strbuf
);
if
(
ch
==
EOF
)
if
(
ch
==
EOF
)
ins
.
set
(
ios
::
eofbit
);
ins
.
set
(
ios
::
eofbit
);
else
else
ins
.
_strbuf
->
sputbackc
(
ch
);
ins
.
_strbuf
->
sputbackc
(
ch
);
ins
.
isfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
ins
;
return
ins
;
}
}
...
@@ -772,11 +895,37 @@ ostream& endl(ostream& outs)
...
@@ -772,11 +895,37 @@ ostream& endl(ostream& outs)
return
flush
(
outs
.
put
(
'\n'
));
return
flush
(
outs
.
put
(
'\n'
));
}
}
istream
&
lock
(
istream
&
ins
)
{
_IO_flockfile
(
ins
.
_strbuf
);
return
ins
;
}
istream
&
unlock
(
istream
&
ins
)
{
_IO_funlockfile
(
ins
.
_strbuf
);
return
ins
;
}
ostream
&
lock
(
ostream
&
outs
)
{
_IO_flockfile
(
outs
.
_strbuf
);
return
outs
;
}
ostream
&
unlock
(
ostream
&
outs
)
{
_IO_funlockfile
(
outs
.
_strbuf
);
return
outs
;
}
ostream
&
ostream
::
write
(
const
char
*
s
,
streamsize
n
)
ostream
&
ostream
::
write
(
const
char
*
s
,
streamsize
n
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
if
(
_IO_sputn
(
_strbuf
,
s
,
n
)
!=
n
)
if
(
_IO_sputn
(
_strbuf
,
s
,
n
)
!=
n
)
set
(
ios
::
failbit
);
set
(
ios
::
failbit
);
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
...
...
libio/iostream.h
View file @
e693cc28
...
@@ -49,8 +49,10 @@ class ostream : virtual public ios
...
@@ -49,8 +49,10 @@ class ostream : virtual public ios
ostream
()
{
}
ostream
()
{
}
ostream
(
streambuf
*
sb
,
ostream
*
tied
=
NULL
);
ostream
(
streambuf
*
sb
,
ostream
*
tied
=
NULL
);
int
opfx
()
{
int
opfx
()
{
if
(
!
good
())
return
0
;
else
{
if
(
_tie
)
_tie
->
flush
();
return
1
;}
}
if
(
!
good
())
return
0
;
void
osfx
()
{
if
(
flags
()
&
(
ios
::
unitbuf
|
ios
::
stdio
))
else
{
if
(
_tie
)
_tie
->
flush
();
_IO_flockfile
(
_strbuf
);
return
1
;}
}
void
osfx
()
{
_IO_funlockfile
(
_strbuf
);
if
(
flags
()
&
(
ios
::
unitbuf
|
ios
::
stdio
))
do_osfx
();
}
do_osfx
();
}
ostream
&
flush
();
ostream
&
flush
();
ostream
&
put
(
char
c
)
{
_strbuf
->
sputc
(
c
);
return
*
this
;
}
ostream
&
put
(
char
c
)
{
_strbuf
->
sputc
(
c
);
return
*
this
;
}
...
@@ -144,6 +146,7 @@ protected:
...
@@ -144,6 +146,7 @@ protected:
int
ipfx
(
int
need
=
0
)
{
int
ipfx
(
int
need
=
0
)
{
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
else
{
else
{
_IO_flockfile
(
_strbuf
);
if
(
_tie
&&
(
need
==
0
||
rdbuf
()
->
in_avail
()
<
need
))
_tie
->
flush
();
if
(
_tie
&&
(
need
==
0
||
rdbuf
()
->
in_avail
()
<
need
))
_tie
->
flush
();
if
(
!
need
&&
(
flags
()
&
ios
::
skipws
))
return
_skip_ws
();
if
(
!
need
&&
(
flags
()
&
ios
::
skipws
))
return
_skip_ws
();
else
return
1
;
else
return
1
;
...
@@ -152,6 +155,7 @@ protected:
...
@@ -152,6 +155,7 @@ protected:
int
ipfx0
()
{
// Optimized version of ipfx(0).
int
ipfx0
()
{
// Optimized version of ipfx(0).
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
else
{
else
{
_IO_flockfile
(
_strbuf
);
if
(
_tie
)
_tie
->
flush
();
if
(
_tie
)
_tie
->
flush
();
if
(
flags
()
&
ios
::
skipws
)
return
_skip_ws
();
if
(
flags
()
&
ios
::
skipws
)
return
_skip_ws
();
else
return
1
;
else
return
1
;
...
@@ -160,11 +164,12 @@ protected:
...
@@ -160,11 +164,12 @@ protected:
int
ipfx1
()
{
// Optimized version of ipfx(1).
int
ipfx1
()
{
// Optimized version of ipfx(1).
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
if
(
!
good
())
{
set
(
ios
::
failbit
);
return
0
;
}
else
{
else
{
_IO_flockfile
(
_strbuf
);
if
(
_tie
&&
rdbuf
()
->
in_avail
()
==
0
)
_tie
->
flush
();
if
(
_tie
&&
rdbuf
()
->
in_avail
()
==
0
)
_tie
->
flush
();
return
1
;
return
1
;
}
}
}
}
void
isfx
()
{
}
void
isfx
()
{
_IO_funlockfile
(
_strbuf
);
}
int
get
()
{
if
(
!
ipfx1
())
return
EOF
;
int
get
()
{
if
(
!
ipfx1
())
return
EOF
;
else
{
int
ch
=
_strbuf
->
sbumpc
();
else
{
int
ch
=
_strbuf
->
sbumpc
();
if
(
ch
==
EOF
)
set
(
ios
::
eofbit
);
if
(
ch
==
EOF
)
set
(
ios
::
eofbit
);
...
@@ -249,6 +254,11 @@ __asm__ ("__IO_clog")
...
@@ -249,6 +254,11 @@ __asm__ ("__IO_clog")
#endif
#endif
;
;
extern
istream
&
lock
(
istream
&
ins
);
extern
istream
&
unlock
(
istream
&
ins
);
extern
ostream
&
lock
(
ostream
&
outs
);
extern
ostream
&
unlock
(
ostream
&
outs
);
struct
Iostream_init
{
}
;
// Compatibility hack for AT&T library.
struct
Iostream_init
{
}
;
// Compatibility hack for AT&T library.
inline
ios
&
dec
(
ios
&
i
)
inline
ios
&
dec
(
ios
&
i
)
...
...
libio/iostrerror.c
View file @
e693cc28
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
extern
char
*
strerror
__P
((
int
));
extern
char
*
strerror
__P
((
int
));
char
*
char
*
DEFUN
(
_IO_strerror
,
(
errnum
),
_IO_strerror
(
errnum
)
int
errnum
)
int
errnum
;
{
{
return
strerror
(
errnum
);
return
strerror
(
errnum
);
}
}
libio/iovfprintf.c
View file @
e693cc28
...
@@ -84,8 +84,9 @@ struct helper_file
...
@@ -84,8 +84,9 @@ struct helper_file
};
};
static
int
static
int
DEFUN
(
_IO_helper_overflow
,
(
fp
,
c
),
_IO_helper_overflow
(
fp
,
c
)
_IO_FILE
*
fp
AND
int
c
)
_IO_FILE
*
fp
;
int
c
;
{
{
_IO_FILE
*
target
=
((
struct
helper_file
*
)
fp
)
->
_put_stream
;
_IO_FILE
*
target
=
((
struct
helper_file
*
)
fp
)
->
_put_stream
;
int
used
=
fp
->
_IO_write_ptr
-
fp
->
_IO_write_base
;
int
used
=
fp
->
_IO_write_ptr
-
fp
->
_IO_write_base
;
...
@@ -119,8 +120,10 @@ static struct _IO_jump_t _IO_helper_jumps = {
...
@@ -119,8 +120,10 @@ static struct _IO_jump_t _IO_helper_jumps = {
};
};
static
int
static
int
DEFUN
(
helper_vfprintf
,
(
fp
,
fmt0
,
ap
),
helper_vfprintf
(
fp
,
fmt0
,
ap
)
register
_IO_FILE
*
fp
AND
char
const
*
fmt0
AND
_IO_va_list
ap
)
_IO_FILE
*
fp
;
char
const
*
fmt0
;
_IO_va_list
ap
;
{
{
char
buf
[
_IO_BUFSIZ
];
char
buf
[
_IO_BUFSIZ
];
struct
helper_file
helper
;
struct
helper_file
helper
;
...
@@ -180,8 +183,10 @@ extern double modf __P((double, double*));
...
@@ -180,8 +183,10 @@ extern double modf __P((double, double*));
#define HEXPREFIX 0x40
/* add 0x or 0X prefix */
#define HEXPREFIX 0x40
/* add 0x or 0X prefix */
int
int
DEFUN
(
_IO_vfprintf
,
(
fp
,
fmt0
,
ap
),
_IO_vfprintf
(
fp
,
fmt0
,
ap
)
register
_IO_FILE
*
fp
AND
char
const
*
fmt0
AND
_IO_va_list
ap
)
_IO_FILE
*
fp
;
char
const
*
fmt0
;
_IO_va_list
ap
;
{
{
register
const
char
*
fmt
;
/* format string */
register
const
char
*
fmt
;
/* format string */
register
int
ch
;
/* character from fmt */
register
int
ch
;
/* character from fmt */
...
...
libio/iovfscanf.c
View file @
e693cc28
...
@@ -119,9 +119,11 @@ extern double atof();
...
@@ -119,9 +119,11 @@ extern double atof();
*errp|=2 if we an invalid character. */
*errp|=2 if we an invalid character. */
int
int
DEFUN
(
_IO_vfscanf
,
(
fp
,
fmt0
,
ap
,
errp
),
_IO_vfscanf
(
fp
,
fmt0
,
ap
,
errp
)
register
_IO_FILE
*
fp
AND
char
const
*
fmt0
_IO_FILE
*
fp
;
AND
_IO_va_list
ap
AND
int
*
errp
)
char
const
*
fmt0
;
_IO_va_list
ap
;
int
*
errp
;
{
{
register
const
u_char
*
fmt
=
(
const
u_char
*
)
fmt0
;
register
const
u_char
*
fmt
=
(
const
u_char
*
)
fmt0
;
register
int
c
;
/* character from format, or conversion */
register
int
c
;
/* character from format, or conversion */
...
@@ -696,8 +698,9 @@ done:
...
@@ -696,8 +698,9 @@ done:
* considered part of the scanset.
* considered part of the scanset.
*/
*/
static
const
u_char
*
static
const
u_char
*
DEFUN
(
__sccl
,
(
tab
,
fmt
),
__sccl
(
tab
,
fmt
)
register
char
*
tab
AND
register
const
u_char
*
fmt
)
char
*
tab
;
const
u_char
*
fmt
;
{
{
register
int
c
,
n
,
v
;
register
int
c
,
n
,
v
;
...
...
libio/libio.h
View file @
e693cc28
/*
/*
Copyright (C) 1991, 92, 93, 94, 95, 97 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation
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
This library is free software; you can redistribute it and/or
terms of the GNU General Public License as published by the
modify it under the terms of the GNU General Public License as
Free Software Foundation; either version 2, or (at your option)
published by the Free Software Foundation; either version 2, or (at
any later version.
your option)
any later version.
This library is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful, but
but
WITHOUT ANY WARRANTY; without even the implied warranty of
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
GNU
General Public License for more details.
General Public License for more details.
You should have received a copy of the GNU General Public License
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
along with this library; see the file COPYING. If not, write to
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
As a special exception, if you link this library with files
the resulting executable to be covered by the GNU General Public License.
compiled with a GNU compiler to produce an executable, this does
This exception does not however invalidate any other reasons why
not cause the resulting executable to be covered by the GNU General
the executable file might be covered by the GNU General Public License. */
Public License. This exception does not however invalidate any
other reasons why the executable file might be covered by the GNU
/* This is part of the iostream library. Written by Per Bothner.
*/
General Public License.
*/
#ifndef _IO_STDIO_H
#ifndef _IO_STDIO_H
#define _IO_STDIO_H
#define _IO_STDIO_H
...
@@ -42,60 +42,56 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -42,60 +42,56 @@ the executable file might be covered by the GNU General Public License. */
#ifdef _G_NEED_STDARG_H
#ifdef _G_NEED_STDARG_H
/* This define avoids name pollution if we're using GNU stdarg.h */
/* This define avoids name pollution if we're using GNU stdarg.h */
#define __need___va_list
#
define __need___va_list
#include <stdarg.h>
#
include <stdarg.h>
#ifdef __GNUC_VA_LIST
#
ifdef __GNUC_VA_LIST
#undef _IO_va_list
#
undef _IO_va_list
#define _IO_va_list __gnuc_va_list
#
define _IO_va_list __gnuc_va_list
#endif
/* __GNUC_VA_LIST */
#
endif
/* __GNUC_VA_LIST */
#endif
#endif
#ifndef __P
#ifndef __P
#if _G_HAVE_SYS_CDEFS
#
if _G_HAVE_SYS_CDEFS
#include <sys/cdefs.h>
#
include <sys/cdefs.h>
#else
#
else
#ifdef __STDC__
#
ifdef __STDC__
#define __P(protos) protos
#
define __P(protos) protos
#else
#
else
#define __P(protos) ()
#
define __P(protos) ()
#endif
#
endif
#endif
#
endif
#endif
/*!__P*/
#endif
/*!__P*/
/* For backward compatibility */
/* For backward compatibility */
#ifndef _PARAMS
#ifndef _PARAMS
#define _PARAMS(protos) __P(protos)
#
define _PARAMS(protos) __P(protos)
#endif
/*!_PARAMS*/
#endif
/*!_PARAMS*/
#ifndef __STDC__
#ifndef __STDC__
#define const
# define const
#endif
#ifndef _G_NO_USE_DTOA
#define _IO_USE_DTOA
#else
#undef _IO_USE_DTOA
#endif
#endif
#define _IO_UNIFIED_JUMPTABLES 1
#define _IO_UNIFIED_JUMPTABLES 1
#if 0
#if 0
#ifdef _IO_NEED_STDARG_H
#
ifdef _IO_NEED_STDARG_H
#include <stdarg.h>
#
include <stdarg.h>
#endif
#
endif
#endif
#endif
#ifndef EOF
#ifndef EOF
#define EOF (-1)
#
define EOF (-1)
#endif
#endif
#ifndef NULL
#ifndef NULL
#ifdef __GNUG__
# if defined __GNUG__ && \
#define NULL (__null)
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
#else
# define NULL (__null)
#if !defined(__cplusplus)
# else
#define NULL ((void*)0)
# if !defined(__cplusplus)
#else
# define NULL ((void*)0)
#define NULL (0)
# else
#endif
# define NULL (0)
#endif
# endif
# endif
#endif
#endif
#define _IOS_INPUT 1
#define _IOS_INPUT 1
...
@@ -109,7 +105,7 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -109,7 +105,7 @@ the executable file might be covered by the GNU General Public License. */
/* Magic numbers and bits for the _flags field.
/* Magic numbers and bits for the _flags field.
The magic numbers use the high-order bits of _flags;
The magic numbers use the high-order bits of _flags;
the remaining bits are a
b
ailable for variable flags.
the remaining bits are a
v
ailable for variable flags.
Note: The magic numbers must all be negative if stdio
Note: The magic numbers must all be negative if stdio
emulation is desired. */
emulation is desired. */
...
@@ -130,6 +126,7 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -130,6 +126,7 @@ the executable file might be covered by the GNU General Public License. */
#define _IO_CURRENTLY_PUTTING 0x800
#define _IO_CURRENTLY_PUTTING 0x800
#define _IO_IS_APPENDING 0x1000
#define _IO_IS_APPENDING 0x1000
#define _IO_IS_FILEBUF 0x2000
#define _IO_IS_FILEBUF 0x2000
#define _IO_BAD_SEEN 0x4000
/* These are "formatting flags" matching the iostream fmtflags enum values. */
/* These are "formatting flags" matching the iostream fmtflags enum values. */
#define _IO_SKIPWS 01
#define _IO_SKIPWS 01
...
@@ -148,19 +145,21 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -148,19 +145,21 @@ the executable file might be covered by the GNU General Public License. */
#define _IO_UNITBUF 020000
#define _IO_UNITBUF 020000
#define _IO_STDIO 040000
#define _IO_STDIO 040000
#define _IO_DONT_CLOSE 0100000
#define _IO_DONT_CLOSE 0100000
#define _IO_BOOLALPHA 0200000
/* A streammarker remembers a position in a buffer. */
struct
_IO_jump_t
;
struct
_IO_FILE
;
struct
_IO_jump_t
;
struct
_IO_FILE
;
/* Handle lock. */
/* Handle lock. */
#ifdef _IO_MTSAFE_IO
#ifdef _IO_MTSAFE_IO
# include <stdio-lock.h>
# include <
bits/
stdio-lock.h>
#else
#else
typedef
void
_IO_lock_t
;
typedef
void
_IO_lock_t
;
#endif
#endif
/* A streammarker remembers a position in a buffer. */
struct
_IO_marker
{
struct
_IO_marker
{
struct
_IO_marker
*
_next
;
struct
_IO_marker
*
_next
;
struct
_IO_FILE
*
_sbuf
;
struct
_IO_FILE
*
_sbuf
;
...
@@ -181,11 +180,7 @@ struct _IO_marker {
...
@@ -181,11 +180,7 @@ struct _IO_marker {
};
};
struct
_IO_FILE
{
struct
_IO_FILE
{
#if _G_USE_INT32_FLAGS
int
_flags
;
/* High-order word is _IO_MAGIC; rest is flags. */
_G_int32_t
_flags
;
/* High-order word is _IO_MAGIC; rest is flags. */
#else
int
_flags
;
#endif
#define _IO_file_flags _flags
#define _IO_file_flags _flags
/* The following pointers correspond to the C++ streambuf protocol. */
/* The following pointers correspond to the C++ streambuf protocol. */
...
@@ -256,22 +251,22 @@ struct _IO_cookie_file
...
@@ -256,22 +251,22 @@ struct _IO_cookie_file
extern
"C"
{
extern
"C"
{
#endif
#endif
extern
int
__underflow
__P
((
_IO_FILE
*
));
extern
int
__underflow
__P
((
_IO_FILE
*
));
extern
int
__uflow
__P
((
_IO_FILE
*
));
extern
int
__uflow
__P
((
_IO_FILE
*
));
extern
int
__overflow
__P
((
_IO_FILE
*
,
int
));
extern
int
__overflow
__P
((
_IO_FILE
*
,
int
));
#define _IO_getc_unlocked(_fp) \
#define _IO_getc_unlocked(_fp) \
((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow(_fp) \
((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end ? __uflow
(_fp) \
: *(unsigned char
*)
(_fp)->_IO_read_ptr++)
: *(unsigned char
*)
(_fp)->_IO_read_ptr++)
#define _IO_peekc_unlocked(_fp) \
#define _IO_peekc_unlocked(_fp) \
((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end \
((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end \
&& __underflow(_fp) == EOF ? EOF \
&& __underflow
(_fp) == EOF ? EOF \
: *(unsigned char
*)
(_fp)->_IO_read_ptr)
: *(unsigned char
*)
(_fp)->_IO_read_ptr)
#define _IO_putc_unlocked(_ch, _fp) \
#define _IO_putc_unlocked(_ch, _fp) \
(((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
(((_fp)->_IO_write_ptr >= (_fp)->_IO_write_end) \
? __overflow
(_fp, (unsigned char)
(_ch)) \
? __overflow
(_fp, (unsigned char)
(_ch)) \
: (unsigned char)(*(_fp)->_IO_write_ptr++ = (_ch)))
: (unsigned char)
(*(_fp)->_IO_write_ptr++ = (_ch)))
#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
#define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
...
@@ -301,15 +296,15 @@ extern int _IO_ftrylockfile __P ((_IO_FILE *));
...
@@ -301,15 +296,15 @@ extern int _IO_ftrylockfile __P ((_IO_FILE *));
#define _IO_peekc(_fp) _IO_peekc_locked (_fp)
#define _IO_peekc(_fp) _IO_peekc_locked (_fp)
extern
int
_IO_vfscanf
__P
((
_IO_FILE
*
,
const
char
*
,
_IO_va_list
,
int
*
));
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
));
extern
int
_IO_vfprintf
__P
((
_IO_FILE
*
,
const
char
*
,
_IO_va_list
));
extern
_IO_ssize_t
_IO_padn
__P
((
_IO_FILE
*
,
int
,
_IO_ssize_t
));
extern
_IO_ssize_t
_IO_padn
__P
((
_IO_FILE
*
,
int
,
_IO_ssize_t
));
extern
_IO_size_t
_IO_sgetn
__P
((
_IO_FILE
*
,
void
*
,
_IO_size_t
));
extern
_IO_size_t
_IO_sgetn
__P
((
_IO_FILE
*
,
void
*
,
_IO_size_t
));
extern
_IO_fpos_t
_IO_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
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
_IO_fpos_t
_IO_seekpos
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
extern
void
_IO_free_backup_area
__P
((
_IO_FILE
*
));
extern
void
_IO_free_backup_area
__P
((
_IO_FILE
*
));
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
libio/libioP.h
View file @
e693cc28
...
@@ -24,36 +24,16 @@
...
@@ -24,36 +24,16 @@
General Public License. */
General Public License. */
#include <errno.h>
#include <errno.h>
#ifndef errno
/* This is a hack until Uli gets me the real fix. */
extern
int
errno
;
#endif
#ifndef __set_errno
/* This is a GNU libc special. Simply set errno to the given value here. */
#define __set_errno(Val) (errno = (Val))
#define __set_errno(Val) (errno = (Val))
#if defined __GLIBC__ && __GLIBC__ >= 2
# include <bits/libc-lock.h>
#else
/*# include <comthread.h>*/
#endif
#endif
#include <stdio-lock.h>
#include "iolibio.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
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
...
@@ -71,11 +51,11 @@ extern "C" {
...
@@ -71,11 +51,11 @@ extern "C" {
* a jump table (of pointers to functions). The pointer is accessed
* a jump table (of pointers to functions). The pointer is accessed
* with the _IO_JUMPS macro. The jump table has a eccentric format,
* with the _IO_JUMPS macro. The jump table has a eccentric format,
* so as to be compatible with the layout of a C++ virtual function table.
* so as to be compatible with the layout of a C++ virtual function table.
* (as implemented by g++). When a pointer to a steambuf object is
* (as implemented by g++). When a pointer to a st
r
eambuf object is
* coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
* coerced to an (_IO_FILE*), then _IO_JUMPS on the result just
* happens to point to the virtual function table of the streambuf.
* happens to point to the virtual function table of the streambuf.
* Thus the _IO_JUMPS function table used for C stdio/libio does
* Thus the _IO_JUMPS function table used for C stdio/libio does
* double duty as the virtual functi
u
on table for C++ streambuf.
* double duty as the virtual function table for C++ streambuf.
*
*
* The entries in the _IO_JUMPS function table (and hence also the
* The entries in the _IO_JUMPS function table (and hence also the
* virtual functions of a streambuf) are described below.
* virtual functions of a streambuf) are described below.
...
@@ -83,107 +63,108 @@ extern "C" {
...
@@ -83,107 +63,108 @@ extern "C" {
* object being acted on (i.e. the 'this' parameter).
* object being acted on (i.e. the 'this' parameter).
*/
*/
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus
*)
(THIS))->vtable
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus
*)
(THIS))->vtable
#ifdef _G_USING_THUNKS
#ifdef _G_USING_THUNKS
#define JUMP_FIELD(TYPE, NAME) TYPE NAME
#
define JUMP_FIELD(TYPE, NAME) TYPE NAME
#
define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC
(THIS)
#
define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC
(THIS)
#
define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC
(THIS, X1)
#
define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC
(THIS, X1)
#
define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC
(THIS, X1, X2)
#
define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC
(THIS, X1, X2)
#
define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC
(THIS, X1,X2, X3)
#
define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC
(THIS, X1,X2, X3)
#define JUMP_INIT(NAME, VALUE) VALUE
#
define JUMP_INIT(NAME, VALUE) VALUE
#
define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT
(dummy2, 0)
#
define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0), JUMP_INIT
(dummy2, 0)
#else
#else
/* These macros will change when we re-implement vtables to use "thunks"! */
/* These macros will change when we re-implement vtables to use "thunks"! */
#define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME
#
define JUMP_FIELD(TYPE, NAME) struct { short delta1, delta2; TYPE pfn; } NAME
#
define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn
(THIS)
#
define JUMP0(FUNC, THIS) _IO_JUMPS(THIS)->FUNC.pfn
(THIS)
#
define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC.pfn
(THIS, X1)
#
define JUMP1(FUNC, THIS, X1) _IO_JUMPS(THIS)->FUNC.pfn
(THIS, X1)
#
define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC.pfn
(THIS, X1, X2)
#
define JUMP2(FUNC, THIS, X1, X2) _IO_JUMPS(THIS)->FUNC.pfn
(THIS, X1, X2)
#
define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC.pfn(THIS, X1,X2,
X3)
#
define JUMP3(FUNC, THIS, X1,X2,X3) _IO_JUMPS(THIS)->FUNC.pfn (THIS, X1,X2,
X3)
#define JUMP_INIT(NAME, VALUE) {0, 0, VALUE}
#
define JUMP_INIT(NAME, VALUE) {0, 0, VALUE}
#define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0)
#
define JUMP_INIT_DUMMY JUMP_INIT(dummy, 0)
#endif
#endif
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
It does not delete (free) it, but does everything else to finalize it/
It does not delete (free) it, but does everything else to finalize it/
It matches the streambuf::~streambuf virtual destructor. */
It matches the streambuf::~streambuf virtual destructor. */
typedef
void
(
*
_IO_finish_t
)
__P
((
_IO_FILE
*
,
int
));
/* finalize */
typedef
void
(
*
_IO_finish_t
)
__P
((
_IO_FILE
*
,
int
));
/* finalize */
#define _IO_FINISH(FP) JUMP1(__finish, FP, 0)
#define _IO_FINISH(FP) JUMP1
(__finish, FP, 0)
/* The 'overflow' hook flushes the buffer.
/* The 'overflow' hook flushes the buffer.
The second argument is a character, or EOF.
The second argument is a character, or EOF.
It matches the streambuf::overflow virtual function. */
It matches the streambuf::overflow virtual function. */
typedef
int
(
*
_IO_overflow_t
)
__P
((
_IO_FILE
*
,
int
));
typedef
int
(
*
_IO_overflow_t
)
__P
((
_IO_FILE
*
,
int
));
#define _IO_OVERFLOW(FP, CH) JUMP1(__overflow, FP, CH)
#define _IO_OVERFLOW(FP, CH) JUMP1
(__overflow, FP, CH)
/* The 'underflow' hook tries to fills the get buffer.
/* The 'underflow' hook tries to fills the get buffer.
It returns the next character (as an unsigned char) or EOF. The next
It returns the next character (as an unsigned char) or EOF. The next
character remains in the get buffer, and the get postion is not changed.
character remains in the get buffer, and the get pos
i
tion is not changed.
It matches the streambuf::underflow virtual function. */
It matches the streambuf::underflow virtual function. */
typedef
int
(
*
_IO_underflow_t
)
__P
((
_IO_FILE
*
));
typedef
int
(
*
_IO_underflow_t
)
__P
((
_IO_FILE
*
));
#define _IO_UNDERFLOW(FP) JUMP0(__underflow, FP)
#define _IO_UNDERFLOW(FP) JUMP0
(__underflow, FP)
/* The 'uflow' hook returns the next character in the input stream
/* The 'uflow' hook returns the next character in the input stream
(cast to unsigned char), and increments the read position;
(cast to unsigned char), and increments the read position;
EOF is returned on failure.
EOF is returned on failure.
It matches the streambuf::uflow virtual function, which is not in the
It matches the streambuf::uflow virtual function, which is not in the
cfront implementation, but was added to C++ by the ANSI/ISO committee. */
cfront implementation, but was added to C++ by the ANSI/ISO committee. */
#define _IO_UFLOW(FP) JUMP0(__uflow, FP)
#define _IO_UFLOW(FP) JUMP0
(__uflow, FP)
/* The 'pbackfail' hook handles backing up.
/* The 'pbackfail' hook handles backing up.
It matches the streambuf::pbackfail virtual function. */
It matches the streambuf::pbackfail virtual function. */
typedef
int
(
*
_IO_pbackfail_t
)
__P
((
_IO_FILE
*
,
int
));
typedef
int
(
*
_IO_pbackfail_t
)
__P
((
_IO_FILE
*
,
int
));
#define _IO_PBACKFAIL(FP, CH) JUMP1(__pbackfail, FP, CH)
#define _IO_PBACKFAIL(FP, CH) JUMP1
(__pbackfail, FP, CH)
/* The 'xsputn' hook writes upto N characters from buffer DATA.
/* The 'xsputn' hook writes upto N characters from buffer DATA.
Returns the number of character actually written.
Returns the number of character actually written.
It matches the streambuf::xsputn virtual function. */
It matches the streambuf::xsputn virtual function. */
typedef
_IO_size_t
(
*
_IO_xsputn_t
)
typedef
_IO_size_t
(
*
_IO_xsputn_t
)
__P
((
_IO_FILE
*
FP
,
const
void
*
DATA
,
__P
((
_IO_FILE
*
FP
,
const
void
*
DATA
,
_IO_size_t
N
));
_IO_size_t
N
));
#define _IO_XSPUTN(FP, DATA, N) JUMP2(__xsputn, FP, DATA, N)
#define _IO_XSPUTN(FP, DATA, N) JUMP2
(__xsputn, FP, DATA, N)
/* The 'xsgetn' hook reads upto N characters into buffer DATA.
/* The 'xsgetn' hook reads upto N characters into buffer DATA.
Returns the number of character actually read.
Returns the number of character actually read.
It matches the streambuf::xsgetn virtual function. */
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
,
#define _IO_XSGETN(FP, DATA, N) JUMP2(__xsgetn, FP, DATA, N)
_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
/* The 'seekoff' hook moves the stream position to a new position
relative to the start of the file (if DIR==0), the current position
relative to the start of the file (if DIR==0), the current position
(MODE==1), or the end of the file (MODE==2).
(MODE==1), or the end of the file (MODE==2).
It matches the streambuf::seekoff virtual function.
It matches the streambuf::seekoff virtual function.
It is also used for the ANSI fseek function. */
It is also used for the ANSI fseek function. */
typedef
_IO_fpos_t
(
*
_IO_seekoff_t
)
typedef
_IO_fpos_t
(
*
_IO_seekoff_t
)
__P
((
_IO_FILE
*
FP
,
_IO_off_t
OFF
,
__P
((
_IO_FILE
*
FP
,
_IO_off_t
OFF
,
int
DIR
,
int
MODE
));
int
DIR
,
int
MODE
));
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3(__seekoff, FP, OFF, DIR, MODE)
#define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3
(__seekoff, FP, OFF, DIR, MODE)
/* The 'seekpos' hook also moves the stream position,
/* The 'seekpos' hook also moves the stream position,
but to an absolute position given by a fpos_t (seekpos).
but to an absolute position given by a fpos_t (seekpos).
It matches the streambuf::seekpos virtual function.
It matches the streambuf::seekpos virtual function.
It is also used for the ANSI fgetpos and fsetpos functions. */
It is also used for the ANSI fgetpos and fsetpos functions. */
/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
/* The _IO_seek_cur and _IO_seek_end options are not allowed. */
typedef
_IO_fpos_t
(
*
_IO_seekpos_t
)
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
typedef
_IO_fpos_t
(
*
_IO_seekpos_t
)
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2(__seekpos, FP, POS, FLAGS)
#define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2
(__seekpos, FP, POS, FLAGS)
/* The 'setbuf' hook gives a buffer to the file.
/* The 'setbuf' hook gives a buffer to the file.
It matches the streambuf::setbuf virtual function. */
It matches the streambuf::setbuf virtual function. */
typedef
_IO_FILE
*
(
*
_IO_setbuf_t
)
__P
((
_IO_FILE
*
,
char
*
,
_IO_ssize_t
));
typedef
_IO_FILE
*
(
*
_IO_setbuf_t
)
__P
((
_IO_FILE
*
,
char
*
,
_IO_ssize_t
));
#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2(__setbuf, FP, BUFFER, LENGTH)
#define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2
(__setbuf, FP, BUFFER, LENGTH)
/* The 'sync' hook attempts to synchronize the internal data structures
/* The 'sync' hook attempts to synchronize the internal data structures
of the file with the external state.
of the file with the external state.
It matches the streambuf::sync virtual function. */
It matches the streambuf::sync virtual function. */
typedef
int
(
*
_IO_sync_t
)
__P
((
_IO_FILE
*
));
typedef
int
(
*
_IO_sync_t
)
__P
((
_IO_FILE
*
));
#define _IO_SYNC(FP) JUMP0(__sync, FP)
#define _IO_SYNC(FP) JUMP0
(__sync, FP)
/* The 'doallocate' hook is used to tell the file to allocate a buffer.
/* The 'doallocate' hook is used to tell the file to allocate a buffer.
It matches the streambuf::doallocate virtual function, which is not
It matches the streambuf::doallocate virtual function, which is not
in the ANSI/ISO C++ standard, but is part traditional implementations. */
in the ANSI/ISO C++ standard, but is part traditional implementations. */
typedef
int
(
*
_IO_doallocate_t
)
__P
((
_IO_FILE
*
));
typedef
int
(
*
_IO_doallocate_t
)
__P
((
_IO_FILE
*
));
#define _IO_DOALLOCATE(FP) JUMP0(__doallocate, FP)
#define _IO_DOALLOCATE(FP) JUMP0
(__doallocate, FP)
/* The following four hooks (sysread, syswrite, sysclose, sysseek, and
/* The following four hooks (sysread, syswrite, sysclose, sysseek, and
sysstat) are low-level hooks specific to this implementation.
sysstat) are low-level hooks specific to this implementation.
There is no correspond
a
nce in the ANSI/ISO C++ standard library.
There is no correspond
e
nce in the ANSI/ISO C++ standard library.
The hooks basically correspond to the Unix system functions
The hooks basically correspond to the Unix system functions
(read, write, close, lseek, and stat) except that a _IO_FILE*
(read, write, close, lseek, and stat) except that a _IO_FILE*
parameter is used instead of a integer file descriptor; the default
parameter is used instead of a integer file descriptor; the default
...
@@ -195,43 +176,44 @@ typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
...
@@ -195,43 +176,44 @@ typedef int (*_IO_doallocate_t) __P((_IO_FILE*));
/* The 'sysread' hook is used to read data from the external file into
/* The 'sysread' hook is used to read data from the external file into
an existing buffer. It generalizes the Unix read(2) function.
an existing buffer. It generalizes the Unix read(2) function.
It matches the streambuf::sys_read virtual function, which is
It matches the streambuf::sys_read virtual function, which is
specific to this implementaion. */
specific to this implementa
t
ion. */
typedef
_IO_ssize_t
(
*
_IO_read_t
)
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
typedef
_IO_ssize_t
(
*
_IO_read_t
)
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
#define _IO_SYSREAD(FP, DATA, LEN) JUMP2(__read, FP, DATA, LEN)
#define _IO_SYSREAD(FP, DATA, LEN) JUMP2
(__read, FP, DATA, LEN)
/* The 'syswrite' hook is used to write data from an existing buffer
/* The 'syswrite' hook is used to write data from an existing buffer
to an external file. It generalizes the Unix write(2) function.
to an external file. It generalizes the Unix write(2) function.
It matches the streambuf::sys_write virtual function, which is
It matches the streambuf::sys_write virtual function, which is
specific to this implementaion. */
specific to this implementa
t
ion. */
typedef
_IO_ssize_t
(
*
_IO_write_t
)
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_ssize_t
));
typedef
_IO_ssize_t
(
*
_IO_write_t
)
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_ssize_t
));
#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2(__write, FP, DATA, LEN)
#define _IO_SYSWRITE(FP, DATA, LEN) JUMP2
(__write, FP, DATA, LEN)
/* The 'sysseek' hook is used to re-position an external file.
/* The 'sysseek' hook is used to re-position an external file.
It generalizes the Unix lseek(2) function.
It generalizes the Unix lseek(2) function.
It matches the streambuf::sys_seek virtual function, which is
It matches the streambuf::sys_seek virtual function, which is
specific to this implementaion. */
specific to this implementa
t
ion. */
typedef
_IO_fpos_t
(
*
_IO_seek_t
)
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
typedef
_IO_fpos_t
(
*
_IO_seek_t
)
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2(__seek, FP, OFFSET, MODE)
#define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2
(__seek, FP, OFFSET, MODE)
/* The 'sysclose' hook is used to finalize (close, finish up) an
/* The 'sysclose' hook is used to finalize (close, finish up) an
external file. It generalizes the Unix close(2) function.
external file. It generalizes the Unix close(2) function.
It matches the streambuf::sys_close virtual function, which is
It matches the streambuf::sys_close virtual function, which is
specific to this implementation. */
specific to this implementation. */
typedef
int
(
*
_IO_close_t
)
__P
((
_IO_FILE
*
));
/* finalize */
typedef
int
(
*
_IO_close_t
)
__P
((
_IO_FILE
*
));
/* finalize */
#define _IO_SYSCLOSE(FP) JUMP0(__close, FP)
#define _IO_SYSCLOSE(FP) JUMP0
(__close, FP)
/* The 'sysstat' hook is used to get information about an external file
/* The 'sysstat' hook is used to get information about an external file
into a struct stat buffer. It generalizes the Unix fstat(2) call.
into a struct stat buffer. It generalizes the Unix fstat(2) call.
It matches the streambuf::sys_stat virtual function, which is
It matches the streambuf::sys_stat virtual function, which is
specific to this implementaion. */
specific to this implementa
t
ion. */
typedef
int
(
*
_IO_stat_t
)
__P
((
_IO_FILE
*
,
void
*
));
typedef
int
(
*
_IO_stat_t
)
__P
((
_IO_FILE
*
,
void
*
));
#define _IO_SYSSTAT(FP, BUF) JUMP1(__stat, FP, BUF)
#define _IO_SYSSTAT(FP, BUF) JUMP1
(__stat, FP, BUF)
#define _IO_CHAR_TYPE char
/* unsigned char ? */
#define _IO_CHAR_TYPE char
/* unsigned char ? */
#define _IO_INT_TYPE int
#define _IO_INT_TYPE int
struct
_IO_jump_t
{
struct
_IO_jump_t
{
JUMP_FIELD
(
_G_size_t
,
__dummy
);
JUMP_FIELD
(
_G_size_t
,
__dummy
);
#ifdef _G_USING_THUNKS
#ifdef _G_USING_THUNKS
JUMP_FIELD
(
_G_size_t
,
__dummy2
);
JUMP_FIELD
(
_G_size_t
,
__dummy2
);
...
@@ -265,63 +247,69 @@ struct _IO_jump_t {
...
@@ -265,63 +247,69 @@ struct _IO_jump_t {
This is for compatibility with C++ streambuf; the word can
This is for compatibility with C++ streambuf; the word can
be used to smash to a pointer to a virtual function table. */
be used to smash to a pointer to a virtual function table. */
struct
_IO_FILE_plus
{
struct
_IO_FILE_plus
{
_IO_FILE
file
;
_IO_FILE
file
;
const
struct
_IO_jump_t
*
vtable
;
const
struct
_IO_jump_t
*
vtable
;
};
};
/* Generic functions */
/* Generic functions */
extern
_IO_fpos_t
_IO_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
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
_IO_fpos_t
_IO_seekpos
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
extern
int
_IO_switch_to_get_mode
__P
((
_IO_FILE
*
));
extern
void
_IO_switch_to_main_get_area
__P
((
_IO_FILE
*
));
extern
void
_IO_init
__P
((
_IO_FILE
*
,
int
));
extern
void
_IO_switch_to_backup_area
__P
((
_IO_FILE
*
));
extern
int
_IO_sputbackc
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_switch_to_get_mode
__P
((
_IO_FILE
*
));
extern
int
_IO_sungetc
__P
((
_IO_FILE
*
));
extern
void
_IO_init
__P
((
_IO_FILE
*
,
int
));
extern
void
_IO_un_link
__P
((
_IO_FILE
*
));
extern
int
_IO_sputbackc
__P
((
_IO_FILE
*
,
int
));
extern
void
_IO_link_in
__P
((
_IO_FILE
*
));
extern
int
_IO_sungetc
__P
((
_IO_FILE
*
));
extern
void
_IO_doallocbuf
__P
((
_IO_FILE
*
));
extern
void
_IO_un_link
__P
((
_IO_FILE
*
));
extern
void
_IO_unsave_markers
__P
((
_IO_FILE
*
));
extern
void
_IO_link_in
__P
((
_IO_FILE
*
));
extern
void
_IO_setb
__P
((
_IO_FILE
*
,
char
*
,
char
*
,
int
));
extern
void
_IO_doallocbuf
__P
((
_IO_FILE
*
));
extern
unsigned
_IO_adjust_column
__P
((
unsigned
,
const
char
*
,
int
));
extern
void
_IO_unsave_markers
__P
((
_IO_FILE
*
));
#define _IO_sputn(__fp, __s, __n) _IO_XSPUTN(__fp, __s, __n)
extern
void
_IO_setb
__P
((
_IO_FILE
*
,
char
*
,
char
*
,
int
));
extern
unsigned
_IO_adjust_column
__P
((
unsigned
,
const
char
*
,
int
));
#define _IO_sputn(__fp, __s, __n) _IO_XSPUTN (__fp, __s, __n)
/* Marker-related function. */
/* Marker-related function. */
extern
void
_IO_init_marker
__P
((
struct
_IO_marker
*
,
_IO_FILE
*
));
extern
void
_IO_init_marker
__P
((
struct
_IO_marker
*
,
_IO_FILE
*
));
extern
void
_IO_remove_marker
__P
((
struct
_IO_marker
*
));
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
*
,
extern
int
_IO_marker_delta
__P
((
struct
_IO_marker
*
));
struct
_IO_marker
*
));
extern
int
_IO_seekmark
__P
((
_IO_FILE
*
,
struct
_IO_marker
*
,
int
));
extern
int
_IO_marker_delta
__P
((
struct
_IO_marker
*
));
extern
int
_IO_seekmark
__P
((
_IO_FILE
*
,
struct
_IO_marker
*
,
int
));
/* Default jumptable functions. */
/* Default jumptable functions. */
extern
int
_IO_default_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_default_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_default_uflow
__P
((
_IO_FILE
*
));
extern
int
_IO_default_uflow
__P
((
_IO_FILE
*
));
extern
int
_IO_default_doallocate
__P
((
_IO_FILE
*
));
extern
int
_IO_default_doallocate
__P
((
_IO_FILE
*
));
extern
void
_IO_default_finish
__P
((
_IO_FILE
*
,
int
));
extern
void
_IO_default_finish
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_default_pbackfail
__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_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
*
,
extern
_IO_size_t
_IO_default_xsgetn
__P
((
_IO_FILE
*
,
void
*
,
_IO_size_t
));
_IO_size_t
));
extern
_IO_fpos_t
_IO_default_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
_IO_size_t
_IO_default_xsgetn
__P
((
_IO_FILE
*
,
void
*
,
_IO_size_t
));
extern
_IO_fpos_t
_IO_default_seekpos
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
extern
_IO_fpos_t
_IO_default_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
_IO_ssize_t
_IO_default_write
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_ssize_t
));
extern
_IO_fpos_t
_IO_default_seekpos
__P
((
_IO_FILE
*
,
_IO_fpos_t
,
int
));
extern
_IO_ssize_t
_IO_default_read
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
extern
_IO_ssize_t
_IO_default_write
__P
((
_IO_FILE
*
,
const
void
*
,
extern
int
_IO_default_stat
__P
((
_IO_FILE
*
,
void
*
));
_IO_ssize_t
));
extern
_IO_fpos_t
_IO_default_seek
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
extern
_IO_ssize_t
_IO_default_read
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
extern
int
_IO_default_sync
__P
((
_IO_FILE
*
));
extern
int
_IO_default_stat
__P
((
_IO_FILE
*
,
void
*
));
#define _IO_default_close ((_IO_close_t)_IO_default_sync)
extern
_IO_fpos_t
_IO_default_seek
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
extern
int
_IO_default_sync
__P
((
_IO_FILE
*
));
#define _IO_default_close ((_IO_close_t) _IO_default_sync)
extern
struct
_IO_jump_t
_IO_file_jumps
;
extern
struct
_IO_jump_t
_IO_file_jumps
;
extern
struct
_IO_jump_t
_IO_streambuf_jumps
;
extern
struct
_IO_jump_t
_IO_streambuf_jumps
;
extern
struct
_IO_jump_t
_IO_proc_jumps
;
extern
struct
_IO_jump_t
_IO_proc_jumps
;
extern
struct
_IO_jump_t
_IO_str_jumps
;
extern
struct
_IO_jump_t
_IO_str_jumps
;
extern
int
_IO_do_write
__P
((
_IO_FILE
*
,
const
char
*
,
_IO_size_t
));
extern
int
_IO_do_write
__P
((
_IO_FILE
*
,
const
char
*
,
_IO_size_t
));
extern
int
_IO_flush_all
__P
((
void
));
extern
int
_IO_flush_all
__P
((
void
));
extern
void
_IO_cleanup
__P
((
void
));
extern
void
_IO_cleanup
__P
((
void
));
extern
void
_IO_flush_all_linebuffered
__P
((
void
));
extern
void
_IO_flush_all_linebuffered
__P
((
void
));
#define _IO_do_flush(_f) \
#define _IO_do_flush(_f) \
_IO_do_write(_f, (_f)->_IO_write_base, \
_IO_do_write(_f, (_f)->_IO_write_base, \
...
@@ -340,42 +328,41 @@ extern void _IO_flush_all_linebuffered __P((void));
...
@@ -340,42 +328,41 @@ extern void _IO_flush_all_linebuffered __P((void));
/* Jumptable functions for files. */
/* Jumptable functions for files. */
extern
int
_IO_file_doallocate
__P
((
_IO_FILE
*
));
extern
int
_IO_file_doallocate
__P
((
_IO_FILE
*
));
extern
_IO_FILE
*
_IO_file_setbuf
__P
((
_IO_FILE
*
,
char
*
,
_IO_ssize_t
));
extern
_IO_FILE
*
_IO_file_setbuf
__P
((
_IO_FILE
*
,
char
*
,
_IO_ssize_t
));
extern
_IO_fpos_t
_IO_file_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
_IO_fpos_t
_IO_file_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
_IO_size_t
_IO_file_xsputn
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_size_t
));
extern
_IO_size_t
_IO_file_xsputn
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_size_t
));
extern
int
_IO_file_stat
__P
((
_IO_FILE
*
,
void
*
));
extern
int
_IO_file_stat
__P
((
_IO_FILE
*
,
void
*
));
extern
int
_IO_file_close
__P
((
_IO_FILE
*
));
extern
int
_IO_file_close
__P
((
_IO_FILE
*
));
extern
int
_IO_file_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_file_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_file_overflow
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_file_overflow
__P
((
_IO_FILE
*
,
int
));
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
#define _IO_file_is_open(__fp) ((__fp)->_fileno >= 0)
extern
void
_IO_file_init
__P
((
_IO_FILE
*
));
extern
void
_IO_file_init
__P
((
_IO_FILE
*
));
extern
_IO_FILE
*
_IO_file_fopen
__P
((
_IO_FILE
*
,
const
char
*
,
const
char
*
));
extern
_IO_FILE
*
_IO_file_attach
__P
((
_IO_FILE
*
,
int
));
extern
_IO_ssize_t
_IO_file_write
__P
((
_IO_FILE
*
,
const
void
*
,
_IO_ssize_t
));
extern
_IO_FILE
*
_IO_file_fopen
__P
((
_IO_FILE
*
,
const
char
*
,
const
char
*
));
extern
_IO_ssize_t
_IO_file_read
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
extern
_IO_ssize_t
_IO_file_write
__P
((
_IO_FILE
*
,
const
void
*
,
extern
int
_IO_file_sync
__P
((
_IO_FILE
*
));
_IO_ssize_t
));
extern
int
_IO_file_close_it
__P
((
_IO_FILE
*
));
extern
_IO_ssize_t
_IO_file_read
__P
((
_IO_FILE
*
,
void
*
,
_IO_ssize_t
));
extern
_IO_fpos_t
_IO_file_seek
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
extern
int
_IO_file_sync
__P
((
_IO_FILE
*
));
extern
void
_IO_file_finish
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_file_close_it
__P
((
_IO_FILE
*
));
extern
_IO_fpos_t
_IO_file_seek
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
));
/* Other file functions. */
extern
void
_IO_file_finish
__P
((
_IO_FILE
*
,
int
));
extern
_IO_FILE
*
_IO_file_attach
__P
((
_IO_FILE
*
,
int
));
/* Jumptable functions for proc_files. */
/* Jumptable functions for proc_files. */
extern
_IO_FILE
*
_IO_proc_open
__P
((
_IO_FILE
*
,
const
char
*
,
const
char
*
));
extern
_IO_FILE
*
_IO_proc_open
__P
((
_IO_FILE
*
,
const
char
*
,
const
char
*
));
extern
int
_IO_proc_close
__P
((
_IO_FILE
*
));
extern
int
_IO_proc_close
__P
((
_IO_FILE
*
));
/* Jumptable functions for strfiles. */
/* Jumptable functions for strfiles. */
extern
int
_IO_str_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_str_underflow
__P
((
_IO_FILE
*
));
extern
int
_IO_str_overflow
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_str_overflow
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_str_pbackfail
__P
((
_IO_FILE
*
,
int
));
extern
int
_IO_str_pbackfail
__P
((
_IO_FILE
*
,
int
));
extern
_IO_fpos_t
_IO_str_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
_IO_fpos_t
_IO_str_seekoff
__P
((
_IO_FILE
*
,
_IO_off_t
,
int
,
int
));
extern
void
_IO_str_finish
__P
((
_IO_FILE
*
,
int
));
extern
void
_IO_str_finish
__P
((
_IO_FILE
*
,
int
));
/* Other strfile functions */
/* Other strfile functions */
extern
void
_IO_str_init_static
__P
((
_IO_FILE
*
,
char
*
,
int
,
char
*
));
extern
void
_IO_str_init_static
__P
((
_IO_FILE
*
,
char
*
,
int
,
char
*
));
extern
void
_IO_str_init_readonly
__P
((
_IO_FILE
*
,
const
char
*
,
int
));
extern
void
_IO_str_init_readonly
__P
((
_IO_FILE
*
,
const
char
*
,
int
));
extern
_IO_ssize_t
_IO_str_count
__P
((
_IO_FILE
*
));
extern
_IO_ssize_t
_IO_str_count
__P
((
_IO_FILE
*
));
extern
int
_IO_vasprintf
__P
((
char
**
result_ptr
,
__const
char
*
format
,
extern
int
_IO_vasprintf
__P
((
char
**
result_ptr
,
__const
char
*
format
,
_IO_va_list
args
));
_IO_va_list
args
));
...
@@ -384,89 +371,97 @@ extern int _IO_vsnprintf __P ((char *string, _IO_size_t maxlen,
...
@@ -384,89 +371,97 @@ extern int _IO_vsnprintf __P ((char *string, _IO_size_t maxlen,
__const
char
*
format
,
_IO_va_list
args
));
__const
char
*
format
,
_IO_va_list
args
));
extern
_IO_size_t
_IO_getline
__P
((
_IO_FILE
*
,
char
*
,
_IO_size_t
,
int
,
int
));
extern
_IO_size_t
_IO_getline
__P
((
_IO_FILE
*
,
char
*
,
_IO_size_t
,
int
,
int
));
extern
_IO_ssize_t
_IO_getdelim
__P
((
char
**
,
_IO_size_t
*
,
int
,
_IO_FILE
*
));
extern
_IO_ssize_t
_IO_getdelim
__P
((
char
**
,
_IO_size_t
*
,
int
,
_IO_FILE
*
));
extern
double
_IO_strtod
__P
((
const
char
*
,
char
**
));
extern
double
_IO_strtod
__P
((
const
char
*
,
char
**
));
extern
char
*
_IO_dtoa
__P
((
double
__d
,
int
__mode
,
int
__ndigits
,
extern
char
*
_IO_dtoa
__P
((
double
__d
,
int
__mode
,
int
__ndigits
,
int
*
__decpt
,
int
*
__sign
,
char
**
__rve
));
int
*
__decpt
,
int
*
__sign
,
char
**
__rve
));
extern
int
_IO_outfloat
__P
((
double
__value
,
_IO_FILE
*
__sb
,
int
__type
,
extern
int
_IO_outfloat
__P
((
double
__value
,
_IO_FILE
*
__sb
,
int
__type
,
int
__width
,
int
__precision
,
int
__flags
,
int
__width
,
int
__precision
,
int
__flags
,
int
__sign_mode
,
int
__fill
));
int
__sign_mode
,
int
__fill
));
extern
_IO_FILE
*
_IO_list_all
;
extern
_IO_FILE
*
_IO_list_all
;
extern
void
(
*
_IO_cleanup_registration_needed
)
__P
((
void
));
extern
void
(
*
_IO_cleanup_registration_needed
)
__P
((
void
));
#ifndef EOF
#ifndef EOF
#define EOF (-1)
#
define EOF (-1)
#endif
#endif
#ifndef NULL
#ifndef NULL
#ifdef __GNUG__
# if defined __GNUG__ && \
#define NULL (__null)
(__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
#else
# define NULL (__null)
#if !defined(__cplusplus)
# else
#define NULL ((void*)0)
# if !defined(__cplusplus)
#else
# define NULL ((void*)0)
#define NULL (0)
# else
#endif
# define NULL (0)
#endif
# endif
# endif
#endif
#endif
#if _G_HAVE_MMAP
#if _G_HAVE_MMAP
#include <unistd.h>
#
include <unistd.h>
#include <fcntl.h>
#
include <fcntl.h>
#include <sys/mman.h>
#
include <sys/mman.h>
#include <sys/param.h>
#
include <sys/param.h>
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#
if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#
define MAP_ANONYMOUS MAP_ANON
#endif
#
endif
#if !defined(MAP_ANONYMOUS) || !defined(EXEC_PAGESIZE)
#
if !defined(MAP_ANONYMOUS) || !defined(EXEC_PAGESIZE)
#undef _G_HAVE_MMAP
#
undef _G_HAVE_MMAP
#define _G_HAVE_MMAP 0
#
define _G_HAVE_MMAP 0
#endif
#
endif
#endif
/* _G_HAVE_MMAP */
#endif
/* _G_HAVE_MMAP */
#if _G_HAVE_MMAP
#if _G_HAVE_MMAP
#define ROUND_TO_PAGE(_S) \
# ifdef _LIBC
/* When using this code in the GNU libc we must not pollute the name space. */
# define mmap __mmap
# define munmap __munmap
# endif
# define ROUND_TO_PAGE(_S) \
(((_S) + EXEC_PAGESIZE - 1) & ~(EXEC_PAGESIZE - 1))
(((_S) + EXEC_PAGESIZE - 1) & ~(EXEC_PAGESIZE - 1))
#define FREE_BUF(_B, _S) \
#
define FREE_BUF(_B, _S) \
munmap ((_B), ROUND_TO_PAGE (_S))
munmap ((_B), ROUND_TO_PAGE (_S))
#define ALLOC_BUF(_B, _S, _R) \
#
define ALLOC_BUF(_B, _S, _R) \
do { \
do { \
(_B) = (char *) mmap (0, ROUND_TO_PAGE (_S), \
(_B) = (char *) mmap (0, ROUND_TO_PAGE (_S), \
PROT_READ | PROT_WRITE, \
PROT_READ | PROT_WRITE, \
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); \
if ((_B) == (char *) -1) \
if ((_B) == (char *) -1) \
return _R;
\
return (_R);
\
} while (0)
} while (0)
#else
/* _G_HAVE_MMAP */
#else
/* _G_HAVE_MMAP */
#define FREE_BUF(_B, _S) \
#
define FREE_BUF(_B, _S) \
free(_B)
free(_B)
#define ALLOC_BUF(_B, _S, _R) \
#
define ALLOC_BUF(_B, _S, _R) \
do { \
do { \
(_B) = (char*)malloc(_S); \
(_B) = (char*)malloc(_S); \
if ((_B) == NULL) \
if ((_B) == NULL) \
return _R;
\
return (_R);
\
} while (0)
} while (0)
#endif
/* _G_HAVE_MMAP */
#endif
/* _G_HAVE_MMAP */
#ifndef OS_FSTAT
#ifndef OS_FSTAT
#define OS_FSTAT fstat
#
define OS_FSTAT fstat
#endif
#endif
struct
stat
;
struct
stat
;
extern
_IO_ssize_t
_IO_read
__P
((
int
,
void
*
,
_IO_size_t
));
extern
_IO_ssize_t
_IO_read
__P
((
int
,
void
*
,
_IO_size_t
));
extern
_IO_ssize_t
_IO_write
__P
((
int
,
const
void
*
,
_IO_size_t
));
extern
_IO_ssize_t
_IO_write
__P
((
int
,
const
void
*
,
_IO_size_t
));
extern
_IO_off_t
_IO_lseek
__P
((
int
,
_IO_off_t
,
int
));
extern
_IO_off_t
_IO_lseek
__P
((
int
,
_IO_off_t
,
int
));
extern
int
_IO_close
__P
((
int
));
extern
int
_IO_close
__P
((
int
));
extern
int
_IO_fstat
__P
((
int
,
struct
stat
*
));
extern
int
_IO_fstat
__P
((
int
,
struct
stat
*
));
extern
int
_IO_vscanf
__P
((
const
char
*
,
_IO_va_list
));
/* Operations on _IO_fpos_t.
/* Operations on _IO_fpos_t.
Normally, these are trivial, but we provide hooks for configurations
Normally, these are trivial, but we provide hooks for configurations
...
@@ -475,19 +470,19 @@ extern int _IO_fstat __P((int, struct stat *));
...
@@ -475,19 +470,19 @@ extern int _IO_fstat __P((int, struct stat *));
/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
/* _IO_pos_BAD is an _IO_fpos_t value indicating error, unknown, or EOF. */
#ifndef _IO_pos_BAD
#ifndef _IO_pos_BAD
#
define _IO_pos_BAD ((_IO_fpos_t)(-1)
)
#
define _IO_pos_BAD ((_IO_fpos_t) -1
)
#endif
#endif
/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
/* _IO_pos_as_off converts an _IO_fpos_t value to an _IO_off_t value. */
#ifndef _IO_pos_as_off
#ifndef _IO_pos_as_off
#
define _IO_pos_as_off(__pos) ((_IO_off_t)
(__pos))
#
define _IO_pos_as_off(__pos) ((_IO_off_t)
(__pos))
#endif
#endif
/* _IO_pos_adjust adjust an _IO_fpos_t by some number of bytes. */
/* _IO_pos_adjust adjust an _IO_fpos_t by some number of bytes. */
#ifndef _IO_pos_adjust
#ifndef _IO_pos_adjust
#define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
#
define _IO_pos_adjust(__pos, __delta) ((__pos) += (__delta))
#endif
#endif
/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
/* _IO_pos_0 is an _IO_fpos_t value indicating beginning of file. */
#ifndef _IO_pos_0
#ifndef _IO_pos_0
#
define _IO_pos_0 ((_IO_fpos_t)
0)
#
define _IO_pos_0 ((_IO_fpos_t)
0)
#endif
#endif
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -496,71 +491,70 @@ extern int _IO_fstat __P((int, struct stat *));
...
@@ -496,71 +491,70 @@ extern int _IO_fstat __P((int, struct stat *));
#ifdef _IO_MTSAFE_IO
#ifdef _IO_MTSAFE_IO
/* check following! */
/* check following! */
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
#
define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \
0, 0, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
0, 0, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
#else
#else
/* check following! */
/* check following! */
#define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
#
define FILEBUF_LITERAL(CHAIN, FLAGS, FD) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD
}
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD
}
#endif
#endif
/* VTABLE_LABEL defines NAME as of the CLASS class.
/* VTABLE_LABEL defines NAME as of the CLASS class.
CNLENGTH is strlen(#CLASS). */
CNLENGTH is strlen(#CLASS). */
#ifdef __GNUC__
#ifdef __GNUC__
#if _G_VTABLE_LABEL_HAS_LENGTH
#
if _G_VTABLE_LABEL_HAS_LENGTH
#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
#
define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CNLENGTH #CLASS);
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CNLENGTH #CLASS);
#else
#
else
#define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
#
define VTABLE_LABEL(NAME, CLASS, CNLENGTH) \
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CLASS);
extern char NAME[] asm (_G_VTABLE_LABEL_PREFIX #CLASS);
#endif
#
endif
#endif
/* __GNUC__ */
#endif
/* __GNUC__ */
#if !defined(builtinbuf_vtable) && defined(__cplusplus)
#if !defined(builtinbuf_vtable) && defined(__cplusplus)
#ifdef __GNUC__
#
ifdef __GNUC__
VTABLE_LABEL
(
builtinbuf_vtable
,
builtinbuf
,
10
)
VTABLE_LABEL
(
builtinbuf_vtable
,
builtinbuf
,
10
)
#else
#
else
#if _G_VTABLE_LABEL_HAS_LENGTH
#
if _G_VTABLE_LABEL_HAS_LENGTH
#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##10builtinbuf
#
define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##10builtinbuf
#else
#
else
#define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##builtinbuf
#
define builtinbuf_vtable _G_VTABLE_LABEL_PREFIX_ID##builtinbuf
#endif
#
endif
#endif
#
endif
#endif
/* !defined(builtinbuf_vtable) && defined(__cplusplus) */
#endif
/* !defined(builtinbuf_vtable) && defined(__cplusplus) */
#if defined(__STDC__) || defined(__cplusplus)
#if defined(__STDC__) || defined(__cplusplus)
#define _IO_va_start(args, last) va_start(args, last)
#
define _IO_va_start(args, last) va_start(args, last)
#else
#else
#define _IO_va_start(args, last) va_start(args)
#
define _IO_va_start(args, last) va_start(args)
#endif
#endif
extern
struct
_IO_fake_stdiobuf
_IO_stdin_buf
,
_IO_stdout_buf
,
_IO_stderr_buf
;
extern
struct
_IO_fake_stdiobuf
_IO_stdin_buf
,
_IO_stdout_buf
,
_IO_stderr_buf
;
#if 1
#if 1
#define COERCE_FILE(FILE)
/* Nothing */
#
define COERCE_FILE(FILE)
/* Nothing */
#else
#else
/* This is part of the kludge for binary compatibility with old stdio. */
/* This is part of the kludge for binary compatibility with old stdio. */
#define COERCE_FILE(FILE) \
#
define COERCE_FILE(FILE) \
(((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
(((FILE)->_IO_file_flags & _IO_MAGIC_MASK) == _OLD_MAGIC_MASK \
&& (FILE) = *(FILE**)&((int*)fp)[1])
&& (FILE) = *(FILE**)&((int*)fp)[1])
#endif
#endif
#ifdef EINVAL
#ifdef EINVAL
#define MAYBE_SET_EINVAL __set_errno (EINVAL)
#
define MAYBE_SET_EINVAL __set_errno (EINVAL)
#else
#else
#define MAYBE_SET_EINVAL
/* nothing */
#
define MAYBE_SET_EINVAL
/* nothing */
#endif
#endif
#ifdef DEBUG
#ifdef
IO_
DEBUG
#
define CHECK_FILE(FILE,
RET) \
#
define CHECK_FILE(FILE,
RET) \
if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
if ((FILE) == NULL) { MAYBE_SET_EINVAL; return RET; } \
else { COERCE_FILE(FILE); \
else { COERCE_FILE(FILE); \
if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
if (((FILE)->_IO_file_flags & _IO_MAGIC_MASK) != _IO_MAGIC) \
{ MAYBE_SET_EINVAL; return RET; }}
{ MAYBE_SET_EINVAL; return RET; }}
#else
#else
#define CHECK_FILE(FILE,RET) \
# define CHECK_FILE(FILE, RET) COERCE_FILE (FILE)
COERCE_FILE(FILE)
#endif
#endif
libio/osform.cc
View file @
e693cc28
...
@@ -29,26 +29,38 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -29,26 +29,38 @@ the executable file might be covered by the GNU General Public License. */
ostream
&
ostream
::
form
(
const
char
*
format
...)
ostream
&
ostream
::
form
(
const
char
*
format
...)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
format
);
va_start
(
ap
,
format
);
_IO_vfprintf
(
rdbuf
(),
format
,
ap
);
_IO_vfprintf
(
rdbuf
(),
format
,
ap
);
va_end
(
ap
);
va_end
(
ap
);
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
ostream
&
ostream
::
vform
(
const
char
*
format
,
_IO_va_list
args
)
ostream
&
ostream
::
vform
(
const
char
*
format
,
_IO_va_list
args
)
{
{
if
(
opfx
())
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
_IO_vfprintf
(
rdbuf
(),
format
,
args
);
_IO_vfprintf
(
rdbuf
(),
format
,
args
);
osfx
();
_IO_cleanup_region_end
(
0
);
}
return
*
this
;
return
*
this
;
}
}
ostream
&
ostream
::
operator
<<
(
const
void
*
p
)
ostream
&
ostream
::
operator
<<
(
const
void
*
p
)
{
{
if
(
opfx
())
{
if
(
opfx
())
{
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_strbuf
);
form
(
"%p"
,
p
);
form
(
"%p"
,
p
);
osfx
();
osfx
();
_IO_cleanup_region_end
(
0
);
}
}
return
*
this
;
return
*
this
;
}
}
libio/outfloat.c
View file @
e693cc28
...
@@ -24,6 +24,7 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -24,6 +24,7 @@ the executable file might be covered by the GNU General Public License. */
#include "libioP.h"
#include "libioP.h"
#ifdef _IO_USE_DTOA
/* Format floating-point number and print them.
/* Format floating-point number and print them.
Return number of chars printed, or EOF on error.
Return number of chars printed, or EOF on error.
...
@@ -33,10 +34,15 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -33,10 +34,15 @@ the executable file might be covered by the GNU General Public License. */
*/
*/
int
int
DEFUN
(
_IO_outfloat
,
(
value
,
sb
,
type
,
width
,
precision
,
flags
,
_IO_outfloat
(
value
,
sb
,
type
,
width
,
precision
,
flags
,
sign_mode
,
fill
)
sign_mode
,
fill
),
double
value
;
double
value
AND
_IO_FILE
*
sb
AND
int
type
AND
int
width
_IO_FILE
*
sb
;
AND
int
precision
AND
int
flags
AND
int
sign_mode
AND
int
fill
)
int
type
;
int
width
;
int
precision
;
int
flags
;
int
sign_mode
;
int
fill
;
{
{
int
count
=
0
;
int
count
=
0
;
#define PUT(x) do {if (_IO_putc(x, sb) < 0) goto error; count++;} while (0)
#define PUT(x) do {if (_IO_putc(x, sb) < 0) goto error; count++;} while (0)
...
@@ -202,3 +208,4 @@ DEFUN(_IO_outfloat, (value, sb, type, width, precision, flags,
...
@@ -202,3 +208,4 @@ DEFUN(_IO_outfloat, (value, sb, type, width, precision, flags,
error
:
error
:
return
EOF
;
return
EOF
;
}
}
#endif
libio/stdio-lock.h
deleted
100644 → 0
View file @
610ce97e
/* this will be used later*/
libio/stdio/ChangeLog
View file @
e693cc28
...
@@ -65,7 +65,7 @@ Wed May 10 03:05:53 1995 Jason Merrill <jason@python.cygnus.com>
...
@@ -65,7 +65,7 @@ Wed May 10 03:05:53 1995 Jason Merrill <jason@python.cygnus.com>
Tue Oct 18 17:15:09 1994 Per Bothner <bothner@kalessin.cygnus.com>
Tue Oct 18 17:15:09 1994 Per Bothner <bothner@kalessin.cygnus.com>
* getline.c, snprintf.c, vsnprintf.c: New files, providing
* getline.c, snprintf.c, vsnprintf.c: New files, providing
functionality of the GNU C
C
library.
functionality of the GNU C library.
* Makefile.in (STDIO_OBJECTS), configure.in: Add new files.
* Makefile.in (STDIO_OBJECTS), configure.in: Add new files.
* stdio.h: Add new functions.
* stdio.h: Add new functions.
...
@@ -131,4 +131,3 @@ Fri Aug 20 00:28:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
...
@@ -131,4 +131,3 @@ Fri Aug 20 00:28:28 1993 Per Bothner (bothner@kalessin.cygnus.com)
* configure.in (stdio_renamed): Removed feof.
* configure.in (stdio_renamed): Removed feof.
Added sprintf sscanf vsscanf.
Added sprintf sscanf vsscanf.
* ChangeLog.old: Copy of old libg++/iostream/stdio/ChangeLog.
* ChangeLog.old: Copy of old libg++/iostream/stdio/ChangeLog.
libio/stdio/feof.c
View file @
e693cc28
/*
/*
Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1993 Free Software Foundation
This file is part of the GNU IO Library.
This file is part of the GNU IO Library. This library is free
This library is free software; you can redistribute it and/or
software; you can redistribute it and/or modify it under the
modify it under the terms of the GNU General Public License as
terms of the GNU General Public License as published by the
published by the Free Software Foundation; either version 2, or (at
Free Software Foundation; either version 2, or (at your option)
your option) any later version.
any later version.
This library is distributed in the hope that it will be useful,
This library is distributed in the hope that it will be useful, but
but
WITHOUT ANY WARRANTY; without even the implied warranty of
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
GNU
General Public License for more details.
General Public License for more details.
You should have received a copy of the GNU General Public License
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
along with this library; see the file COPYING. If not, write to
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does not cause
compiled with a GNU compiler to produce an executable, this does
the resulting executable to be covered by the GNU General Public License.
not cause the resulting executable to be covered by the GNU General
This exception does not however invalidate any other reasons why
Public License. This exception does not however invalidate any
the executable file might be covered by the GNU General Public License. */
other reasons why the executable file might be covered by the GNU
General Public License. */
#include "libioP.h"
#include "libioP.h"
#include "stdio.h"
#include "stdio.h"
int
int
feof
(
fp
)
_IO_feof
(
fp
)
_IO_FILE
*
fp
;
_IO_FILE
*
fp
;
{
{
CHECK_FILE
(
fp
,
EOF
);
int
result
;
return
_IO_feof
(
fp
);
CHECK_FILE
(
fp
,
EOF
);
_IO_flockfile
(
fp
);
result
=
_IO_feof_unlocked
(
fp
);
_IO_funlockfile
(
fp
);
return
result
;
}
}
#ifdef weak_alias
weak_alias
(
_IO_feof
,
feof
)
#endif
libio/stdio/ferror.c
View file @
e693cc28
/* 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 "libioP.h"
#include "stdio.h"
#include "stdio.h"
int
int
ferror
(
fp
)
_IO_ferror
(
fp
)
FILE
*
fp
;
_IO_
FILE
*
fp
;
{
{
CHECK_FILE
(
fp
,
EOF
);
int
result
;
return
_IO_ferror
(
fp
);
CHECK_FILE
(
fp
,
EOF
);
_IO_flockfile
(
fp
);
result
=
_IO_ferror_unlocked
(
fp
);
_IO_funlockfile
(
fp
);
return
result
;
}
}
#ifdef weak_alias
weak_alias
(
_IO_ferror
,
ferror
)
#endif
libio/stdio/getc.c
View file @
e693cc28
/* 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 "libioP.h"
#include "stdio.h"
#include "stdio.h"
#undef getc
#undef
_IO_
getc
int
int
getc
(
stream
)
_IO_getc
(
fp
)
FILE
*
stream
;
FILE
*
fp
;
{
{
return
_IO_getc
(
stream
);
int
result
;
CHECK_FILE
(
fp
,
EOF
);
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
fp
);
_IO_flockfile
(
fp
);
result
=
_IO_getc_unlocked
(
fp
);
_IO_cleanup_region_end
(
1
);
return
result
;
}
}
#undef getc
#ifdef weak_alias
weak_alias
(
_IO_getc
,
getc
)
#endif
libio/stdio/putc.c
View file @
e693cc28
/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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. */
#include "libioP.h"
#include "libioP.h"
#include "stdio.h"
#include "stdio.h"
#undef putc
#undef
_IO_
putc
int
int
putc
(
c
,
stream
)
_IO_putc
(
c
,
fp
)
int
c
;
int
c
;
FILE
*
stream
;
_IO_FILE
*
fp
;
{
{
return
_IO_putc
(
c
,
stream
);
int
result
;
CHECK_FILE
(
fp
,
EOF
);
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
fp
);
_IO_flockfile
(
fp
);
result
=
_IO_putc_unlocked
(
c
,
fp
);
_IO_cleanup_region_end
(
1
);
return
result
;
}
}
#undef putc
#ifdef weak_alias
weak_alias
(
_IO_putc
,
putc
)
#endif
libio/stdio/putchar.c
View file @
e693cc28
...
@@ -27,7 +27,7 @@ putchar (c)
...
@@ -27,7 +27,7 @@ putchar (c)
{
{
int
result
;
int
result
;
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_IO_cleanup_region_start
((
void
(
*
)
__P
((
void
*
)))
_IO_funlockfile
,
_IO_stdout
);
_IO_stdout
);
_IO_flockfile
(
_IO_stdout
);
_IO_flockfile
(
_IO_stdout
);
result
=
_IO_putc_unlocked
(
c
,
_IO_stdout
);
result
=
_IO_putc_unlocked
(
c
,
_IO_stdout
);
_IO_cleanup_region_end
(
1
);
_IO_cleanup_region_end
(
1
);
...
...
libio/stdio/stdio.h
View file @
e693cc28
...
@@ -169,10 +169,48 @@ extern int vsnprintf __P ((char *, size_t, const char *, _IO_va_list));
...
@@ -169,10 +169,48 @@ extern int vsnprintf __P ((char *, size_t, const char *, _IO_va_list));
extern
int
__underflow
__P
((
struct
_IO_FILE
*
));
extern
int
__underflow
__P
((
struct
_IO_FILE
*
));
extern
int
__overflow
__P
((
struct
_IO_FILE
*
,
int
));
extern
int
__overflow
__P
((
struct
_IO_FILE
*
,
int
));
/* Handle locking of streams. */
#if defined _REENTRANT || defined _THREAD_SAFE
extern
void
clearerr_locked
__P
((
FILE
*
));
extern
void
clearerr_unlocked
__P
((
FILE
*
));
extern
int
feof_locked
__P
((
FILE
*
));
extern
int
feof_unlocked
__P
((
FILE
*
));
extern
int
ferror_locked
__P
((
FILE
*
));
extern
int
ferror_unlocked
__P
((
FILE
*
));
extern
int
fileno_locked
__P
((
FILE
*
));
extern
int
fileno_unlocked
__P
((
FILE
*
));
extern
void
flockfile
__P
((
FILE
*
));
extern
void
funlockfile
__P
((
FILE
*
));
extern
int
ftrylockfile
__P
((
FILE
*
));
extern
int
fclose_unlocked
__P
((
FILE
*
));
extern
int
fflush_locked
__P
((
FILE
*
));
extern
int
fflush_unlocked
__P
((
FILE
*
));
extern
size_t
fread_unlocked
__P
((
void
*
,
size_t
,
size_t
,
FILE
*
));
extern
size_t
fwrite_unlocked
__P
((
const
void
*
,
size_t
,
size_t
,
FILE
*
));
extern
int
fputc_locked
__P
((
int
,
FILE
*
));
extern
int
fputc_unlocked
__P
((
int
,
FILE
*
));
extern
int
getc_locked
__P
((
FILE
*
));
extern
int
getc_unlocked
__P
((
FILE
*
));
extern
int
getchar_locked
__P
((
void
));
extern
int
getchar_unlocked
__P
((
void
));
extern
int
putc_locked
__P
((
int
,
FILE
*
));
extern
int
putc_unlocked
__P
((
int
,
FILE
*
));
extern
int
putchar_locked
__P
((
int
));
extern
int
putchar_unlocked
__P
((
int
));
# define getc_unlocked(fp) _IO_getc_unlocked (fp)
# define getc_locked(fp) _IO_getc (fp)
# define getchar_unlocked() _IO_getc_unlocked (stdin)
# define getchar_locked() _IO_getc (stdin)
# define putchar_unlocked(c) _IO_putc_unlocked (c, stdout)
# define putchar_locked(c) _IO_putc (c, stdout)
#endif
/* __USE_REENTRANT */
#define getc(fp) _IO_getc(fp)
#define getc(fp) _IO_getc(fp)
#define putc(c, fp) _IO_putc(c, fp)
#define putc(c, fp) _IO_putc(c, fp)
#define putchar(c) putc(c, stdout)
#define putchar(c)
_IO_
putc(c, stdout)
#define getchar() getc(stdin)
#define getchar()
_IO_
getc(stdin)
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
libio/stdstrbufs.cc
View file @
e693cc28
/*
/*
Copyright (C) 1994 Free Software Foundation
Copyright (C) 1994 Free Software Foundation
This file is part of the GNU IO Library. This library is free
This file is part of the GNU IO Library. This library is free
...
@@ -54,8 +54,15 @@ extern char filebuf_vtable[];
...
@@ -54,8 +54,15 @@ extern char filebuf_vtable[];
#define STD_VTABLE (const struct _IO_jump_t *)filebuf_vtable
#define STD_VTABLE (const struct _IO_jump_t *)filebuf_vtable
#endif
#endif
#ifdef _IO_MTSAFE_IO
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
struct _IO_FILE_plus NAME \
= {FILEBUF_LITERAL(CHAIN, FLAGS, FD), &_IO_file_jumps}
#else
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
#define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
struct _IO_FILE_plus NAME = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), STD_VTABLE}
struct _IO_FILE_plus NAME = {FILEBUF_LITERAL(CHAIN, FLAGS, FD), STD_VTABLE}
#endif
DEF_STDFILE
(
_IO_stdin_
,
0
,
0
,
_IO_NO_WRITES
);
DEF_STDFILE
(
_IO_stdin_
,
0
,
0
,
_IO_NO_WRITES
);
DEF_STDFILE
(
_IO_stdout_
,
1
,
&
_IO_stdin_
.
file
,
_IO_NO_READS
);
DEF_STDFILE
(
_IO_stdout_
,
1
,
&
_IO_stdin_
.
file
,
_IO_NO_READS
);
...
@@ -95,17 +102,21 @@ extern struct _IO_jump_t stdiobuf_vtable;
...
@@ -95,17 +102,21 @@ extern struct _IO_jump_t stdiobuf_vtable;
#endif
/* !__GNUC__ */
#endif
/* !__GNUC__ */
#endif
/* !stdiobuf_vtable */
#endif
/* !stdiobuf_vtable */
#if _IO_UNIFIED_JUMPTABLES
#ifdef _IO_MTSAFE_IO
#define JUMP_PTR
/* Nothing */
#define DEF_STDIOFILE(NAME, FD, FILE, FLAGS, CHAIN) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
struct _IO_fake_stdiobuf NAME = \
{{{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+_IO_UNBUFFERED+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD, \
0, 0, 0, 0, { 0 }, _IO_stdfile_##FD##_lock},\
&stdiobuf_vtable}, FILE}
#else
#else
#define JUMP_PTR &_IO_streambuf_jumps,
#endif
#define DEF_STDIOFILE(NAME, FD, FILE, FLAGS, CHAIN) \
#define DEF_STDIOFILE(NAME, FD, FILE, FLAGS, CHAIN) \
struct _IO_fake_stdiobuf NAME = \
struct _IO_fake_stdiobuf NAME = \
{{{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+_IO_UNBUFFERED+FLAGS, \
{{{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+_IO_UNBUFFERED+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, JUMP_PTR FD},
\
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, CHAIN, FD},
\
&stdiobuf_vtable}, FILE}
&stdiobuf_vtable}, FILE}
#endif
DEF_STDIOFILE
(
_IO_stdin_buf
,
0
,
stdin
,
_IO_NO_WRITES
,
&
_IO_stderr_
.
file
);
DEF_STDIOFILE
(
_IO_stdin_buf
,
0
,
stdin
,
_IO_NO_WRITES
,
&
_IO_stderr_
.
file
);
DEF_STDIOFILE
(
_IO_stdout_buf
,
1
,
stdout
,
_IO_NO_READS
,
&
_IO_stdin_buf
.
s
.
file
);
DEF_STDIOFILE
(
_IO_stdout_buf
,
1
,
stdout
,
_IO_NO_READS
,
&
_IO_stdin_buf
.
s
.
file
);
...
...
libio/streambuf.cc
View file @
e693cc28
...
@@ -162,7 +162,7 @@ static _IO_pos_t _IO_sb_seekpos(_IO_FILE *fp, _IO_pos_t pos, int mode)
...
@@ -162,7 +162,7 @@ static _IO_pos_t _IO_sb_seekpos(_IO_FILE *fp, _IO_pos_t pos, int mode)
static
int
_IO_sb_pbackfail
(
_IO_FILE
*
fp
,
int
ch
)
static
int
_IO_sb_pbackfail
(
_IO_FILE
*
fp
,
int
ch
)
{
return
((
streambuf
*
)
fp
)
->
pbackfail
(
ch
);
}
{
return
((
streambuf
*
)
fp
)
->
pbackfail
(
ch
);
}
static
void
_IO_sb_finish
(
_IO_FILE
*
fp
)
static
void
_IO_sb_finish
(
_IO_FILE
*
fp
,
int
)
{
((
streambuf
*
)
fp
)
->~
streambuf
();
}
{
((
streambuf
*
)
fp
)
->~
streambuf
();
}
static
_IO_ssize_t
_IO_sb_read
(
_IO_FILE
*
fp
,
void
*
buf
,
_IO_ssize_t
n
)
static
_IO_ssize_t
_IO_sb_read
(
_IO_FILE
*
fp
,
void
*
buf
,
_IO_ssize_t
n
)
{
return
((
streambuf
*
)
fp
)
->
sys_read
((
char
*
)
buf
,
n
);
}
{
return
((
streambuf
*
)
fp
)
->
sys_read
((
char
*
)
buf
,
n
);
}
...
@@ -207,13 +207,22 @@ struct _IO_jump_t _IO_streambuf_jumps = {
...
@@ -207,13 +207,22 @@ struct _IO_jump_t _IO_streambuf_jumps = {
streambuf
::
streambuf
(
int
flags
)
streambuf
::
streambuf
(
int
flags
)
{
{
#ifdef _IO_MTSAFE_IO
_lock
=
new
_IO_lock_t
;
#endif
_IO_init
(
this
,
flags
);
_IO_init
(
this
,
flags
);
#if !_IO_UNIFIED_JUMPTABLES
#if !_IO_UNIFIED_JUMPTABLES
_jumps
=
&
_IO_streambuf_jumps
;
_jumps
=
&
_IO_streambuf_jumps
;
#endif
#endif
}
}
streambuf
::~
streambuf
()
{
_IO_default_finish
(
this
,
0
);
}
streambuf
::~
streambuf
()
{
_IO_default_finish
(
this
,
0
);
#ifdef _IO_MTSAFE_IO
delete
_lock
;
#endif
}
streampos
streampos
streambuf
::
seekoff
(
streamoff
,
_seek_dir
,
int
/*=ios::in|ios::out*/
)
streambuf
::
seekoff
(
streamoff
,
_seek_dir
,
int
/*=ios::in|ios::out*/
)
...
...
libio/strops.c
View file @
e693cc28
...
@@ -200,8 +200,8 @@ _IO_ssize_t
...
@@ -200,8 +200,8 @@ _IO_ssize_t
_IO_str_count
(
fp
)
_IO_str_count
(
fp
)
_IO_FILE
*
fp
;
_IO_FILE
*
fp
;
{
{
return
((
fp
->
_IO_write_
ptr
>
fp
->
_IO_read_end
return
((
fp
->
_IO_write_
end
>
fp
->
_IO_read_end
?
fp
->
_IO_write_
ptr
:
fp
->
_IO_read_end
)
?
fp
->
_IO_write_
end
:
fp
->
_IO_read_end
)
-
fp
->
_IO_read_base
);
-
fp
->
_IO_read_base
);
}
}
...
...
libio/tests/tFile.cc
View file @
e693cc28
...
@@ -43,6 +43,8 @@ the executable file might be covered by the GNU General Public License. */
...
@@ -43,6 +43,8 @@ the executable file might be covered by the GNU General Public License. */
#include <string.h>
#include <string.h>
#include <assert.h>
#include <assert.h>
const
char
*
tempfile
;
class
record
class
record
{
{
public
:
public
:
...
@@ -160,9 +162,9 @@ void t4()
...
@@ -160,9 +162,9 @@ void t4()
cout
<<
"
\n
Making File tf ... "
;
cout
<<
"
\n
Making File tf ... "
;
#ifdef _OLD_STREAMS
#ifdef _OLD_STREAMS
File
tf
(
"tempfile"
,
io_readwrite
,
a_create
);
File
tf
(
tempfile
,
io_readwrite
,
a_create
);
#else
#else
fstream
tf
(
"tempfile"
,
ios
::
in
|
ios
::
out
|
ios
::
trunc
);
fstream
tf
(
tempfile
,
ios
::
in
|
ios
::
out
|
ios
::
trunc
);
#endif
#endif
assert
(
tf
.
good
());
assert
(
tf
.
good
());
assert
(
tf
.
is_open
());
assert
(
tf
.
is_open
());
...
@@ -190,7 +192,7 @@ void t4()
...
@@ -190,7 +192,7 @@ void t4()
tf
.
open
(
tf
.
name
(),
io_appendonly
,
a_use
);
tf
.
open
(
tf
.
name
(),
io_appendonly
,
a_use
);
#else
#else
tf
.
close
();
tf
.
close
();
tf
.
open
(
"tempfile"
,
ios
::
app
);
tf
.
open
(
tempfile
,
ios
::
app
);
#endif
#endif
assert
(
tf
.
good
());
assert
(
tf
.
good
());
assert
(
tf
.
is_open
());
assert
(
tf
.
is_open
());
...
@@ -204,7 +206,7 @@ void t4()
...
@@ -204,7 +206,7 @@ void t4()
tf
<<
s
;
tf
<<
s
;
assert
(
tf
.
good
());
assert
(
tf
.
good
());
tf
.
close
();
tf
.
close
();
tf
.
open
(
"tempfile"
,
ios
::
in
);
tf
.
open
(
tempfile
,
ios
::
in
);
#endif
#endif
tf
.
raw
();
tf
.
raw
();
assert
(
tf
.
good
());
assert
(
tf
.
good
());
...
@@ -512,6 +514,8 @@ t12 ()
...
@@ -512,6 +514,8 @@ t12 ()
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
char
temp
[
1024
]
=
"tempfile"
;
if
(
argc
>
1
&&
strncmp
(
argv
[
1
],
"-b"
,
2
)
==
0
)
{
if
(
argc
>
1
&&
strncmp
(
argv
[
1
],
"-b"
,
2
)
==
0
)
{
streambuf
*
sb
=
cout
.
rdbuf
();
streambuf
*
sb
=
cout
.
rdbuf
();
streambuf
*
ret
;
streambuf
*
ret
;
...
@@ -522,7 +526,11 @@ main(int argc, char **argv)
...
@@ -522,7 +526,11 @@ main(int argc, char **argv)
ret
=
sb
->
setbuf
(
new
char
[
buffer_size
],
buffer_size
);
ret
=
sb
->
setbuf
(
new
char
[
buffer_size
],
buffer_size
);
if
(
ret
!=
sb
)
if
(
ret
!=
sb
)
cerr
<<
"Warning: cout.rdbuf()->setbuf failed!
\n
"
;
cerr
<<
"Warning: cout.rdbuf()->setbuf failed!
\n
"
;
strncpy
(
&
temp
[
8
],
&
argv
[
1
][
2
],
1000
);
temp
[
1008
]
=
'\0'
;
}
}
tempfile
=
temp
;
t1
();
t1
();
t2
();
t2
();
t3
();
t3
();
...
...
libstdc++/ChangeLog
View file @
e693cc28
1997-09-15 02:37 Ulrich Drepper <drepper@cygnus.com>
* config/linux.mt: New file. Make sure _PTHREADS is defined
if necessary.
* configure.in: Find linux.mt file.
Thu Sep 11 15:03:20 1997 Jason Merrill <jason@yorick.cygnus.com>
Thu Sep 11 15:03:20 1997 Jason Merrill <jason@yorick.cygnus.com>
* std/bastring.h (class basic_string): Add global scope to
* std/bastring.h (class basic_string): Add global scope to
...
...
libstdc++/configure.in
View file @
e693cc28
...
@@ -41,6 +41,11 @@ if [ "${shared}" = "yes" ]; then
...
@@ -41,6 +41,11 @@ if [ "${shared}" = "yes" ]; then
esac
esac
fi
fi
# Make sure the right flags are defined for multi-threading.
case "${target}" in
*-*-linux-gnu) frags="${frags} linux.mt" ;;
esac
for frag in ${frags}; do
for frag in ${frags}; do
frag=${srcdir}/config/$frag
frag=${srcdir}/config/$frag
if [ -f ${frag} ]; then
if [ -f ${frag} ]; then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment